[dpdk-stable] patch 'net/dpaa2: add retry and timeout in packet enqueue API' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:34:05 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 78ffee310f5b56511603de118258819e2b255f45 Mon Sep 17 00:00:00 2001
From: Nipun Gupta <nipun.gupta at nxp.com>
Date: Tue, 5 Nov 2019 19:53:16 +0530
Subject: [PATCH] net/dpaa2: add retry and timeout in packet enqueue API

[ upstream commit ce4fd609b4d7724533ccf9eb8b667afadc5a1687 ]

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")

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

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index ece1a7d432..4f7e49cc3c 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -63,6 +63,8 @@
 #define DPAA2_DQRR_RING_SIZE	16
 	/** <Maximum number of slots available in RX ring*/
 
+#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 bcac19af5e..4459424e1e 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -636,15 +636,28 @@ dpaa2_dev_tx(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(swp, &eqdesc,
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
 					&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;
-		dpaa2_q->tx_pkts += frames_to_send;
-		nb_pkts -= frames_to_send;
+		num_tx += loop;
+		dpaa2_q->tx_pkts += loop;
+		nb_pkts -= loop;
 	}
 	return num_tx;
 
@@ -653,12 +666,21 @@ send_n_return:
 	if (loop) {
 		unsigned int i = 0;
 
+		retry_count = 0;
 		while (i < loop) {
-			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
+			ret = qbman_swp_enqueue_multiple(swp, &eqdesc,
 							&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;
-		dpaa2_q->tx_pkts += loop;
+		num_tx += i;
+		dpaa2_q->tx_pkts += i;
 	}
 skip_tx:
 	return num_tx;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:30.234433702 +0000
+++ 0098-net-dpaa2-add-retry-and-timeout-in-packet-enqueue-AP.patch	2019-12-19 14:32:26.229300284 +0000
@@ -1,8 +1,10 @@
-From ce4fd609b4d7724533ccf9eb8b667afadc5a1687 Mon Sep 17 00:00:00 2001
+From 78ffee310f5b56511603de118258819e2b255f45 Mon Sep 17 00:00:00 2001
 From: Nipun Gupta <nipun.gupta at nxp.com>
 Date: Tue, 5 Nov 2019 19:53:16 +0530
 Subject: [PATCH] net/dpaa2: add retry and timeout in packet enqueue API
 
+[ upstream commit ce4fd609b4d7724533ccf9eb8b667afadc5a1687 ]
+
 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
@@ -10,22 +12,21 @@
 
 Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations")
 Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
-Cc: stable at dpdk.org
 
 Signed-off-by: Nipun Gupta <nipun.gupta at nxp.com>
 Signed-off-by: Radu Bulie <radu-andrei.bulie at 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(-)
+ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  2 ++
+ drivers/net/dpaa2/dpaa2_rxtx.c          | 36 ++++++++++++++++++++-----
+ 2 files changed, 31 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
-index db6dad5444..4ed82f5749 100644
+index ece1a7d432..4f7e49cc3c 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
+@@ -63,6 +63,8 @@
+ #define DPAA2_DQRR_RING_SIZE	16
+ 	/** <Maximum number of slots available in RX ring*/
  
 +#define DPAA2_MAX_TX_RETRY_COUNT	10000
 +
@@ -33,11 +34,11 @@
  #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 b7b2d8652a..52d913d9ea 100644
+index bcac19af5e..4459424e1e 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
+@@ -636,15 +636,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+ 			}
  			bufs++;
  		}
 +
@@ -46,8 +47,7 @@
  		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);
+ 					&fd_arr[loop], frames_to_send - loop);
 +			if (unlikely(ret < 0)) {
 +				retry_count++;
 +				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) {
@@ -62,26 +62,23 @@
  		}
  
 -		num_tx += frames_to_send;
+-		dpaa2_q->tx_pkts += frames_to_send;
 -		nb_pkts -= frames_to_send;
 +		num_tx += loop;
++		dpaa2_q->tx_pkts += loop;
 +		nb_pkts -= loop;
  	}
- 	dpaa2_q->tx_pkts += num_tx;
  	return num_tx;
-@@ -1153,13 +1166,22 @@ send_n_return:
+ 
+@@ -653,12 +666,21 @@ send_n_return:
  	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);
+ 							&fd_arr[i], loop - i);
 +			if (unlikely(ret < 0)) {
 +				retry_count++;
 +				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
@@ -92,66 +89,12 @@
 +			}
  		}
 -		num_tx += loop;
+-		dpaa2_q->tx_pkts += loop;
 +		num_tx += i;
++		dpaa2_q->tx_pkts += 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 @@ send_n_return:
- 	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.20.1
 


More information about the stable mailing list