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

ID 683517
Date 7/30/2024
Public
Document Table of Contents

3.5.2.4.1.3. Install and Build Testpmd

Note: test-pmd is supported only for CentOS and not for Ubuntu.
If testing the MCDMA by using test-pmd, use the following steps; otherwise, if using perfq_app, skip to Install PMD and Test Application (for CentOS):
  1. Download dpdk and apply the build patches.

    Execute the following commands with root as user.

    $ cd software/dpdk/dpdk/patches/v20.05-rc1

    $ sh apply-patch.sh

  2. Enable IGB_UIO module in build configuration.
    Update the following macro in ./config/common_base to “y”. By default, igb_uio is disabled.
    CONFIG_RTE_EAL_IGB_UIO=y
  3. Enable the below macro for channels more than 16:
    CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=128
  4. Undefine IFC_BUF_REUSE macro for Testpmd in drivers/net/mcdma/rte_pmd_mcdma.h, by default it is enabled.
    #undef IFC_BUF_REUSE
  5. In case to avoid Tx drop count, enable the following macro in the file: drivers/net/mcdma/rte_pmd_mcdma.h.
    This is applicable for pkt-gen only. Skip this step for loopback.
    #define AVOID_TX_DROP_COUNT
  6. Build DPDK and install.
    Execute the following steps:
    1. $ export DPDK_DIR= <cloned dir>/software/dpdk/patches/v20.05-rc1/dpdk
    2. $ export RTE_SDK=${DPDK_DIR}
    3. $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
    4. $ export RTE_TARGET=x86_64-native-linuxapp-gcc
    5. $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
    6. $ make config T=x86_64-native-linuxapp-gcc
    7. $ rm -rf x86_64-native-linuxapp-gcc
    8. $ make -j32 install T=$DPDK_TARGET DESTDIR=install
  7. Install the UIO base module.

    $ modprobe uio

  8. Install the igb_uio module.

    $ insmod x86_64-native-linuxapp-gcc/build/kernel/linux/igb_uio/igb_uio.ko

  9. Bind the device to the igb_uio driver.

    $ ./usertools/dpdk-devbind.py -b igb_uio <BDF>

    For example:

    $ ./usertools/dpdk-devbind.py -b igb_uio 01:00.0

  10. Run Testpmd cli.
No. of Queue Test PMD Command Line (Loop Mode)
1
./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4 -w 0000:01:00.0 -- --tx-first\
 --nb-cores=1 --rxq=1 --txq=1 --rxd=512 --txd=512--max-pkt-len=<payload len> --no-flush-rx\
 --stats-period 1 --burst=127 --txpkts=<payload len>
2
./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4 -w 0000:01:00.0 -- --tx-first\
 --nb-cores=2 --rxq=2 --txq=2 --rxd=512 --txd=512 --max-pkt-len=<payload len> --no-flush-rx\
 --stats-period 1 –burst=254 --txpkts=<payload len>
3
./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4 -w 0000:01:00.0 -- --tx-first\
 --nb-cores=3 --rxq=3 --txq=3 --rxd=512 --txd=512 --max-pkt-len=64 --no-flush-rx\
 --stats-period 1 --burst=508 --txpkts=<payload len>
4
./x86_64-native-linuxapp-gcc/app/testpmd -c ff -n 4 -w 0000:01:00.0 -- --tx-first\
 --nb-cores=4 --rxq=4 --txq=4 --rxd=512 --txd=512 --max-pkt-len=64 --no-flush-rx\
 --stats-period 1 --burst=127 --txpkts=<payload len>
8
./x86_64-native-linuxapp-gcc/app/testpmd -c fff -n 4 -w 0000:01:00.0 -- --tx-first\
 --nb-cores=8 --rxq=8 --txq=8 --rxd=512 --txd=512 --max-pkt-len=<payload len> --no-flush-rx\
 --stats-period 1 --burst=127 --txpkts=<payload len>
Forwarding Mode Test PMD Command Line
Only Rx Mode
./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4 -w 0000:01:00.0 --\
 --forward-mode=rxonly --nb-cores=1 --rxq=1 --txq=1 --rxd=512 --txd=512 --max-pkt-len=<payload len>\
 --no-flush-rx --stats-period 1 --burst=127 --txpkts=<payload len>
Only Tx Mode
./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4 -w 0000:01:00.0 --\
 --forward-mode=txonly --nb-cores=1 --rxq=1 --txq=1 --rxd=512 --txd=512 --max-pkt-len=<payload len>\
 --no-flush-rx --stats-period 1 --burst=254 --txpkts=<payload len>
Note: --burst=0 : If set to 0, driver default is used (i.e. 16 burst-size). Otherwise, the Test PMD default burst size (i.e. 32) is used. The default Testpmd pkt-len, in the case of Tx, is 64.

Use the following command to run test-pmd:

$./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4 -w
0000:01:00.0 -- --tx-first --nb-cores=1 --rxq=1 --txq=1 --rxd=512
--txd=512 --max-pkt-len=64 --no-flush-rx --stats-period 1 --
burst=127 --txpkts=64
Parameters used:
  1. BDF of device. (-w 0000:01:00.0)
  2. Forwarding mode (--tx-first)
  3. Number of cores (--nb-cores=1)
  4. Number of RX and TX queues per port (--rxq=1 --txq=1)
  5. Number of descriptors in the RX and TX rings (--rxd=512 --txd=512)
  6. Max packet length (max-pkt-len=64)
  7. Display statistics every PERIOD seconds (--stats-period 1)
  8. Number of packets per burst (--burst=127)
Note: This hardware test was run with the Stratix® 10 GX H-tile PCIe Gen3 x16 configuration.
Note: Hardware test with P-Tile Gen4 x16 may be added in a future release.