summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/dma
diff options
context:
space:
mode:
authorBarry Song <song.bao.hua@hisilicon.com>2020-11-16 09:08:47 +0300
committerChristoph Hellwig <hch@lst.de>2020-11-27 12:33:42 +0300
commit65789daa8087e125927230ccb7e1eab13999b0cf (patch)
tree86351d7870a8879dd702b1a801a3c97fce08a083 /tools/testing/selftests/dma
parent819b70ad620119d21a9e4be6ad665ece26fc0db8 (diff)
downloadlinux-65789daa8087e125927230ccb7e1eab13999b0cf.tar.xz
dma-mapping: add benchmark support for streaming DMA APIs
Nowadays, there are increasing requirements to benchmark the performance of dma_map and dma_unmap particually while the device is attached to an IOMMU. This patch enables the support. Users can run specified number of threads to do dma_map_page and dma_unmap_page on a specific NUMA node with the specified duration. Then dma_map_benchmark will calculate the average latency for map and unmap. A difficulity for this benchmark is that dma_map/unmap APIs must run on a particular device. Each device might have different backend of IOMMU or non-IOMMU. So we use the driver_override to bind dma_map_benchmark to a particual device by: For platform devices: echo dma_map_benchmark > /sys/bus/platform/devices/xxx/driver_override echo xxx > /sys/bus/platform/drivers/xxx/unbind echo xxx > /sys/bus/platform/drivers/dma_map_benchmark/bind For PCI devices: echo dma_map_benchmark > /sys/bus/pci/devices/0000:00:01.0/driver_override echo 0000:00:01.0 > /sys/bus/pci/drivers/xxx/unbind echo 0000:00:01.0 > /sys/bus/pci/drivers/dma_map_benchmark/bind Cc: Will Deacon <will@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com> [hch: folded in two fixes from Colin Ian King <colin.king@canonical.com>] Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'tools/testing/selftests/dma')
0 files changed, 0 insertions, 0 deletions