6 DPDK_VERSION=dpdk-18.02
7 ROOTDIR=/tmp/openvpp-testing
17 SCRIPT_NAME=$(basename $0)
19 # define a function to get the l3fwd PID
20 function get_l3fwd_pid()
22 pid_l3fwd=`sudo ps -elf | grep l3fwd | grep -v grep | grep -v SCREEN | grep -v ${SCRIPT_NAME} | awk '{print $4}'`
26 # Try to kill the l3fwd
27 # Don't use the pgrep and pkill
28 l3fwd_pid=`get_l3fwd_pid`
30 if [ ! -z ${l3fwd_pid} ]; then
32 sudo kill -15 ${l3fwd_pid}
34 for attempt in {1..5}; do
35 echo "Checking if l3fwd is still alive, attempt nr ${attempt}"
36 l3fwd_pid=`get_l3fwd_pid`
37 if [ -z ${l3fwd_pid} ]; then
42 echo "l3fwd is still alive, waiting 1 second"
45 if [ "$success" = false ]; then
46 echo "The command sudo kill -15 l3fwd failed"
47 sudo kill -9 ${l3fwd_pid}
52 echo "l3fwd is not running"
55 # Try to kill the testpmd
57 if [ $? -eq "0" ]; then
61 for attempt in {1..5}; do
62 echo "Checking if testpmd is still alive, attempt nr ${attempt}"
64 if [ $? -eq "1" ]; then
65 echo "testpmd is dead"
69 echo "testpmd is still alive, waiting 1 second"
72 if [ "$success" = false ]; then
73 echo "The command sudo pkill testpmd failed"
79 echo "testpmd is not running"
82 sudo rm -f /dev/hugepages/*
87 cd ${ROOTDIR}/${DPDK_VERSION}/
89 if [ "$jumbo_frames" = "yes" ]; then
90 sudo sh -c "screen -dmSL DPDK-test ./examples/l3fwd/build/app/l3fwd \
91 -l ${cpu_corelist} -n 4 -- -P -L -p 0x3 --config='${port_config}' \
92 --enable-jumbo --max-pkt-len=9000 --eth-dest=0,${adj_mac0} \
93 --eth-dest=1,${adj_mac1} --parse-ptype"
95 sudo sh -c "screen -dmSL DPDK-test ./examples/l3fwd/build/app/l3fwd \
96 -l ${cpu_corelist} -n 4 -- -P -L -p 0x3 --config='${port_config}' \
97 --eth-dest=0,${adj_mac0} --eth-dest=1,${adj_mac1} --parse-ptype"