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

From: Leon Romanovsky

Date: Mon Mar 16 2026 - 15:44:40 EST


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/cover.1746424934.git.leon@xxxxxxxxxx/
https://lore.kernel.org/all/20250623141259.76767-1-hch@xxxxxx/
https://lwn.net/Articles/997563/

Thanks