]> git.baikalelectronics.ru Git - kernel.git/commit
dma-iommu: add iommu_dma_opt_mapping_size()
authorJohn Garry <john.garry@huawei.com>
Thu, 14 Jul 2022 11:15:25 +0000 (19:15 +0800)
committerChristoph Hellwig <hch@lst.de>
Tue, 19 Jul 2022 04:05:45 +0000 (06:05 +0200)
commitfa26a9a17179d382b6cc81086f7f3775ec4e658d
treeabaca6c6f44208643e0c36705199c3ff9ff0dc80
parentd81a557408d0f5f2538cce985c8f25929a5f3c62
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>
drivers/iommu/dma-iommu.c
drivers/iommu/iova.c
include/linux/iova.h