<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel/dma/map_benchmark.c, branch v5.11-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>dma-mapping: add benchmark support for streaming DMA APIs</title>
<updated>2020-11-27T09:33:42+00:00</updated>
<author>
<name>Barry Song</name>
<email>song.bao.hua@hisilicon.com</email>
</author>
<published>2020-11-16T06:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=65789daa8087e125927230ccb7e1eab13999b0cf'/>
<id>65789daa8087e125927230ccb7e1eab13999b0cf</id>
<content type='text'>
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 &gt; /sys/bus/platform/devices/xxx/driver_override
echo xxx &gt; /sys/bus/platform/drivers/xxx/unbind
echo xxx &gt; /sys/bus/platform/drivers/dma_map_benchmark/bind

For PCI devices:
echo dma_map_benchmark &gt; /sys/bus/pci/devices/0000:00:01.0/driver_override
echo 0000:00:01.0 &gt; /sys/bus/pci/drivers/xxx/unbind
echo 0000:00:01.0 &gt; /sys/bus/pci/drivers/dma_map_benchmark/bind

Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Signed-off-by: Barry Song &lt;song.bao.hua@hisilicon.com&gt;
[hch: folded in two fixes from Colin Ian King &lt;colin.king@canonical.com&gt;]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &gt; /sys/bus/platform/devices/xxx/driver_override
echo xxx &gt; /sys/bus/platform/drivers/xxx/unbind
echo xxx &gt; /sys/bus/platform/drivers/dma_map_benchmark/bind

For PCI devices:
echo dma_map_benchmark &gt; /sys/bus/pci/devices/0000:00:01.0/driver_override
echo 0000:00:01.0 &gt; /sys/bus/pci/drivers/xxx/unbind
echo 0000:00:01.0 &gt; /sys/bus/pci/drivers/dma_map_benchmark/bind

Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Signed-off-by: Barry Song &lt;song.bao.hua@hisilicon.com&gt;
[hch: folded in two fixes from Colin Ian King &lt;colin.king@canonical.com&gt;]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
