patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16
@ 2018-06-21  9:43 Hemant Agrawal
  2018-06-21  9:43 ` [dpdk-stable] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-06-21  9:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Alok Makhariya, Shreyansh Jain, stable

From: Alok Makhariya <alok.makhariya@nxp.com>

Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
Cc: Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
---
 drivers/bus/dpaa/base/fman/of.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c
index 1b2dbe2..eb55cb9 100644
--- a/drivers/bus/dpaa/base/fman/of.c
+++ b/drivers/bus/dpaa/base/fman/of.c
@@ -182,6 +182,11 @@ linear_dir(struct dt_dir *d)
 				DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
 					     d->node.node.full_name);
 			d->lphandle = f;
+		} else if (!strcmp(f->node.node.name, "phandle")) {
+			if (d->lphandle)
+				DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
+					     d->node.node.full_name);
+			d->lphandle = f;
 		} else if (!strcmp(f->node.node.name, "#address-cells")) {
 			if (d->a_cells)
 				DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s",
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH 02/10] bus/dpaa: fix svr id fetch location
  2018-06-21  9:43 [dpdk-stable] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
@ 2018-06-21  9:43 ` Hemant Agrawal
  2018-06-21  9:44 ` [dpdk-stable] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
  2 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-06-21  9:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

Otherwise the SVR may not be avilable for dpaa init.

Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 2046206..7956bd0 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -539,6 +539,13 @@ rte_dpaa_bus_probe(void)
 	unsigned int svr_ver;
 	int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST;
 
+	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
+	if (svr_file) {
+		if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
+			dpaa_svr_family = svr_ver & SVR_MASK;
+		fclose(svr_file);
+	}
+
 	/* For each registered driver, and device, call the driver->probe */
 	TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
 		TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) {
@@ -569,13 +576,6 @@ rte_dpaa_bus_probe(void)
 	if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
 		rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
-	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
-	if (svr_file) {
-		if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
-			dpaa_svr_family = svr_ver & SVR_MASK;
-		fclose(svr_file);
-	}
-
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts
  2018-06-21  9:43 [dpdk-stable] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
  2018-06-21  9:43 ` [dpdk-stable] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal
