[PATCH v2 3/9] net/ixgbe: fix Rx mbuf leak on queue start failure

Anurag Mandal anurag.mandal at intel.com
Tue Dec 1 11:55:14 CET 2026


ixgbe_alloc_rx_queue_mbufs() returns on the first
allocation failure and leaves the mbufs already
allocated in the software ring.

When called from ixgbe_dev_rx_queue_start(),
nothing releases them and the queue stays in
stopped state, so the ethdev layer does not
call the queue stop callback either.
The next start attempt overwrites the ring
entries and leaks those mbufs.

Free the partially allocated mbufs before
returning the error.

Fixes: 029fd06d40fa ("ixgbe: queue start and stop")
Cc: stable at dpdk.org

Signed-off-by: Anurag Mandal <anurag.mandal at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/intel/ixgbe/ixgbe_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
index 32db2410b0..c9fe970cf6 100644
--- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
@@ -4653,6 +4653,10 @@ ixgbe_alloc_rx_queue_mbufs(struct ci_rx_queue *rxq)
 		if (mbuf == NULL) {
 			PMD_INIT_LOG(ERR, "RX mbuf alloc failed queue_id=%u",
 				     (unsigned) rxq->queue_id);
+			while (i-- > 0) {
+				rte_mbuf_raw_free(rxe[i].mbuf);
+				rxe[i].mbuf = NULL;
+			}
 			return -ENOMEM;
 		}
 
-- 
2.25.1



More information about the stable mailing list