Build a dpdk development environment in centos 7
Environment: Centos 7, dpdk 16.04
Virtual Machine Software: VMWare WorkStation 10.0.1 build-1379776
CPU: 4 CPUs, one core for each CPU
Memory: 2 GB
NIC: intel Nic * 2, used for dpdk testing; another Nic is used to communicate with the host system (this must be noted)
1. Compile dpdk
Cd dpdk16.04
Make config T = x86_64-native-linuxapp-gcc
Make
After this method is compiled, a build directory is generated,
Various folders:
App: test programs, such as test and testpmd
Lib: Library File
Include: header file
Kmod: compiled modules. After compilation, I have igb_uio.ko and rte_kni.ko.
2. Load the system's UIO driver and the newly generated dpdk igb_uio driver
Modprobe uio
Insmod build/kmod/igb_uio.ko
3. allocate large page memory
mkdir -p /mnt/hugemount -t hugetblfs nodev /mnt/hugeecho 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
4. unbind the driver of the NIC to be used
Because the driver used by the NIC is automatically loaded when the system starts, you must first unbind the driver from the specified network port. When you bind an Eni
You can use./tools/dpdk_nic_bind.py-usage to view how to use the script. The main usage is as follows:
To display current device status: dpdk_nic_bind.py --statusTo bind eth1 from the current driver and move to use igb_uio dpdk_nic_bind.py --bind=igb_uio eth1To unbind 0000:01:00.0 from using any driver dpdk_nic_bind.py -u 0000:01:00.0To bind 0000:02:00.0 and 0000:02:00.1 to the ixgbe kernel driver dpdk_nic_bind.py -b ixgbe 02:00.0 02:00.1
5. Bind The NIC to the specified driver
You can replace the current driver with the new driver without going through Step 1:
./Tools/dpdk_nic_bind.py-B igb_uio eth1
You can also bind a new driver directly after Step 1. You can bind multiple NICs directly:
./Tools/dpdk_nic_bind.py-B igb_uio. 0. 0. 0:. 0 indicates the mac address.
========================================================== ==================
The good news is that dpdk has integrated a script/tools/setup. sh that includes compiling dpdk source code, setting environment variables such as hugepages and loading kernel modules.
Before running setup. h, you need to set the environment variable export RTE_SDK =