Re: [PATCH net-next] eth: bnxt: report TX HW GSO queue stats
From: Narcisa Vasile
Date: Thu Nov 19 2026 - 23:48:56 EST
On Wed, Nov 18, 2026 at 08:44:00AM +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 (1) · Medium: 1 · Low: 1
>
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > index 6846a27bfef4c..1a7a93bf684ac 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > @@ -869,6 +869,11 @@ static bool __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
> > cons = NEXT_TX(cons);
> > tx_pkts++;
> > tx_bytes += skb->len;
> > + if (skb_is_gso(skb) && !tx_buf->is_sw_gso) {
> > + txr->tx_hw_gso_packets++;
> > + txr->tx_hw_gso_wire_packets +=
> > + skb_shinfo(skb)->gso_segs;
> > + }
> > tx_buf->skb = NULL;
> > tx_buf->is_ts_pkt = 0;
>
> [Severity: Medium]
> Can this over-count wire packets for GSO skbs that were sent through the
> TX push path?
>
> This block runs before the is_push early-out. It treats every completed
> skb with skb_is_gso() && !is_sw_gso as segmented by the hardware.
> However, the push path gate in bnxt_start_xmit() does not exclude GSO
> skbs:
>
> if (free_size == bp->tx_ring_size && length <= bp->tx_push_thresh &&
> skb_frags_readable(skb) && !lflags) {
>
> The push BDs never set TX_BD_FLAGS_LSO or tx_bd_mss, so the NIC sends
> the skb as a single frame.
>
> Take an idle ring with tx_push_thresh at 164 and a GSO skb of 164 bytes
> or less. Two examples are TCP with a peer-advertised MSS of 48 and 96
> bytes of payload, or UDP_SEGMENT with gso_size=8 and 80 bytes of
> payload. Either skb would be counted as 1 hw_gso_packet plus gso_segs
> hw_gso_wire_packets, even though only one frame went on the wire.
>
> tso.py reads these counters, so could this give misleading results
> there? Fixing the push path issue described below would also fix this.
>
This couldn't give misleading results there, since no GSO skb in tso.py
can be 164 bytes or less, so none can take the push path.
> [Severity: High]
> This is a pre-existing issue and was not introduced by this patch, but
> should bnxt_start_xmit() keep GSO skbs out of the push path?
>
This patch doesn't introduce the push path issue (the high severity one).
The medium severity issue is a symptom of this pre-existing high one.
Both need a GSO skb of 164 bytes or less sent on an idle TX ring to manifest.
If the preexisting push path bug is ever hit, the stats added by this patch
would cause hw_gso_wire_packets to be over-reported by gso_segs - 1 for the
skbs which take the push path.
I think this patch can be merged as is.
If it's worth fixing, the push path issue can be addressed independently
with a one line change in bnxt_start_xmit(). With that fix in place, the
stats would also report correctly, with no other change needed.
>
> --
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116204313.23023-1-narcisav.kernel%40gmail.com