aboutsummaryrefslogtreecommitdiffstats
path: root/dpdk-tests/dpdk_scripts/run_l2fwd.sh
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2017-02-10 09:24:00 +0100
committerPeter Mikus <pmikus@cisco.com>2017-04-03 09:46:36 +0000
commitec059708c78fe3563bc89507739a2712adc062f3 (patch)
tree1cf1805603919c3b5cf941f53bffa056bdeb7e10 /dpdk-tests/dpdk_scripts/run_l2fwd.sh
parentc95798bd9e803a7ad98ed9056e6ddb1a8bbd2dc1 (diff)
Add x710 and xl710 tests for testpmd
10ge2p1x710-eth-l2xcbase-ndrdisc 40ge2p1xl710-eth-l2xcbase-ndrdisc Change-Id: Iea411182fd41e1ae9ed9b5a17f540befc247adb9 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'dpdk-tests/dpdk_scripts/run_l2fwd.sh')
-rwxr-xr-xdpdk-tests/dpdk_scripts/run_l2fwd.sh48
1 files changed, 31 insertions, 17 deletions
diff --git a/dpdk-tests/dpdk_scripts/run_l2fwd.sh b/dpdk-tests/dpdk_scripts/run_l2fwd.sh
index 3ddf4fd958..80ed14a330 100755
--- a/dpdk-tests/dpdk_scripts/run_l2fwd.sh
+++ b/dpdk-tests/dpdk_scripts/run_l2fwd.sh
@@ -1,52 +1,66 @@
#!/bin/bash
+set -x
+
+# Setting variables
+DPDK_VERSION=dpdk-17.02
ROOTDIR=/tmp/openvpp-testing
+TESTPMDLOG=screenlog.0
PWDDIR=$(pwd)
-TESTPMD_LOG=/tmp/testpmd.log
-TESTPMD_PID=/tmp/testpmd.pid
-
+# Setting command line arguments
cpu_corelist=$1
nb_cores=$2
queue_nums=$3
jumbo_frames=$4
-#kill the testpmd
+# 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
-sudo rm -f ${TESTPMD_LOG}
-sudo rm -f ${TESTPMD_PID}
+# Remove hugepages
sudo rm -f /dev/hugepages/*
-#run the testpmd
-cd ${ROOTDIR}
+sleep 2
+
+cd ${ROOTDIR}/${DPDK_VERSION}/
+rm -f ${TESTPMDLOG}
if [ "$jumbo_frames" = "yes" ]; then
-tail -f /dev/null | nohup ./dpdk-16.07/x86_64-native-linuxapp-gcc/app/testpmd -l ${cpu_corelist} \
- -n 4 -- --numa --nb-ports=2 --portmask=0x3 --nb-cores=${nb_cores} \
- --max-pkt-len=9000 --txqflags=0 --forward-mode=io --rxq=${queue_nums} \
- --txq=${queue_nums} --auto-start > ${TESTPMD_LOG} 2>&1 &
-echo $! > ${TESTPMD_PID}
+ sudo sh -c "screen -dmSL DPDK-test ./x86_64-native-linuxapp-gcc/app/testpmd -l ${cpu_corelist} \
+ -n 4 -- --numa --nb-ports=2 --portmask=0x3 --nb-cores=${nb_cores} \
+ --max-pkt-len=9000 --txqflags=0 --forward-mode=io --rxq=${queue_nums} \
+ --txq=${queue_nums} --auto-start"
+ sleep 10
+ cat ${TESTPMDLOG}
else
-tail -f /dev/null | nohup ./dpdk-16.07/x86_64-native-linuxapp-gcc/app/testpmd -l ${cpu_corelist} \
- -n 4 -- --numa --nb-ports=2 --portmask=0x3 --nb-cores=${nb_cores} \
- --forward-mode=io --rxq=${queue_nums} --txq=${queue_nums} --auto-start > ${TESTPMD_LOG} 2>&1 &
-echo $! > ${TESTPMD_PID}
+ sudo sh -c "screen -dmSL DPDK-test ./x86_64-native-linuxapp-gcc/app/testpmd -l ${cpu_corelist} \
+ -n 4 -- --numa --nb-ports=2 --portmask=0x3 --nb-cores=${nb_cores} \
+ --forward-mode=io --rxq=${queue_nums} --txq=${queue_nums} --auto-start"
+ sleep 10
+ cat ${TESTPMDLOG}
fi
cd ${PWDDIR}