dpdk 19.11.5 install

dpdk的安装基本使用dpdk-setup.sh一个脚本就搞定了。如果需要1G的大页内存,需要事先手动调用脚本hugepage_set.sh。如果需要隔离cpu,也需要事先手动调用脚本cpu_isolation.sh

下载

1
wget http://fast.dpdk.org/rel/dpdk-19.11.5.tar.xz

安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
1. 依赖安装
   yum install -y "kernel-devel-uname-r == $(uname -r)"  //驱动部分与内核相关,编译时需要内核头文件的支持
   yum install libnuma-devel    //numa工具
   yum install -y libpcap-devel //pdump抓包需要
2. 解压
   tar -xf dpdk-19.11.5.tar.xz && cd dpdk-stable-19.11.5
3. 修改配置支持pdump
   vi config/common_base
   CONFIG_RTE_LIBRTE_PMD_PCAP=n
   改为
   CONFIG_RTE_LIBRTE_PMD_PCAP=y
4. 修改配置加快编译时间(多核并行编译)
   vi usertools/dpdk-setup.sh
   make install T=${RTE_TARGET} 
   改为 
   make -j install T=${RTE_TARGET}
5. 设置环境变量(避免每次执行脚本都设置)
   vi usertools/dpdk-setup.sh
   export RTE_SDK=$PWD 
   //下一行新增
   export RTE_TARGET=x86_64-native-linuxapp-gcc
6. kni模块增加启动参数(默认kni网卡不启动)
   vi usertools/dpdk-setup.sh
   sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/rte_kni.ko
   改为
   sudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/rte_kni.ko carrier=on
7. 编译
   sh usertools/dpdk-setup.sh
   [38] x86_64-native-linuxapp-gcc
8. 插入uio内核模块(intel网卡,mlx网卡不需要)
   sh usertools/dpdk-setup.sh
   [45] Insert IGB UIO module
9. 插入kni模块
   sh usertools/dpdk-setup.sh
   [47] Insert KNI module
10. 查看大页内存
   sh usertools/dpdk-setup.sh
   [56] List hugepage info from /proc/meminfo
11. 绑定大页内存(如果已设置1g大页则跳过)
   sh usertools/dpdk-setup.sh
   [49] Setup hugepage mappings for NUMA systems
12. 绑定网卡(可输入多个,空格分割)
   [51] Bind Ethernet/Baseband/Crypto device to IGB UIO module
   Enter PCI address of device to bind to IGB UIO driver: 0000:01:00.1 0000:03:00.0

使用

1
2
export RTE_SDK=/export/servers/dpdk-stable-19.11.5
export RTE_TARGET=x86_64-native-linuxapp-gcc