安装pktgen
我之前安装的dpdk版本是stable-18.11.2, linux版本为 3.10.0-1160.36.2.el7.x86_64, 从网站http://git.dpdk.org/apps/pktgen-dpdk/refs/下载尝试多个版本的pktgen,最后试出pktgen3.7.2能编译成功,详细命令如下:
export RTE_SDK=/root/share/dpdk/dpdk-stable-18.11.2
export RTE_TARGET=x86_64-native-linuxapp-gcc
modprobe pktgen
lsmod|grep gen
wget -c http://www.lua.org/ftp/lua-5.3.5.tar.gz
yum install libtermcap-devel ncurses-devel libevent-devel readline-devel
yum install -y libpcap-devel
tar zxvf lua-5.3.5.tar.gz
yum install libreadline5 libreadline-gplv2-dev
cd lua-5.3.5
make linux
make install
lua // test lua
tar zxvf pktgen-dpdk-pktgen-3.7.2.tar.gz
cd pktgen-dpdk-pktgen-3.7.2
make
运行pktgen
可以在pktgen源代码的目录下运行如下命令:
./app/x86_64-native-linuxapp-gcc/pktgen -l 2-10 -n 4 --proc-type auto --socket-mem 1024 -- -P -m "[3-4:5-6].0,[7-8:9-10].1" -f themes/black-yellow.theme
或者
./app/x86_64-native-linuxapp-gcc/pktgen -l 0-1 -n 3 -- -P -m "[1].0"
这些参数的意思可以参考官网: https://pktgen-dpdk.readthedocs.io/en/latest/usage_pktgen.html#usage-pktgen
但是这样运行着,就不能再运行dpdk的程序了