net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbell
PATCH 1/1 net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbell
In GQI Queue Page List (GQI_QPL) mode each Tx queue copies outgoing frames into a fixed QPL bounce FIFO (512 pages = 2 MiB on GCE, ~236 8,832-byte cacheline-aligned jumbo frames) even when nb_tx_desc is configured to 2048. Under sustained jumbo bursts three bugs cause unnecessary packet drops and mbuf tracking hazards:
1. Entry cleanup in gve_tx_burst_qpl() only ran when nb_free < free_thresh
(32) or fifo_avail == 0. With 2048 descriptors, 236 jumbo frames leave nb_free = 1811 and non-zero remainder bytes in fifo_avail, so entry cleanup never ran and every QPL wrap stalled mid-burst. Reclaim when fifo_avail drops below half of fifo_size, and do not count normal FIFO/ring-full backpressure as hardware stats.errors.
2. When is_fifo_avail() failed mid-burst after queuing packets, the driver polled gve_tx_clean() once before writing qtx_tail, so the device had not yet started draining the newly queued frames, and a single GVE_TX_MAX_FREE_SZ batch after many small frames could stop short of freeing a jumbo slot. Flush qtx_tail first and loop gve_tx_clean() while next_to_clean advances.
3. sw_ring[sw_id] and the first TSO header slice were allocated/written before verifying total FIFO space, gve_free_bulk_mbuf() did not clear the first freed slot, and gve_tx_burst_ra() skipped mid-burst ring cleanup and wrote pkt_len instead of data_len into the first segment descriptor of multi-segment non-TSO packets.
--- drivers/net/gve/gve_tx.c | 68 +++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 21 deletions(-)
drivers/net/gve/gve_tx.c +47 -21
@@ -19,6 +19,7 @@ gve_free_bulk_mbuf(struct rte_mbuf **txep, int num)for (s =0 ; s < num; s++) {if (txep[s] !=NULL ) { m =rte_pktmbuf_prefree_seg (txep[s]); + txep[s] =NULL ;if (m !=NULL )break ; }
@@ -200,7 +201,7 @@ gve_tx_fill_seg_desc(volatile union gve_tx_desc *desc, uint64_t ol_flags, }static inline bool -is_fifo_avail (struct gve_tx_queue *txq,uint16_t len) +is_fifo_avail (struct gve_tx_queue *txq,uint32_t len) {if (txq->fifo_avail < len)return false;
@@ -210,6 +211,26 @@ is_fifo_avail(struct gve_tx_queue *txq, uint16_t len)return false;return true; } + +static inline bool +gve_tx_reclaim_fifo_qpl (struct gve_tx_queue *txq,uint32_t tx_tail, +uint32_t need) +{ +if (txq->tx_tail != tx_tail) { +rte_write32 (rte_cpu_to_be_32 (tx_tail), txq->qtx_tail); + txq->tx_tail = tx_tail; + } + +do { +uint32_t prev_ntc = txq->next_to_clean; + +gve_tx_clean (txq); +if (is_fifo_avail (txq, need)) +return true; +if (txq->next_to_clean == prev_ntc) +return false; + }while (true); +}static inline uint64_t gve_tx_alloc_from_fifo (struct gve_tx_queue *txq,uint16_t tx_id,uint16_t len) {
@@ -266,7 +287,8 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) txr = txq->tx_desc_ring; -if (txq->nb_free < txq->free_thresh || txq->fifo_avail ==0 ) +if (txq->nb_free < txq->free_thresh || + txq->fifo_avail < (txq->fifo_size >>1 ))gve_tx_clean (txq);if (txq->sw_nb_free < txq->free_thresh)
@@ -304,22 +326,23 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) (uint32_t)(tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len) : tx_pkt->pkt_len; -if (!is_fifo_avail (txq, hlen)) { -gve_tx_clean (txq); -if (!is_fifo_avail (txq, hlen)) +if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +uint32_t data_len, need; + +if (unlikely (tx_pkt->pkt_len <= hlen)) + goto end_of_tx; + data_len = tx_pkt->pkt_len - hlen; + need =RTE_ALIGN (hlen,RTE_CACHE_LINE_SIZE ) + +RTE_ALIGN (data_len,RTE_CACHE_LINE_SIZE ); +if (!is_fifo_avail (txq, need) && + !gve_tx_reclaim_fifo_qpl (txq, tx_tail, need)) goto end_of_tx; + }else if (!is_fifo_avail (txq, hlen) && + !gve_tx_reclaim_fifo_qpl (txq, tx_tail, hlen)) { + goto end_of_tx; } fifo_addr =gve_tx_alloc_from_fifo (txq, tx_id, hlen); -/* For TSO, check if there's enough fifo space for data first */ -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { -if (!is_fifo_avail (txq, tx_pkt->pkt_len - hlen)) { -gve_tx_clean (txq); -if (!is_fifo_avail (txq, tx_pkt->pkt_len - hlen)) - goto end_of_tx; - } - } - qpl_write_addr = (void *)(size_t )(fifo_addr + txq->fifo_base); mbuf_header_addr =rte_pktmbuf_read (tx_pkt,0 , hlen, qpl_write_addr);
@@ -370,13 +393,14 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) end_of_tx:if (nb_tx) { -rte_write32 (rte_cpu_to_be_32 (tx_tail), txq->qtx_tail); - txq->tx_tail = tx_tail; +if (txq->tx_tail != tx_tail) { +rte_write32 (rte_cpu_to_be_32 (tx_tail), txq->qtx_tail); + txq->tx_tail = tx_tail; + } txq->sw_tail = sw_id; txq->stats.packets += nb_tx; txq->stats.bytes += bytes; - txq->stats.errors += nb_pkts - nb_tx; }return nb_tx;
@@ -411,8 +435,11 @@ gve_tx_burst_ra(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) nb_used++; -if (txq->nb_free < nb_used) - goto end_of_tx; +if (txq->nb_free < nb_used) { +gve_tx_clean (txq); +if (txq->nb_free < nb_used) + goto end_of_tx; + } tx_offload.l2_len = tx_pkt->l2_len; tx_offload.l3_len = tx_pkt->l3_len;
@@ -424,7 +451,7 @@ gve_tx_burst_ra(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) hlen = ol_flags &RTE_MBUF_F_TX_TCP_SEG ? (uint32_t )(tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len) : - tx_pkt->pkt_len; + tx_pkt->data_len;/* * if tso, the driver needs to fill 2 descs for 1 mbuf * so only put this mbuf into the 1st tx entry in sw ring
@@ -465,7 +492,6 @@ gve_tx_burst_ra(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) txq->stats.packets += nb_tx; txq->stats.bytes += bytes; - txq->stats.errors += nb_pkts - nb_tx; }return nb_tx;
Signature · 1 line
2.56.0.679.gc527c65306-goog
Quoted 24 lines · On Sun, 15 Nov 2026 09:00:16 -0500 Ryan Wolfe <[email protected]> wrote:
In GQI Queue Page List (
GQI_QPL) mode each Tx queue copies outgoing frames into a fixed QPL bounce FIFO (512 pages = 2 MiB on GCE, ~236 8,832-byte cacheline-aligned jumbo frames) even whennb_tx_descis configured to 2048. Under sustained jumbo bursts three bugs cause unnecessary packet drops and mbuf tracking hazards:1. Entry cleanup in
gve_tx_burst_qpl()only ran whennb_free<free_thresh
(32) orfifo_avail== 0. With 2048 descriptors, 236 jumbo frames leavenb_free= 1811 and non-zero remainder bytes infifo_avail, so entry cleanup never ran and every QPL wrap stalled mid-burst. Reclaim whenfifo_availdrops below half offifo_size, and do not count normal FIFO/ring-full backpressure as hardware stats.errors.
2. Whenis_fifo_avail()failed mid-burst after queuing packets, the driver polledgve_tx_clean()once before writingqtx_tail, so the device had not yet started draining the newly queued frames, and a singleGVE_TX_MAX_FREE_SZbatch after many small frames could stop short of freeing a jumbo slot. Flushqtx_tailfirst and loopgve_tx_clean()whilenext_to_cleanadvances.
3. sw_ring[sw_id] and the first TSO header slice were allocated/written before verifying total FIFO space,gve_free_bulk_mbuf()did not clear the first freed slot, andgve_tx_burst_ra()skipped mid-burst ring cleanup and wrotepkt_leninstead ofdata_leninto the first segment descriptor of multi-segment non-TSO packets.
Quoted 5 lines
Fixes a46583cf43c8 ("net/gve: support Rx/Tx")Signed-off-by Ryan Wolfe <[email protected]>---
The AI review spotted some changes needed.
[PATCH] net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbell
The FIFO fixes look right. Checking the TSO header and payload together before allocating also fixes a real leak: the old code allocated the header slice, then hit goto end_of_tx when the payload check failed. iov_ring[tx_id] was overwritten on the next burst, so that FIFO space was never returned to fifo_avail. The reclaim helper rings the doorbell before polling, which is the right order.
Error
TSO packets with pkt_len <= hlen now goto end_of_tx. That is a per-packet validation failure handled as backpressure. The app retries the same mbuf forever and the queue stalls. Drop the packet and move on:
if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
uint32_t data_len, need;
if (unlikely(tx_pkt->pkt_len <= hlen)) {
txq->stats.errors++;
rte_pktmbuf_free(tx_pkt);
nb_drop++;
continue;
}Leave nb_drop out of stats.packets. A better long-term fix is a tx_pkt_prepare callback that rejects these before tx_burst, since gve has none today.
Warning
The commit message does not match the code. Item 3 says sw_ring[sw_id] is written before the FIFO check, but commit 1299806a ("net/gve: delay adding mbuf head to software ring") already moved it. This patch does not touch that ordering. Drop the claim.
This patch makes six separate changes to two Tx paths, under one Fixes tag, and is marked for stable:
- gve_free_bulk_mbuf() clears slot s
- QPL FIFO reclaim, doorbell flush and wider is_fifo_avail()
- QPL TSO check before allocating
- RA: clean the ring mid-burst
- RA: use data_len for the first descriptor
- stats.errors removal in both paths
Split it into at least three patches: the free_bulk fix, the QPL FIFO changes, and the RA fixes. Give each one a Fixes: tag pointing at the commit that added that bug. Not all of them date back to a46583cf43c8. Splitting lets stable maintainers backport each fix on its own.
Say in the commit message why the free_bulk fix matters. In RA mode a TSO packet uses two descriptors, but sw_ring[] is set only for the first one. The second slot can still hold a stale pointer from a previous wrap. The old code did not clear slot s, or earlier slots whose refcount was still held, so gve_tx_clean() could free that stale mbuf a second time. That is a double free, not a vague "mbuf tracking hazard". The RA data_len fix is the same kind of
bug: the device was told to read pkt_len bytes from the first segment, past the end of that segment. Both deserve their own patch and a clear description.
The commit message is long and reads like generated text. Make it short and factual, and say how this was tested: which instance type, which queue mode, and the traffic used to reproduce.
Info
Use for (;;) rather than do { } while (true) in gve_tx_reclaim_fifo_qpl(). Add a blank line between it and gve_tx_alloc_from_fifo().
v2 cover net/gve: fix GQI Tx cleanup and QPL FIFO reclaim
In reply to Ryan WolfeThis series fixes three independent bugs in the GQI Tx paths of net/gve:
- 1/3 clears the first freed sw_ring entry in gve_free_bulk_mbuf() so completed or refcounted segments do not leave stale mbuf pointers that are freed a second time on queue stop or release.
- 2/3 fixes GQI_RDA multi-segment non-TSO packet descriptors to pass data_len instead of pkt_len for the head segment, reclaims completed descriptors when nb_free runs low mid-burst, and stops counting normal ring-full backpressure as stats.errors.
- 3/3 fixes GQI_QPL jumbo Tx FIFO reclaim, TSO pre-allocation space checks, malformed TSO mbuf handling, and doorbell flushing.
v2:
- split v1 into three atomic Fixes patches for stable backporting
- free and count malformed TSO mbufs (pkt_len <= hlen) in gve_tx_burst_qpl() while tracking nb_sent separately from nb_tx so an invalid TSO request cannot stall the queue at tx_pkts[0]
- use for (;;) and add the missing blank line after gve_tx_reclaim_fifo_qpl()
Ryan Wolfe (3):
net/gve: clear first freed slot in bulk mbuf free net/gve: fix GQI RDA multi-seg descriptor length and clean net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbell
drivers/net/gve/gve_tx.c | 78 ++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 23 deletions(-)
PATCH v2 1/3 net/gve: clear first freed slot in bulk mbuf free
In gve_free_bulk_mbuf(), the initial scan for the first segment ready to return to its mempool calls rte_pktmbuf_prefree_seg(txep[s]) without clearing txep[s]. Neither the early scan (including refcounted segments where prefree returns NULL) nor the subsequent loop starting at s + 1 resets txep[s] to NULL, leaving stale mbuf pointers in sw_ring that gve_release_txq_mbufs() frees a second time on queue stop or release.
Clear txep[s] immediately after rte_pktmbuf_prefree_seg(), matching the cleanup loop for the remaining entries.
--- drivers/net/gve/gve_tx.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/gve/gve_tx.c +1 -0
@@ -19,6 +19,7 @@ gve_free_bulk_mbuf(struct rte_mbuf **txep, int num)for (s =0 ; s < num; s++) {if (txep[s] !=NULL ) { m =rte_pktmbuf_prefree_seg (txep[s]); + txep[s] =NULL ;if (m !=NULL )break ; }
PATCH v2 2/3 net/gve: fix GQI RDA multi-seg descriptor length and clean
In reply to Ryan Wolfegve_tx_burst_ra() has three bugs on multi-segment bursts and ring wrap:
1. For non-TSO packets, hlen was set to tx_pkt->pkt_len instead of tx_pkt->data_len and passed as the first descriptor's seg_len, causing the device to overrun the head mbuf buffer on multi-segment frames while also transmitting the trailing segment descriptors.
2. When txq->nb_free dropped below nb_used mid-burst, gve_tx_burst_ra() aborted immediately without calling gve_tx_clean(txq) to reclaim completed descriptors.
3. Unsent packets left for the caller on ring-full backpressure were added to txq->stats.errors.
Use tx_pkt->data_len for the head segment of non-TSO frames, attempt gve_tx_clean() before stopping when descriptors run low mid-burst, and stop counting normal backpressure as Tx errors.
--- drivers/net/gve/gve_tx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/gve/gve_tx.c +6 -4
@@ -412,8 +412,11 @@ gve_tx_burst_ra(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) nb_used++; -if (txq->nb_free < nb_used) - goto end_of_tx; +if (txq->nb_free < nb_used) { +gve_tx_clean (txq); +if (txq->nb_free < nb_used) + goto end_of_tx; + } tx_offload.l2_len = tx_pkt->l2_len; tx_offload.l3_len = tx_pkt->l3_len;
@@ -425,7 +428,7 @@ gve_tx_burst_ra(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) hlen = ol_flags &RTE_MBUF_F_TX_TCP_SEG ? (uint32_t )(tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len) : - tx_pkt->pkt_len; + tx_pkt->data_len;/* * if tso, the driver needs to fill 2 descs for 1 mbuf * so only put this mbuf into the 1st tx entry in sw ring
@@ -466,7 +469,6 @@ gve_tx_burst_ra(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) txq->stats.packets += nb_tx; txq->stats.bytes += bytes; - txq->stats.errors += nb_pkts - nb_tx; }return nb_tx;
PATCH v2 3/3 net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbell
In reply to Ryan WolfeIn GQI Queue Page List (GQI_QPL) mode each Tx queue copies outgoing frames into a fixed QPL bounce FIFO (for example 512 pages = 2 MiB, or ~236 8,832-byte cacheline-aligned jumbo frames) even when nb_tx_desc is configured to 2048. Under sustained jumbo bursts three bugs cause stalls, packet drops, and corrupted FIFO accounting:
1. Entry cleanup in gve_tx_burst_qpl() only ran when nb_free < free_thresh (32) or fifo_avail == 0. With 2048 descriptors, 236 jumbo frames leave nb_free = 1811 and non-zero remainder bytes in fifo_avail, so entry cleanup never ran. Reclaim when fifo_avail drops below half of fifo_size, and stop counting normal FIFO-full backpressure as stats.errors.
2. When is_fifo_avail() failed mid-burst after queuing frames, the driver polled gve_tx_clean() once before writing qtx_tail, so the device had not begun draining the queued frames, and one GVE_TX_MAX_FREE_SZ batch after small frames could stop short of a jumbo slot. Flush qtx_tail first and loop gve_tx_clean() while next_to_clean advances.
3. For TSO packets, the header FIFO slice was allocated before checking payload FIFO space (leaking header FIFO space on mid-packet abort), and a malformed TSO mbuf with pkt_len <= hlen jumped to end_of_tx without consuming the mbuf, stalling the queue indefinitely. Verify combined aligned header + payload space up front with a 32-bit length check, and free and count malformed TSO mbufs while tracking nb_sent separately from nb_tx.
--- drivers/net/gve/gve_tx.c | 67 ++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 19 deletions(-)
drivers/net/gve/gve_tx.c +48 -19
@@ -201,7 +201,7 @@ gve_tx_fill_seg_desc(volatile union gve_tx_desc *desc, uint64_t ol_flags, }static inline bool -is_fifo_avail (struct gve_tx_queue *txq,uint16_t len) +is_fifo_avail (struct gve_tx_queue *txq,uint32_t len) {if (txq->fifo_avail < len)return false;
@@ -211,6 +211,27 @@ is_fifo_avail(struct gve_tx_queue *txq, uint16_t len)return false;return true; } + +static inline bool +gve_tx_reclaim_fifo_qpl (struct gve_tx_queue *txq,uint32_t tx_tail, +uint32_t need) +{ +if (txq->tx_tail != tx_tail) { +rte_write32 (rte_cpu_to_be_32 (tx_tail), txq->qtx_tail); + txq->tx_tail = tx_tail; + } + +for (;;) { +uint32_t prev_ntc = txq->next_to_clean; + +gve_tx_clean (txq); +if (is_fifo_avail (txq, need)) +return true; +if (txq->next_to_clean == prev_ntc) +return false; + } +} +static inline uint64_t gve_tx_alloc_from_fifo (struct gve_tx_queue *txq,uint16_t tx_id,uint16_t len) {
@@ -261,13 +282,15 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)uint16_t sw_id = txq->sw_tail;uint64_t ol_flags, fifo_addr;uint16_t nb_used, i; +uint16_t nb_sent =0 ;uint64_t bytes =0 ;uint16_t nb_tx =0 ;uint32_t hlen; txr = txq->tx_desc_ring; -if (txq->nb_free < txq->free_thresh || txq->fifo_avail ==0 ) +if (txq->nb_free < txq->free_thresh || + txq->fifo_avail < (txq->fifo_size >>1 ))gve_tx_clean (txq);if (txq->sw_nb_free < txq->free_thresh)
@@ -305,21 +328,25 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) (uint32_t)(tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len) : tx_pkt->pkt_len; -if (!is_fifo_avail (txq, hlen)) { -gve_tx_clean (txq); -if (!is_fifo_avail (txq, hlen)) - goto end_of_tx; - } - fifo_addr =gve_tx_alloc_from_fifo (txq, tx_id, hlen); - -/* For TSO, check if there's enough fifo space for data first */ if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { -if (!is_fifo_avail (txq, tx_pkt->pkt_len - hlen)) { -gve_tx_clean (txq); -if (!is_fifo_avail (txq, tx_pkt->pkt_len - hlen)) - goto end_of_tx; +uint32_t data_len, need; + +if (unlikely (tx_pkt->pkt_len <= hlen)) { +rte_pktmbuf_free (tx_pkt); + txq->stats.errors++; +continue ; } + data_len = tx_pkt->pkt_len - hlen; + need =RTE_ALIGN (hlen,RTE_CACHE_LINE_SIZE ) + +RTE_ALIGN (data_len,RTE_CACHE_LINE_SIZE ); +if (!is_fifo_avail (txq, need) && + !gve_tx_reclaim_fifo_qpl (txq, tx_tail, need)) + goto end_of_tx; + }else if (!is_fifo_avail (txq, hlen) && + !gve_tx_reclaim_fifo_qpl (txq, tx_tail, hlen)) { + goto end_of_tx; } + fifo_addr =gve_tx_alloc_from_fifo (txq, tx_id, hlen); qpl_write_addr = (void *)(size_t )(fifo_addr + txq->fifo_base); mbuf_header_addr =rte_pktmbuf_read (tx_pkt,0 , hlen, qpl_write_addr);
@@ -367,17 +394,19 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) tx_tail += nb_used; bytes += first->pkt_len; + nb_sent++; } end_of_tx: -if (nb_tx) { -rte_write32 (rte_cpu_to_be_32 (tx_tail), txq->qtx_tail); - txq->tx_tail = tx_tail; +if (nb_sent) { +if (txq->tx_tail != tx_tail) { +rte_write32 (rte_cpu_to_be_32 (tx_tail), txq->qtx_tail); + txq->tx_tail = tx_tail; + } txq->sw_tail = sw_id; - txq->stats.packets += nb_tx; + txq->stats.packets += nb_sent; txq->stats.bytes += bytes; - txq->stats.errors += nb_pkts - nb_tx; }return nb_tx;
Re: [PATCH v2 0/3] net/gve: fix GQI Tx cleanup and QPL FIFO reclaim
In reply to Ryan WolfeQuoted 12 lines · On Tue, 17 Nov 2026 09:11:41 -0500 Ryan Wolfe <[email protected]> wrote:
This series fixes three independent bugs in the GQI Tx paths of net/gve:
- 1/3 clears the first freed
sw_ringentry ingve_free_bulk_mbuf()so completed or refcounted segments do not leave stale mbuf pointers that are freed a second time on queue stop or release.
- 2/3 fixesGQI_RDAmulti-segment non-TSO packet descriptors to passdata_leninstead ofpkt_lenfor the head segment, reclaims completed descriptors whennb_freeruns low mid-burst, and stops counting normal ring-full backpressure as stats.errors.
- 3/3 fixesGQI_QPLjumbo Tx FIFO reclaim, TSO pre-allocation space checks, malformed TSO mbuf handling, and doorbell flushing.
Quoted 7 lines
v2:
- split v1 into three atomic Fixes patches for stable backporting
- free and count malformed TSO mbufs (pkt_len<= hlen) ingve_tx_burst_qpl()while trackingnb_sentseparately fromnb_txso an invalid TSO request cannot stall the queue at tx_pkts[0]
- use for (;;) and add the missing blank line aftergve_tx_reclaim_fifo_qpl()
AI review looks clean, though it did see some pre-existing issues
Subject: Re: [PATCH v2 0/3] net/gve: GQI Tx fixes
Applied to main, builds with -Dwerror=true. All three fixes are correct. Remaining notes are pre-existing code next to what the series touches, worth picking up while in this area.
Patch 2/3: net/gve: fix GQI RDA multi-seg descriptor length and clean
Info (pre-existing): TSO payload length underflows when the headers are not all in the first segment.
gve_tx_fill_seg_desc(txd, ol_flags, tx_offload,
tx_pkt->data_len - hlen, addr);
If data_len < l2+l3+l4, the uint16_t wraps and the device is given a near-64K segment. Either reject that case (free and count as error, as patch 3 does for QPL) or require headers in the first segment via tx_prepare.
Patch 3/3: net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbell
Info (pre-existing): the 32-bit widening stops at is_fifo_avail(). The allocator still takes uint16_t:
gve_tx_alloc_from_fifo(struct gve_tx_queue *txq, uint16_t tx_id,
uint16_t len)
and is called with
fifo_addr = gve_tx_alloc_from_fifo(txq, tx_id,
tx_pkt->pkt_len - hlen);
GQI advertises RTE_ETH_TX_OFFLOAD_TCP_TSO with no size limit and no tx_prepare. A TSO mbuf with payload > 65535 now passes the full-width "need" check, reserves only (len & 0xffff) bytes, then rte_pktmbuf_read() copies the full payload into the FIFO, overwriting in-flight frames or running past fifo_size. pkt.len is __be16 so the device cannot describe such a packet anyway. Simplest fix is to drop it with the malformed case:
if (unlikely(tx_pkt->pkt_len <= hlen ||
tx_pkt->pkt_len > UINT16_MAX)) {
rte_pktmbuf_free(tx_pkt);
txq->stats.errors++;
continue;
}Info (pre-existing): the QPL path has the same descriptor-low abort that patch 2 fixes for RDA:
if (txq->nb_free < nb_used)
goto end_of_tx;Using gve_tx_reclaim_fifo_qpl() style clean (or at least gve_tx_clean()) there would be consistent.
Stephen Hemminger
AppliedRe: [PATCH v2 0/3] net/gve: fix GQI Tx cleanup and QPL FIFO reclaim
In reply to Ryan WolfeQuoted 20 lines · On Tue, 17 Nov 2026 09:11:41 -0500 Ryan Wolfe <[email protected]> wrote:
This series fixes three independent bugs in the GQI Tx paths of net/gve:
- 1/3 clears the first freed
sw_ringentry ingve_free_bulk_mbuf()so completed or refcounted segments do not leave stale mbuf pointers that are freed a second time on queue stop or release.
- 2/3 fixesGQI_RDAmulti-segment non-TSO packet descriptors to passdata_leninstead ofpkt_lenfor the head segment, reclaims completed descriptors whennb_freeruns low mid-burst, and stops counting normal ring-full backpressure as stats.errors.
- 3/3 fixesGQI_QPLjumbo Tx FIFO reclaim, TSO pre-allocation space checks, malformed TSO mbuf handling, and doorbell flushing.v2:
- split v1 into three atomic Fixes patches for stable backporting
- free and count malformed TSO mbufs (pkt_len<= hlen) ingve_tx_burst_qpl()while trackingnb_sentseparately fromnb_txso an invalid TSO request cannot stall the queue at tx_pkts[0]
- use for (;;) and add the missing blank line aftergve_tx_reclaim_fifo_qpl()
Quoted 8 lines
Ryan Wolfe (3):
net/gve: clear first freed slot in bulk mbuf free net/gve: fix GQI RDA multi-seg descriptor length and clean net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbelldrivers/net/gve/gve_tx.c | 78 ++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 23 deletions(-)
Applied to next-net for 27.03 merge
Stephen Hemminger
AppliedRe: [PATCH v2 0/3] net/gve: fix GQI Tx cleanup and QPL FIFO reclaim
In reply to Ryan WolfeQuoted 20 lines · On Tue, 17 Nov 2026 09:11:41 -0500 Ryan Wolfe <[email protected]> wrote:
This series fixes three independent bugs in the GQI Tx paths of net/gve:
- 1/3 clears the first freed
sw_ringentry ingve_free_bulk_mbuf()so completed or refcounted segments do not leave stale mbuf pointers that are freed a second time on queue stop or release.
- 2/3 fixesGQI_RDAmulti-segment non-TSO packet descriptors to passdata_leninstead ofpkt_lenfor the head segment, reclaims completed descriptors whennb_freeruns low mid-burst, and stops counting normal ring-full backpressure as stats.errors.
- 3/3 fixesGQI_QPLjumbo Tx FIFO reclaim, TSO pre-allocation space checks, malformed TSO mbuf handling, and doorbell flushing.v2:
- split v1 into three atomic Fixes patches for stable backporting
- free and count malformed TSO mbufs (pkt_len<= hlen) ingve_tx_burst_qpl()while trackingnb_sentseparately fromnb_txso an invalid TSO request cannot stall the queue at tx_pkts[0]
- use for (;;) and add the missing blank line aftergve_tx_reclaim_fifo_qpl()
Quoted 8 lines
Ryan Wolfe (3):
net/gve: clear first freed slot in bulk mbuf free net/gve: fix GQI RDA multi-seg descriptor length and clean net/gve: fix GQI QPL jumbo Tx FIFO reclaim and doorbelldrivers/net/gve/gve_tx.c | 78 ++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 23 deletions(-)
Applied to next-net for 27.03 merge