Data Plane Development Kit
The Intel Data Plane Development Kit (DPDK) is a set of user-space
libraries and drivers that provides a programming framework for high-speed
packet processing applications. The DPDK includes a number of Poll Mode
Drivers that enable direct packet transfer between the physical NIC and
user-space without using interrupts, bypassing the Linux kernel network
stack entirely.
In order to take advantage of DPDK, Linux huge
pages must be enabled in the system. The allocation of huge pages
should preferably be done at boot time by passing parameters on the kernel
command line. Add the following to the kernel boot parameters:
default_hugepagesz=1GB hugepagesz=1GB hugepages=8 hugepagesz=2M hugepages=2048
For DPDK documentation, see http://dpdk.org/doc/guides-17.02/index.html
Pktgen
In addition to DPDK, Enea NFV Access Platform includes Pktgen, a
software traffic generator that is powered by the DPDK packet processing
framework. Pktgen can act as a transmitter or receiver and is capable of
generating 10Gbit wire rate traffic with 64 byte frames.
Pktgen is installed in /usr/share/apps/pktgen/
and needs to be executed from this directory.
For Pktgen documentation, see http://pktgen-dpdk.readthedocs.io
DPDK setup instructions
The following setup instructions apply to both host and
guest.
To make the hugepage memory available for DPDK, it must be
mounted:
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
Load the DPDK igb_uio kernel module:
modprobe igb_uio
Bind the device to the igb_uio driver:
dpdk-devbind --bind=igb_uio <PCI device number>The
DPDK provides the dpdk-devbind tool to help binding/unbinding devices
from specific drivers. See http://dpdk.org/doc/guides-17.02/tools/devbind.html
for more information.
To print the current status of all known network
interfaces:dpdk-devbind --status
At this point the system is ready to run DPDK applications.
DPDK example test setup
This is a simple DPDK test setup using two boards connected
back-to-back. One board generates traffic using the Pktgen application,
and the other board runs the DPDK testpmd example to forward packets back
on the same interface.
Pktgen [DPDK] - Board 1 PHY <--> Board 2 PHY - [DPDK] testpmd
Setup DPDK on both boards, following the instructions in
[FIXME]:
On board 1, start the Pktgen application:
cd /usr/share/apps/pktgen/./pktgen -c 0x7 -n 4 --socket-mem 1024 -- -P -m "[1:2].0"
In the Pktgen console, run:
start 0
The Pktgen output will display the traffic configuration and
statistics.
On board 2, start the testpmd application:
testpmd -c 0x7 -n 4 -- --txd=512 --rxd=512 --port-topology=chained
For more information, refer to the testpmd application user
guide: http://dpdk.org/doc/guides-17.02/testpmd_app_ug/index.html.