Re: [PATCH net-next v4 4/5] net: devmem: size TX net_iovs from the dmabuf sg table

From: Breno Leitao

Date: Fri Nov 13 2026 - 07:50:06 EST


On Wed, Nov 11, 2026 at 02:47:39PM -0800, Stanislav Fomichev wrote:
> PAGE_SIZE TX net_iovs cap devmem skbs at MAX_SKB_FRAGS pages (~68KB),
> which makes BIG TCP ineffective.
>
> TX net_iovs only need to be DMA contiguous. Use the largest power of 2,
> from PAGE_SIZE up to 2MB, which aligns every DMA segment of the dmabuf:
> - 2MB hugepage-backed udmabufs get 2MB net_iovs
> - no UAPI change, TX addresses are dmabuf offsets
> - skbs keep their size, only the frags get larger
>
> The net_iov size doesn't depend on the device. A frag is never larger
> than its skb, and the skb is never larger than the device's
> gso_max_size. TCP sizes skbs to fit, and validate_xmit_skb() segments
> bigger ones. gso_max_size is 64KB unless BIG TCP is enabled. With BIG
> TCP, page frags can already be 64KB or larger, for example with
> MSG_ZEROCOPY from huge pages or with 64KB pages. So drivers that
> enable BIG TCP already have to handle them. bnxt doesn't handle them
> yet. It has a 16-bit BD length and needs a separate fix.
>
> Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>
> Reviewed-by: Mina Almasry <almasrymina@xxxxxxxxxx>
> Reviewed-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>

Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>