1 虚拟机用了2个核,2G内存,3个网卡
2 去http://core.dpdk.org/download/下载了18.11
3 安装apt-get install libnuma-dev
4 运行ifconfig down ***停掉2个网卡,方便后面添加到dpdk
5 解压后,进入usertools,运行dpdk-setup.sh。系统是64位的,所以选择x86_64-native-linuxapp-gcc。
运行成功:
其中 .......cannot run with T defined .......暂时不管
6 根据提示的选项,安装IGB UIO
7 根据提示的选项设置hugepages,这里设置256
8 根据提示的选项绑定之前停用的网卡,这里都是intel的网卡
9 根据提示的选项,运行testpmd。如果报EAL Error reading from file descriptor 23 Input output error 则需要修改dpdk目录下的kernel/igb_uio/igb_uio.c,将
将文件中该行修改
pci_intx_mask_supported(dev)
修改为
pci_intx_mask_supported(dev)||true
再重新编译。
10 运行:
testpmd> start # 开始转发命令
testpmd> stop # 停止转发命令,结束时会显示转发的汇总(收、发、drop)
testpmd> quit # 退出testpmd
testpmd> show port stats all # 显示所有端口的收发包信息