2017年5月10日 星期三

DPDK (Data Plane Development Kit) 環境建置

1. 介紹 DPDK (Data Plane Development Kit)
DPDK is a set of libraries and drivers for fast packet processing. It was designed to run on any processors. The first supported CPU was Intel x86 and it is now extended to IBM Power 8, EZchip TILE-Gx and ARM. It runs mostly in Linux userland. A FreeBSD port is available for a subset of DPDK features.

DPDK is an Open Source BSD licensed project. The most recent patches and enhancements, provided by the community, are available in master branch.

2. 取得DPDK原始碼
http://dpdk.org/download
$ tar -zxvf dpdk-2.2.0.tar.gz
$ cd dpdk-2.2.0 
3. DPDK環境架設
$ sudo apt-get install libpcap-dev

 
$ export RTE_SDK=`pwd`
$ export RTE_TARGET=x86_64-native-linuxapp-gcc

4. DPDK編譯
$ make config T=x86_64-native-linuxapp-gcc
$ make
5. 配置 hugepage
$ mkdir -p /mnt/huge
$ mount -t hugetlbfs nodev /mnt/huge
$ sudo bash -c  'echo 64 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages'
6. 插入 igb_uio module
$ modprobe uio

$ insmod $RTE_SDK/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
7. Bind network card
$ ./tools/dpdk_nic_bind.py --status

$ ./tools/dpdk_nic_bind.py -b igb_uio 0000:02:05.0
$ ./tools/dpdk_nic_bind.py -b igb_uio 0000:02:06.0
8. 執行 test program
$ ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x3 -n 2 -- -i
9. Reference
http://www.apmbe.com/dpdk%E5%AE%9E%E8%B7%B5/

沒有留言:

張貼留言