NetXtreme-UG100
54
NetXtreme-C/NetXtreme-E
User Guide
16 DPDK – Configuration and Use Case Examples
The testpmd application can be used to test the DPDK in a packet forwarding mode and also to access NIC hardware
features such as Flow Director. It also serves as an example of how to build a more fully-featured application using the DPDK
SDK. The below chapters shows how to build and run the testpmd application and how to configure the application from the
command line and the run-time environment.
16.1 Compiling the Application
To compile the application:
1. Set the required environmental variables and go to the source code with the following commands:
cd /Linux/Linux_DPDK
tar zxvf dpdk-*.gz
cd dpdk-*
make config T=x86_64-native-linuxapp-gcc && make
2. Allocate system resources and attach the UIO module with the following commands:
mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
echo 2048 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 2048 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
modprobe uio
insmod ./build/kmod/igb_uio.ko
3. Bind the device with the following command:
usertools/dpdk-devbind.py -b igb_uio 3b:00.0
4. The PCI device information is displayed by lspci with the following commands:
[root@localhost /]# lspci |grep Eth
3b:00.0 Ethernet controller: Broadcom Limited BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet
Controller (rev 01)
3b:00.1 Ethernet controller: Broadcom Limited BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet
Controller (rev 01)
16.2 Running the Application
To run the application, execute the following command:
build/app/testpmd -l 0,1,2,3,4,5,6,7,8 -- -i --nb-ports=1 --nb-cores=8 --txq=2 --rxq=2
Options for this example:
-l – CORELIST List of cores to run.
-i – Interactive Run testpmd in interactive mode.
--nb-cores=N – Sets the number of forwarding cores.
--nb-ports=N – Sets the number of forwarding ports.
--rxq=N – Sets the number of RX queues per port to N.
--txq=N – Sets the number of TX queues per port to N.