@ 2018-06-21  9:44 ` Hemant Agrawal
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
  2 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-06-21  9:44 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

This patch fix the prefetch rx routine to
set the next prefetch request to the size of nb_pkts.
This will assume that next request will ideally will be
of same size.

Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index dac086d..311861c 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
 return 0;
 }
 
+/* This function assumes that you will be keeping the same value for nb_pkts
+ * across calls per queue, if that is not the case, better use non-prefetch
+ * version of rx call.
+ * It will return the packets as request in the previous call without honoring
+ * the current nb_pkts or bufs space.
+ */
 uint16_t
 dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 {
@@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue;
 	struct qbman_result *dq_storage, *dq_storage1 = NULL;
 	uint32_t fqid = dpaa2_q->fqid;
-	int ret, num_rx = 0;
+	int ret, num_rx = 0, pull_size;
 	uint8_t pending, status;
 	struct qbman_swp *swp;
 	const struct qbman_fd *fd, *next_fd;
@@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		}
 	}
 	swp = DPAA2_PER_LCORE_ETHRX_PORTAL;
-
+	pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ?
+					       DPAA2_DQRR_RING_SIZE : nb_pkts;
 	if (unlikely(!q_storage->active_dqs)) {
 		q_storage->toggle = 0;
 		dq_storage = q_storage->dq_storage[q_storage->toggle];
-		q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ?
-					       DPAA2_DQRR_RING_SIZE : nb_pkts;
+		q_storage->last_num_pkts = pull_size;
 		qbman_pull_desc_clear(&pulldesc);
 		qbman_pull_desc_set_numframes(&pulldesc,
 					      q_storage->last_num_pkts);
@@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	q_storage->toggle ^= 1;
 	dq_storage1 = q_storage->dq_storage[q_storage->toggle];
 	qbman_pull_desc_clear(&pulldesc);
-	qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE);
+	qbman_pull_desc_set_numframes(&pulldesc, pull_size);
 	qbman_pull_desc_set_fq(&pulldesc, fqid);
 	qbman_pull_desc_set_storage(&pulldesc, dq_storage1,
 		(uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16
  2018-06-21  9:43 [dpdk-stable] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
  2018-06-21  9:43 ` [dpdk-stable] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal
  2018-06-21  9:44 ` [dpdk-stable] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
@ 2018-07-04  9:43 ` Hemant Agrawal
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
                     ` (5 more replies)
  2 siblings, 6 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-04  9:43 UTC (permalink / raw)
  To: dev; +Cc: Alok Makhariya, Shreyansh Jain, stable

From: Alok Makhariya <alok.makhariya@nxp.com>

Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
Cc: Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
---
 drivers/bus/dpaa/base/fman/of.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c
index 1b2dbe2..eb55cb9 100644
--- a/drivers/bus/dpaa/base/fman/of.c
+++ b/drivers/bus/dpaa/base/fman/of.c
@@ -182,6 +182,11 @@ linear_dir(struct dt_dir *d)
 				DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
 					     d->node.node.full_name);
 			d->lphandle = f;
+		} else if (!strcmp(f->node.node.name, "phandle")) {
+			if (d->lphandle)
+				DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
+					     d->node.node.full_name);
+			d->lphandle = f;
 		} else if (!strcmp(f->node.node.name, "#address-cells")) {
 			if (d->a_cells)
 				DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s",
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
@ 2018-07-04  9:43   ` Hemant Agrawal
  2018-07-06  4:44     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-04  9:43 UTC (permalink / raw)
  To: dev; +Cc: stable

Otherwise the SVR may not be avilable for dpaa init.

Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 2046206..7956bd0 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -539,6 +539,13 @@ rte_dpaa_bus_probe(void)
 	unsigned int svr_ver;
 	int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST;
 
