安装前检查
- 查看网卡和CPU绑定关系
cat /sys/class/net/enp94s0f0/device/local_cpulist
# cat /sys/class/net/enp94s0f0/device/local_cpulist
0-19,40-59
# cat /sys/class/net/enp94s0f1/device/local_cpulist
0-19,40-59
- 查看CPU和NUMA的绑定关系
lscpu
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz
Stepping: 7
CPU MHz: 2100.000
BogoMIPS: 4200.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 28160K
NUMA node0 CPU(s): 0-19,40-59 #两个网卡均在CPU0上
NUMA node1 CPU(s): 20-39,60-79
- 禁用irqbalance服务
systemctl disable irqbalance.service
systemctl stop irqbalance.service
systemctl status irqbalance.service
- Hugepage设置
是否NUMA系统配置不同,目前基本都是NUMA的,需要分别对每个Node单独分配
echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
上述命令为每个节点各预留了1024个2M大页,总共4GB内存
设置完毕page后需要进行mount操作
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
yum install libhugetlbfs-utils.x86_64
# hugeadm --list-all-mounts //查看挂载是否成功
Mount Point Options
/dev/hugepages rw,relatime
/mnt/huge rw,relatime
1. 安装
1.1 下载
下载:wget [http://fast.dpdk.org/rel/dpdk-19.11.7.tar.xz](http://fast.dpdk.org/rel/dpdk-19.11.7.tar.xz)
解压: tar -Jxvf dpdk-19.11.7.tar.xz
进入解压后的目录: /opt/dpdk-stable-19.11.7/usertools
1.2 编译
配置环境 make config T=x86_64-native-linux-gcc && make
- "T=“指定了配置模板"RTE_CONFIG_TEMPLATE”,
- "O="可指定输出目录,若不指定,默认为./build目录
报错:make: *** /lib/modules/3.10.0-957.27.2.el7.x86_64/build: No such file or directory. Stop.
查看该目录指向了/usr/src/kernels/3.10.0-957.27.2.el7.x86_64,实际没有该文件,安装该kernel包yum install gcc kernel-devel-3.10.0-957.27.2.el7
然后重新make config和make
/usr/src/kernels/3.10.0-957.27.2.el7.x86_64/arch/x86/Makefile:166: *** CONFIG_RETPOLINE=y, but not supported by the compiler. Compiler update recommended…Stop.
查看GCC版本 gcc -v
可以指定GCC版本来实现
cd /opt/dpdk-stable-19.11.7
export PATH=/usr/bin/:$PATH
make config T=x86_64-native-linuxapp-gcc
export RTE_SDK=$PWD
make
#
/opt/dpdk-stable-19.11.7/build/kmod
# ll
total 1052
-rw-r--r-- 1 root root 290008 Apr 6 15:04 igb_uio.ko
-rw-r--r-- 1 root root 784608 Apr 6 15:04 rte_kni.ko