[dpdk-stable] patch 'net/ixgbe: fix queue release' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:30:25 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. 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.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/d55700c3a0f711a2e374609b7b8319cdc1576509

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d55700c3a0f711a2e374609b7b8319cdc1576509 Mon Sep 17 00:00:00 2001
From: Julien Meunier <julien.meunier at nokia.com>
Date: Tue, 28 Sep 2021 10:12:38 +0200
Subject: [PATCH] net/ixgbe: fix queue release
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6507e67af817183c69b684e81d820791eef18259 ]

On the vector implementation, during the tear-down, the mbufs not
drained in the RxQ and TxQ are freed based on an algorithm which
supposed that the number of descriptors is a power of 2 (max_desc).
Based on this hypothesis, this algorithm uses a bitmask in order to
detect an index overflow during the iteration, and to restart the loop
from 0.

However, there is no such power of 2 requirement in the ixgbe for the
number of descriptors in the RxQ / TxQ. The only requirement is to have
a number correctly aligned.

If a user requested to configure a number of descriptors which is not a
power of 2, as a consequence, during the tear-down, it was possible to
be in an infinite loop, and to never reach the exit loop condition.

By removing the bitmask and changing the loop method, we can avoid this
issue, and allow the user to configure a RxQ / TxQ which is not a power
of 2.

Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx")

Signed-off-by: Julien Meunier <julien.meunier at nokia.com>
Acked-by: Haiyue Wang <haiyue.wang at intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index a97c27189b..e650feac82 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -152,7 +152,7 @@ _ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq)
 	/* release the used mbufs in sw_ring */
 	for (i = txq->tx_next_dd - (txq->tx_rs_thresh - 1);
 	     i != txq->tx_tail;
-	     i = (i + 1) & max_desc) {
+	     i = (i + 1) % txq->nb_tx_desc) {
 		txe = &txq->sw_ring_v[i];
 		rte_pktmbuf_free_seg(txe->mbuf);
 	}
@@ -168,7 +168,6 @@ _ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq)
 static inline void
 _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
 {
-	const unsigned int mask = rxq->nb_rx_desc - 1;
 	unsigned int i;
 
 	if (rxq->sw_ring == NULL || rxq->rxrearm_nb >= rxq->nb_rx_desc)
@@ -183,7 +182,7 @@ _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq)
 	} else {
 		for (i = rxq->rx_tail;
 		     i != rxq->rxrearm_start;
-		     i = (i + 1) & mask) {
+		     i = (i + 1) % rxq->nb_rx_desc) {
 			if (rxq->sw_ring[i].mbuf != NULL)
 				rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf);
 		}
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:08.207121592 +0800
+++ 0141-net-ixgbe-fix-queue-release.patch	2021-11-10 14:17:01.910745763 +0800
@@ -1 +1 @@
-From 6507e67af817183c69b684e81d820791eef18259 Mon Sep 17 00:00:00 2001
+From d55700c3a0f711a2e374609b7b8319cdc1576509 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6507e67af817183c69b684e81d820791eef18259 ]
@@ -26 +28,0 @@
-Cc: stable at dpdk.org
@@ -35 +37 @@
-index adba855ca3..005e60668a 100644
+index a97c27189b..e650feac82 100644


More information about the stable mailing list