Re: [net-next v6 09/12] net: bnxt: Add SW GSO completion and teardown support
From: Jakub Kicinski
Date: Tue Mar 31 2026 - 21:04:10 EST
On Tue, 31 Mar 2026 14:14:09 -0700 Joe Damato wrote:
> > > + if (!(bp->flags & BNXT_FLAG_UDP_GSO_CAP)) {
> > > + if (features & NETIF_F_GSO_UDP_L4)
> > > + bp->tx_wake_thresh = max_t(int, bp->tx_wake_thresh,
> > > + BNXT_SW_USO_MAX_DESCS);
> > > + else
> > > + bp->tx_wake_thresh = max_t(int, bp->tx_ring_size / 2,
> > > + BNXT_MIN_TX_DESC_CNT);
> >
> > Adding extra handling for min ring size all over the place looks a bit
> > messy. Can you factor something out of this logic?
>
> Could add something like:
>
> static int bnxt_min_tx_desc_cnt(struct bnxt *bp)
> {
> if (!(bp->flags & BNXT_FLAG_UDP_GSO_CAP) &&
> (bp->dev->features & NETIF_F_GSO_UDP_L4))
> return BNXT_SW_USO_MAX_DESCS;
> return BNXT_MIN_TX_DESC_CNT;
> }
>
> and then when setting the tx_wake_thresh, it becomes:
>
> bp->tx_wake_thresh = max_t(int, bp->tx_ring_size / 2,
> bnxt_min_tx_desc_cnt(bp));
>
> and fix_features can use the same helper.
Something along these lines looks reasonable.
> Question then is just do we still want to bump BNXT_MIN_TX_DESC_CNT (as per
> your previous comment)?
No, sorry, I sent that one before looking at the relevant part of
the diffs