安装依赖关系
apt install make -y
apt install make-guile -y
apt install gcc build-essential -y
apt install libnuma-dev -y
编辑sysctl.conf,设置2M大页的数量
vm.nr_hugepages=1024
下载并安装dpdk最新版
mkdir -p /root/dpdk
cd /root/dpdk/
wget http://fast.dpdk.org/rel/dpdk-17.11.tar.xz
tar xf dpdk-17.11.tar.xz
export DPDK_DIR=/root/dpdk/dpdk-17.11
export DPDK_TARGET=x86_64-native-linuxapp-gcc
export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
cd $DPDK_DIR
make install T=$DPDK_TARGET DESTDIR=install
设定EAL环境
export DPDK_DIR=/root/dpdk/dpdk-17.11
export DPDK_TARGET=x86_64-native-linuxapp-gcc
export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
mkdir -p /dev/hugepages
mount -t hugetlbfs hugetlbfs /dev/hugepages
modprobe uio
insmod $DPDK_BUILD/kmod/igb_uio.ko
export RTE_SDK=$DPDK_DIR
export RTE_TARGET=$DPDK_TARGET
编译l2fwd
cd /root/dpdk/dpdk-17.11/examples/l2fwd/
make
cp /root/dpdk/dpdk-17.11/examples/l2fwd/build/app/l2fwd /root/dpdk/
编译l3fwd
cd /root/dpdk/dpdk-17.11/examples/l3fwd/
make
cp /root/dpdk/dpdk-17.11/examples/l3fwd/build/app/l3fwd /root/dpdk/