DPDK的L2FWD实践
10.5.39.242充当l2fwd转发器
用10.5.39.241的1口发包,2口收包
10.5.39.241的intel X520-DA2
90:e2:ba:88:35:40
90:e2:ba:88:35:41
10.5.39.242的intel X520-DA2
90:e2:ba:88:3f:6c
90:e2:ba:88:3f:6d
按以下端口的mac进行连接
90:e2:ba:88:35:40----90:e2:ba:88:3f:6c
90:e2:ba:88:35:41----90:e2:ba:88:3f:6d
在10.5.39.242上
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
$DPDK_DIR/usertools/dpdk-devbind.py -b igb_uio 0000:84:00.0 0000:84:00.1
cd /root/dpdk/
./l2fwd -c 3 -n 2 --socket-mem 1024,1024 --huge-dir /dev/hugepages -- -p 3
在10.5.39.241上
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
$DPDK_DIR/usertools/dpdk-devbind.py -b igb_uio 0000:84:00.0 0000:84:00.1
cd /root/pktgen-3.4.9/
./pktgen -l 0,2,3,4,5 -n 4 --proc-type auto --socket-mem 1024,1024 --huge-dir /dev/hugepages --file-prefix pg1 -b 00:09.0 -- -P -T -m '[2:3].0,[4:5].1'
set 0 src ip 192.168.10.241/24
set 0 src mac 90:e2:ba:88:35:40
set 0 dst ip 192.168.10.242
set 0 dst mac 90:e2:ba:88:3f:6c
start 0
REF: