From: Joshua Washington <joshwash@google.com>
To: Jeroen de Borst <jeroendb@google.com>,
Joshua Washington <joshwash@google.com>,
Rushil Gupta <rushilg@google.com>,
Junfeng Guo <junfengg@nvidia.com>
Cc: dev@dpdk.org, stable@dpdk.org,
"Jasper Tran O'Leary" <jtranoleary@google.com>
Subject: [PATCH v3 6/9] net/gve: free ctx mbuf if packet dropped after first segment
Date: Tue, 7 Jul 2026 09:40:16 -0700 [thread overview]
Message-ID: <20260707164020.2936476-7-joshwash@google.com> (raw)
In-Reply-To: <20260707164020.2936476-1-joshwash@google.com>
GVE GQ has support for multi-descriptor RX. It is possible for a packet
to be dropped after the first descriptor has been processed an mbuf has
been added to the context. In such a case, the mbuf head should be freed
before clearing the context so that mbufs aren't leaked.
In addition, clear mbuf from sw_ring after adding the packet to the
context to avoid double-freeing buffers that have not been reposted, but
have been reported to the application.
Fixes: 496d4d2c8b54 ("net/gve: support jumbo frame for GQI")
Cc: stable@dpdk.org
Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Jasper Tran O'Leary <jtranoleary@google.com>
---
drivers/net/gve/gve_rx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index cda87af294..567b82d020 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -205,6 +205,8 @@ gve_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
if (gve_rx(rxq, rxd, rx_id)) {
if (!ctx->drop_pkt)
rx_pkts[nb_rx++] = ctx->mbuf_head;
+ else if (ctx->mbuf_head != NULL)
+ rte_pktmbuf_free(ctx->mbuf_head);
rxq->nb_avail += ctx->total_frags;
gve_rx_ctx_clear(ctx);
}
--
2.55.0.rc2.803.g1fd1e6609c-goog
next prev parent reply other threads:[~2026-07-07 16:41 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 13:12 [PATCH v2 0/9] Stability fixes for GVE Joshua Washington
2026-07-03 13:12 ` [PATCH v2 1/9] net/gve: clear out shared memory region for stats report Joshua Washington
2026-07-03 13:12 ` [PATCH v2 2/9] net/gve: delay adding mbuf head to software ring Joshua Washington
2026-07-03 13:13 ` [PATCH v2 3/9] net/gve: copy data to QPL buffer when mbuf read does not Joshua Washington
2026-07-03 13:13 ` [PATCH v2 4/9] net/gve: validate buf ID before processing Rx packet Joshua Washington
2026-07-03 13:13 ` [PATCH v2 5/9] net/gve: set mbuf to null in software ring after use Joshua Washington
2026-07-03 13:13 ` [PATCH v2 6/9] net/gve: free ctx mbuf if packet dropped after first segment Joshua Washington
2026-07-03 13:13 ` [PATCH v2 7/9] net/gve: increase range of DMA memzone ids to 64 bits Joshua Washington
2026-07-03 13:13 ` [PATCH v2 8/9] net/gve: don't reset ring size bounds to default on reset Joshua Washington
2026-07-03 13:13 ` [PATCH v2 9/9] net/gve: restrict max ring size in GQ QPL to 2K Joshua Washington
2026-07-03 14:27 ` [PATCH v2 0/9] Stability fixes for GVE Stephen Hemminger
2026-07-07 16:02 ` Joshua Washington
2026-07-07 16:10 ` David Marchand
2026-07-07 16:36 ` Joshua Washington
2026-07-07 16:40 ` Bruce Richardson
2026-07-07 16:40 ` [PATCH v3 " Joshua Washington
2026-07-07 16:40 ` [PATCH v3 1/9] net/gve: clear out shared memory region for stats report Joshua Washington
2026-07-07 16:40 ` [PATCH v3 2/9] net/gve: delay adding mbuf head to software ring Joshua Washington
2026-07-07 16:40 ` [PATCH v3 3/9] net/gve: copy data to QPL buffer when mbuf read does not Joshua Washington
2026-07-07 16:40 ` [PATCH v3 4/9] net/gve: validate buf ID before processing Rx packet Joshua Washington
2026-07-07 16:40 ` [PATCH v3 5/9] net/gve: set mbuf to null in software ring after use Joshua Washington
2026-07-07 16:40 ` Joshua Washington [this message]
2026-07-07 16:40 ` [PATCH v3 7/9] net/gve: increase range of DMA memzone ids to 64 bits Joshua Washington
2026-07-07 16:40 ` [PATCH v3 8/9] net/gve: don't reset ring size bounds to default on reset Joshua Washington
2026-07-07 16:40 ` [PATCH v3 9/9] net/gve: restrict max ring size in GQ QPL to 2K Joshua Washington
2026-07-07 22:13 ` Joshua Washington
2026-07-09 4:07 ` [PATCH v4 0/9] Stability fixes for GVE Joshua Washington
2026-07-09 4:07 ` [PATCH v4 1/9] net/gve: clear out shared memory region for stats report Joshua Washington
2026-07-09 4:07 ` [PATCH v4 2/9] net/gve: delay adding mbuf head to software ring Joshua Washington
2026-07-10 14:45 ` Thomas Monjalon
2026-07-10 20:33 ` Joshua Washington
2026-07-09 4:07 ` [PATCH v4 3/9] net/gve: copy data to QPL buffer when mbuf read does not Joshua Washington
2026-07-09 4:07 ` [PATCH v4 4/9] net/gve: validate buf ID before processing Rx packet Joshua Washington
2026-07-09 4:07 ` [PATCH v4 5/9] net/gve: set mbuf to null in software ring after use Joshua Washington
2026-07-09 4:07 ` [PATCH v4 6/9] net/gve: free ctx mbuf if packet dropped after first segment Joshua Washington
2026-07-09 4:07 ` [PATCH v4 7/9] net/gve: increase range of DMA memzone ids to 64 bits Joshua Washington
2026-07-09 4:07 ` [PATCH v4 8/9] net/gve: don't reset ring size bounds to default on reset Joshua Washington
2026-07-09 4:07 ` [PATCH v4 9/9] net/gve: restrict max ring size in GQ QPL to 2K Joshua Washington
2026-07-10 21:34 ` [PATCH v4 0/9] Stability fixes for GVE Thomas Monjalon
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=20260707164020.2936476-7-joshwash@google.com \
--to=joshwash@google.com \
--cc=dev@dpdk.org \
--cc=jeroendb@google.com \
--cc=jtranoleary@google.com \
--cc=junfengg@nvidia.com \
--cc=rushilg@google.com \
--cc=stable@dpdk.org \
/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