DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup
@ 2019-10-11  5:46 Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
                   ` (12 more replies)
  0 siblings, 13 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena

These patches incllude various fixes and some cleanups related
to DPAA and FSLMC drivers

Hemant Agrawal (1):
  bus/dpaa: moving qbman global init to bus

Nipun Gupta (7):
  net/dpaa: fix supported RSS types
  net/dpaa: fix LS1043 alignment check
  common/dpaax: fallback to check separate memory node for VM
  mempool/dpaa2: panic on endless loop in mbuf release
  net/dpaa2: add retry and timeout in packet enqueue API
  raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  raw/dpaa2_cmdif: add retry and timeout in packet enqueue API

Shreyansh Jain (1):
  bus/fslmc: sanitize device name parsing for clarity

 drivers/bus/dpaa/dpaa_bus.c               | 21 ++++++-
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 -
 drivers/bus/fslmc/fslmc_bus.c             | 14 +++--
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h   |  2 +
 drivers/common/dpaax/dpaax_iova_table.c   |  7 ++-
 drivers/common/dpaax/dpaax_iova_table.h   |  2 +
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 +++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c  | 23 +++++---
 drivers/net/dpaa/dpaa_ethdev.c            | 14 -----
 drivers/net/dpaa/dpaa_ethdev.h            | 13 ++--
 drivers/net/dpaa/dpaa_rxtx.c              |  2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c            | 72 ++++++++++++++++++-----
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c     |  9 ++-
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c       | 12 +++-
 14 files changed, 140 insertions(+), 61 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH 1/9] net/dpaa: fix supported RSS types
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 2/9] net/dpaa: fix LS1043 alignment check Nipun Gupta
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 2/9] net/dpaa: fix LS1043 alignment check
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 2/9] net/dpaa: fix LS1043 alignment check Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (2 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [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-dev] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (3 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [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-dev] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 6/9] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (4 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [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-dev] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (5 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-15  6:55   ` Hemant Agrawal
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 8/9] bus/dpaa: moving qbman global init to bus Nipun Gupta
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 8/9] bus/dpaa: moving qbman global init to bus
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (6 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 9/9] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena

From: Hemant Agrawal <hemant.agrawal@nxp.com>

DPAA SEC shall be able to work independent of DPAA ETH
driver.
This patch moves qbman init to bus, so that any driver
can use them even when no eth resources are present
or none of the eth devices are probed.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c               | 21 +++++++++++++++++++--
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 --
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 ++++++++
 drivers/net/dpaa/dpaa_ethdev.c            | 14 --------------
 4 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 1d8a294b1..882b6e2f3 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void)
 		return 0;
 
 	/* Device list creation is only done once */
-	if (!process_once)
+	if (!process_once) {
 		rte_dpaa_bus_dev_build();
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			/* One time load of Qman/Bman drivers */
+			ret = qman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("QMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+			ret = bman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("BMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+		}
+	}
 	process_once = 1;
 
 	/* If no device present on DPAA bus nothing needs to be done */