+	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
+	if (svr_file) {
+		if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
+			dpaa_svr_family = svr_ver & SVR_MASK;
+		fclose(svr_file);
+	}
+
 	/* For each registered driver, and device, call the driver->probe */
 	TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
 		TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) {
@@ -569,13 +576,6 @@ rte_dpaa_bus_probe(void)
 	if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
 		rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
-	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
-	if (svr_file) {
-		if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
-			dpaa_svr_family = svr_ver & SVR_MASK;
-		fclose(svr_file);
-	}
-
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
@ 2018-07-04  9:43   ` Hemant Agrawal
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-04  9:43 UTC (permalink / raw)
  To: dev; +Cc: stable

The buffer offset was incorrectly being set at 64,
thus not honoring the packet headroom.

Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/fman/fman_hw.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c
index 0148b98..7ada7fa 100644
--- a/drivers/bus/dpaa/base/fman/fman_hw.c
+++ b/drivers/bus/dpaa/base/fman/fman_hw.c
@@ -16,6 +16,8 @@
 #include <fsl_fman_crc64.h>
 #include <fsl_bman.h>
 
+#define FMAN_SP_EXT_BUF_MARG_START_SHIFT            16
+
 /* Instantiate the global variable that the inline CRC64 implementation (in
  * <fsl_fman.h>) depends on.
  */
@@ -422,20 +424,16 @@ fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta)
 int
 fman_if_get_fdoff(struct fman_if *fm_if)
 {
-	u32 fmbm_ricp;
+	u32 fmbm_rebm;
 	int fdoff;
-	int iceof_mask = 0x001f0000;
-	int icsz_mask = 0x0000001f;
 
 	struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
 
 	assert(fman_ccsr_map_fd != -1);
 
-	fmbm_ricp =
-		   in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_ricp);
-	/*iceof + icsz*/
-	fdoff = ((fmbm_ricp & iceof_mask) >> 16) * 16 +
-		(fmbm_ricp & icsz_mask) * 16;
+	fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm);
+
+	fdoff = (fmbm_rebm >> FMAN_SP_EXT_BUF_MARG_START_SHIFT) & 0x1ff;
 
 	return fdoff;
 }
@@ -502,12 +500,16 @@ fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset)
 {
 	struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
 	unsigned int *fmbm_rebm;
+	int val = 0;
+	int fmbm_mask = 0x01ff0000;
+
+	val = fd_offset << FMAN_SP_EXT_BUF_MARG_START_SHIFT;
 
 	assert(fman_ccsr_map_fd != -1);
 
 	fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm;
 
-	out_be32(fmbm_rebm, in_be32(fmbm_rebm) | (fd_offset << 16));
+	out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val);
 }
 
 void
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
@ 2018-07-04  9:43   ` Hemant Agrawal
  2018-07-06  4:56     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-04  9:43 UTC (permalink / raw)
  To: dev; +Cc: stable

Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index d014a11..79ba6bd 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -516,7 +516,15 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	PMD_INIT_FUNC_TRACE();
 
-	DPAA_PMD_INFO("Rx queue setup for queue index: %d", queue_idx);
+	if (queue_idx >= dev->data->nb_rx_queues) {
+		rte_errno = EOVERFLOW;
+		DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)",
+		      (void *)dev, queue_idx, dev->data->nb_rx_queues);
+		return -rte_errno;
+	}
+
+	DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)",
+			queue_idx, rxq->fqid);
 
 	if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) {
 		struct fman_if_ic_params icp;
@@ -580,9 +588,11 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 			opts.fqd.fq_ctrl |= QM_FQCTRL_CGE;
 		}
 		ret = qman_init_fq(rxq, flags, &opts);
-		if (ret)
-			DPAA_PMD_ERR("Channel/Queue association failed. fqid %d"
-				     " ret: %d", rxq->fqid, ret);
+		if (ret) {
+			DPAA_PMD_ERR("Channel/Q association failed. fqid 0x%x "
+				"ret:%d(%s)", rxq->fqid, ret, strerror(ret));
+			return ret;
+		}
 		rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb;
 		rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare;
 		rxq->is_static = true;
@@ -657,8 +667,8 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev,
 
 	ret = qman_init_fq(rxq, flags, &opts);
 	if (ret) {
-		DPAA_PMD_ERR("Channel/Queue association failed. fqid %d ret:%d",
-			     rxq->fqid, ret);
+		DPAA_PMD_ERR("Ev-Channel/Q association failed. fqid 0x%x "
+				"ret:%d(%s)", rxq->fqid, ret, strerror(ret));
 		return ret;
 	}
 
@@ -715,7 +725,15 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	PMD_INIT_FUNC_TRACE();
 
-	DPAA_PMD_INFO("Tx queue setup for queue index: %d", queue_idx);
+	if (queue_idx >= dev->data->nb_tx_queues) {
+		rte_errno = EOVERFLOW;
+		DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)",
+		      (void *)dev, queue_idx, dev->data->nb_tx_queues);
+		return -rte_errno;
+	}
+
+	DPAA_PMD_INFO("Tx queue setup for queue index: %d fq_id (0x%x)",
+			queue_idx, dpaa_intf->tx_queues[queue_idx].fqid);
 	dev->data->tx_queues[queue_idx] = &dpaa_intf->tx_queues[queue_idx];
 	return 0;
 }
@@ -1016,7 +1034,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx,
 	DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid);
 	ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq);
 	if (ret) {
-		DPAA_PMD_ERR("create rx fqid %d failed with ret: %d",
+		DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d",
 			fqid, ret);
 		return ret;
 	}
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
                     ` (2 preceding siblings ...)
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
@ 2018-07-04  9:43   ` Hemant Agrawal
  2018-07-06  5:01     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
  2018-07-04 10:59   ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
  5 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-04  9:43 UTC (permalink / raw)
  To: dev; +Cc: stable

