Multi Channel DMA IP for PCI Express* Design Example User Guide

ID 683517
Date 8/04/2025
Public
Document Table of Contents

3.5.7.3.2. Avalon-ST Device-side Packet Loopback (Device-side Packet Loopback)

Complete the instructions outlined in the Prerequisites section before verifying the Device-side Packet Loopback design example variant using the following command:

$ cd p0_software/user/cli/perfq_app

$ sudo ./perfq_app -b 0000:01:00.0 -p 32768 -l 5 -i -c 2 -d 2 -a 4

Configuration:
  • BDF (-b 0000:01:00.0)
  • 2 DMA channels (-c 2)
  • Bidirectional H2D-D2H loopback (-i)
  • Payload length of 32,768 bytes in each descriptor (-p 32768)
  • Transfer the data for 5 seconds (-l 5)
  • Dump the progress log every 2 seconds (-d 2)
  • Total of four threads, with one thread per queue x 2 queues per channel x 2 channels (-a 4)
Note: This hardware test was run with the Stratix® 10 GX H-tile PCIe Gen3 x16 configuration.
Note: This hardware test was run with the Agilex™ 7 P-Tile PCIe Gen4 x16 configuration.

Custom AVST DMA Gen4 x16 : P-Tile Hardware Test Result

Metadata Test

Metadata is the 8-byte private data that the host sends to the device in the H2D direction, and the device sends to the host in the D2H direction.

  1. If you have the design example generated with the metadata option enabled, modify IFC_QDMA_META_DATA, PERFQ_LOAD_DATA, and PERFQ_PERF settings as shown below in p0_software/user/common/mk/common.mk.

    __cflags += -DIFC_QDMA_META_DATA

    __cflags += -DPERFQ_LOAD_DATA

    __cflags += -UPERFQ_PERF

  2. If the Linux kernel driver has been installed, build the driver and application by following the instructions in Build and Install the User Space Library and Build the Reference Application. Otherwise, the Linux kernel driver needs to be installed before building the driver and application.
  3. Run the metadata test using the following command:

    sudo ./perfq_app -p 128 -s 128 -d 1 -i -a 2 -b 0000:98:00.0 -v -c 1

Note: To verify the metadata functionality, every descriptor should have eof set to 1. Use the commands in such a way that every descriptor contains a single file. Use perfq_app with the -s parameter.