From: Joshua Washington <joshwash@google.com>
To: Joshua Washington <joshwash@google.com>,
Xiaoyun Li <xiaoyun.li@intel.com>,
Junfeng Guo <junfengg@nvidia.com>
Cc: dev@dpdk.org, "Jasper Tran O'Leary" <jtranoleary@google.com>,
stable@dpdk.org
Subject: [PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start
Date: Thu, 3 Dec 2026 15:26:34 -0800 [thread overview]
Message-ID: <20261203232637.1044501-12-joshwash@google.com> (raw)
In-Reply-To: <20261203232637.1044501-1-joshwash@google.com>
From: Jasper Tran O'Leary <jtranoleary@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@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@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
next prev parent reply other threads:[~2026-12-03 23:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
2026-12-03 23:26 ` [PATCH 01/12] net/gve: disable queue start and stop Joshua Washington
2026-12-03 23:26 ` [PATCH 02/12] net/gve: free partially received GQI Rx packet Joshua Washington
2026-12-03 23:26 ` [PATCH 03/12] net/gve: fix integer underflow in GQI Rx path Joshua Washington
2026-12-03 23:26 ` [PATCH 04/12] net/gve: fix integer truncation in GQI QPL Tx path Joshua Washington
2026-12-03 23:26 ` [PATCH 05/12] net/gve: do not count unsent DQO Tx packets as oerrors Joshua Washington
2026-12-03 23:26 ` [PATCH 06/12] net/gve: disable unsupported TCP LRO offload Joshua Washington
2026-12-03 23:26 ` [PATCH 07/12] net/gve: drop multi-seg Rx packets if scatter is off Joshua Washington
2026-12-03 23:26 ` [PATCH 08/12] net/gve: reject non-power-of-2 ring sizes on DQO Joshua Washington
2026-12-03 23:26 ` [PATCH 09/12] net/gve: properly handle RSS realloc failures Joshua Washington
2026-12-03 23:26 ` [PATCH 10/12] net/gve: reject unsupported flow attributes and item masks Joshua Washington
2026-12-03 23:26 ` Joshua Washington [this message]
2026-12-03 23:26 ` [PATCH 12/12] net/gve: support scattered Rx for DQO Joshua Washington
2026-12-04 19:13 ` [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203232637.1044501-12-joshwash@google.com \
--to=joshwash@google.com \
--cc=dev@dpdk.org \
--cc=jtranoleary@google.com \
--cc=junfengg@nvidia.com \
--cc=stable@dpdk.org \
--cc=xiaoyun.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox