patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH 1/9] net/dpaa: fix supported RSS types
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 2/9] net/dpaa: fix LS1043 alignment check Nipun Gupta
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch fixes the supported RSS types on DPAA platform

Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index f63a5f164..baaf8abd0 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -76,14 +76,11 @@
 #define DPAA_DEBUG_FQ_TX_ERROR   1
 
 #define DPAA_RSS_OFFLOAD_ALL ( \
-	ETH_RSS_FRAG_IPV4 | \
-	ETH_RSS_NONFRAG_IPV4_TCP | \
-	ETH_RSS_NONFRAG_IPV4_UDP | \
-	ETH_RSS_NONFRAG_IPV4_SCTP | \
-	ETH_RSS_FRAG_IPV6 | \
-	ETH_RSS_NONFRAG_IPV6_TCP | \
-	ETH_RSS_NONFRAG_IPV6_UDP | \
-	ETH_RSS_NONFRAG_IPV6_SCTP)
+	ETH_RSS_L2_PAYLOAD | \
+	ETH_RSS_IP | \
+	ETH_RSS_UDP | \
+	ETH_RSS_TCP | \
+	ETH_RSS_SCTP)
 
 #define DPAA_TX_CKSUM_OFFLOAD_MASK (             \
 		PKT_TX_IP_CKSUM |                \
-- 
2.17.1


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

* [dpdk-stable] [PATCH 2/9] net/dpaa: fix LS1043 alignment check
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

On LS1043, we are good to check 128 byte alignment of offset to
transmit out the packet

Fixes: 9eba4a60c2f5 ("net/dpaa: support scatter gather in Tx for non DPAA buffer")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 2de1a1a7e..934be50e9 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -927,7 +927,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 			 * the buffer in such case.
 			 */
 			if (dpaa_svr_family == SVR_LS1043A_FAMILY &&
-					(mbuf->data_off & 0xFF) != 0x0)
+					(mbuf->data_off & 0x7F) != 0x0)
 				realloc_mbuf = 1;
 			seqn = mbuf->seqn;
 			if (seqn != DPAA_INVALID_MBUF_SEQN) {
-- 
2.17.1


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

* [dpdk-stable] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 2/9] net/dpaa: fix LS1043 alignment check Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

In Virtual Machine the memory node in the device tree is at
'/proc/device-tree/memory/reg' which is separate from the memory
node path on the host. This patch enables check on both the paths.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 7 +++++--
 drivers/common/dpaax/dpaax_iova_table.h | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 43c9c72e6..98b076e09 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -68,9 +68,12 @@ read_memory_node(unsigned int *count)
 	*count = 0;
 
 	ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result);
+	if (ret != 0)
+		ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result);
+
 	if (ret != 0) {
-		DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)",
-			    MEM_NODE_PATH_GLOB, ret);
+		DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)",
+			ret);
 		goto out;
 	}
 
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index 138827e7b..fef97f6dd 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p;
  * is SoC dependent, or even Uboot fixup dependent.
  */
 #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg"
+/* For Virtual Machines memory node is at different path (below) */
+#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg"
 /* Device file should be multiple of 16 bytes, each containing 8 byte of addr
  * and its length. Assuming max of 5 entries.
  */
-- 
2.17.1


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

