2 ##############################################################################
3 # Copyright (c) 2017 ZTE corporation and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 # Commandline arguments
15 DST_MAC=$1 # MAC address of the peer port
19 if lsmod | grep "uio" &> /dev/null ; then
20 echo "uio module is loaded"
25 if lsmod | grep "igb_uio" &> /dev/null ; then
26 echo "igb_uio module is loaded"
28 insmod /dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
31 if lsmod | grep "rte_kni" &> /dev/null ; then
32 echo "rte_kni module is loaded"
34 insmod /dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko
40 chmod 777 /sys/bus/pci/drivers/virtio-pci/*
41 chmod 777 /sys/bus/pci/drivers/igb_uio/*
44 add_interface_to_dpdk(){
45 interfaces=$(lspci |grep Eth |tail -n +2 |awk '{print $1}')
46 /dpdk/tools/dpdk-devbind.py --bind=igb_uio $interfaces
51 blacklist=$(lspci |grep Eth |awk '{print $1}'|head -1)
53 sudo ./destdir/bin/testpmd -c 0x07 -n 4 -b $blacklist -- -a --eth-peer=1,$DST_MAC --forward-mode=mac