]> www.infradead.org Git - users/hch/misc.git/commit
dma: Provide an interface to allow allocate IOVA
authorLeon Romanovsky <leonro@nvidia.com>
Sun, 29 Oct 2023 13:49:40 +0000 (15:49 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 23 Oct 2024 16:45:08 +0000 (18:45 +0200)
commitbfef303ce917d6d8822a5c5db157530e292ceac3
treed85001dcaa85025406b4bea2ff78875caea2749c
parent1df34b2912fff31de66ccd8b34e5dbf45ab6cea3
dma: Provide an interface to allow allocate IOVA

The existing .map_page() callback provides both allocating of IOVA
and linking DMA pages. That combination works great for most of the
callers who use it in control paths, but is less effective in fast
paths where there may be multiple calls to map_page().

These advanced callers already manage their data in some sort of
database and can perform IOVA allocation in advance, leaving range
linkage operation to be in fast path.

Provide an interface to allocate/deallocate IOVA and next patch
link/unlink DMA ranges to that specific IOVA.

The API is exported from dma-iommu as it is the only implementation
supported, the namespace is clearly different from iommu_* functions
which are not allowed to be used. This code layout allows us to save
function call per API call used in datapath as well as a lot of boilerplate
code.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/iommu/dma-iommu.c
include/linux/dma-mapping.h