* [dpdk-stable] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
                   ` (2 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Radu Bulie

When BMAN is not able to accept more buffers, it could be that
there are no FBPR's (internal mem provided to bman) left.
Panic in such conditions.

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index f26c30b00..7e815a1ce 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	struct qbman_release_desc releasedesc;
 	struct qbman_swp *swp;
 	int ret;
-	int i, n;
+	int i, n, retry_count;
 	uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
@@ -225,9 +225,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	}
 
 	/* feed them to bman */
-	do {
-		ret = qbman_swp_release(swp, &releasedesc, bufs, n);
-	} while (ret == -EBUSY);
+	retry_count = 0;
+	while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) ==
+			-EBUSY) {
+		retry_count++;
+		if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+			rte_panic("bman release retry exceeded, low fbpr?\n");
+	}
 
 aligned:
 	/* if there are more buffers to free */
@@ -243,10 +247,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 #endif
 		}
 
-		do {
-			ret = qbman_swp_release(swp, &releasedesc, bufs,
-						DPAA2_MBUF_MAX_ACQ_REL);
-		} while (ret == -EBUSY);
+		retry_count = 0;
+		while ((ret = qbman_swp_release(swp, &releasedesc, bufs,
+					DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) {
+			retry_count++;
+			if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+				rte_panic("bman release retry exceeded, low fbpr?\n");
+		}
 		n += DPAA2_MBUF_MAX_ACQ_REL;
 	}
 }
-- 
2.17.1


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

* [dpdk-stable] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
                   ` (3 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta,
	Radu Bulie

In the packet transmit, if the QBMAN is not able to process the
packets, the Tx function loops infinitely to send the packet out.
This patch changes the logic retry for some time (count) and then
return.

Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations")
Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  2 +
 drivers/net/dpaa2/dpaa2_rxtx.c          | 72 ++++++++++++++++++++-----
 2 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 5087f68c6..d28c7159f 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -59,6 +59,8 @@
 #define DPAA2_SWP_CINH_REGION		1
 #define DPAA2_SWP_CENA_MEM_REGION	2
 
+#define DPAA2_MAX_TX_RETRY_COUNT	10000
+
 #define MC_PORTAL_INDEX		0
 #define NUM_DPIO_REGIONS	2
 #define NUM_DQS_PER_QUEUE       2
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index b7b2d8652..52d913d9e 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -1135,15 +1135,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 #endif
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
 					&fd_arr[loop], &flags[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1153,13 +1166,22 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i],
-							&flags[loop],
-							loop - i);
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
+							 &fd_arr[i],
+							 &flags[i],
+							 loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
@@ -1365,15 +1387,28 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple_desc(swp,
+			ret = qbman_swp_enqueue_multiple_desc(swp,
 					&eqdesc[loop], &fd_arr[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1383,11 +1418,20 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop],
-							&fd_arr[i], loop - i);
+			ret = qbman_swp_enqueue_multiple_desc(swp,
+				       &eqdesc[loop], &fd_arr[i], loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
-- 
2.17.1


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

* [dpdk-stable] [PATCH 6/9] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
                   ` (4 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
@ 2019-10-11  5:46 ` " Nipun Gupta
  2019-10-15  6:55   ` Hemant Agrawal
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds the logic in the DPAA2 QDMA packet enqueue API

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index a391913b0..af678273d 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev,
 		}
 
 		/* Enqueue the packet to the QBMAN */
-		uint32_t enqueue_loop = 0;
+		uint32_t enqueue_loop = 0, retry_count = 0;
 		while (enqueue_loop < loop) {
-			enqueue_loop += qbman_swp_enqueue_multiple(swp,
+			ret = qbman_swp_enqueue_multiple(swp,
 						&eqdesc,
 						&fd[enqueue_loop],
 						NULL,
 						loop - enqueue_loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					return num_tx - (loop - enqueue_loop);
+			} else {
+				enqueue_loop += ret;
+				retry_count = 0;
+			}
 		}
 		nb_jobs -= loop;
 	}
-- 
2.17.1


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

* [dpdk-stable] [PATCH 7/9] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
       [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
                   ` (5 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-11  5:46 ` " Nipun Gupta
  2019-10-15  6:55   ` Hemant Agrawal
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds retry in the DPAA2 CMDIF packet enqueue API

Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 3f42da1fe..ae53114b5 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 	struct qbman_fd fd;
 	struct qbman_eq_desc eqdesc;
 	struct qbman_swp *swp;
+	uint32_t retry_count = 0;
 	int ret;
 
 	RTE_SET_USED(count);
@@ -100,11 +101,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 		ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1);
 		if (ret < 0 && ret != -EBUSY)
 			DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret);
-	} while (ret == -EBUSY);
+		retry_count++;
+	} while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT));
+
+	if (ret < 0)
+		return ret;
 
 	DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n");
 
-	return 0;
+	return 1;
 }
 
 static int
-- 
2.17.1


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

* Re: [dpdk-stable] [PATCH 7/9] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-15  6:55   ` Hemant Agrawal
  0 siblings, 0 replies; 32+ messages in thread
From: Hemant Agrawal @ 2019-10-15  6:55 UTC (permalink / raw)
  To: Nipun Gupta, dev; +Cc: ferruh.yigit, Sachin Saxena, stable, Nipun Gupta

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

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

* Re: [dpdk-stable] [PATCH 6/9] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  2019-10-11  5:46 ` [dpdk-stable] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-15  6:55   ` Hemant Agrawal
  0 siblings, 0 replies; 32+ messages in thread
From: Hemant Agrawal @ 2019-10-15  6:55 UTC (permalink / raw)
  To: Nipun Gupta, dev; +Cc: ferruh.yigit, Sachin Saxena, stable, Nipun Gupta

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

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

* [dpdk-stable] [PATCH 1/9 v2] net/dpaa: fix supported RSS types
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
@ 2019-10-17 12:43   ` Nipun Gupta
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check Nipun Gupta
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch fixes the supported RSS types on DPAA platform

Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 182becac1..7e51b0e68 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -76,14 +76,11 @@
 #define DPAA_DEBUG_FQ_TX_ERROR   1
 
 #define DPAA_RSS_OFFLOAD_ALL ( \
-	ETH_RSS_FRAG_IPV4 | \
-	ETH_RSS_NONFRAG_IPV4_TCP | \
-	ETH_RSS_NONFRAG_IPV4_UDP | \
-	ETH_RSS_NONFRAG_IPV4_SCTP | \
-	ETH_RSS_FRAG_IPV6 | \
-	ETH_RSS_NONFRAG_IPV6_TCP | \
-	ETH_RSS_NONFRAG_IPV6_UDP | \
-	ETH_RSS_NONFRAG_IPV6_SCTP)
+	ETH_RSS_L2_PAYLOAD | \
+	ETH_RSS_IP | \
+	ETH_RSS_UDP | \
+	ETH_RSS_TCP | \
+	ETH_RSS_SCTP)
 
 #define DPAA_TX_CKSUM_OFFLOAD_MASK (             \
 		PKT_TX_IP_CKSUM |                \
