8. CLI Usage Examples
This section provides side-by-side command-line examples for the most common DMA operations, showing how each userspace application is invoked in QDMA vs. MDB5 DMA.
C2H (Card-to-Host) maps to the read direction, and H2C (Host-to-Card) maps to the write direction. In MDB5 DMA, the direction flag -d uses read/write accordingly.
QDMA and MDB5 DMA userspace applications share the same binary names and many of the same flag letters, but several flags have different meanings. Refer to the Flag Differences section for details.
Flag Differences Between QDMA and MDB5 DMA userspace applications
The following table provides a comprehensive flag-by-flag comparison across both the userspace applications. The same option can carry different meanings depending on the userspace application.
| Flag | Application(s) | QDMA | MDB5 DMA |
|---|---|---|---|
-d |
dma-to-device dma-from-device |
--device: device node path
(e.g., /dev/qdma06000-MM-0) |
Not available. |
| dma-ctl | Not available. | --dir: channel direction
(read / write) |
|
-c |
dma-to-device dma-from-device |
--count: number of transfer iterations
(default: 1) |
--channel: channel index (0-7). |
| dma-ctl | Not available. | --channel: channel index (0-7). |
|
-f |
dma-to-device dma-from-device |
--file: data file,
input (dma-to-device) or output (dma-from-device) |
--data_input_file: input file
(dma-to-device only, required). |
-w |
dma-to-device dma-from-device |
--data outfile: output / verification
file. dma-to-device only |
--data_output_file: output file.
Available in both dma-to-device (optional
verification) and dma-from-device (primary output) |
-a |
dma-to-device dma-from-device |
--address: AXI bus starting address. |
--address: device memory address |
| dma-ctl | Not available. | --set_aperture_sz: set aperture window
size. Requires -c and -d |
|
-s |
dma-to-device dma-from-device |
--size: transfer size in bytes |
--size: transfer size in bytes |
| dma-ctl | Not available. | --bdf: PCI Bus:Device.Function in hex
(BB:DD.F). |
|
-o |
dma-to-device dma-from-device |
--offset: page offset of transfer |
--offset: page offset of transfer |
-m |
dma-ctl | Not available | --set_transfer_mode: simple or sg
(Scatter-Gather). |
-M |
dma-ctl | Not available. | --get_transfer_mode: get current transfer
mode. |
-S |
dma-ctl | Not available. | --stats: channel statistics (transfer
counts, success/failure rates, data processed). |
-A |
dma-ctl | Not available. | --get_aperture_sz: get current aperture
window size. |
-r |
dma-ctl | Not available. | --reg_read: register offset to read.
Used with -s (BDF) |
For the complete list of options, see the MDB5 DMA User Applications reference and the QDMA User Guide.
8.1 C2H Transfer (dma-from-device)
| QDMA | MDB5 DMA |
|---|---|
Options:
|
Options:
|
8.2 H2C Transfer (dma-to-device)
| QDMA | MDB5 DMA |
|---|---|
Options:
|
Options:
|
8.3 Register Read/Write (dma-ctl)
| QDMA | MDB5 DMA |
|---|---|
Syntax:
|
Options:
|
8.4 Channel/Queue Management (dma-ctl)
| QDMA | MDB5 DMA |
|---|---|
Key difference: QDMA requires explicit queue lifecycle management via netlink commands. |
Options:
Key difference: No queue lifecycle — channels are always available. Configuration is done via ioctl. |
8.5 Transfer test config based (dma-xfer)
Both userspace applications use a configuration file. QDMA's config specifies queue parameters and netlink-based queue setup; MDB5 DMA's config specifies channel parameters and transfer mode.
| QDMA | MDB5 DMA |
|---|---|
Sample config (qdma_xfer_config.txt): |
Sample config (mdb5_dma_xfer_config.txt): |
8.6 Performance Testing (dma-perf)
Both performance userspace applications are config-file driven and measure sustained DMA throughput over a specified runtime.
| QDMA | MDB5 DMA |
|---|---|
Sample config (qdma_perf_config.txt): |
Sample config (mdb5_dma_perf_config.txt): |