summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorQinxin Xia <xiaqinxin@huawei.com>2026-02-25 17:37:59 +0800
committerMarek Szyprowski <m.szyprowski@samsung.com>2026-03-04 11:22:05 +0100
commita8d14dd6e621f47344d0eda72f7ce9203bdef4f1 (patch)
treefc6d156a9688dfe3e9d92d55e880579e41259c25 /include
parent9cc60ec453fe5d58d4faa70829814769a8af24d4 (diff)
dma-mapping: benchmark: add support for dma_map_sg
Support for dma scatter-gather mapping and is intended for testing mapping performance. It achieves by introducing the dma_sg_map_param structure and related functions, which enable the implementation of scatter-gather mapping preparation, mapping, and unmapping operations. Additionally, the dma_map_benchmark_ops array is updated to include operations for scatter-gather mapping. This commit aims to provide a wider range of mapping performance test to cater to different scenarios. Reviewed-by: Barry Song <baohua@kernel.org> Signed-off-by: Qinxin Xia <xiaqinxin@huawei.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20260225093800.3625054-3-xiaqinxin@huawei.com
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/map_benchmark.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/uapi/linux/map_benchmark.h b/include/uapi/linux/map_benchmark.h
index e076748f2120..4b17829a9f17 100644
--- a/include/uapi/linux/map_benchmark.h
+++ b/include/uapi/linux/map_benchmark.h
@@ -19,6 +19,7 @@
enum {
DMA_MAP_BENCH_SINGLE_MODE,
+ DMA_MAP_BENCH_SG_MODE,
DMA_MAP_BENCH_MODE_MAX
};
@@ -33,7 +34,9 @@ struct map_benchmark {
__u32 dma_bits; /* DMA addressing capability */
__u32 dma_dir; /* DMA data direction */
__u32 dma_trans_ns; /* time for DMA transmission in ns */
- __u32 granule; /* how many PAGE_SIZE will do map/unmap once a time */
+ __u32 granule; /* - SINGLE_MODE: number of pages mapped/unmapped per operation
+ * - SG_MODE: number of scatterlist entries (each maps one page)
+ */
__u8 map_mode; /* the mode of dma map */
__u8 expansion[75]; /* For future use */
};