* [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue
@ 2018-04-05 8:54 Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
` (7 more replies)
0 siblings, 8 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Coverity issue: 268332
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index 66838d2..07b29d5 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -160,6 +160,7 @@ struct qman_portal *fsl_qman_portal_create(void)
&cpuset);
if (ret) {
error(0, ret, "pthread_getaffinity_np()");
+ kfree(q_pcfg);
return NULL;
}
@@ -168,12 +169,14 @@ struct qman_portal *fsl_qman_portal_create(void)
if (CPU_ISSET(loop, &cpuset)) {
if (q_pcfg->cpu != -1) {
pr_err("Thread is not affine to 1 cpu\n");
+ kfree(q_pcfg);
return NULL;
}
q_pcfg->cpu = loop;
}
if (q_pcfg->cpu == -1) {
pr_err("Bug in getaffinity handling!\n");
+ kfree(q_pcfg);
return NULL;
}
@@ -183,6 +186,7 @@ struct qman_portal *fsl_qman_portal_create(void)
ret = process_portal_map(&q_map);
if (ret) {
error(0, ret, "process_portal_map()");
+ kfree(q_pcfg);
return NULL;
}
q_pcfg->channel = q_map.channel;
@@ -217,6 +221,7 @@ struct qman_portal *fsl_qman_portal_create(void)
close(q_fd);
err1:
process_portal_unmap(&q_map.addr);
+ kfree(q_pcfg);
return NULL;
}
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 2/8] bus/dpaa: fix the unchecked return value
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 3/8] net/dpaa: fix the array overrun Hemant Agrawal
` (6 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")
Coverity issue: 268323
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/dpaa_bus.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 3535da5..ffc90a7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -308,9 +308,15 @@ rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq)
/* Affine above created portal with channel*/
u32 sdqcr;
struct qman_portal *qp;
+ int ret;
- if (unlikely(!RTE_PER_LCORE(dpaa_io)))
- rte_dpaa_portal_init(arg);
+ if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+ ret = rte_dpaa_portal_init(arg);
+ if (ret < 0) {
+ DPAA_BUS_LOG(ERR, "portal initialization failure");
+ return ret;
+ }
+ }
/* Initialise qman specific portals */
qp = fsl_qman_portal_create();
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 3/8] net/dpaa: fix the array overrun
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-09 5:29 ` Shreyansh Jain
2018-04-05 8:54 ` [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access Hemant Agrawal
` (5 subsequent siblings)
7 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
Coverity issue: 268342
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index db49364..0aad111 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1105,10 +1105,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE;
}
- /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX
+ /* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX
* queues.
*/
- if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_PCD_FQID_MULTIPLIER) {
+ if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_MAX_NUM_PCD_QUEUES) {
DPAA_PMD_ERR("Invalid number of RX queues\n");
return -EINVAL;
}
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 3/8] net/dpaa: fix the array overrun Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-09 7:23 ` Shreyansh Jain
2018-04-05 8:54 ` [dpdk-dev] [PATCH 5/8] bus/dpaa: fix resource leak Hemant Agrawal
` (4 subsequent siblings)
7 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Coverity issue: 268318
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0aad111..cbdc4f2 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -339,6 +339,9 @@ dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
{
unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings);
+ if (limit < stat_cnt)
+ return stat_cnt;
+
if (xstats_names != NULL)
for (i = 0; i < stat_cnt; i++)
snprintf(xstats_names[i].name,
@@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
return 0;
fman_if_stats_get_all(dpaa_intf->fif, values_copy,
- sizeof(struct dpaa_if_stats));
+ sizeof(struct dpaa_if_stats) / 8);
for (i = 0; i < stat_cnt; i++)
values[i] =
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 5/8] bus/dpaa: fix resource leak
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (2 preceding siblings ...)
2018-04-05 8:54 ` [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-09 7:18 ` Shreyansh Jain
2018-04-05 8:54 ` [dpdk-dev] [PATCH 6/8] net/dpaa: update checksum for external pool obj Hemant Agrawal
` (3 subsequent siblings)
7 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan")
Coverity issue: 268337
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/base/fman/fman.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index e6fd5f3..be91da4 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -442,6 +442,7 @@ fman_if_init(const struct device_node *dpa_node)
if (!pool_node) {
FMAN_ERR(-ENXIO, "%s: bad fsl,bman-buffer-pools\n",
dname);
+ free(bpool);
goto err;
}
pname = pool_node->full_name;
@@ -449,6 +450,7 @@ fman_if_init(const struct device_node *dpa_node)
prop = of_get_property(pool_node, "fsl,bpid", &proplen);
if (!prop) {
FMAN_ERR(-EINVAL, "%s: no fsl,bpid\n", pname);
+ free(bpool);
goto err;
}
assert(proplen == sizeof(*prop));
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 6/8] net/dpaa: update checksum for external pool obj
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (3 preceding siblings ...)
2018-04-05 8:54 ` [dpdk-dev] [PATCH 5/8] bus/dpaa: fix resource leak Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
` (2 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
From: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/net/dpaa/dpaa_rxtx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index bdb7f66..1316d2a 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -825,6 +825,8 @@ tx_on_external_pool(struct qman_fq *txq, struct rte_mbuf *mbuf,
}
DPAA_MBUF_TO_CONTIG_FD(dmable_mbuf, fd_arr, dpaa_intf->bp_info->bpid);
+ if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK)
+ dpaa_unsegmented_checksum(mbuf, fd_arr);
return 0;
}
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 7/8] net/dpaa2: fix the implementation of xstats
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (4 preceding siblings ...)
2018-04-05 8:54 ` [dpdk-dev] [PATCH 6/8] net/dpaa: update checksum for external pool obj Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 8/8] bus/fslmc: configure separate portal for Ethernet Rx Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
Fixes: 1d6329b2fc1f ("net/dpaa2: support extra stats")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 281483d..eed6dc9 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1115,12 +1115,12 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
union dpni_statistics value[3] = {};
unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings);
- if (xstats == NULL)
- return 0;
-
if (n < num)
return num;
+ if (xstats == NULL)
+ return 0;
+
/* Get Counters from page_0*/
retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,
0, 0, &value[0]);
@@ -1153,10 +1153,13 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
static int
dpaa2_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names,
- __rte_unused unsigned int limit)
+ unsigned int limit)
{
unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings);
+ if (limit < stat_cnt)
+ return stat_cnt;
+
if (xstats_names != NULL)
for (i = 0; i < stat_cnt; i++)
snprintf(xstats_names[i].name,
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH 8/8] bus/fslmc: configure separate portal for Ethernet Rx
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (5 preceding siblings ...)
2018-04-05 8:54 ` [dpdk-dev] [PATCH 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
@ 2018-04-05 8:54 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-05 8:54 UTC (permalink / raw)
To: ferruh.yigit; +Cc: dev, shreyansh.jain
From: Nipun Gupta <nipun.gupta@nxp.com>
In case of Receive from Ethernet we add a new pull request (prefetch)
but do not fetch the results from that pull request until next
dequeue operation. This keeps the portal in busy mode.
This patch updates the portals bifurcation to have separate portals
to receive packets for Ethernet and all other devices to use a
common portal.
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 27 ++++++++++++++-------------
drivers/bus/fslmc/portal/dpaa2_hw_dpio.h | 8 ++++----
drivers/bus/fslmc/rte_bus_fslmc_version.map | 8 +++++++-
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 12 ++++++------
drivers/net/dpaa2/dpaa2_rxtx.c | 29 ++++++++++++++++-------------
5 files changed, 47 insertions(+), 37 deletions(-)
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 881dd5f..a741626 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -350,7 +350,7 @@ dpaa2_affine_qbman_swp(void)
}
int
-dpaa2_affine_qbman_swp_sec(void)
+dpaa2_affine_qbman_ethrx_swp(void)
{
unsigned int lcore_id = rte_lcore_id();
uint64_t tid = syscall(SYS_gettid);
@@ -361,35 +361,36 @@ dpaa2_affine_qbman_swp_sec(void)
else if (lcore_id >= RTE_MAX_LCORE)
return -1;
- if (dpaa2_io_portal[lcore_id].sec_dpio_dev) {
+ if (dpaa2_io_portal[lcore_id].ethrx_dpio_dev) {
DPAA2_BUS_DP_INFO(
"DPAA Portal=%p (%d) is being shared between thread"
" %" PRIu64 " and current %" PRIu64 "\n",
- dpaa2_io_portal[lcore_id].sec_dpio_dev,
- dpaa2_io_portal[lcore_id].sec_dpio_dev->index,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev->index,
dpaa2_io_portal[lcore_id].sec_tid,
tid);
- RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev
- = dpaa2_io_portal[lcore_id].sec_dpio_dev;
+ RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
+ = dpaa2_io_portal[lcore_id].ethrx_dpio_dev;
rte_atomic16_inc(&dpaa2_io_portal
- [lcore_id].sec_dpio_dev->ref_count);
+ [lcore_id].ethrx_dpio_dev->ref_count);
dpaa2_io_portal[lcore_id].sec_tid = tid;
DPAA2_BUS_DP_DEBUG(
"Old Portal=%p (%d) affined thread"
" - %" PRIu64 "\n",
- dpaa2_io_portal[lcore_id].sec_dpio_dev,
- dpaa2_io_portal[lcore_id].sec_dpio_dev->index,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev->index,
tid);
return 0;
}
/* Populate the dpaa2_io_portal structure */
- dpaa2_io_portal[lcore_id].sec_dpio_dev = dpaa2_get_qbman_swp(lcore_id);
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev =
+ dpaa2_get_qbman_swp(lcore_id);
- if (dpaa2_io_portal[lcore_id].sec_dpio_dev) {
- RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev
- = dpaa2_io_portal[lcore_id].sec_dpio_dev;
+ if (dpaa2_io_portal[lcore_id].ethrx_dpio_dev) {
+ RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
+ = dpaa2_io_portal[lcore_id].ethrx_dpio_dev;
dpaa2_io_portal[lcore_id].sec_tid = tid;
return 0;
} else {
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
index c0bd878..d593eea 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
@@ -13,7 +13,7 @@
struct dpaa2_io_portal_t {
struct dpaa2_dpio_dev *dpio_dev;
- struct dpaa2_dpio_dev *sec_dpio_dev;
+ struct dpaa2_dpio_dev *ethrx_dpio_dev;
uint64_t net_tid;
uint64_t sec_tid;
void *eventdev;
@@ -25,8 +25,8 @@ RTE_DECLARE_PER_LCORE(struct dpaa2_io_portal_t, _dpaa2_io);
#define DPAA2_PER_LCORE_DPIO RTE_PER_LCORE(_dpaa2_io).dpio_dev
#define DPAA2_PER_LCORE_PORTAL DPAA2_PER_LCORE_DPIO->sw_portal
-#define DPAA2_PER_LCORE_SEC_DPIO RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev
-#define DPAA2_PER_LCORE_SEC_PORTAL DPAA2_PER_LCORE_SEC_DPIO->sw_portal
+#define DPAA2_PER_LCORE_ETHRX_DPIO RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
+#define DPAA2_PER_LCORE_ETHRX_PORTAL DPAA2_PER_LCORE_ETHRX_DPIO->sw_portal
/* Variable to store DPAA2 platform type */
extern uint32_t dpaa2_svr_family;
@@ -39,7 +39,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id);
int dpaa2_affine_qbman_swp(void);
/* Affine additional DPIO portal to current crypto processing thread */
-int dpaa2_affine_qbman_swp_sec(void);
+int dpaa2_affine_qbman_ethrx_swp(void);
/* allocate memory for FQ - dq storage */
int
diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map
index b7db074..f519651 100644
--- a/drivers/bus/fslmc/rte_bus_fslmc_version.map
+++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map
@@ -2,7 +2,6 @@ DPDK_17.05 {
global:
dpaa2_affine_qbman_swp;
- dpaa2_affine_qbman_swp_sec;
dpaa2_alloc_dpbp_dev;
dpaa2_alloc_dq_storage;
dpaa2_free_dpbp_dev;
@@ -101,3 +100,10 @@ DPDK_18.02 {
rte_fslmc_get_device_count;
} DPDK_17.11;
+
+DPDK_18.05 {
+ global:
+
+ dpaa2_affine_qbman_ethrx_swp;
+
+} DPDK_18.02;
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 7c80df6..d02d821 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1159,14 +1159,14 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
qbman_eq_desc_set_response(&eqdesc, 0, 0);
qbman_eq_desc_set_fq(&eqdesc, dpaa2_qp->tx_vq.fqid);
- if (!DPAA2_PER_LCORE_SEC_DPIO) {
- ret = dpaa2_affine_qbman_swp_sec();
+ if (!DPAA2_PER_LCORE_DPIO) {
+ ret = dpaa2_affine_qbman_swp();
if (ret) {
DPAA2_SEC_ERR("Failure in affining portal");
return 0;
}
}
- swp = DPAA2_PER_LCORE_SEC_PORTAL;
+ swp = DPAA2_PER_LCORE_PORTAL;
while (nb_ops) {
frames_to_send = (nb_ops >> 3) ? MAX_TX_RING_SLOTS : nb_ops;
@@ -1307,14 +1307,14 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,
const struct qbman_fd *fd;
struct qbman_pull_desc pulldesc;
- if (!DPAA2_PER_LCORE_SEC_DPIO) {
- ret = dpaa2_affine_qbman_swp_sec();
+ if (!DPAA2_PER_LCORE_DPIO) {
+ ret = dpaa2_affine_qbman_swp();
if (ret) {
DPAA2_SEC_ERR("Failure in affining portal");
return 0;
}
}
- swp = DPAA2_PER_LCORE_SEC_PORTAL;
+ swp = DPAA2_PER_LCORE_PORTAL;
dq_storage = dpaa2_qp->rx_vq.q_storage->dq_storage[0];
qbman_pull_desc_clear(&pulldesc);
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 532de94..d1cfe95 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -481,14 +481,15 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
struct queue_storage_info_t *q_storage = dpaa2_q->q_storage;
struct rte_eth_dev *dev = dpaa2_q->dev;
- if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
- ret = dpaa2_affine_qbman_swp();
+ if (unlikely(!DPAA2_PER_LCORE_ETHRX_DPIO)) {
+ ret = dpaa2_affine_qbman_ethrx_swp();
if (ret) {
DPAA2_PMD_ERR("Failure in affining portal");
return 0;
}
}
- swp = DPAA2_PER_LCORE_PORTAL;
+ swp = DPAA2_PER_LCORE_ETHRX_PORTAL;
+
if (unlikely(!q_storage->active_dqs)) {
q_storage->toggle = 0;
dq_storage = q_storage->dq_storage[q_storage->toggle];
@@ -500,11 +501,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
qbman_pull_desc_set_fq(&pulldesc, fqid);
qbman_pull_desc_set_storage(&pulldesc, dq_storage,
(dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1);
- if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) {
+ if (check_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)) {
while (!qbman_check_command_complete(
- get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)))
+ get_swp_active_dqs(
+ DPAA2_PER_LCORE_ETHRX_DPIO->index)))
;
- clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index);
+ clear_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index);
}
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
@@ -516,8 +518,9 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
break;
}
q_storage->active_dqs = dq_storage;
- q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index;
- set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage);
+ q_storage->active_dpio_id = DPAA2_PER_LCORE_ETHRX_DPIO->index;
+ set_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index,
+ dq_storage);
}
dq_storage = q_storage->active_dqs;
@@ -583,11 +586,11 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
num_rx++;
} while (pending);
- if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) {
+ if (check_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)) {
while (!qbman_check_command_complete(
- get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)))
+ get_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)))
;
- clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index);
+ clear_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index);
}
/* issue a volatile dequeue command for next pull */
while (1) {
@@ -599,8 +602,8 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
break;
}
q_storage->active_dqs = dq_storage1;
- q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index;
- set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage1);
+ q_storage->active_dpio_id = DPAA2_PER_LCORE_ETHRX_DPIO->index;
+ set_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index, dq_storage1);
dpaa2_q->rx_pkts += num_rx;
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH 3/8] net/dpaa: fix the array overrun
2018-04-05 8:54 ` [dpdk-dev] [PATCH 3/8] net/dpaa: fix the array overrun Hemant Agrawal
@ 2018-04-09 5:29 ` Shreyansh Jain
0 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-04-09 5:29 UTC (permalink / raw)
To: Hemant Agrawal, ferruh.yigit; +Cc: dev
On Thursday 05 April 2018 02:24 PM, Hemant Agrawal wrote:
> Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
> Coverity issue: 268342
> Cc: stable@dpdk.org
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH 5/8] bus/dpaa: fix resource leak
2018-04-05 8:54 ` [dpdk-dev] [PATCH 5/8] bus/dpaa: fix resource leak Hemant Agrawal
@ 2018-04-09 7:18 ` Shreyansh Jain
0 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-04-09 7:18 UTC (permalink / raw)
To: Hemant Agrawal, ferruh.yigit; +Cc: dev
On Thursday 05 April 2018 02:24 PM, Hemant Agrawal wrote:
> Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan")
> Coverity issue: 268337
> Cc: stable@dpdk.org
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access
2018-04-05 8:54 ` [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access Hemant Agrawal
@ 2018-04-09 7:23 ` Shreyansh Jain
0 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-04-09 7:23 UTC (permalink / raw)
To: Hemant Agrawal, ferruh.yigit; +Cc: dev
On Thursday 05 April 2018 02:24 PM, Hemant Agrawal wrote:
> Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
> Coverity issue: 268318
> Cc: stable@dpdk.org
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
> drivers/net/dpaa/dpaa_ethdev.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
> index 0aad111..cbdc4f2 100644
> --- a/drivers/net/dpaa/dpaa_ethdev.c
> +++ b/drivers/net/dpaa/dpaa_ethdev.c
> @@ -339,6 +339,9 @@ dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
Definition of this function is:
static int
dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names,
__rte_unused unsigned int limit)
> {
> unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings);
>
> + if (limit < stat_cnt)
> + return stat_cnt;
As this patch is using the 'limit' argument, '__rte_unused' should be
removed from the function arguments.
> +
> if (xstats_names != NULL)
> for (i = 0; i < stat_cnt; i++)
> snprintf(xstats_names[i].name,
> @@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
> return 0;
>
> fman_if_stats_get_all(dpaa_intf->fif, values_copy,
> - sizeof(struct dpaa_if_stats));
> + sizeof(struct dpaa_if_stats) / 8);
>
> for (i = 0; i < stat_cnt; i++)
> values[i] =
>
Once the above is correct, please use:
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (6 preceding siblings ...)
2018-04-05 8:54 ` [dpdk-dev] [PATCH 8/8] bus/fslmc: configure separate portal for Ethernet Rx Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
` (7 more replies)
7 siblings, 8 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Sunil Kumar Kori, stable
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Coverity issue: 268332
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index 66838d2..07b29d5 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -160,6 +160,7 @@ struct qman_portal *fsl_qman_portal_create(void)
&cpuset);
if (ret) {
error(0, ret, "pthread_getaffinity_np()");
+ kfree(q_pcfg);
return NULL;
}
@@ -168,12 +169,14 @@ struct qman_portal *fsl_qman_portal_create(void)
if (CPU_ISSET(loop, &cpuset)) {
if (q_pcfg->cpu != -1) {
pr_err("Thread is not affine to 1 cpu\n");
+ kfree(q_pcfg);
return NULL;
}
q_pcfg->cpu = loop;
}
if (q_pcfg->cpu == -1) {
pr_err("Bug in getaffinity handling!\n");
+ kfree(q_pcfg);
return NULL;
}
@@ -183,6 +186,7 @@ struct qman_portal *fsl_qman_portal_create(void)
ret = process_portal_map(&q_map);
if (ret) {
error(0, ret, "process_portal_map()");
+ kfree(q_pcfg);
return NULL;
}
q_pcfg->channel = q_map.channel;
@@ -217,6 +221,7 @@ struct qman_portal *fsl_qman_portal_create(void)
close(q_fd);
err1:
process_portal_unmap(&q_map.addr);
+ kfree(q_pcfg);
return NULL;
}
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 3/8] net/dpaa: fix the array overrun Hemant Agrawal
` (6 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Sunil Kumar Kori, stable
From: Sunil Kumar Kori <sunil.kori@nxp.com>
Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")
Coverity issue: 268323
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/dpaa/dpaa_bus.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 3535da5..ffc90a7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -308,9 +308,15 @@ rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq)
/* Affine above created portal with channel*/
u32 sdqcr;
struct qman_portal *qp;
+ int ret;
- if (unlikely(!RTE_PER_LCORE(dpaa_io)))
- rte_dpaa_portal_init(arg);
+ if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+ ret = rte_dpaa_portal_init(arg);
+ if (ret < 0) {
+ DPAA_BUS_LOG(ERR, "portal initialization failure");
+ return ret;
+ }
+ }
/* Initialise qman specific portals */
qp = fsl_qman_portal_create();
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 3/8] net/dpaa: fix the array overrun
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 4/8] net/dpaa: fix the oob access Hemant Agrawal
` (5 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable
Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
Coverity issue: 268342
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index db49364..0aad111 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1105,10 +1105,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE;
}
- /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX
+ /* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX
* queues.
*/
- if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_PCD_FQID_MULTIPLIER) {
+ if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_MAX_NUM_PCD_QUEUES) {
DPAA_PMD_ERR("Invalid number of RX queues\n");
return -EINVAL;
}
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 4/8] net/dpaa: fix the oob access
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 3/8] net/dpaa: fix the array overrun Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 5/8] bus/dpaa: fix resource leak Hemant Agrawal
` (4 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable
Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Coverity issue: 268318
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0aad111..581e3a0 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -335,10 +335,13 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
static int
dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names,
- __rte_unused unsigned int limit)
+ unsigned int limit)
{
unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings);
+ if (limit < stat_cnt)
+ return stat_cnt;
+
if (xstats_names != NULL)
for (i = 0; i < stat_cnt; i++)
snprintf(xstats_names[i].name,
@@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
return 0;
fman_if_stats_get_all(dpaa_intf->fif, values_copy,
- sizeof(struct dpaa_if_stats));
+ sizeof(struct dpaa_if_stats) / 8);
for (i = 0; i < stat_cnt; i++)
values[i] =
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 5/8] bus/dpaa: fix resource leak
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (2 preceding siblings ...)
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 4/8] net/dpaa: fix the oob access Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 6/8] net/dpaa: update checksum for external pool obj Hemant Agrawal
` (3 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable
Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan")
Coverity issue: 268337
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>
---
drivers/bus/dpaa/base/fman/fman.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index e6fd5f3..be91da4 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -442,6 +442,7 @@ fman_if_init(const struct device_node *dpa_node)
if (!pool_node) {
FMAN_ERR(-ENXIO, "%s: bad fsl,bman-buffer-pools\n",
dname);
+ free(bpool);
goto err;
}
pname = pool_node->full_name;
@@ -449,6 +450,7 @@ fman_if_init(const struct device_node *dpa_node)
prop = of_get_property(pool_node, "fsl,bpid", &proplen);
if (!prop) {
FMAN_ERR(-EINVAL, "%s: no fsl,bpid\n", pname);
+ free(bpool);
goto err;
}
assert(proplen == sizeof(*prop));
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 6/8] net/dpaa: update checksum for external pool obj
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (3 preceding siblings ...)
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 5/8] bus/dpaa: fix resource leak Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
` (2 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Akhil Goyal
From: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
drivers/net/dpaa/dpaa_rxtx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index bdb7f66..1316d2a 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -825,6 +825,8 @@ tx_on_external_pool(struct qman_fq *txq, struct rte_mbuf *mbuf,
}
DPAA_MBUF_TO_CONTIG_FD(dmable_mbuf, fd_arr, dpaa_intf->bp_info->bpid);
+ if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK)
+ dpaa_unsegmented_checksum(mbuf, fd_arr);
return 0;
}
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (4 preceding siblings ...)
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 6/8] net/dpaa: update checksum for external pool obj Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 8/8] bus/fslmc: configure separate portal for Ethernet Rx Hemant Agrawal
2018-04-11 22:20 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Thomas Monjalon
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable
Fixes: 1d6329b2fc1f ("net/dpaa2: support extra stats")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 281483d..eed6dc9 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1115,12 +1115,12 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
union dpni_statistics value[3] = {};
unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings);
- if (xstats == NULL)
- return 0;
-
if (n < num)
return num;
+ if (xstats == NULL)
+ return 0;
+
/* Get Counters from page_0*/
retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,
0, 0, &value[0]);
@@ -1153,10 +1153,13 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
static int
dpaa2_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names,
- __rte_unused unsigned int limit)
+ unsigned int limit)
{
unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings);
+ if (limit < stat_cnt)
+ return stat_cnt;
+
if (xstats_names != NULL)
for (i = 0; i < stat_cnt; i++)
snprintf(xstats_names[i].name,
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* [dpdk-dev] [PATCH v2 8/8] bus/fslmc: configure separate portal for Ethernet Rx
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (5 preceding siblings ...)
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
@ 2018-04-09 10:22 ` Hemant Agrawal
2018-04-11 22:20 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Thomas Monjalon
7 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-04-09 10:22 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Nipun Gupta
From: Nipun Gupta <nipun.gupta@nxp.com>
In case of Receive from Ethernet we add a new pull request (prefetch)
but do not fetch the results from that pull request until next
dequeue operation. This keeps the portal in busy mode.
This patch updates the portals bifurcation to have separate portals
to receive packets for Ethernet and all other devices to use a
common portal.
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 27 ++++++++++++++-------------
drivers/bus/fslmc/portal/dpaa2_hw_dpio.h | 8 ++++----
drivers/bus/fslmc/rte_bus_fslmc_version.map | 8 +++++++-
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 12 ++++++------
drivers/net/dpaa2/dpaa2_rxtx.c | 29 ++++++++++++++++-------------
5 files changed, 47 insertions(+), 37 deletions(-)
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 881dd5f..a741626 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -350,7 +350,7 @@ dpaa2_affine_qbman_swp(void)
}
int
-dpaa2_affine_qbman_swp_sec(void)
+dpaa2_affine_qbman_ethrx_swp(void)
{
unsigned int lcore_id = rte_lcore_id();
uint64_t tid = syscall(SYS_gettid);
@@ -361,35 +361,36 @@ dpaa2_affine_qbman_swp_sec(void)
else if (lcore_id >= RTE_MAX_LCORE)
return -1;
- if (dpaa2_io_portal[lcore_id].sec_dpio_dev) {
+ if (dpaa2_io_portal[lcore_id].ethrx_dpio_dev) {
DPAA2_BUS_DP_INFO(
"DPAA Portal=%p (%d) is being shared between thread"
" %" PRIu64 " and current %" PRIu64 "\n",
- dpaa2_io_portal[lcore_id].sec_dpio_dev,
- dpaa2_io_portal[lcore_id].sec_dpio_dev->index,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev->index,
dpaa2_io_portal[lcore_id].sec_tid,
tid);
- RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev
- = dpaa2_io_portal[lcore_id].sec_dpio_dev;
+ RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
+ = dpaa2_io_portal[lcore_id].ethrx_dpio_dev;
rte_atomic16_inc(&dpaa2_io_portal
- [lcore_id].sec_dpio_dev->ref_count);
+ [lcore_id].ethrx_dpio_dev->ref_count);
dpaa2_io_portal[lcore_id].sec_tid = tid;
DPAA2_BUS_DP_DEBUG(
"Old Portal=%p (%d) affined thread"
" - %" PRIu64 "\n",
- dpaa2_io_portal[lcore_id].sec_dpio_dev,
- dpaa2_io_portal[lcore_id].sec_dpio_dev->index,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev,
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev->index,
tid);
return 0;
}
/* Populate the dpaa2_io_portal structure */
- dpaa2_io_portal[lcore_id].sec_dpio_dev = dpaa2_get_qbman_swp(lcore_id);
+ dpaa2_io_portal[lcore_id].ethrx_dpio_dev =
+ dpaa2_get_qbman_swp(lcore_id);
- if (dpaa2_io_portal[lcore_id].sec_dpio_dev) {
- RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev
- = dpaa2_io_portal[lcore_id].sec_dpio_dev;
+ if (dpaa2_io_portal[lcore_id].ethrx_dpio_dev) {
+ RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
+ = dpaa2_io_portal[lcore_id].ethrx_dpio_dev;
dpaa2_io_portal[lcore_id].sec_tid = tid;
return 0;
} else {
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
index c0bd878..d593eea 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h
@@ -13,7 +13,7 @@
struct dpaa2_io_portal_t {
struct dpaa2_dpio_dev *dpio_dev;
- struct dpaa2_dpio_dev *sec_dpio_dev;
+ struct dpaa2_dpio_dev *ethrx_dpio_dev;
uint64_t net_tid;
uint64_t sec_tid;
void *eventdev;
@@ -25,8 +25,8 @@ RTE_DECLARE_PER_LCORE(struct dpaa2_io_portal_t, _dpaa2_io);
#define DPAA2_PER_LCORE_DPIO RTE_PER_LCORE(_dpaa2_io).dpio_dev
#define DPAA2_PER_LCORE_PORTAL DPAA2_PER_LCORE_DPIO->sw_portal
-#define DPAA2_PER_LCORE_SEC_DPIO RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev
-#define DPAA2_PER_LCORE_SEC_PORTAL DPAA2_PER_LCORE_SEC_DPIO->sw_portal
+#define DPAA2_PER_LCORE_ETHRX_DPIO RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev
+#define DPAA2_PER_LCORE_ETHRX_PORTAL DPAA2_PER_LCORE_ETHRX_DPIO->sw_portal
/* Variable to store DPAA2 platform type */
extern uint32_t dpaa2_svr_family;
@@ -39,7 +39,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id);
int dpaa2_affine_qbman_swp(void);
/* Affine additional DPIO portal to current crypto processing thread */
-int dpaa2_affine_qbman_swp_sec(void);
+int dpaa2_affine_qbman_ethrx_swp(void);
/* allocate memory for FQ - dq storage */
int
diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map
index b7db074..f519651 100644
--- a/drivers/bus/fslmc/rte_bus_fslmc_version.map
+++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map
@@ -2,7 +2,6 @@ DPDK_17.05 {
global:
dpaa2_affine_qbman_swp;
- dpaa2_affine_qbman_swp_sec;
dpaa2_alloc_dpbp_dev;
dpaa2_alloc_dq_storage;
dpaa2_free_dpbp_dev;
@@ -101,3 +100,10 @@ DPDK_18.02 {
rte_fslmc_get_device_count;
} DPDK_17.11;
+
+DPDK_18.05 {
+ global:
+
+ dpaa2_affine_qbman_ethrx_swp;
+
+} DPDK_18.02;
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 784b96d..23012e3 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1159,14 +1159,14 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
qbman_eq_desc_set_response(&eqdesc, 0, 0);
qbman_eq_desc_set_fq(&eqdesc, dpaa2_qp->tx_vq.fqid);
- if (!DPAA2_PER_LCORE_SEC_DPIO) {
- ret = dpaa2_affine_qbman_swp_sec();
+ if (!DPAA2_PER_LCORE_DPIO) {
+ ret = dpaa2_affine_qbman_swp();
if (ret) {
DPAA2_SEC_ERR("Failure in affining portal");
return 0;
}
}
- swp = DPAA2_PER_LCORE_SEC_PORTAL;
+ swp = DPAA2_PER_LCORE_PORTAL;
while (nb_ops) {
frames_to_send = (nb_ops >> 3) ? MAX_TX_RING_SLOTS : nb_ops;
@@ -1307,14 +1307,14 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops,
const struct qbman_fd *fd;
struct qbman_pull_desc pulldesc;
- if (!DPAA2_PER_LCORE_SEC_DPIO) {
- ret = dpaa2_affine_qbman_swp_sec();
+ if (!DPAA2_PER_LCORE_DPIO) {
+ ret = dpaa2_affine_qbman_swp();
if (ret) {
DPAA2_SEC_ERR("Failure in affining portal");
return 0;
}
}
- swp = DPAA2_PER_LCORE_SEC_PORTAL;
+ swp = DPAA2_PER_LCORE_PORTAL;
dq_storage = dpaa2_qp->rx_vq.q_storage->dq_storage[0];
qbman_pull_desc_clear(&pulldesc);
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 532de94..d1cfe95 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -481,14 +481,15 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
struct queue_storage_info_t *q_storage = dpaa2_q->q_storage;
struct rte_eth_dev *dev = dpaa2_q->dev;
- if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
- ret = dpaa2_affine_qbman_swp();
+ if (unlikely(!DPAA2_PER_LCORE_ETHRX_DPIO)) {
+ ret = dpaa2_affine_qbman_ethrx_swp();
if (ret) {
DPAA2_PMD_ERR("Failure in affining portal");
return 0;
}
}
- swp = DPAA2_PER_LCORE_PORTAL;
+ swp = DPAA2_PER_LCORE_ETHRX_PORTAL;
+
if (unlikely(!q_storage->active_dqs)) {
q_storage->toggle = 0;
dq_storage = q_storage->dq_storage[q_storage->toggle];
@@ -500,11 +501,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
qbman_pull_desc_set_fq(&pulldesc, fqid);
qbman_pull_desc_set_storage(&pulldesc, dq_storage,
(dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1);
- if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) {
+ if (check_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)) {
while (!qbman_check_command_complete(
- get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)))
+ get_swp_active_dqs(
+ DPAA2_PER_LCORE_ETHRX_DPIO->index)))
;
- clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index);
+ clear_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index);
}
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
@@ -516,8 +518,9 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
break;
}
q_storage->active_dqs = dq_storage;
- q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index;
- set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage);
+ q_storage->active_dpio_id = DPAA2_PER_LCORE_ETHRX_DPIO->index;
+ set_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index,
+ dq_storage);
}
dq_storage = q_storage->active_dqs;
@@ -583,11 +586,11 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
num_rx++;
} while (pending);
- if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) {
+ if (check_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)) {
while (!qbman_check_command_complete(
- get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)))
+ get_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)))
;
- clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index);
+ clear_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index);
}
/* issue a volatile dequeue command for next pull */
while (1) {
@@ -599,8 +602,8 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
break;
}
q_storage->active_dqs = dq_storage1;
- q_storage->active_dpio_id = DPAA2_PER_LCORE_DPIO->index;
- set_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index, dq_storage1);
+ q_storage->active_dpio_id = DPAA2_PER_LCORE_ETHRX_DPIO->index;
+ set_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index, dq_storage1);
dpaa2_q->rx_pkts += num_rx;
--
2.7.4
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
` (6 preceding siblings ...)
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 8/8] bus/fslmc: configure separate portal for Ethernet Rx Hemant Agrawal
@ 2018-04-11 22:20 ` Thomas Monjalon
7 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2018-04-11 22:20 UTC (permalink / raw)
To: Hemant Agrawal, Sunil Kumar Kori; +Cc: dev, ferruh.yigit, stable
09/04/2018 12:22, Hemant Agrawal:
> From: Sunil Kumar Kori <sunil.kori@nxp.com>
>
> Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
> Coverity issue: 268332
> Cc: stable@dpdk.org
>
> Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Series applied, thanks
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2018-04-11 22:20 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 8:54 [dpdk-dev] [PATCH 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 3/8] net/dpaa: fix the array overrun Hemant Agrawal
2018-04-09 5:29 ` Shreyansh Jain
2018-04-05 8:54 ` [dpdk-dev] [PATCH 4/8] net/dpaa: fix the oob access Hemant Agrawal
2018-04-09 7:23 ` Shreyansh Jain
2018-04-05 8:54 ` [dpdk-dev] [PATCH 5/8] bus/dpaa: fix resource leak Hemant Agrawal
2018-04-09 7:18 ` Shreyansh Jain
2018-04-05 8:54 ` [dpdk-dev] [PATCH 6/8] net/dpaa: update checksum for external pool obj Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
2018-04-05 8:54 ` [dpdk-dev] [PATCH 8/8] bus/fslmc: configure separate portal for Ethernet Rx Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 2/8] bus/dpaa: fix the unchecked return value Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 3/8] net/dpaa: fix the array overrun Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 4/8] net/dpaa: fix the oob access Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 5/8] bus/dpaa: fix resource leak Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 6/8] net/dpaa: update checksum for external pool obj Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats Hemant Agrawal
2018-04-09 10:22 ` [dpdk-dev] [PATCH v2 8/8] bus/fslmc: configure separate portal for Ethernet Rx Hemant Agrawal
2018-04-11 22:20 ` [dpdk-dev] [PATCH v2 1/8] bus/dpaa: fix the resource leak issue Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).