[PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start

Joshua Washington joshwash at google.com
Fri Dec 4 00:26:34 CET 2026


From: Jasper Tran O'Leary <jtranoleary at google.com>

When a GQI Rx queue is started, gve_rxq_mbufs_alloc() fills every slot
of the software ring with an mbuf but posts only nb_rx_desc - 1 buffers
to the device. The first refill then begins at the last slot of the
ring and stores a newly allocated mbuf there without freeing the one
the initial fill left in it. One mbuf per queue is lost every time a
queue is started and goes on to receive traffic.

Allocate nb_rx_desc - 1 mbufs up front. This is the number of buffers
posted to the device, and it is what the fallback path taken when the
bulk allocation fails already allocates.

Fixes: a46583cf43c8 ("net/gve: support Rx/Tx")
Cc: stable at dpdk.org

Signed-off-by: Jasper Tran O'Leary <jtranoleary at google.com>
Signed-off-by: Joshua Washington <joshwash at google.com>
---
 drivers/net/gve/gve_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 05430621de..f0ad420992 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -487,7 +487,7 @@ gve_rxq_mbufs_alloc(struct gve_rx_queue *rxq)
 	uint16_t i;
 	int diag;
 
-	diag = rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], rxq->nb_rx_desc);
+	diag = rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], rxq->nb_rx_desc - 1);
 	if (diag < 0) {
 		for (i = 0; i < rxq->nb_rx_desc - 1; i++) {
 			nmb = rte_pktmbuf_alloc(rxq->mpool);
-- 
2.56.1.915.g69d5ec7298-goog



More information about the stable mailing list