[PATCH v2 0/3] net/gve: fix GQI Tx cleanup and QPL FIFO reclaim
Stephen Hemminger
stephen at networkplumber.org
Thu Nov 19 01:00:09 CET 2026
On Tue, 17 Nov 2026 09:11:41 -0500
Ryan Wolfe <rnwolfe at google.com> wrote:
> This 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()
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.
More information about the dev
mailing list