-- 
2.17.1


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

* [dpdk-stable] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 1/9 v2] net/dpaa: fix supported RSS types Nipun Gupta
@ 2019-10-17 12:43   ` Nipun Gupta
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

On LS1043, we are good to check 128 byte alignment of offset to
transmit out the packet

Fixes: 9eba4a60c2f5 ("net/dpaa: support scatter gather in Tx for non DPAA buffer")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index bbe615099..5dba1db8b 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -927,7 +927,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 			 * the buffer in such case.
 			 */
 			if (dpaa_svr_family == SVR_LS1043A_FAMILY &&
-					(mbuf->data_off & 0xFF) != 0x0)
+					(mbuf->data_off & 0x7F) != 0x0)
 				realloc_mbuf = 1;
 			seqn = mbuf->seqn;
 			if (seqn != DPAA_INVALID_MBUF_SEQN) {
-- 
2.17.1


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

* [dpdk-stable] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 1/9 v2] net/dpaa: fix supported RSS types Nipun Gupta
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check Nipun Gupta
@ 2019-10-17 12:43   ` Nipun Gupta
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

In Virtual Machine the memory node in the device tree is at
'/proc/device-tree/memory/reg' which is separate from the memory
node path on the host. This patch enables check on both the paths.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 7 +++++--
 drivers/common/dpaax/dpaax_iova_table.h | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 43c9c72e6..98b076e09 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -68,9 +68,12 @@ read_memory_node(unsigned int *count)
 	*count = 0;
 
 	ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result);
+	if (ret != 0)
+		ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result);
+
 	if (ret != 0) {
-		DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)",
-			    MEM_NODE_PATH_GLOB, ret);
+		DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)",
+			ret);
 		goto out;
 	}
 
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index 138827e7b..fef97f6dd 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p;
  * is SoC dependent, or even Uboot fixup dependent.
  */
 #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg"
+/* For Virtual Machines memory node is at different path (below) */
+#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg"
 /* Device file should be multiple of 16 bytes, each containing 8 byte of addr
  * and its length. Assuming max of 5 entries.
  */
-- 
2.17.1


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

* [dpdk-stable] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
                     ` (2 preceding siblings ...)
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
@ 2019-10-17 12:43   ` Nipun Gupta
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 5/9 v2] raw/dpaa2_qdma: " Nipun Gupta
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:43 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta,
	Radu Bulie

In the packet transmit, if the QBMAN is not able to process the
packets, the Tx function loops infinitely to send the packet out.
This patch changes the logic retry for some time (count) and then
return.

Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations")
Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  2 +
 drivers/net/dpaa2/dpaa2_rxtx.c          | 72 ++++++++++++++++++++-----
 2 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 5087f68c6..d28c7159f 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -59,6 +59,8 @@
 #define DPAA2_SWP_CINH_REGION		1
 #define DPAA2_SWP_CENA_MEM_REGION	2
 
+#define DPAA2_MAX_TX_RETRY_COUNT	10000
+
 #define MC_PORTAL_INDEX		0
 #define NUM_DPIO_REGIONS	2
 #define NUM_DQS_PER_QUEUE       2
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index b7b2d8652..52d913d9e 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -1135,15 +1135,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 #endif
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
 					&fd_arr[loop], &flags[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1153,13 +1166,22 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i],
-							&flags[loop],
-							loop - i);
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
+							 &fd_arr[i],
+							 &flags[i],
+							 loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
@@ -1365,15 +1387,28 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple_desc(swp,
+			ret = qbman_swp_enqueue_multiple_desc(swp,
 					&eqdesc[loop], &fd_arr[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1383,11 +1418,20 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop],
-							&fd_arr[i], loop - i);
+			ret = qbman_swp_enqueue_multiple_desc(swp,
+				       &eqdesc[loop], &fd_arr[i], loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
-- 
2.17.1


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

* [dpdk-stable] [PATCH 5/9 v2] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
                     ` (3 preceding siblings ...)
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
@ 2019-10-17 12:43   ` " Nipun Gupta
  2019-10-17 12:44   ` [dpdk-stable] [PATCH 6/9 v2] raw/dpaa2_cmdif: " Nipun Gupta
  2019-10-17 12:44   ` [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds the logic in the DPAA2 QDMA packet enqueue API

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index a391913b0..af678273d 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev,
 		}
 
 		/* Enqueue the packet to the QBMAN */
-		uint32_t enqueue_loop = 0;
+		uint32_t enqueue_loop = 0, retry_count = 0;
 		while (enqueue_loop < loop) {
-			enqueue_loop += qbman_swp_enqueue_multiple(swp,
+			ret = qbman_swp_enqueue_multiple(swp,
 						&eqdesc,
 						&fd[enqueue_loop],
 						NULL,
 						loop - enqueue_loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					return num_tx - (loop - enqueue_loop);
+			} else {
+				enqueue_loop += ret;
+				retry_count = 0;
+			}
 		}
 		nb_jobs -= loop;
 	}
-- 
2.17.1


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

* [dpdk-stable] [PATCH 6/9 v2] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
                     ` (4 preceding siblings ...)
  2019-10-17 12:43   ` [dpdk-stable] [PATCH 5/9 v2] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-17 12:44   ` " Nipun Gupta
  2019-10-17 12:44   ` [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:44 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds retry in the DPAA2 CMDIF packet enqueue API

Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 3f42da1fe..ae53114b5 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 	struct qbman_fd fd;
 	struct qbman_eq_desc eqdesc;
 	struct qbman_swp *swp;
+	uint32_t retry_count = 0;
 	int ret;
 
 	RTE_SET_USED(count);
@@ -100,11 +101,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 		ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1);
 		if (ret < 0 && ret != -EBUSY)
 			DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret);
-	} while (ret == -EBUSY);
+		retry_count++;
+	} while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT));
+
+	if (ret < 0)
+		return ret;
 
 	DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n");
 
