patch 'net/mana: fix Rx mempool leak on port stop' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Thu Jul 23 19:14:37 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.11.3

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/8e200d24d3766df34fe1349993087961b19bd9d9

Thanks.

Kevin

---
>From 8e200d24d3766df34fe1349993087961b19bd9d9 Mon Sep 17 00:00:00 2001
From: Long Li <longli at microsoft.com>
Date: Wed, 8 Apr 2026 18:55:19 -0700
Subject: [PATCH] net/mana: fix Rx mempool leak on port stop

[ upstream commit fa777bc5a6d44f91033da0534bd746de4ab965ba ]

The RX descriptor ring drain loop in mana_stop_rx_queues() uses
'while (tail != head)' to free posted mbufs. The RX ring is likely
completely full because every consumed WQE is immediately replenished,
so head == tail when the ring is full. The drain loop never executes,
leaking all RX mbufs on every port stop.

Fix by adding a desc_ring_len counter to mana_rxq (matching mana_txq)
and using 'while (desc_ring_len > 0)' as the drain condition. Apply
the same change to the TX drain loop for consistency.

Fixes: 5f705ac262a1 ("net/mana: start/stop Rx queues")

Signed-off-by: Long Li <longli at microsoft.com>
---
 drivers/net/mana/mana.h | 2 +-
 drivers/net/mana/rx.c   | 6 +++++-
 drivers/net/mana/tx.c   | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 7d94840dc4..79cc47b6ab 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -444,5 +444,5 @@ struct mana_rxq {
 	 * completion pull off desc_ring_tail
 	 */
-	uint32_t desc_ring_head, desc_ring_tail;
+	uint32_t desc_ring_head, desc_ring_tail, desc_ring_len;
 
 #ifdef RTE_ARCH_32
diff --git a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c
index f196d43aee..1b8ba1f3a9 100644
--- a/drivers/net/mana/rx.c
+++ b/drivers/net/mana/rx.c
@@ -103,4 +103,5 @@ mana_post_rx_wqe(struct mana_rxq *rxq, struct rte_mbuf *mbuf)
 #endif
 		rxq->desc_ring_head = (rxq->desc_ring_head + 1) % rxq->num_desc;
+		rxq->desc_ring_len++;
 	} else {
 		DP_LOG(DEBUG, "failed to post recv ret %d", ret);
@@ -216,5 +217,5 @@ mana_stop_rx_queues(struct rte_eth_dev *dev)
 
 		/* Drain and free posted WQEs */
-		while (rxq->desc_ring_tail != rxq->desc_ring_head) {
+		while (rxq->desc_ring_len > 0) {
 			struct mana_rxq_desc *desc =
 				&rxq->desc_ring[rxq->desc_ring_tail];
@@ -224,7 +225,9 @@ mana_stop_rx_queues(struct rte_eth_dev *dev)
 			rxq->desc_ring_tail =
 				(rxq->desc_ring_tail + 1) % rxq->num_desc;
+			rxq->desc_ring_len--;
 		}
 		rxq->desc_ring_head = 0;
 		rxq->desc_ring_tail = 0;
+		rxq->desc_ring_len = 0;
 
 		memset(&rxq->gdma_rq, 0, sizeof(rxq->gdma_rq));
@@ -561,4 +564,5 @@ drop:
 
 		rxq->gdma_rq.tail += desc->wqe_size_in_bu;
+		rxq->desc_ring_len--;
 
 		/* Record the number of the RX WQE we need to post to replenish
diff --git a/drivers/net/mana/tx.c b/drivers/net/mana/tx.c
index e5ab566e8a..57dbbc3651 100644
--- a/drivers/net/mana/tx.c
+++ b/drivers/net/mana/tx.c
@@ -40,5 +40,5 @@ mana_stop_tx_queues(struct rte_eth_dev *dev)
 
 		/* Drain and free posted WQEs */
-		while (txq->desc_ring_tail != txq->desc_ring_head) {
+		while (txq->desc_ring_len > 0) {
 			struct mana_txq_desc *desc =
 				&txq->desc_ring[txq->desc_ring_tail];
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-23 17:57:59.109829350 +0100
+++ 0014-net-mana-fix-Rx-mempool-leak-on-port-stop.patch	2026-07-23 17:57:58.632638707 +0100
@@ -1 +1 @@
-From fa777bc5a6d44f91033da0534bd746de4ab965ba Mon Sep 17 00:00:00 2001
+From 8e200d24d3766df34fe1349993087961b19bd9d9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fa777bc5a6d44f91033da0534bd746de4ab965ba ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list