History

dma-mapping: benchmark: modify the framework to adapt to more map modes

This patch adjusts the DMA map benchmark framework to make the DMA map benchmark framework more flexible and adaptable to other mapping modes in the future. By abstracting the framework into five interfaces: prepare, unprepare, initialize_data, do_map, and do_unmap. The new map schema can be introduced more easily without major modifications to the existing code structure.

Qinxin Xia committed 8 months ago

Commit 9cc60ec1 parent 6de23f82 files · +115 −24Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/map_benchmark.h+7−1
@@ -17,6 +17,11 @@ · 16 unmodified lines
17#define DMA_MAP_TO_DEVICE 117#define DMA_MAP_TO_DEVICE 1
18#define DMA_MAP_FROM_DEVICE 218#define DMA_MAP_FROM_DEVICE 2
19 19
20enum {
21 DMA_MAP_BENCH_SINGLE_MODE,
22 DMA_MAP_BENCH_MODE_MAX
23};
24
20struct map_benchmark {25struct map_benchmark {
21 __u64 avg_map_100ns; /* average map latency in 100ns */26 __u64 avg_map_100ns; /* average map latency in 100ns */
22 __u64 map_stddev; /* standard deviation of map latency */27 __u64 map_stddev; /* standard deviation of map latency */
@@ -29,7 +34,8 @@ struct map_benchmark { · 6 unmodified lines
29 __u32 dma_dir; /* DMA data direction */34 __u32 dma_dir; /* DMA data direction */
30 __u32 dma_trans_ns; /* time for DMA transmission in ns */35 __u32 dma_trans_ns; /* time for DMA transmission in ns */
31 __u32 granule; /* how many PAGE_SIZE will do map/unmap once a time */36 __u32 granule; /* how many PAGE_SIZE will do map/unmap once a time */
32 __u8 expansion[76]; /* For future use */37 __u8 map_mode; /* the mode of dma map */
38 __u8 expansion[75]; /* For future use */
33};39};
34 40
35#endif /* _UAPI_DMA_BENCHMARK_H */41#endif /* _UAPI_DMA_BENCHMARK_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t