Re: [net-next v6 09/12] net: bnxt: Add SW GSO completion and teardown support

From: Jakub Kicinski

Date: Mon Mar 30 2026 - 19:58:18 EST


On Thu, 26 Mar 2026 16:52:28 -0700 Joe Damato wrote:
> @@ -4645,6 +4687,10 @@ static int bnxt_init_tx_rings(struct bnxt *bp)
>
> bp->tx_wake_thresh = max_t(int, bp->tx_ring_size / 2,
> BNXT_MIN_TX_DESC_CNT);
> + if (!(bp->flags & BNXT_FLAG_UDP_GSO_CAP) &&
> + (bp->dev->features & NETIF_F_GSO_UDP_L4))
> + bp->tx_wake_thresh = max_t(int, bp->tx_wake_thresh,
> + BNXT_SW_USO_MAX_DESCS);
>
> for (i = 0; i < bp->tx_nr_rings; i++) {
> struct bnxt_tx_ring_info *txr = &bp->tx_ring[i];
> @@ -13832,6 +13878,11 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
> if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp, false))
> features &= ~NETIF_F_NTUPLE;
>
> + if ((features & NETIF_F_GSO_UDP_L4) &&
> + !(bp->flags & BNXT_FLAG_UDP_GSO_CAP) &&
> + bp->tx_ring_size < 2 * BNXT_SW_USO_MAX_DESCS)
> + features &= ~NETIF_F_GSO_UDP_L4;
> +
> if ((bp->flags & BNXT_FLAG_NO_AGG_RINGS) || bp->xdp_prog)
> features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
>
> @@ -13877,6 +13928,15 @@ static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
> int rc = 0;
> bool re_init = false;
>
> + 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?