Re: [PATCH net-next v2 2/2] bnxt_en: Pad short SW USO segments to BNXT_MIN_PKT_SIZE
From: Joe Damato
Date: Mon Oct 12 2026 - 17:31:26 EST
On Fri, Oct 09, 2026 at 02:54:24PM -0700, Joe Damato wrote:
> Each SW USO segment is hdr_len + seg_payload bytes. With IPv4, hdr_len
> is 42 bytes, so a segment carrying less than 10 bytes of UDP payload is
> sent shorter than BNXT_MIN_PKT_SIZE. This happens with a short last
> segment (e.g. gso_size 1400 and 1405 bytes of payload) or with a
> gso_size below 10 bytes.
[...]
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c
> index ef04c9d08066..80d5c4f963a9 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c
> @@ -82,11 +82,19 @@ int bnxt_sw_udp_gso_xmit(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
> if (unlikely(num_segs <= 1))
> goto drop;
>
> + /* bnxt_features_check() makes the stack segment these, but paths
> + * that skip validate_xmit_skb() (e.g. generic XDP_TX of a GRO'd
> + * skb) can still get here. Padding every segment would need more
> + * BDs than bds_needed reserves below, so drop instead.
> + */
> + if (unlikely(bnxt_sw_gso_pad_len(hdr_len, mss)))
> + goto drop;
> +
I could be wrong, but I think if [1] is applied this drop can go away (?)
[1]: https://lore.kernel.org/netdev/20260928223648.2739371-6-kuba@xxxxxxxxxx/