This patch fix the prefetch rx routine to
set the next prefetch request to the size of nb_pkts.
This will assume that next request will ideally will be
of same size.

Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index dac086d..311861c 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
 return 0;
 }
 
+/* This function assumes that you will be keeping the same value for nb_pkts
+ * across calls per queue, if that is not the case, better use non-prefetch
+ * version of rx call.
+ * It will return the packets as request in the previous call without honoring
+ * the current nb_pkts or bufs space.
+ */
 uint16_t
 dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 {
@@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue;
 	struct qbman_result *dq_storage, *dq_storage1 = NULL;
 	uint32_t fqid = dpaa2_q->fqid;
-	int ret, num_rx = 0;
+	int ret, num_rx = 0, pull_size;
 	uint8_t pending, status;
 	struct qbman_swp *swp;
 	const struct qbman_fd *fd, *next_fd;
@@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		}
 	}
 	swp = DPAA2_PER_LCORE_ETHRX_PORTAL;
-
+	pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ?
+					       DPAA2_DQRR_RING_SIZE : nb_pkts;
 	if (unlikely(!q_storage->active_dqs)) {
 		q_storage->toggle = 0;
 		dq_storage = q_storage->dq_storage[q_storage->toggle];
-		q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ?
-					       DPAA2_DQRR_RING_SIZE : nb_pkts;
+		q_storage->last_num_pkts = pull_size;
 		qbman_pull_desc_clear(&pulldesc);
 		qbman_pull_desc_set_numframes(&pulldesc,
 					      q_storage->last_num_pkts);
@@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	q_storage->toggle ^= 1;
 	dq_storage1 = q_storage->dq_storage[q_storage->toggle];
 	qbman_pull_desc_clear(&pulldesc);
-	qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE);
+	qbman_pull_desc_set_numframes(&pulldesc, pull_size);
 	qbman_pull_desc_set_fq(&pulldesc, fqid);
 	qbman_pull_desc_set_storage(&pulldesc, dq_storage1,
 		(uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
                     ` (3 preceding siblings ...)
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
@ 2018-07-04 10:59   ` Shreyansh Jain
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
  5 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-07-04 10:59 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: Alok Makhariya, stable

> -----Original Message-----
> From: Hemant Agrawal
> Sent: Wednesday, July 4, 2018 3:14 PM
> To: dev@dpdk.org
> Cc: Alok Makhariya <alok.makhariya@nxp.com>; Shreyansh Jain
> <shreyansh.jain@nxp.com>; stable@dpdk.org
> Subject: [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16
> 
> From: Alok Makhariya <alok.makhariya@nxp.com>
> 
> Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
> Cc: Shreyansh Jain <shreyansh.jain@nxp.com>
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
> ---
>  drivers/bus/dpaa/base/fman/of.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
@ 2018-07-06  4:44     ` Shreyansh Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-07-06  4:44 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: stable

On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote:
> Otherwise the SVR may not be avilable for dpaa init.
> 
> Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines")
> 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-stable] [dpdk-dev] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
@ 2018-07-06  4:56     ` Shreyansh Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-07-06  4:56 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: stable

On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote:
> Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev")
> 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-stable] [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts
  2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
@ 2018-07-06  5:01     ` Shreyansh Jain
  2018-07-06  8:13       ` Hemant Agrawal
  0 siblings, 1 reply; 20+ messages in thread
From: Shreyansh Jain @ 2018-07-06  5:01 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: stable

On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote:
> This patch fix the prefetch rx routine to
             ^^^^^
             fixes
> set the next prefetch request to the size of nb_pkts.
> This will assume that next request will ideally will be
> of same size.

Incorrect wording.
Maybe:
"It assumes that next request would ideally be of same size"

> 
> Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>   drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
> index dac086d..311861c 100644
> --- a/drivers/net/dpaa2/dpaa2_rxtx.c
> +++ b/drivers/net/dpaa2/dpaa2_rxtx.c
> @@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
>   return 0;
>   }
>   
> +/* This function assumes that you will be keeping the same value for nb_pkts
                             ^^^^^^^^^^
Ideally commit messages shouldn't have personifications 'you/your' etc
But, it is a trivial thing and I leave at your discretion.

> + * across calls per queue, if that is not the case, better use non-prefetch
> + * version of rx call.
> + * It will return the packets as request in the previous call without honoring
                                    ^^^^^^^^^
                                    requested

[...]

Being very trivial comments, if you send the next version, please use:

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16
  2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
                     ` (4 preceding siblings ...)
  2018-07-04 10:59   ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain
@ 2018-07-06  8:09   ` Hemant Agrawal
  2018-07-06  8:09     ` [dpdk-stable] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
                       ` (4 more replies)
  5 siblings, 5 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-06  8:09 UTC (permalink / raw)
  To: dev; +Cc: shreyansh.jain, Alok Makhariya, stable

From: Alok Makhariya <alok.makhariya@nxp.com>

Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
Cc: Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: stable@dpdk.org

Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/dpaa/base/fman/of.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/dpaa/base/fman/of.c b/drivers/bus/dpaa/base/fman/of.c
index 1b2dbe2..eb55cb9 100644
--- a/drivers/bus/dpaa/base/fman/of.c
+++ b/drivers/bus/dpaa/base/fman/of.c
@@ -182,6 +182,11 @@ linear_dir(struct dt_dir *d)
 				DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
 					     d->node.node.full_name);
 			d->lphandle = f;
+		} else if (!strcmp(f->node.node.name, "phandle")) {
+			if (d->lphandle)
+				DPAA_BUS_LOG(DEBUG, "Duplicate lphandle in %s",
+					     d->node.node.full_name);
+			d->lphandle = f;
 		} else if (!strcmp(f->node.node.name, "#address-cells")) {
 			if (d->a_cells)
 				DPAA_BUS_LOG(DEBUG, "Duplicate a_cells in %s",
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
@ 2018-07-06  8:09     ` Hemant Agrawal
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-06  8:09 UTC (permalink / raw)
  To: dev; +Cc: shreyansh.jain, stable

Otherwise the SVR may not be avilable for dpaa init.

Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 2046206..7956bd0 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -539,6 +539,13 @@ rte_dpaa_bus_probe(void)
 	unsigned int svr_ver;
 	int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST;
 
+	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
+	if (svr_file) {
+		if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
+			dpaa_svr_family = svr_ver & SVR_MASK;
+		fclose(svr_file);
+	}
+
 	/* For each registered driver, and device, call the driver->probe */
 	TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
 		TAILQ_FOREACH(drv, &rte_dpaa_bus.driver_list, next) {
@@ -569,13 +576,6 @@ rte_dpaa_bus_probe(void)
 	if (!TAILQ_EMPTY(&rte_dpaa_bus.device_list))
 		rte_mbuf_set_platform_mempool_ops(DPAA_MEMPOOL_OPS_NAME);
 
-	svr_file = fopen(DPAA_SOC_ID_FILE, "r");
-	if (svr_file) {
-		if (fscanf(svr_file, "svr:%x", &svr_ver) > 0)
-			dpaa_svr_family = svr_ver & SVR_MASK;
-		fclose(svr_file);
-	}
-
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
  2018-07-06  8:09     ` [dpdk-stable] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
@ 2018-07-06  8:10     ` Hemant Agrawal
  2018-07-06 12:28       ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
                       ` (2 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-06  8:10 UTC (permalink / raw)
  To: dev; +Cc: shreyansh.jain, stable

The buffer offset was incorrectly being set at 64,
thus not honoring the packet headroom.

Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/fman/fman_hw.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c
index 0148b98..7ada7fa 100644
--- a/drivers/bus/dpaa/base/fman/fman_hw.c
+++ b/drivers/bus/dpaa/base/fman/fman_hw.c
@@ -16,6 +16,8 @@
 #include <fsl_fman_crc64.h>
 #include <fsl_bman.h>
 
+#define FMAN_SP_EXT_BUF_MARG_START_SHIFT            16
+
 /* Instantiate the global variable that the inline CRC64 implementation (in
  * <fsl_fman.h>) depends on.
  */
@@ -422,20 +424,16 @@ fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta)
 int
 fman_if_get_fdoff(struct fman_if *fm_if)
 {
-	u32 fmbm_ricp;
+	u32 fmbm_rebm;
 	int fdoff;
-	int iceof_mask = 0x001f0000;
-	int icsz_mask = 0x0000001f;
 
 	struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
 
 	assert(fman_ccsr_map_fd != -1);
 
-	fmbm_ricp =
-		   in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_ricp);
-	/*iceof + icsz*/
-	fdoff = ((fmbm_ricp & iceof_mask) >> 16) * 16 +
-		(fmbm_ricp & icsz_mask) * 16;
+	fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm);
+
+	fdoff = (fmbm_rebm >> FMAN_SP_EXT_BUF_MARG_START_SHIFT) & 0x1ff;
 
 	return fdoff;
 }
@@ -502,12 +500,16 @@ fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset)
 {
 	struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if);
 	unsigned int *fmbm_rebm;
+	int val = 0;
+	int fmbm_mask = 0x01ff0000;
+
+	val = fd_offset << FMAN_SP_EXT_BUF_MARG_START_SHIFT;
 
 	assert(fman_ccsr_map_fd != -1);
 
 	fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm;
 
-	out_be32(fmbm_rebm, in_be32(fmbm_rebm) | (fd_offset << 16));
+	out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val);
 }
 
 void
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
  2018-07-06  8:09     ` [dpdk-stable] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
@ 2018-07-06  8:10     ` Hemant Agrawal
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
  2018-07-12 12:49     ` [dpdk-stable] [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon
  4 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-06  8:10 UTC (permalink / raw)
  To: dev; +Cc: shreyansh.jain, stable

Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev")
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 | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index d014a11..79ba6bd 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -516,7 +516,15 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	PMD_INIT_FUNC_TRACE();
 
-	DPAA_PMD_INFO("Rx queue setup for queue index: %d", queue_idx);
+	if (queue_idx >= dev->data->nb_rx_queues) {
+		rte_errno = EOVERFLOW;
+		DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)",
+		      (void *)dev, queue_idx, dev->data->nb_rx_queues);
+		return -rte_errno;
+	}
+
+	DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)",
+			queue_idx, rxq->fqid);
 
 	if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) {
 		struct fman_if_ic_params icp;
@@ -580,9 +588,11 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 			opts.fqd.fq_ctrl |= QM_FQCTRL_CGE;
 		}
 		ret = qman_init_fq(rxq, flags, &opts);
