Subject: Re: [RFC net-next v2 00/12] Add TSO map-once DMA helpers and bnxt SW USO support

From: Joe Damato <[email-masked]>
Date: Mon, 16 Mar 2026 14:02:26 -0700

On Mon, Mar 16, 2026 at 09:44:19PM +0200, Leon Romanovsky wrote:
> On Thu, Mar 12, 2026 at 03:34:37PM -0700, Joe Damato wrote:
> > Greetings:
> > 
> > This series extends net/tso to add a data structure and some helpers allowing
> > drivers to DMA map headers and packet payloads a single time. The helpers can
> > then be used to reference slices of shared mapping for each segment. This
> > helps to avoid the cost of repeated DMA mappings, especially on systems which
> > use an IOMMU.
> 
> In modern kernels, it is done by using DMA IOVA API, see NVMe
> driver/block layer for the most comprehensive example.
> 
> The pseudo code is:
>  if (with_iommu)
>     use dma_iova_link/dma_iova_unlink
>  else
>     use dma_map_phys()
> 
> https://lore.kernel.org/all/[email-masked]/
> https://lore.kernel.org/all/[email-masked]/
> https://lwn.net/Articles/997563/

Thanks for the pointer. 

I agree it's the right approach. Batching the IOVA allocation and IOTLB sync
across all regions is a clear win over the per-region
dma_map_single/skb_frag_dma_map calls I had in v2.

I'll submit a v3 with the tso_dma_map internals updated to use
dma_iova_try_alloc + dma_iova_link + dma_iova_sync, with a
dma_map_phys fallback.