Re: [net-next v6 08/12] net: bnxt: Implement software USO

From: Jakub Kicinski

Date: Sun Mar 29 2026 - 18:20:49 EST


On Thu, 26 Mar 2026 16:52:27 -0700 Joe Damato wrote:
> + /* Upper bound on the number of descriptors needed.
> + *
> + * Each segment uses 1 long BD + 1 ext BD + payload BDs, which is
> + * at most num_segs + nr_frags (each frag boundary crossing adds at
> + * most 1 extra BD).
> + */
> + bds_needed = 3 * num_segs + skb_shinfo(skb)->nr_frags + 1;
> +
> + if (unlikely(bnxt_tx_avail(bp, txr) < bds_needed)) {
> + netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr),
> + bp->tx_wake_thresh);
> + return NETDEV_TX_BUSY;
> + }
> +
> + slots = BNXT_SW_USO_MAX_SEGS - (txr->tx_inline_prod - txr->tx_inline_cons);
> +
> + if (unlikely(slots < num_segs)) {
> + netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr),

This looks sus, try_stop() will evaluate the bnxt_tx_avail(bp, txr)
and leave the ring running.

> + bp->tx_wake_thresh);

Is tx_wake_thresh larger than the max USO even for smallest ring size?