summaryrefslogtreecommitdiff
path: root/include/linux/iova.h
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2022-07-14 14:15:25 +0300
committerChristoph Hellwig <hch@lst.de>2022-07-19 07:05:45 +0300
commit6d9870b7e5def2450e21316515b9efc0529204dd (patch)
treeabaca6c6f44208643e0c36705199c3ff9ff0dc80 /include/linux/iova.h
parenta229cc14f3395311b899e5e582b71efa8dd01df0 (diff)
downloadlinux-6d9870b7e5def2450e21316515b9efc0529204dd.tar.xz
dma-iommu: add iommu_dma_opt_mapping_size()
Add the IOMMU callback for DMA mapping API dma_opt_mapping_size(), which allows the drivers to know the optimal mapping limit and thus limit the requested IOVA lengths. This value is based on the IOVA rcache range limit, as IOVAs allocated above this limit must always be newly allocated, which may be quite slow. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Acked-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/iova.h')
-rw-r--r--include/linux/iova.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/iova.h b/include/linux/iova.h
index 320a70e40233..c6ba6d95d79c 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -79,6 +79,8 @@ static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova)
int iova_cache_get(void);
void iova_cache_put(void);
+unsigned long iova_rcache_range(void);
+
void free_iova(struct iova_domain *iovad, unsigned long pfn);
void __free_iova(struct iova_domain *iovad, struct iova *iova);
struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size,