linux-stable/kernel/dma
John Garry f3e7d9471c dma-mapping: add dma_opt_mapping_size()
[ Upstream commit a229cc14f3 ]

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: John Garry <john.garry@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stable-dep-of: afc5aa46ed ("iommu/dma: Force swiotlb_max_mapping_size on an untrusted device")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:18:47 +02:00
..
Kconfig Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-09-03 10:34:44 -07:00
Makefile
coherent.c dma-mapping: clear dev->dma_mem to NULL after freeing it 2024-01-25 14:52:38 -08:00
contiguous.c
debug.c dma-debug: don't call __dma_entry_alloc_check_leak() under free_entries_lock 2023-10-06 13:18:14 +02:00
debug.h dma-debug: teach add_dma_entry() about DMA_ATTR_SKIP_CPU_SYNC 2021-10-18 12:46:45 +02:00
direct.c dma-direct: use the correct size for dma_set_encrypted() 2022-06-29 09:03:31 +02:00
direct.h dma-direct: avoid redundant memory sync for swiotlb 2022-04-20 09:34:21 +02:00
dummy.c dma-mapping: return error code from dma_dummy_map_sg() 2021-08-09 17:13:06 +02:00
map_benchmark.c dma-mapping: benchmark: Add support for multi-pages map/unmap 2021-04-02 16:41:08 +02:00
mapping.c dma-mapping: add dma_opt_mapping_size() 2024-04-10 16:18:47 +02:00
ops_helpers.c dma-mapping: handle vmalloc addresses in dma_common_{mmap,get_sgtable} 2021-07-16 11:30:26 +02:00
pool.c dma/pool: create dma atomic pool only if dma zone has managed pages 2022-01-27 11:03:00 +01:00
remap.c dma-remap: use kvmalloc_array/kvfree for larger dma memory remap 2023-08-26 14:23:22 +02:00
swiotlb.c swiotlb: Fix alignment checks when both allocation and DMA masks are present 2024-04-10 16:18:47 +02:00