-		if (ret)
-			DPAA_PMD_ERR("Channel/Queue association failed. fqid %d"
-				     " ret: %d", rxq->fqid, ret);
+		if (ret) {
+			DPAA_PMD_ERR("Channel/Q association failed. fqid 0x%x "
+				"ret:%d(%s)", rxq->fqid, ret, strerror(ret));
+			return ret;
+		}
 		rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb;
 		rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare;
 		rxq->is_static = true;
@@ -657,8 +667,8 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev,
 
 	ret = qman_init_fq(rxq, flags, &opts);
 	if (ret) {
-		DPAA_PMD_ERR("Channel/Queue association failed. fqid %d ret:%d",
-			     rxq->fqid, ret);
+		DPAA_PMD_ERR("Ev-Channel/Q association failed. fqid 0x%x "
+				"ret:%d(%s)", rxq->fqid, ret, strerror(ret));
 		return ret;
 	}
 
@@ -715,7 +725,15 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 	PMD_INIT_FUNC_TRACE();
 
-	DPAA_PMD_INFO("Tx queue setup for queue index: %d", queue_idx);
+	if (queue_idx >= dev->data->nb_tx_queues) {
+		rte_errno = EOVERFLOW;
+		DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)",
+		      (void *)dev, queue_idx, dev->data->nb_tx_queues);
+		return -rte_errno;
+	}
+
+	DPAA_PMD_INFO("Tx queue setup for queue index: %d fq_id (0x%x)",
+			queue_idx, dpaa_intf->tx_queues[queue_idx].fqid);
 	dev->data->tx_queues[queue_idx] = &dpaa_intf->tx_queues[queue_idx];
 	return 0;
 }
@@ -1016,7 +1034,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx,
 	DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid);
 	ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq);
 	if (ret) {
-		DPAA_PMD_ERR("create rx fqid %d failed with ret: %d",
+		DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d",
 			fqid, ret);
 		return ret;
 	}
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [dpdk-stable] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
                       ` (2 preceding siblings ...)
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
@ 2018-07-06  8:10     ` Hemant Agrawal
  2018-07-12 12:49     ` [dpdk-stable] [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 Thomas Monjalon
  4 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-06  8:10 UTC (permalink / raw)
  To: dev; +Cc: shreyansh.jain, stable

This patch fixes prefetch rx routine to
set the next prefetch request to the size of nb_pkts.
It assumes that next request would ideally be
of same size.

Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/net/dpaa2/dpaa2_rxtx.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index dac086d..ef109a6 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -447,6 +447,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
 return 0;
 }
 
+/* This function assumes that caller will be keep the same value for nb_pkts
+ * across calls per queue, if that is not the case, better use non-prefetch
+ * version of rx call.
+ * It will return the packets as requested in previous call without honoring
+ * the current nb_pkts or bufs space.
+ */
 uint16_t
 dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 {
@@ -454,7 +460,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue;
 	struct qbman_result *dq_storage, *dq_storage1 = NULL;
 	uint32_t fqid = dpaa2_q->fqid;
-	int ret, num_rx = 0;
+	int ret, num_rx = 0, pull_size;
 	uint8_t pending, status;
 	struct qbman_swp *swp;
 	const struct qbman_fd *fd, *next_fd;
@@ -470,12 +476,12 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		}
 	}
 	swp = DPAA2_PER_LCORE_ETHRX_PORTAL;
-
+	pull_size = (nb_pkts > DPAA2_DQRR_RING_SIZE) ?
+					       DPAA2_DQRR_RING_SIZE : nb_pkts;
 	if (unlikely(!q_storage->active_dqs)) {
 		q_storage->toggle = 0;
 		dq_storage = q_storage->dq_storage[q_storage->toggle];
-		q_storage->last_num_pkts = (nb_pkts > DPAA2_DQRR_RING_SIZE) ?
-					       DPAA2_DQRR_RING_SIZE : nb_pkts;
+		q_storage->last_num_pkts = pull_size;
 		qbman_pull_desc_clear(&pulldesc);
 		qbman_pull_desc_set_numframes(&pulldesc,
 					      q_storage->last_num_pkts);
@@ -514,7 +520,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	q_storage->toggle ^= 1;
 	dq_storage1 = q_storage->dq_storage[q_storage->toggle];
 	qbman_pull_desc_clear(&pulldesc);
-	qbman_pull_desc_set_numframes(&pulldesc, DPAA2_DQRR_RING_SIZE);
+	qbman_pull_desc_set_numframes(&pulldesc, pull_size);
 	qbman_pull_desc_set_fq(&pulldesc, fqid);
 	qbman_pull_desc_set_storage(&pulldesc, dq_storage1,
 		(uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage1)), 1);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts
  2018-07-06  5:01     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
@ 2018-07-06  8:13       ` Hemant Agrawal
  0 siblings, 0 replies; 20+ messages in thread