-	return 0;
+	return 1;
 }
 
 static int
-- 
2.17.1


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

* [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release
       [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
                     ` (5 preceding siblings ...)
  2019-10-17 12:44   ` [dpdk-stable] [PATCH 6/9 v2] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-17 12:44   ` Nipun Gupta
  2019-10-23 23:08     ` Thomas Monjalon
  6 siblings, 1 reply; 32+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:44 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Radu Bulie

From: Radu Bulie <radu-andrei.bulie@nxp.com>

When BMAN is not able to accept more buffers, it could be that
there are no FBPR's (internal mem provided to bman) left.
Panic in such conditions.

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index f26c30b00..7e815a1ce 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	struct qbman_release_desc releasedesc;
 	struct qbman_swp *swp;
 	int ret;
-	int i, n;
+	int i, n, retry_count;
 	uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
@@ -225,9 +225,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	}
 
 	/* feed them to bman */
-	do {
-		ret = qbman_swp_release(swp, &releasedesc, bufs, n);
-	} while (ret == -EBUSY);
+	retry_count = 0;
+	while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) ==
+			-EBUSY) {
+		retry_count++;
+		if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+			rte_panic("bman release retry exceeded, low fbpr?\n");
+	}
 
 aligned:
 	/* if there are more buffers to free */
@@ -243,10 +247,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 #endif
 		}
 
-		do {
-			ret = qbman_swp_release(swp, &releasedesc, bufs,
-						DPAA2_MBUF_MAX_ACQ_REL);
-		} while (ret == -EBUSY);
+		retry_count = 0;
+		while ((ret = qbman_swp_release(swp, &releasedesc, bufs,
+					DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) {
+			retry_count++;
+			if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+				rte_panic("bman release retry exceeded, low fbpr?\n");
+		}
 		n += DPAA2_MBUF_MAX_ACQ_REL;
 	}
 }
-- 
2.17.1


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

