Add the DPDK l2fwd performance test cases.
[csit.git] / dpdk-tests / dpdk_scripts / cleanup_dpdk.sh
1 #!/bin/bash
2
3 ROOTDIR=/tmp/openvpp-testing
4 PWDDIR=$(pwd)
5
6 TESTPMD_LOG=/tmp/testpmd.log
7 TESTPMD_PID=/tmp/testpmd.pid
8
9 port1_driver=$1
10 port1_pci=$2
11 port2_driver=$3
12 port2_pci=$4
13
14 #kill the dpdk application
15 sudo pkill testpmd
16 sudo pkill l2fwd
17 sudo pkill l3fwd
18 sudo rm -f ${TESTPMD_PID}
19 sudo rm -f /dev/hugepages/*
20 cat ${TESTPMD_LOG}
21
22 sleep 2
23
24 cd ${ROOTDIR}/dpdk-16.07/
25 ./tools/dpdk-devbind.py -b ${port1_driver} ${port1_pci}
26 ./tools/dpdk-devbind.py -b ${port2_driver} ${port2_pci}
27
28 sleep 2
29
30 if1_name=`./tools/dpdk-devbind.py --s | grep "${port1_pci}" | sed -n 's/.*if=\(\S\)/\1/p' | awk -F' ' '{print $1}'`
31 if2_name=`./tools/dpdk-devbind.py --s | grep "${port2_pci}" | sed -n 's/.*if=\(\S\)/\1/p' | awk -F' ' '{print $1}'`
32
33 ifconfig ${if1_name} up
34 ifconfig ${if2_name} up
35
36 rmmod igb_uio
37 rmmod uio
38
39 cd ${PWDDIR}