blob: 48e1a29b63946160c0cc2cd68699912c205c8c51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#!/bin/bash
set -x
# Setting variables
DPDK_VERSION=dpdk-17.05
ROOTDIR=/tmp/openvpp-testing
TESTPMDLOG=screenlog.0
PWDDIR=$(pwd)
# Setting command line arguments
port1_driver=$1
port1_pci=$2
port2_driver=$3
port2_pci=$4
# Try to kill the testpmd
sudo pgrep testpmd
if [ $? -eq "0" ]; then
success=false
sudo pkill testpmd
echo "RC = $?"
for attempt in {1..5}; do
echo "Checking if testpmd is still alive, attempt nr ${attempt}"
sudo pgrep testpmd
if [ $? -eq "1" ]; then
echo "testpmd is dead"
success=true
break
fi
echo "testpmd is still alive, waiting 1 second"
sleep 1
done
if [ "$success" = false ]; then
echo "The command sudo pkill testpmd failed"
sudo pkill -9 testpmd
echo "RC = $?"
exit 1
fi
else
echo "testpmd is not running"
fi
#also kill the l3fwd
sudo pgrep l3fwd
if [ $? -eq "0" ]; then
success=false
sudo pkill l3fwd
echo "RC = $?"
for attempt in {1..5}; do
echo "Checking if l3fwd is still alive, attempt nr ${attempt}"
sudo pgrep l3fwd
if [ $? -eq "1" ]; then
echo "l3fwd is dead"
success=true
break
fi
echo "l3fwd is still alive, waiting 1 second"
sleep 1
done
if [ "$success" = false ]; then
echo "The command sudo pkill l3fwd failed"
sudo pkill -9 l3fwd
echo "RC = $?"
exit 1
fi
else
echo "l3fwd is not running"
fi
# Remove hugepages
sudo rm -f /dev/hugepages/*
# Unbind interfaces
cd ${ROOTDIR}/${DPDK_VERSION}/
sudo ./usertools/dpdk-devbind.py -b ${port1_driver} ${port1_pci} || \
{ echo "Unbind ${port1_pci} failed"; exit 1; }
sudo ./usertools/dpdk-devbind.py -b ${port2_driver} ${port2_pci} || \
{ echo "Unbind ${port1_pci} failed"; exit 1; }
sleep 2
if1_name=`./usertools/dpdk-devbind.py --s | grep "${port1_pci}" | sed -n 's/.*if=\(\S\)/\1/p' | awk -F' ' '{print $1}'`
if2_name=`./usertools/dpdk-devbind.py --s | grep "${port2_pci}" | sed -n 's/.*if=\(\S\)/\1/p' | awk -F' ' '{print $1}'`
# Remove igb_uio driver
rmmod igb_uio || \
{ echo "Removing igb_uio failed"; exit 1; }
cd ${PWDDIR}
|