系统:ubuntu-14.04.3-desktop-amd64.iso 内核:3.19.0-25-generic, 低版本有问题
按照官网安装:
Quick start
"A simple forwarding test with pcap PMD which works with any NIC (with performance penalties)"
Extract sources.
tar xf dpdk.tar.gz cd dpdk
Enable pcap (libpcap headers are required).
make config T=x86_64-native-linuxapp-gcc sed -ri 's,(PMD_PCAP=).*,\1y,' build/.config
Build libraries and test application (Linux headers may be needed with default config).
make
make过程可能会出现问题:pcap.h not found! 解决办法:sudo apt-get install libpcap-dev
Reserve huge pages memory.
mkdir -p /mnt/huge mount -t hugetlbfs nodev /mnt/huge echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
运行:build/app/testpmd -c7 -n3 --vdev=eth_pcap0,iface=eth0 --vdev=eth_pcap1,iface=eth1 -- -i --nb-cores=2 --nb-ports=2 --total-num-mbufs=2048