From: Hemant Agrawal @ 2018-07-06  8:13 UTC (permalink / raw)
  To: Shreyansh Jain, dev; +Cc: stable

On Wednesday 04 July 2018 03:13 PM, Hemant Agrawal wrote:
> This patch fix the prefetch rx routine to
             ^^^^^
             fixes
> set the next prefetch request to the size of nb_pkts.
> This will assume that next request will ideally will be of same size.

Incorrect wording.
Maybe:
"It assumes that next request would ideally be of same size"

[Hemant] I have taken care of it in v3.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
@ 2018-07-06 12:28       ` Shreyansh Jain
  0 siblings, 0 replies; 20+ messages in thread
From: Shreyansh Jain @ 2018-07-06 12:28 UTC (permalink / raw)
  To: Hemant Agrawal, dev; +Cc: stable

On Friday 06 July 2018 01:40 PM, Hemant Agrawal wrote:
> The buffer offset was incorrectly being set at 64,
> thus not honoring the packet headroom.
> 
> Fixes: 6d6b4f49a155 (bus/dpaa: add FMAN hardware operations")
> 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-stable] [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16
  2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
                       ` (3 preceding siblings ...)
  2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
@ 2018-07-12 12:49     ` Thomas Monjalon
  4 siblings, 0 replies; 20+ messages in thread
From: Thomas Monjalon @ 2018-07-12 12:49 UTC (permalink / raw)
  To: Hemant Agrawal, shreyansh.jain, Akhil Goyal; +Cc: dev, Alok Makhariya, stable

06/07/2018 10:09, Hemant Agrawal:
> From: Alok Makhariya <alok.makhariya@nxp.com>
> 
> Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
> Cc: Shreyansh Jain <shreyansh.jain@nxp.com>
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Series applied without last patch (because must be reworked).

This series has a lot of cleanups. Starting from now, I will consider
NXP drivers as mature enough. I won't accept anymore such patch without
(or not enough) explanation.
For your users and readers, please start considering to explain
what was wrong and what needs to be changed.
Thanks

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-07-12 12:49 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21  9:43 [dpdk-stable] [PATCH 01/10] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
2018-06-21  9:43 ` [dpdk-stable] [PATCH 02/10] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-06-21  9:44 ` [dpdk-stable] [PATCH 08/10] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-04  9:43 ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Hemant Agrawal
2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-07-06  4:44     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
2018-07-06  4:56     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-04  9:43   ` [dpdk-stable] [PATCH v2 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-06  5:01     ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-06  8:13       ` Hemant Agrawal
2018-07-04 10:59   ` [dpdk-stable] [PATCH v2 01/16] bus/dpaa: fix phandle support for kernel 4.16 Shreyansh Jain
2018-07-06  8:09   ` [dpdk-stable] [PATCH v3 " Hemant Agrawal
2018-07-06  8:09     ` [dpdk-stable] [PATCH v3 02/16] bus/dpaa: fix svr id fetch location Hemant Agrawal
2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 03/16] bus/dpaa: fix the buffer offset setting in FMAN Hemant Agrawal
2018-07-06 12:28       ` [dpdk-stable] [dpdk-dev] " Shreyansh Jain
2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs Hemant Agrawal
2018-07-06  8:10     ` [dpdk-stable] [PATCH v3 05/16] net/dpaa2: fix the prefetch Rx to honor nb pkts Hemant Agrawal
2018-07-12 12:49     ` [dpdk-stable] [dpdk-dev] [PATCH v3 01/16] bus/dpaa: fix phandle support for kernel 4.16 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).