* Re: [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release
  2019-10-17 12:44   ` [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
@ 2019-10-23 23:08     ` Thomas Monjalon
  2019-10-30 12:17       ` Nipun Gupta
  0 siblings, 1 reply; 32+ messages in thread
From: Thomas Monjalon @ 2019-10-23 23:08 UTC (permalink / raw)
  To: Nipun Gupta, Radu Bulie
  Cc: stable, dev, ferruh.yigit, hemant.agrawal, sachin.saxena

17/10/2019 14:44, Nipun Gupta:
> From: Radu Bulie <radu-andrei.bulie@nxp.com>
> +				rte_panic("bman release retry exceeded, low fbpr?\n");

You are not supposed to call rte_panic in a library.
Please replace with a smoother abort.






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

* [dpdk-stable] [PATCH 1/9 v3] net/dpaa: fix supported RSS types
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check Nipun Gupta
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch fixes the supported RSS types on DPAA platform

Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 182becac1..7e51b0e68 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -76,14 +76,11 @@
 #define DPAA_DEBUG_FQ_TX_ERROR   1
 
 #define DPAA_RSS_OFFLOAD_ALL ( \
-	ETH_RSS_FRAG_IPV4 | \
-	ETH_RSS_NONFRAG_IPV4_TCP | \
-	ETH_RSS_NONFRAG_IPV4_UDP | \
-	ETH_RSS_NONFRAG_IPV4_SCTP | \
-	ETH_RSS_FRAG_IPV6 | \
-	ETH_RSS_NONFRAG_IPV6_TCP | \
-	ETH_RSS_NONFRAG_IPV6_UDP | \
-	ETH_RSS_NONFRAG_IPV6_SCTP)
+	ETH_RSS_L2_PAYLOAD | \
+	ETH_RSS_IP | \
+	ETH_RSS_UDP | \
+	ETH_RSS_TCP | \
+	ETH_RSS_SCTP)
 
 #define DPAA_TX_CKSUM_OFFLOAD_MASK (             \
 		PKT_TX_IP_CKSUM |                \
-- 
2.17.1


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

* [dpdk-stable] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 1/9 v3] net/dpaa: fix supported RSS types Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

On LS1043, we are good to check 128 byte alignment of offset to
transmit out the packet

Fixes: f8c7a17a48c9 ("net/dpaa: support scatter gather in Tx for non DPAA buffer")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index bbe615099..5dba1db8b 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -927,7 +927,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 			 * the buffer in such case.
 			 */
 			if (dpaa_svr_family == SVR_LS1043A_FAMILY &&
-					(mbuf->data_off & 0xFF) != 0x0)
+					(mbuf->data_off & 0x7F) != 0x0)
 				realloc_mbuf = 1;
 			seqn = mbuf->seqn;
 			if (seqn != DPAA_INVALID_MBUF_SEQN) {
-- 
2.17.1


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

* [dpdk-stable] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 1/9 v3] net/dpaa: fix supported RSS types Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

In Virtual Machine the memory node in the device tree is at
'/proc/device-tree/memory/reg' which is separate from the memory
node path on the host. This patch enables check on both the paths.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 7 +++++--
 drivers/common/dpaax/dpaax_iova_table.h | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 43c9c72e6..98b076e09 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -68,9 +68,12 @@ read_memory_node(unsigned int *count)
 	*count = 0;
 
 	ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result);
+	if (ret != 0)
+		ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result);
+
 	if (ret != 0) {
-		DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)",
-			    MEM_NODE_PATH_GLOB, ret);
+		DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)",
+			ret);
 		goto out;
 	}
 
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index 138827e7b..fef97f6dd 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p;
  * is SoC dependent, or even Uboot fixup dependent.
  */
 #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg"
+/* For Virtual Machines memory node is at different path (below) */
+#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg"
 /* Device file should be multiple of 16 bytes, each containing 8 byte of addr
  * and its length. Assuming max of 5 entries.
  */
-- 
2.17.1


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

* [dpdk-stable] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
                     ` (2 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 5/9 v3] raw/dpaa2_qdma: " Nipun Gupta
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable,
	Nipun Gupta, Radu Bulie

In the packet transmit, if the QBMAN is not able to process the
packets, the Tx function loops infinitely to send the packet out.
This patch changes the logic retry for some time (count) and then
return.

Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations")
Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  2 +
 drivers/net/dpaa2/dpaa2_rxtx.c          | 72 ++++++++++++++++++++-----
 2 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index db6dad544..4ed82f574 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -59,6 +59,8 @@
 #define DPAA2_SWP_CINH_REGION		1
 #define DPAA2_SWP_CENA_MEM_REGION	2
 
+#define DPAA2_MAX_TX_RETRY_COUNT	10000
+
 #define MC_PORTAL_INDEX		0
 #define NUM_DPIO_REGIONS	2
 #define NUM_DQS_PER_QUEUE       2
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index b7b2d8652..52d913d9e 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -1135,15 +1135,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 #endif
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
 					&fd_arr[loop], &flags[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1153,13 +1166,22 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i],
-							&flags[loop],
-							loop - i);
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
+							 &fd_arr[i],
+							 &flags[i],
+							 loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
@@ -1365,15 +1387,28 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple_desc(swp,
+			ret = qbman_swp_enqueue_multiple_desc(swp,
 					&eqdesc[loop], &fd_arr[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1383,11 +1418,20 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop],
-							&fd_arr[i], loop - i);
+			ret = qbman_swp_enqueue_multiple_desc(swp,
+				       &eqdesc[loop], &fd_arr[i], loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
-- 
2.17.1


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

* [dpdk-stable] [PATCH 5/9 v3] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
                     ` (3 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
@ 2019-10-30 12:09   ` " Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 6/9 v3] raw/dpaa2_cmdif: " Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds the logic in the DPAA2 QDMA packet enqueue API

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index a391913b0..af678273d 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev,
 		}
 
 		/* Enqueue the packet to the QBMAN */
-		uint32_t enqueue_loop = 0;
+		uint32_t enqueue_loop = 0, retry_count = 0;
 		while (enqueue_loop < loop) {
-			enqueue_loop += qbman_swp_enqueue_multiple(swp,
+			ret = qbman_swp_enqueue_multiple(swp,
 						&eqdesc,
 						&fd[enqueue_loop],
 						NULL,
 						loop - enqueue_loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					return num_tx - (loop - enqueue_loop);
+			} else {
+				enqueue_loop += ret;
+				retry_count = 0;
+			}
 		}
 		nb_jobs -= loop;
 	}
-- 
2.17.1


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

* [dpdk-stable] [PATCH 6/9 v3] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
                     ` (4 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 5/9 v3] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-30 12:09   ` " Nipun Gupta
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds retry in the DPAA2 CMDIF packet enqueue API

Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 3f42da1fe..ae53114b5 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 	struct qbman_fd fd;
 	struct qbman_eq_desc eqdesc;
 	struct qbman_swp *swp;
+	uint32_t retry_count = 0;
 	int ret;
 
 	RTE_SET_USED(count);
@@ -100,11 +101,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 		ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1);
 		if (ret < 0 && ret != -EBUSY)
 			DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret);
