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

ID 683517
Date 9/15/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

3.5.2.4.1.3. Install and Build Testpmd

  1. Download dpdk and apply the build patches.

    Execute the following commands with root as user.

    $ cd software/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. In case to Avoid Tx drop count in drivers/net/mcdma/rte_pmd_mcdma.h, by default it is disabled. Skip this step for loopback.

    #undef IFC_BUF_REUSE

    Define Avoid Tx drop count in drivers/net/mcdma/rte_pmd_mcdma.h. By default, it is disabled.

    #define AVOID_TX_DROP_COUNT

  5. Build DPDK and install.

    Execute the following steps:

    $ export DPDK_DIR= <cloned dir>/software/dpdk/patches/v20.05-rc1/dpdk

    $ export RTE_SDK=${DPDK_DIR}

    $ export DPDK_TARGET=x86_64-native-linuxapp-gcc

    $ export RTE_TARGET=x86_64-native-linuxapp-gcc

    $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET

    $ make config T=x86_64-native-linuxapp-gcc

    $ rm -rf x86_64-native-linuxapp-gcc

    $ make -j 32 install T=$DPDK_TARGET DESTDIR=install

  6. Install the UIO base module.

    $ modprobe uio

  7. Install the igb_uio module.

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

  8. 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

  9. 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 Intel® Stratix® 10 GX H-tile PCIe Gen3 x16 configuration.