4.3.4. 测试指南

4.3.4.1. 测试环境

4.3.4.1.1. 硬件

  • 开发板

4.3.4.1.2. 软件

  • PC端的串口终端软件,用于PC和开发板进行串口通信

  • Linux内核原生的dmatest模块

4.3.4.1.3. 软件配置

4.3.4.1.3.1. dmttest

dmatest是 Linux 内核中原生的一个模块,参考快速入门 - 编译概述 - Kernel配置,按如下选择:

Linux
    Device Drivers
        [*] DMA Engine support
             <*>   DMA Test client

备注

dmatest模块只限于测试 Mem To Mem 的数据传输操作。

4.3.4.2. dmatest 测试

dmatest模块初始化成功后,会在Sysfs目录创建一些节点,测试过程就是通过这些节点配置参数、启动测试。

[aic@] # cd /sys/module/dmatest/parameters/
[aic@parameters] # ls
alignment         max_channels      run               transfer_size
channel           norandom          test_buf_size     verbose
device            noverify          test_list         wait
dmatest           polled            threads_per_chan  xor_sources
iterations        pq_sources        timeout

[aic@parameters] # echo 30 > iterations
[aic@parameters] # echo 8 > max_channels
[aic@parameters] # echo Y > polled
[aic@parameters] # echo Y > run
[  104.696480] dmatest: No channels configured, continue with any
[  104.697377] dmatest: Added 1 threads using dma0chan2
[  104.698061] dmatest: Added 1 threads using dma0chan3
[  104.698695] dmatest: Added 1 threads using dma0chan4
[  104.699334] dmatest: Added 1 threads using dma0chan5
[  104.699964] dmatest: Added 1 threads using dma0chan6
[  104.700599] dmatest: Added 1 threads using dma0chan7
[  104.701248] dmatest: Added 1 threads using dma0chan8
[  104.701883] dmatest: Added 1 threads using dma0chan9
[  104.702328] dmatest: Started 1 threads using dma0chan2
[  104.702776] dmatest: Started 1 threads using dma0chan3
[  104.703223] dmatest: Started 1 threads using dma0chan4
[  104.703671] dmatest: Started 1 threads using dma0chan5
[  104.704118] dmatest: Started 1 threads using dma0chan6
[  104.704564] dmatest: Started 1 threads using dma0chan7
[  104.705011] dmatest: Started 1 threads using dma0chan8
[  104.705457] dmatest: Started 1 threads using dma0chan9
[  105.006038] dmatest: dma0chan4-copy0: summary 30 tests, 0 failures 106.28 iops 836 KB/s (0)
[  105.306046] dmatest: dma0chan2-copy0: summary 30 tests, 0 failures 106.58 iops 884 KB/s (0)
[  105.606055] dmatest: dma0chan3-copy0: summary 30 tests, 0 failures 106.60 iops 1044 KB/s (0)
[  105.906057] dmatest: dma0chan5-copy0: summary 30 tests, 0 failures 106.59 iops 835 KB/s (0)
[  106.206050] dmatest: dma0chan6-copy0: summary 30 tests, 0 failures 106.59 iops 792 KB/s (0)
[  106.506034] dmatest: dma0chan7-copy0: summary 30 tests, 0 failures 106.61 iops 856 KB/s (0)
[  106.806048] dmatest: dma0chan8-copy0: summary 30 tests, 0 failures 107.64 iops 843 KB/s (0)
[  107.106044] dmatest: dma0chan9-copy0: summary 30 tests, 0 failures 106.81 iops 993 KB/s (0)