patch 'net/gve: free Rx mbufs if allocation fails on ring setup' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Oct 31 15:32:31 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.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/05/25. 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/ea57f0b441d375770a72e3cd74660d13166bb78f

Thanks.

Kevin

---
>From ea57f0b441d375770a72e3cd74660d13166bb78f Mon Sep 17 00:00:00 2001
From: Joshua Washington <joshwash at google.com>
Date: Mon, 25 Aug 2025 17:03:34 -0700
Subject: [PATCH] net/gve: free Rx mbufs if allocation fails on ring setup

[ upstream commit fa48f964253ba018b4a3054246a6e26b31b5c8b0 ]

When creating new RX rings, one less than the number of buffers in the
ring need to be allocated. It is possible that only a part of the
allocation is successful, resulting in a failure to create the rings.
In this case, the driver should free the buffers which were successfully
allocated to avoid a memory leak in case the application does not
automatically exit.

Fixes: 265daac8a53a ("net/gve: fix mbuf allocation memory leak for DQ Rx")

Signed-off-by: Joshua Washington <joshwash at google.com>
Reviewed-by: Ankit Garg <nktgrg at google.com>
Reviewed-by: Ziwei Xiao <ziweixiao at google.com>
---
 drivers/net/gve/gve_rx_dqo.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index 0103add985..cd85d90bb6 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -377,12 +377,11 @@ gve_rxq_mbufs_alloc_dqo(struct gve_rx_queue *rxq)
 		for (i = 0; i < rx_mask; i++) {
 			nmb = rte_pktmbuf_alloc(rxq->mpool);
-			if (!nmb)
-				break;
+			if (!nmb) {
+				rxq->stats.no_mbufs++;
+				gve_release_rxq_mbufs_dqo(rxq);
+				return -ENOMEM;
+			}
 			rxq->sw_ring[i] = nmb;
 		}
-		if (i < rxq->nb_rx_desc - 1) {
-			rxq->stats.no_mbufs += rx_mask - i;
-			return -ENOMEM;
-		}
 	}
 
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-31 13:53:53.148028684 +0000
+++ 0029-net-gve-free-Rx-mbufs-if-allocation-fails-on-ring-se.patch	2025-10-31 13:53:52.057523434 +0000
@@ -1 +1 @@
-From fa48f964253ba018b4a3054246a6e26b31b5c8b0 Mon Sep 17 00:00:00 2001
+From ea57f0b441d375770a72e3cd74660d13166bb78f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fa48f964253ba018b4a3054246a6e26b31b5c8b0 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list