@@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void)
 			    RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
 				if (ret) {
-					DPAA_BUS_ERR("Unable to probe.\n");
+					DPAA_BUS_ERR("unable to probe:%s",
+						     dev->name);
 				} else {
 					dev->driver = drv;
 					dev->device.driver = &drv->driver;
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index a221522c2..3b411aa13 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -4,7 +4,6 @@ DPDK_17.11 {
 	bman_acquire;
 	bman_free_pool;
 	bman_get_params;
-	bman_global_init;
 	bman_new_pool;
 	bman_query_free_buffers;
 	bman_release;
@@ -50,7 +49,6 @@ DPDK_17.11 {
 	qman_enqueue_multi;
 	qman_fq_fqid;
 	qman_fq_state;
-	qman_global_init;
 	qman_init_fq;
 	qman_poll_dqrr;
 	qman_query_fq_np;
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 1754862be..ce9a87095 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2718,6 +2718,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 		}
 	}
 
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		retval = rte_dpaa_portal_init((void *)1);
+		if (retval) {
+			DPAA_SEC_ERR("Unable to initialize portal");
+			return retval;
+		}
+	}
+
 	/* Invoke PMD device initialization function */
 	retval = dpaa_sec_dev_init(cryptodev);
 	if (retval == 0)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..16b52b5e1 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 	}
 
 	if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) {
-		/* One time load of Qman/Bman drivers */
-		ret = qman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("QMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-		ret = bman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("BMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-
 		if (access("/tmp/fmc.bin", F_OK) == -1) {
 			RTE_LOG(INFO, PMD,
 				"* FMC not configured.Enabling default mode\n");
-- 
2.17.1


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

* [dpdk-dev] [PATCH 9/9] bus/fslmc: sanitize device name parsing for clarity
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (7 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 8/9] bus/dpaa: moving qbman global init to bus Nipun Gupta
@ 2019-10-11  5:46 ` Nipun Gupta
  2019-10-15  6:56 ` [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Hemant Agrawal
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-11  5:46 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, Shreyansh Jain

From: Shreyansh Jain <shreyansh.jain@nxp.com>

remove unneccessary dup and free

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index eff15f25d..251f148da 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -236,8 +236,9 @@ rte_fslmc_parse(const char *name, void *addr)
 {
 	uint16_t dev_id;
 	char *t_ptr;
-	char *sep = NULL;
+	const char *sep;
 	uint8_t sep_exists = 0;
+	int ret = -1;
 
 	DPAA2_BUS_DEBUG("Parsing dev=(%s)", name);
 
@@ -267,10 +268,11 @@ rte_fslmc_parse(const char *name, void *addr)
 		} else {
 			DPAA2_BUS_DEBUG("Invalid device for matching (%s).",
 					name);
+			ret = -EINVAL;
 			goto err_out;
 		}
 	} else
-		sep = strdup(name);
+		sep = name;
 
 jump_out:
 	/* Validate device name */
@@ -284,23 +286,23 @@ rte_fslmc_parse(const char *name, void *addr)
 	    strncmp("dpdmai", sep, 6) &&
 	    strncmp("dpdmux", sep, 6)) {
 		DPAA2_BUS_DEBUG("Unknown or unsupported device (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	t_ptr = strchr(sep, '.');
 	if (!t_ptr || sscanf(t_ptr + 1, "%hu", &dev_id) != 1) {
 		DPAA2_BUS_ERR("Missing device id in device name (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	if (addr)
 		strcpy(addr, sep);
 
-	return 0;
+	ret = 0;
 err_out:
-	if (!sep_exists && sep)
-		free(sep);
-	return -EINVAL;
+	return ret;
 }
 
 static int
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-15  6:55   ` Hemant Agrawal
  0 siblings, 0 replies; 47+ 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] 47+ messages in thread

* Re: [dpdk-dev] [PATCH 6/9] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-15  6:55   ` Hemant Agrawal
  0 siblings, 0 replies; 47+ 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] 47+ messages in thread

* Re: [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (8 preceding siblings ...)
  2019-10-11  5:46 ` [dpdk-dev] [PATCH 9/9] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
@ 2019-10-15  6:56 ` Hemant Agrawal
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 47+ messages in thread
From: Hemant Agrawal @ 2019-10-15  6:56 UTC (permalink / raw)
  To: Nipun Gupta, dev; +Cc: ferruh.yigit, Sachin Saxena

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


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

* [dpdk-dev] [PATCH 0/9 v2] DPAA and FSLMC driver fixes and cleanup
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (9 preceding siblings ...)
  2019-10-15  6:56 ` [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Hemant Agrawal
@ 2019-10-17 12:43 ` Nipun Gupta
  2019-10-17 12:43   ` [dpdk-dev] [PATCH 1/9 v2] net/dpaa: fix supported RSS types Nipun Gupta
                     ` (8 more replies)
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  12 siblings, 9 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:43 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena

These patches incllude various fixes and some cleanups related
to DPAA and FSLMC drivers

Changes in v2:
- Rebased the patches (moved "mempool/dpaa2: panic on endless loop in
  mbuf release" after "net/dpaa2: add retry and timeout in packet
  enqueue API") so that DPAA2_MAX_TX_RETRY_COUNT is defined
  before it is used - to fix intermediate patch compilation issue.
- Fixed checkpatch error in patch #9

Hemant Agrawal (1):
  bus/dpaa: moving qbman global init to bus

Nipun Gupta (7):
  net/dpaa: fix supported RSS types
  net/dpaa: fix LS1043 alignment check
  common/dpaax: fallback to check separate memory node for VM
  net/dpaa2: add retry and timeout in packet enqueue API
  raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  mempool/dpaa2: panic on endless loop in mbuf release

Shreyansh Jain (1):
  bus/fslmc: sanitize device name parsing for clarity

 drivers/bus/dpaa/dpaa_bus.c               | 21 ++++++-
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 -
 drivers/bus/fslmc/fslmc_bus.c             | 14 +++--
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h   |  2 +
 drivers/common/dpaax/dpaax_iova_table.c   |  7 ++-
 drivers/common/dpaax/dpaax_iova_table.h   |  2 +
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 +++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c  | 23 +++++---
 drivers/net/dpaa/dpaa_ethdev.c            | 14 -----
 drivers/net/dpaa/dpaa_ethdev.h            | 13 ++--
 drivers/net/dpaa/dpaa_rxtx.c              |  2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c            | 72 ++++++++++++++++++-----
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c     |  9 ++-
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c       | 12 +++-
 14 files changed, 140 insertions(+), 61 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH 1/9 v2] net/dpaa: fix supported RSS types
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
@ 2019-10-17 12:43   ` Nipun Gupta
  2019-10-17 12:43   ` [dpdk-dev] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check Nipun Gupta
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
  2019-10-17 12:43   ` [dpdk-dev] [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-dev] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
  2019-10-17 12:43   ` [dpdk-dev] [PATCH 1/9 v2] net/dpaa: fix supported RSS types Nipun Gupta
  2019-10-17 12:43   ` [dpdk-dev] [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-dev] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                     ` (2 preceding siblings ...)
  2019-10-17 12:43   ` [dpdk-dev] [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-dev] [PATCH 5/9 v2] raw/dpaa2_qdma: " Nipun Gupta
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 5/9 v2] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                     ` (3 preceding siblings ...)
  2019-10-17 12:43   ` [dpdk-dev] [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-dev] [PATCH 6/9 v2] raw/dpaa2_cmdif: " Nipun Gupta
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 6/9 v2] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                     ` (4 preceding siblings ...)
  2019-10-17 12:43   ` [dpdk-dev] [PATCH 5/9 v2] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-17 12:44   ` Nipun Gupta
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                     ` (5 preceding siblings ...)
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 6/9 v2] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-17 12:44   ` Nipun Gupta
  2019-10-23 23:08     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus Nipun Gupta
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 9/9 v2] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
  8 siblings, 1 reply; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                     ` (6 preceding siblings ...)
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
@ 2019-10-17 12:44   ` Nipun Gupta
  2019-10-18  9:06     ` Akhil Goyal
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 9/9 v2] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
  8 siblings, 1 reply; 47+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:44 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena

From: Hemant Agrawal <hemant.agrawal@nxp.com>

DPAA SEC shall be able to work independent of DPAA ETH
driver.
This patch moves qbman init to bus, so that any driver
can use them even when no eth resources are present
or none of the eth devices are probed.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c               | 21 +++++++++++++++++++--
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 --
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 ++++++++
 drivers/net/dpaa/dpaa_ethdev.c            | 14 --------------
 4 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index d028ef3be..f27820db3 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void)
 		return 0;
 
 	/* Device list creation is only done once */
-	if (!process_once)
+	if (!process_once) {
 		rte_dpaa_bus_dev_build();
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			/* One time load of Qman/Bman drivers */
+			ret = qman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("QMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+			ret = bman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("BMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+		}
+	}
 	process_once = 1;
 
 	/* If no device present on DPAA bus nothing needs to be done */
@@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void)
 			    RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
 				if (ret) {
-					DPAA_BUS_ERR("Unable to probe.\n");
+					DPAA_BUS_ERR("unable to probe:%s",
+						     dev->name);
 				} else {
 					dev->driver = drv;
 					dev->device.driver = &drv->driver;
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index 97f4f622d..cf428a54d 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -4,7 +4,6 @@ DPDK_17.11 {
 	bman_acquire;
 	bman_free_pool;
 	bman_get_params;
-	bman_global_init;
 	bman_new_pool;
 	bman_query_free_buffers;
 	bman_release;
@@ -48,7 +47,6 @@ DPDK_17.11 {
 	qman_enqueue_multi;
 	qman_fq_fqid;
 	qman_fq_state;
-	qman_global_init;
 	qman_init_fq;
 	qman_poll_dqrr;
 	qman_query_fq_np;
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 1e4f55b11..1db9bc381 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3050,6 +3050,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 		}
 	}
 
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		retval = rte_dpaa_portal_init((void *)1);
+		if (retval) {
+			DPAA_SEC_ERR("Unable to initialize portal");
+			return retval;
+		}
+	}
+
 	/* Invoke PMD device initialization function */
 	retval = dpaa_sec_dev_init(cryptodev);
 	if (retval == 0)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..16b52b5e1 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 	}
 
 	if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) {
-		/* One time load of Qman/Bman drivers */
-		ret = qman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("QMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-		ret = bman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("BMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-
 		if (access("/tmp/fmc.bin", F_OK) == -1) {
 			RTE_LOG(INFO, PMD,
 				"* FMC not configured.Enabling default mode\n");
-- 
2.17.1


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

* [dpdk-dev] [PATCH 9/9 v2] bus/fslmc: sanitize device name parsing for clarity
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
                     ` (7 preceding siblings ...)
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus Nipun Gupta
@ 2019-10-17 12:44   ` Nipun Gupta
  8 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-17 12:44 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, hemant.agrawal, sachin.saxena, Shreyansh Jain

From: Shreyansh Jain <shreyansh.jain@nxp.com>

remove unnecessary dup and free

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 4116552c6..b3e964aa9 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -235,8 +235,9 @@ rte_fslmc_parse(const char *name, void *addr)
 {
 	uint16_t dev_id;
 	char *t_ptr;
-	char *sep = NULL;
+	const char *sep;
 	uint8_t sep_exists = 0;
+	int ret = -1;
 
 	DPAA2_BUS_DEBUG("Parsing dev=(%s)", name);
 
@@ -266,10 +267,11 @@ rte_fslmc_parse(const char *name, void *addr)
 		} else {
 			DPAA2_BUS_DEBUG("Invalid device for matching (%s).",
 					name);
+			ret = -EINVAL;
 			goto err_out;
 		}
 	} else
-		sep = strdup(name);
+		sep = name;
 
 jump_out:
 	/* Validate device name */
@@ -283,23 +285,23 @@ rte_fslmc_parse(const char *name, void *addr)
 	    strncmp("dpdmai", sep, 6) &&
 	    strncmp("dpdmux", sep, 6)) {
 		DPAA2_BUS_DEBUG("Unknown or unsupported device (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	t_ptr = strchr(sep, '.');
 	if (!t_ptr || sscanf(t_ptr + 1, "%hu", &dev_id) != 1) {
 		DPAA2_BUS_ERR("Missing device id in device name (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	if (addr)
 		strcpy(addr, sep);
 
-	return 0;
+	ret = 0;
 err_out:
-	if (!sep_exists && sep)
-		free(sep);
-	return -EINVAL;
+	return ret;
 }
 
 static int
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus
  2019-10-17 12:44   ` [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus Nipun Gupta
@ 2019-10-18  9:06     ` Akhil Goyal
  0 siblings, 0 replies; 47+ messages in thread
From: Akhil Goyal @ 2019-10-18  9:06 UTC (permalink / raw)
  To: Nipun Gupta, dev; +Cc: ferruh.yigit, Hemant Agrawal, Sachin Saxena



> 
> From: Hemant Agrawal <hemant.agrawal@nxp.com>
> 
> DPAA SEC shall be able to work independent of DPAA ETH
> driver.
> This patch moves qbman init to bus, so that any driver
> can use them even when no eth resources are present
> or none of the eth devices are probed.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>


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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release
  2019-10-17 12:44   ` [dpdk-dev] [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; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (10 preceding siblings ...)
  2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
@ 2019-10-30 12:09 ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 1/9 v3] net/dpaa: fix supported RSS types Nipun Gupta
                     ` (8 more replies)
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  12 siblings, 9 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena

These patches incllude various fixes and some cleanups related
to DPAA and FSLMC drivers

Changes in v3:
 - Report error instead of panic for low FPBR's in BMAN (patch #7)

Changes in v2:
 - Rebased the patches (moved "mempool/dpaa2: panic on endless loop in
   mbuf release" after "net/dpaa2: add retry and timeout in packet
   enqueue API") so that DPAA2_MAX_TX_RETRY_COUNT is defined
   before it is used - to fix intermediate patch compilation issue.
 - Fixed checkpatch error in patch #9

Hemant Agrawal (1):
  bus/dpaa: moving qbman global init to bus

Nipun Gupta (6):
  net/dpaa: fix supported RSS types
  net/dpaa: fix LS1043 alignment check
  common/dpaax: fallback to check separate memory node for VM
  net/dpaa2: add retry and timeout in packet enqueue API
  raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  raw/dpaa2_cmdif: add retry and timeout in packet enqueue API

Radu Bulie (1):
  mempool/dpaa2: report error on endless loop in mbuf release

Shreyansh Jain (1):
  bus/fslmc: sanitize device name parsing for clarity

 drivers/bus/dpaa/dpaa_bus.c               | 21 ++++++-
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 -
 drivers/bus/fslmc/fslmc_bus.c             | 14 +++--
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h   |  2 +
 drivers/common/dpaax/dpaax_iova_table.c   |  7 ++-
 drivers/common/dpaax/dpaax_iova_table.h   |  2 +
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 +++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c  | 27 ++++++---
 drivers/net/dpaa/dpaa_ethdev.c            | 14 -----
 drivers/net/dpaa/dpaa_ethdev.h            | 13 ++--
 drivers/net/dpaa/dpaa_rxtx.c              |  2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c            | 72 ++++++++++++++++++-----
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c     |  9 ++-
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c       | 12 +++-
 14 files changed, 144 insertions(+), 61 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH 1/9 v3] net/dpaa: fix supported RSS types
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check Nipun Gupta
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [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-dev] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 1/9 v3] net/dpaa: fix supported RSS types Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [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-dev] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (2 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-dev] [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-dev] [PATCH 5/9 v3] raw/dpaa2_qdma: " Nipun Gupta
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 5/9 v3] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (3 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-dev] [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-dev] [PATCH 6/9 v3] raw/dpaa2_cmdif: " Nipun Gupta
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 6/9 v3] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (4 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 5/9 v3] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (5 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 6/9 v3] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 8/9 v3] bus/dpaa: moving qbman global init to bus Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 9/9 v3] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
  8 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 8/9 v3] bus/dpaa: moving qbman global init to bus
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (6 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 9/9 v3] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
  8 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena

From: Hemant Agrawal <hemant.agrawal@nxp.com>

DPAA SEC shall be able to work independent of DPAA ETH
driver.
This patch moves qbman init to bus, so that any driver
can use them even when no eth resources are present
or none of the eth devices are probed.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c               | 21 +++++++++++++++++++--
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 --
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 ++++++++
 drivers/net/dpaa/dpaa_ethdev.c            | 14 --------------
 4 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index d028ef3be..f27820db3 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void)
 		return 0;
 
 	/* Device list creation is only done once */
-	if (!process_once)
+	if (!process_once) {
 		rte_dpaa_bus_dev_build();
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			/* One time load of Qman/Bman drivers */
+			ret = qman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("QMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+			ret = bman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("BMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+		}
+	}
 	process_once = 1;
 
 	/* If no device present on DPAA bus nothing needs to be done */
@@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void)
 			    RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
 				if (ret) {
-					DPAA_BUS_ERR("Unable to probe.\n");
+					DPAA_BUS_ERR("unable to probe:%s",
+						     dev->name);
 				} else {
 					dev->driver = drv;
 					dev->device.driver = &drv->driver;
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index 97f4f622d..cf428a54d 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -4,7 +4,6 @@ DPDK_17.11 {
 	bman_acquire;
 	bman_free_pool;
 	bman_get_params;
-	bman_global_init;
 	bman_new_pool;
 	bman_query_free_buffers;
 	bman_release;
@@ -48,7 +47,6 @@ DPDK_17.11 {
 	qman_enqueue_multi;
 	qman_fq_fqid;
 	qman_fq_state;
-	qman_global_init;
 	qman_init_fq;
 	qman_poll_dqrr;
 	qman_query_fq_np;
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 6c186338f..ee59cf974 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3334,6 +3334,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 		}
 	}
 
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		retval = rte_dpaa_portal_init((void *)1);
+		if (retval) {
+			DPAA_SEC_ERR("Unable to initialize portal");
+			return retval;
+		}
+	}
+
 	/* Invoke PMD device initialization function */
 	retval = dpaa_sec_dev_init(cryptodev);
 	if (retval == 0)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..16b52b5e1 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 	}
 
 	if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) {
-		/* One time load of Qman/Bman drivers */
-		ret = qman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("QMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-		ret = bman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("BMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-
 		if (access("/tmp/fmc.bin", F_OK) == -1) {
 			RTE_LOG(INFO, PMD,
 				"* FMC not configured.Enabling default mode\n");
-- 
2.17.1


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

* [dpdk-dev] [PATCH 9/9 v3] bus/fslmc: sanitize device name parsing for clarity
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (7 preceding siblings ...)
  2019-10-30 12:09   ` [dpdk-dev] [PATCH 8/9 v3] bus/dpaa: moving qbman global init to bus Nipun Gupta
@ 2019-10-30 12:09   ` Nipun Gupta
  8 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-10-30 12:09 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, Shreyansh Jain

From: Shreyansh Jain <shreyansh.jain@nxp.com>

remove unnecessary dup and free

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 4116552c6..b3e964aa9 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -235,8 +235,9 @@ rte_fslmc_parse(const char *name, void *addr)
 {
 	uint16_t dev_id;
 	char *t_ptr;
-	char *sep = NULL;
+	const char *sep;
 	uint8_t sep_exists = 0;
+	int ret = -1;
 
 	DPAA2_BUS_DEBUG("Parsing dev=(%s)", name);
 
@@ -266,10 +267,11 @@ rte_fslmc_parse(const char *name, void *addr)
 		} else {
 			DPAA2_BUS_DEBUG("Invalid device for matching (%s).",
 					name);
+			ret = -EINVAL;
 			goto err_out;
 		}
 	} else
-		sep = strdup(name);
+		sep = name;
 
 jump_out:
 	/* Validate device name */
@@ -283,23 +285,23 @@ rte_fslmc_parse(const char *name, void *addr)
 	    strncmp("dpdmai", sep, 6) &&
 	    strncmp("dpdmux", sep, 6)) {
 		DPAA2_BUS_DEBUG("Unknown or unsupported device (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	t_ptr = strchr(sep, '.');
 	if (!t_ptr || sscanf(t_ptr + 1, "%hu", &dev_id) != 1) {
 		DPAA2_BUS_ERR("Missing device id in device name (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	if (addr)
 		strcpy(addr, sep);
 
-	return 0;
+	ret = 0;
 err_out:
-	if (!sep_exists && sep)
-		free(sep);
-	return -EINVAL;
+	return ret;
 }
 
 static int
-- 
2.17.1


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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release
  2019-10-23 23:08     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2019-10-30 12:17       ` Nipun Gupta
  0 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup
  2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                   ` (11 preceding siblings ...)
  2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
@ 2019-11-05 14:23 ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 1/9 v4] net/dpaa: fix supported RSS types Nipun Gupta
                     ` (9 more replies)
  12 siblings, 10 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena

These patches incllude various fixes and some cleanups related
to DPAA and FSLMC drivers

Changes in v4:
 - Rebased on master branch. Due to some other changes patches
   were not getting applied on master

Changes in v3:
 - Report error instead of panic for low FPBR's in BMAN (patch #7)

Changes in v2:
 - Rebased the patches (moved "mempool/dpaa2: panic on endless loop in
   mbuf release" after "net/dpaa2: add retry and timeout in packet
   enqueue API") so that DPAA2_MAX_TX_RETRY_COUNT is defined
   before it is used - to fix intermediate patch compilation issue.
 - Fixed checkpatch error in patch #9

Hemant Agrawal (1):
  bus/dpaa: moving qbman global init to bus

Nipun Gupta (7):
  net/dpaa: fix supported RSS types
  net/dpaa: fix LS1043 alignment check
  common/dpaax: fallback to check separate memory node for VM
  net/dpaa2: add retry and timeout in packet enqueue API
  raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  bus/fslmc: sanitize device name parsing for clarity

Radu Bulie (1):
  mempool/dpaa2: report error on endless loop in mbuf release

 drivers/bus/dpaa/dpaa_bus.c               | 21 ++++++-
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 -
 drivers/bus/fslmc/fslmc_bus.c             | 19 +++---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h   |  2 +
 drivers/common/dpaax/dpaax_iova_table.c   |  7 ++-
 drivers/common/dpaax/dpaax_iova_table.h   |  2 +
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 +++
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c  | 27 ++++++---
 drivers/net/dpaa/dpaa_ethdev.c            | 14 -----
 drivers/net/dpaa/dpaa_ethdev.h            | 13 ++--
 drivers/net/dpaa/dpaa_rxtx.c              |  2 +-
 drivers/net/dpaa2/dpaa2_rxtx.c            | 72 ++++++++++++++++++-----
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c     |  9 ++-
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c       | 12 +++-
 14 files changed, 145 insertions(+), 65 deletions(-)

-- 
2.17.1


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

* [dpdk-dev] [PATCH 1/9 v4] net/dpaa: fix supported RSS types
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check Nipun Gupta
                     ` (8 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [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-dev] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 1/9 v4] net/dpaa: fix supported RSS types Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [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-dev] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (2 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [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-dev] [PATCH 5/9 v4] raw/dpaa2_qdma: " Nipun Gupta
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 5/9 v4] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (3 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [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-dev] [PATCH 6/9 v4] raw/dpaa2_cmdif: " Nipun Gupta
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 6/9 v4] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (4 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 5/9 v4] raw/dpaa2_qdma: " Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (5 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 6/9 v4] raw/dpaa2_cmdif: " Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 8/9 v4] bus/dpaa: moving qbman global init to bus Nipun Gupta
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 47+ 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] 47+ messages in thread

* [dpdk-dev] [PATCH 8/9 v4] bus/dpaa: moving qbman global init to bus
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (6 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 9/9 v4] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
  2019-11-06  0:19   ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Thomas Monjalon
  9 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena

From: Hemant Agrawal <hemant.agrawal@nxp.com>

DPAA SEC shall be able to work independent of DPAA ETH
driver.
This patch moves qbman init to bus, so that any driver
can use them even when no eth resources are present
or none of the eth devices are probed.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c               | 21 +++++++++++++++++++--
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  2 --
 drivers/crypto/dpaa_sec/dpaa_sec.c        |  8 ++++++++
 drivers/net/dpaa/dpaa_ethdev.c            | 14 --------------
 4 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index d028ef3be..f27820db3 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void)
 		return 0;
 
 	/* Device list creation is only done once */
-	if (!process_once)
+	if (!process_once) {
 		rte_dpaa_bus_dev_build();
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			/* One time load of Qman/Bman drivers */
+			ret = qman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("QMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+			ret = bman_global_init();
+			if (ret) {
+				DPAA_PMD_ERR("BMAN initialization failed: %d",
+					     ret);
+				return ret;
+			}
+		}
+	}
 	process_once = 1;
 
 	/* If no device present on DPAA bus nothing needs to be done */
@@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void)
 			    RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
 				if (ret) {
-					DPAA_BUS_ERR("Unable to probe.\n");
+					DPAA_BUS_ERR("unable to probe:%s",
+						     dev->name);
 				} else {
 					dev->driver = drv;
 					dev->device.driver = &drv->driver;
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index 97f4f622d..cf428a54d 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -4,7 +4,6 @@ DPDK_17.11 {
 	bman_acquire;
 	bman_free_pool;
 	bman_get_params;
-	bman_global_init;
 	bman_new_pool;
 	bman_query_free_buffers;
 	bman_release;
@@ -48,7 +47,6 @@ DPDK_17.11 {
 	qman_enqueue_multi;
 	qman_fq_fqid;
 	qman_fq_state;
-	qman_global_init;
 	qman_init_fq;
 	qman_poll_dqrr;
 	qman_query_fq_np;
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 6c186338f..ee59cf974 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3334,6 +3334,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 		}
 	}
 
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		retval = rte_dpaa_portal_init((void *)1);
+		if (retval) {
+			DPAA_SEC_ERR("Unable to initialize portal");
+			return retval;
+		}
+	}
+
 	/* Invoke PMD device initialization function */
 	retval = dpaa_sec_dev_init(cryptodev);
 	if (retval == 0)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index caf255d67..16b52b5e1 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 	}
 
 	if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) {
-		/* One time load of Qman/Bman drivers */
-		ret = qman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("QMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-		ret = bman_global_init();
-		if (ret) {
-			DPAA_PMD_ERR("BMAN initialization failed: %d",
-				     ret);
-			return ret;
-		}
-
 		if (access("/tmp/fmc.bin", F_OK) == -1) {
 			RTE_LOG(INFO, PMD,
 				"* FMC not configured.Enabling default mode\n");
-- 
2.17.1


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

* [dpdk-dev] [PATCH 9/9 v4] bus/fslmc: sanitize device name parsing for clarity
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (7 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 8/9 v4] bus/dpaa: moving qbman global init to bus Nipun Gupta
@ 2019-11-05 14:23   ` Nipun Gupta
  2019-11-06  0:19   ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Thomas Monjalon
  9 siblings, 0 replies; 47+ messages in thread
From: Nipun Gupta @ 2019-11-05 14:23 UTC (permalink / raw)
  To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, sachin.saxena, Shreyansh Jain

remove unnecessary dup and free

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 9caf5b6b9..b3e964aa9 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -235,8 +235,9 @@ rte_fslmc_parse(const char *name, void *addr)
 {
 	uint16_t dev_id;
 	char *t_ptr;
-	char *sep = NULL;
+	const char *sep;
 	uint8_t sep_exists = 0;
+	int ret = -1;
 
 	DPAA2_BUS_DEBUG("Parsing dev=(%s)", name);
 
@@ -266,10 +267,11 @@ rte_fslmc_parse(const char *name, void *addr)
 		} else {
 			DPAA2_BUS_DEBUG("Invalid device for matching (%s).",
 					name);
+			ret = -EINVAL;
 			goto err_out;
 		}
 	} else
-		sep = strdup(name);
+		sep = name;
 
 jump_out:
 	/* Validate device name */
@@ -283,26 +285,23 @@ rte_fslmc_parse(const char *name, void *addr)
 	    strncmp("dpdmai", sep, 6) &&
 	    strncmp("dpdmux", sep, 6)) {
 		DPAA2_BUS_DEBUG("Unknown or unsupported device (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
 	t_ptr = strchr(sep, '.');
 	if (!t_ptr || sscanf(t_ptr + 1, "%hu", &dev_id) != 1) {
 		DPAA2_BUS_ERR("Missing device id in device name (%s)", sep);
+		ret = -EINVAL;
 		goto err_out;
 	}
 
-	if (addr) {
+	if (addr)
 		strcpy(addr, sep);
-		if (!sep_exists && sep)
-			free(sep);
-		return 0;
-	}
 
+	ret = 0;
 err_out:
-	if (!sep_exists && sep)
-		free(sep);
-	return -EINVAL;
+	return ret;
 }
 
 static int
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup
  2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
                     ` (8 preceding siblings ...)
  2019-11-05 14:23   ` [dpdk-dev] [PATCH 9/9 v4] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
@ 2019-11-06  0:19   ` Thomas Monjalon
  9 siblings, 0 replies; 47+ messages in thread
From: Thomas Monjalon @ 2019-11-06  0:19 UTC (permalink / raw)
  To: Nipun Gupta
  Cc: dev, ferruh.yigit, hemant.agrawal, sachin.saxena, david.marchand

05/11/2019 15:23, Nipun Gupta:
> Hemant Agrawal (1):
>   bus/dpaa: moving qbman global init to bus
> 
> Nipun Gupta (7):
>   net/dpaa: fix supported RSS types
>   net/dpaa: fix LS1043 alignment check
>   common/dpaax: fallback to check separate memory node for VM
>   net/dpaa2: add retry and timeout in packet enqueue API
>   raw/dpaa2_qdma: add retry and timeout in packet enqueue API
>   raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
>   bus/fslmc: sanitize device name parsing for clarity

This last patch is from Shreyansh (fixed on merge).

> 
> Radu Bulie (1):
>   mempool/dpaa2: report error on endless loop in mbuf release

Applied, thanks



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

end of thread, other threads:[~2019-11-06  0:19 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11  5:46 [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 1/9] net/dpaa: fix supported RSS types Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 2/9] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 3/9] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 4/9] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 5/9] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 6/9] raw/dpaa2_qdma: " Nipun Gupta
2019-10-15  6:55   ` Hemant Agrawal
2019-10-11  5:46 ` [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: " Nipun Gupta
2019-10-15  6:55   ` Hemant Agrawal
2019-10-11  5:46 ` [dpdk-dev] [PATCH 8/9] bus/dpaa: moving qbman global init to bus Nipun Gupta
2019-10-11  5:46 ` [dpdk-dev] [PATCH 9/9] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
2019-10-15  6:56 ` [dpdk-dev] [PATCH 0/9] DPAA and FSLMC driver fixes and cleanup Hemant Agrawal
2019-10-17 12:43 ` [dpdk-dev] [PATCH 0/9 v2] " Nipun Gupta
2019-10-17 12:43   ` [dpdk-dev] [PATCH 1/9 v2] net/dpaa: fix supported RSS types Nipun Gupta
2019-10-17 12:43   ` [dpdk-dev] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-10-17 12:43   ` [dpdk-dev] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-10-17 12:43   ` [dpdk-dev] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-10-17 12:43   ` [dpdk-dev] [PATCH 5/9 v2] raw/dpaa2_qdma: " Nipun Gupta
2019-10-17 12:44   ` [dpdk-dev] [PATCH 6/9 v2] raw/dpaa2_cmdif: " Nipun Gupta
2019-10-17 12:44   ` [dpdk-dev] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release Nipun Gupta
2019-10-23 23:08     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-10-30 12:17       ` Nipun Gupta
2019-10-17 12:44   ` [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus Nipun Gupta
2019-10-18  9:06     ` Akhil Goyal
2019-10-17 12:44   ` [dpdk-dev] [PATCH 9/9 v2] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
2019-10-30 12:09 ` [dpdk-dev] [PATCH 0/9 v3] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 1/9 v3] net/dpaa: fix supported RSS types Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 2/9 v3] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 3/9 v3] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 4/9 v3] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 5/9 v3] raw/dpaa2_qdma: " Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 6/9 v3] raw/dpaa2_cmdif: " Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 8/9 v3] bus/dpaa: moving qbman global init to bus Nipun Gupta
2019-10-30 12:09   ` [dpdk-dev] [PATCH 9/9 v3] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
2019-11-05 14:23 ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 1/9 v4] net/dpaa: fix supported RSS types Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 2/9 v4] net/dpaa: fix LS1043 alignment check Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 3/9 v4] common/dpaax: fallback to check separate memory node for VM Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 4/9 v4] net/dpaa2: add retry and timeout in packet enqueue API Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 5/9 v4] raw/dpaa2_qdma: " Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 6/9 v4] raw/dpaa2_cmdif: " Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 7/9 v4] mempool/dpaa2: report error on endless loop in mbuf release Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 8/9 v4] bus/dpaa: moving qbman global init to bus Nipun Gupta
2019-11-05 14:23   ` [dpdk-dev] [PATCH 9/9 v4] bus/fslmc: sanitize device name parsing for clarity Nipun Gupta
2019-11-06  0:19   ` [dpdk-dev] [PATCH 0/9 v4] DPAA and FSLMC driver fixes and cleanup 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).