-	} while (ret == -EBUSY);
+		retry_count++;
+	} while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT));
+
+	if (ret < 0)
+		return ret;
 
 	DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n");
 
-	return 0;
+	return 1;
 }
 
 static int
-- 
2.17.1


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

* [dpdk-stable] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release
       [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
                     ` (5 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-stable] [PATCH 6/9 v3] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable,
	Radu Bulie, Nipun Gupta

From: Radu Bulie <radu-andrei.bulie@nxp.com>

When BMAN is not able to accept more buffers, it could be that
there are no FBPR's (internal mem provided to bman) left.
Report error in such condition.

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 27 +++++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index f26c30b00..cc4f837b6 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	struct qbman_release_desc releasedesc;
 	struct qbman_swp *swp;
 	int ret;
-	int i, n;
+	int i, n, retry_count;
 	uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
@@ -225,9 +225,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	}
 
 	/* feed them to bman */
-	do {
-		ret = qbman_swp_release(swp, &releasedesc, bufs, n);
-	} while (ret == -EBUSY);
+	retry_count = 0;
+	while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) ==
+			-EBUSY) {
+		retry_count++;
+		if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+			DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
+			return;
+		}
+	}
 
 aligned:
 	/* if there are more buffers to free */
@@ -243,10 +249,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 #endif
 		}
 
-		do {
-			ret = qbman_swp_release(swp, &releasedesc, bufs,
-						DPAA2_MBUF_MAX_ACQ_REL);
-		} while (ret == -EBUSY);
+		retry_count = 0;
+		while ((ret = qbman_swp_release(swp, &releasedesc, bufs,
+					DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) {
+			retry_count++;
+			if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+				DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
+				return;
+			}
+		}
 		n += DPAA2_MBUF_MAX_ACQ_REL;
 	}
 }
-- 
2.17.1


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

* Re: [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release
  2019-10-23 23:08     ` Thomas Monjalon
@ 2019-10-30 12:17       ` Nipun Gupta
  0 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:17 UTC (permalink / raw)
  To: Thomas Monjalon, Radu-andrei Bulie
  Cc: stable, dev, ferruh.yigit, Hemant Agrawal, Sachin Saxena

Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, October 24, 2019 4:39 AM
> To: Nipun Gupta <nipun.gupta@nxp.com>; Radu-andrei Bulie <radu-
> andrei.bulie@nxp.com>
> Cc: stable@dpdk.org; dev@dpdk.org; ferruh.yigit@intel.com; Hemant
> Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@nxp.com>
> Subject: Re: [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless
> loop in mbuf release
> 
> 17/10/2019 14:44, Nipun Gupta:
> > From: Radu Bulie <radu-andrei.bulie@nxp.com>
> > +				rte_panic("bman release retry exceeded, low
> fbpr?\n");
> 
> You are not supposed to call rte_panic in a library.
> Please replace with a smoother abort.

Agree. Will add a log and return.

> 
> 
> 
> 


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

* [dpdk-stable] [PATCH 1/9 v4] net/dpaa: fix supported RSS types
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check Nipun Gupta
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch fixes the supported RSS types on DPAA platform

Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 182becac1..7e51b0e68 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -76,14 +76,11 @@
 #define DPAA_DEBUG_FQ_TX_ERROR   1
 
 #define DPAA_RSS_OFFLOAD_ALL ( \
-	ETH_RSS_FRAG_IPV4 | \
-	ETH_RSS_NONFRAG_IPV4_TCP | \
-	ETH_RSS_NONFRAG_IPV4_UDP | \
-	ETH_RSS_NONFRAG_IPV4_SCTP | \
-	ETH_RSS_FRAG_IPV6 | \
-	ETH_RSS_NONFRAG_IPV6_TCP | \
-	ETH_RSS_NONFRAG_IPV6_UDP | \
-	ETH_RSS_NONFRAG_IPV6_SCTP)
+	ETH_RSS_L2_PAYLOAD | \
+	ETH_RSS_IP | \
+	ETH_RSS_UDP | \
+	ETH_RSS_TCP | \
+	ETH_RSS_SCTP)
 
 #define DPAA_TX_CKSUM_OFFLOAD_MASK (             \
 		PKT_TX_IP_CKSUM |                \
-- 
2.17.1


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

* [dpdk-stable] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 1/9 v4] net/dpaa: fix supported RSS types Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

On LS1043, we are good to check 128 byte alignment of offset to
transmit out the packet

Fixes: f8c7a17a48c9 ("net/dpaa: support scatter gather in Tx for non DPAA buffer")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index bbe615099..5dba1db8b 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -927,7 +927,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 			 * the buffer in such case.
 			 */
 			if (dpaa_svr_family == SVR_LS1043A_FAMILY &&
-					(mbuf->data_off & 0xFF) != 0x0)
+					(mbuf->data_off & 0x7F) != 0x0)
 				realloc_mbuf = 1;
 			seqn = mbuf->seqn;
 			if (seqn != DPAA_INVALID_MBUF_SEQN) {
-- 
2.17.1


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

* [dpdk-stable] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 1/9 v4] net/dpaa: fix supported RSS types Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

In Virtual Machine the memory node in the device tree is at
'/proc/device-tree/memory/reg' which is separate from the memory
node path on the host. This patch enables check on both the paths.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 7 +++++--
 drivers/common/dpaax/dpaax_iova_table.h | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 43c9c72e6..98b076e09 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -68,9 +68,12 @@ read_memory_node(unsigned int *count)
 	*count = 0;
 
 	ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result);
+	if (ret != 0)
+		ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result);
+
 	if (ret != 0) {
-		DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)",
-			    MEM_NODE_PATH_GLOB, ret);
+		DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)",
+			ret);
 		goto out;
 	}
 
diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h
index 138827e7b..fef97f6dd 100644
--- a/drivers/common/dpaax/dpaax_iova_table.h
+++ b/drivers/common/dpaax/dpaax_iova_table.h
@@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p;
  * is SoC dependent, or even Uboot fixup dependent.
  */
 #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg"
+/* For Virtual Machines memory node is at different path (below) */
+#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg"
 /* Device file should be multiple of 16 bytes, each containing 8 byte of addr
  * and its length. Assuming max of 5 entries.
  */
-- 
2.17.1


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

* [dpdk-stable] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
                     ` (2 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 5/9 v4] raw/dpaa2_qdma: " Nipun Gupta
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable,
	Nipun Gupta, Radu Bulie

In the packet transmit, if the QBMAN is not able to process the
packets, the Tx function loops infinitely to send the packet out.
This patch changes the logic retry for some time (count) and then
return.

Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations")
Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  2 +
 drivers/net/dpaa2/dpaa2_rxtx.c          | 72 ++++++++++++++++++++-----
 2 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index db6dad544..4ed82f574 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -59,6 +59,8 @@
 #define DPAA2_SWP_CINH_REGION		1
 #define DPAA2_SWP_CENA_MEM_REGION	2
 
+#define DPAA2_MAX_TX_RETRY_COUNT	10000
+
 #define MC_PORTAL_INDEX		0
 #define NUM_DPIO_REGIONS	2
 #define NUM_DQS_PER_QUEUE       2
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index b7b2d8652..52d913d9e 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -1135,15 +1135,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 #endif
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
 					&fd_arr[loop], &flags[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1153,13 +1166,22 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i],
-							&flags[loop],
-							loop - i);
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
+							 &fd_arr[i],
+							 &flags[i],
+							 loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
@@ -1365,15 +1387,28 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 			bufs++;
 		}
