Commit f3e7d947 authored by John Garry's avatar John Garry Committed by Greg Kroah-Hartman
Browse files

dma-mapping: add dma_opt_mapping_size()



[ Upstream commit a229cc14 ]

Streaming DMA mapping involving an IOMMU may be much slower for larger
total mapping size. This is because every IOMMU DMA mapping requires an
IOVA to be allocated and freed. IOVA sizes above a certain limit are not
cached, which can have a big impact on DMA mapping performance.

Provide an API for device drivers to know this "optimal" limit, such that
they may try to produce mapping which don't exceed it.

Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Stable-dep-of: afc5aa46 ("iommu/dma: Force swiotlb_max_mapping_size on an untrusted device")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 685e8332
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment