centos 编译dpdk-stable-17.02.1

1大页设置

echo 128 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge

 2环境变量设置

#environment config
export RTE_SDK=/home/dpdk-stable-17.02.1
export RTE_TARGET=x86_64-native-linuxapp-gcc
export KERNELDIR=/lib/modules/3.10.0-514.el7.x86_64/build/


3、dpdk编译设置 so igb_uio


cd /home/dpdk-stable-17.02.1
vim config/common_base
CONFIG_RTE_BUILD_SHARED_LIB=y
CONFIG_RTE_EAL_IGB_UIO=y


4、make


make config T=x86_64-native-linuxapp-gcc
make install T=$RTE_TARGET DESTDIR=/usr/local/dpdk -j 4
cp x86_64-native-linuxapp-gcc/lib/lib* /lib64

#安装后会在/usr/local/dpdk找到相关内容

5、后续设置,根据其他博客内容设置,也可不设

mkdir /root/dpdk
cp /usr/local/dpdk/include /root/dpdk/
cp /usr/local/dpdk/lib /root/dpdk/
cp /usr/local/dpdk/lib/modules /root/dpdk/
cp /usr/local/dpdk/share/dpdk/usertools /root/dpdk/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/dpdk/lib

5、gcc helloworld

cd /home/dpdk-stable-17.02.1/examples/helloworld
gcc main.c -I /root/dpdk/include/dpdk/ -L /root/dpdk/lib/ -lrte_eal -lrte_mempool -lrte_ring -o helloworld

你可能感兴趣的:(centos,linux,网络)