+
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple_desc(swp,
+			ret = qbman_swp_enqueue_multiple_desc(swp,
 					&eqdesc[loop], &fd_arr[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_pkts -= loop;
+					goto send_n_return;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
 
-		num_tx += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
 	return num_tx;
@@ -1383,11 +1418,20 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop],
-							&fd_arr[i], loop - i);
+			ret = qbman_swp_enqueue_multiple_desc(swp,
+				       &eqdesc[loop], &fd_arr[i], loop - i);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					break;
+			} else {
+				i += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += loop;
+		num_tx += i;
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
-- 
2.17.1


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

* [dpdk-stable] [PATCH 5/9 v4] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
                     ` (3 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
@ 2019-11-05 14:23   ` " Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 6/9 v4] raw/dpaa2_cmdif: " Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds the logic in the DPAA2 QDMA packet enqueue API

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index a391913b0..af678273d 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev,
 		}
 
 		/* Enqueue the packet to the QBMAN */
-		uint32_t enqueue_loop = 0;
+		uint32_t enqueue_loop = 0, retry_count = 0;
 		while (enqueue_loop < loop) {
-			enqueue_loop += qbman_swp_enqueue_multiple(swp,
+			ret = qbman_swp_enqueue_multiple(swp,
 						&eqdesc,
 						&fd[enqueue_loop],
 						NULL,
 						loop - enqueue_loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					return num_tx - (loop - enqueue_loop);
+			} else {
+				enqueue_loop += ret;
+				retry_count = 0;
+			}
 		}
 		nb_jobs -= loop;
 	}
-- 
2.17.1


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

* [dpdk-stable] [PATCH 6/9 v4] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
                     ` (4 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 5/9 v4] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-11-05 14:23   ` " Nipun Gupta
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable, Nipun Gupta

This patch adds retry in the DPAA2 CMDIF packet enqueue API

Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 3f42da1fe..ae53114b5 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 	struct qbman_fd fd;
 	struct qbman_eq_desc eqdesc;
 	struct qbman_swp *swp;
+	uint32_t retry_count = 0;
 	int ret;
 
 	RTE_SET_USED(count);
@@ -100,11 +101,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 		ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1);
 		if (ret < 0 && ret != -EBUSY)
 			DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret);
-	} while (ret == -EBUSY);
+		retry_count++;
+	} while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT));
+
+	if (ret < 0)
+		return ret;
 
 	DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n");
 
-	return 0;
+	return 1;
 }
 
 static int
-- 
2.17.1


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

* [dpdk-stable] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release
       [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
                     ` (5 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-stable] [PATCH 6/9 v4] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  6 siblings, 0 replies; 32+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, stable,
	Radu Bulie, Nipun Gupta

From: Radu Bulie <radu-andrei.bulie@nxp.com>

When BMAN is not able to accept more buffers, it could be that
there are no FBPR's (internal mem provided to bman) left.
Report error in such condition.

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org

Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 27 +++++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index f26c30b00..cc4f837b6 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	struct qbman_release_desc releasedesc;
 	struct qbman_swp *swp;
 	int ret;
-	int i, n;
+	int i, n, retry_count;
 	uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL];
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
@@ -225,9 +225,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 	}
 
 	/* feed them to bman */
-	do {
-		ret = qbman_swp_release(swp, &releasedesc, bufs, n);
-	} while (ret == -EBUSY);
+	retry_count = 0;
+	while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) ==
+			-EBUSY) {
+		retry_count++;
+		if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+			DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
+			return;
+		}
+	}
 
 aligned:
 	/* if there are more buffers to free */
@@ -243,10 +249,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused,
 #endif
 		}
 
-		do {
-			ret = qbman_swp_release(swp, &releasedesc, bufs,
-						DPAA2_MBUF_MAX_ACQ_REL);
-		} while (ret == -EBUSY);
+		retry_count = 0;
+		while ((ret = qbman_swp_release(swp, &releasedesc, bufs,
+					DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) {
+			retry_count++;
+			if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
+				DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?");
+				return;
+			}
+		}
 		n += DPAA2_MBUF_MAX_ACQ_REL;
 	}
 }
-- 
2.17.1


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

end of thread, back to index

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191011054657.21931-1-nipun.gupta@nxp.com>
2019-10-11  5:46 ` [dpdk-stable] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
2019-10-11  5:46 ` [dpdk-stable] [PATCH 2/9] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-10-11  5:46 ` [dpdk-stable] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-10-11  5:46 ` [dpdk-stable] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
2019-10-11  5:46 ` [dpdk-stable] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-10-11  5:46 ` [dpdk-stable] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
2019-10-15  6:55   ` Hemant Agrawal
2019-10-11  5:46 ` [dpdk-stable] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
2019-10-15  6:55   ` Hemant Agrawal
     [not found] ` <20191017124403.26734-1-nipun.gupta@nxp.com>
2019-10-17 12:43   ` [dpdk-stable] [PATCH 1/9 v2] net/dpaa: fix supported RSS types Nipun Gupta
2019-10-17 12:43   ` [dpdk-stable] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-10-17 12:43   ` [dpdk-stable] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-10-17 12:43   ` [dpdk-stable] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-10-17 12:43   ` [dpdk-stable] [PATCH 5/9 v2] raw/dpaa2_qdma: " Nipun Gupta
2019-10-17 12:44   ` [dpdk-stable] [PATCH 6/9 v2] raw/dpaa2_cmdif: " Nipun Gupta
2019-10-17 12:44   ` [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
2019-10-23 23:08     ` Thomas Monjalon
2019-10-30 12:17       ` Nipun Gupta
     [not found] ` <20191030120955.26904-1-nipun.gupta@nxp.com>
2019-10-30 12:09   ` [dpdk-stable] [PATCH 1/9 v3] net/dpaa: fix supported RSS types Nipun Gupta
2019-10-30 12:09   ` [dpdk-stable] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-10-30 12:09   ` [dpdk-stable] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-10-30 12:09   ` [dpdk-stable] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-10-30 12:09   ` [dpdk-stable] [PATCH 5/9 v3] raw/dpaa2_qdma: " Nipun Gupta
2019-10-30 12:09   ` [dpdk-stable] [PATCH 6/9 v3] raw/dpaa2_cmdif: " Nipun Gupta
2019-10-30 12:09   ` [dpdk-stable] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
     [not found] ` <20191105142321.7478-1-nipun.gupta@nxp.com>
2019-11-05 14:23   ` [dpdk-stable] [PATCH 1/9 v4] net/dpaa: fix supported RSS types Nipun Gupta
2019-11-05 14:23   ` [dpdk-stable] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-11-05 14:23   ` [dpdk-stable] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-11-05 14:23   ` [dpdk-stable] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-11-05 14:23   ` [dpdk-stable] [PATCH 5/9 v4] raw/dpaa2_qdma: " Nipun Gupta
2019-11-05 14:23   ` [dpdk-stable] [PATCH 6/9 v4] raw/dpaa2_cmdif: " Nipun Gupta
2019-11-05 14:23   ` [dpdk-stable] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox