0、环境说明
OS:Red Hat Enterprise Linux Server release 6.3
kernel:2.6.32-279.el6.x86_64
DPDK:dpdk-16.04
1、安装依赖的软件包
yum install gcc -y
yum install kernel.x86_64 -y
yum install kernel-headers -y
yum install kernel-devel -y
并确认/lib/modules/2.6.32-279.el6.x86_64/build指向正确的kernel
2、编译DPDK
解压dpdk-16.04.tar.xz
xz -d dpdk-16.04.tar.xz
tar -xvf dpdk-16.04.tar
编译
make install T=x86_64-native-linuxapp-gcc
编译的产物在x86_64-native-linuxapp-gcc子目录下
3、开启hugepage支持
mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
# 每块内存大小2MB,共预留1024个2MB内存块
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages