3 # Copyright (c) 2020 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 ROOTDIR="/tmp/openvpp-testing"
21 TESTPMDLOG="screenlog.0"
24 # Setting command line arguments.
31 # DPDK prefers "arm64" to "aarch64" and does not allow arm64 native target.
32 if [ "${arch}" == "aarch64" ]; then
39 # Try to kill the testpmd.
41 if [ ${?} -eq "0" ]; then
45 for attempt in {1..60}; do
46 echo "Checking if testpmd is still alive, attempt nr ${attempt}"
48 if [ ${?} -eq "1" ]; then
49 echo "testpmd is dead"
53 echo "testpmd is still alive, waiting 1 second"
56 if [ "${success}" = false ]; then
57 echo "The command sudo pkill testpmd failed"
63 echo "testpmd is not running"
66 # Try to kill the l3fwd.
68 if [ ${?} -eq "0" ]; then
72 for attempt in {1..60}; do
73 echo "Checking if l3fwd is still alive, attempt nr ${attempt}"
75 if [ ${?} -eq "1" ]; then
80 echo "l3fwd is still alive, waiting 1 second"
83 if [ "${success}" = false ]; then
84 echo "The command sudo pkill l3fwd failed"
90 echo "l3fwd is not running"
94 sudo rm -f /dev/hugepages/*
98 cd "${ROOTDIR}/${DPDK_DIR}/"
100 TESTPMD_BIN="./${arch}-${machine}-linuxapp-gcc/app/testpmd"
102 if [ "${jumbo_frames}" = "yes" ]; then
103 sudo sh -c "screen -dmSL DPDK-test ${TESTPMD_BIN} \
104 -l ${cpu_corelist} -n 4 --log-level 8 -v -- \
108 --nb-cores=${nb_cores} \
110 --tx-offloads=0x7FFFFFFF \
112 --rxq=${queue_nums} \
113 --txq=$((${nb_cores} + 1)) \
117 --disable-link-check \
120 sudo sh -c "screen -dmSL DPDK-test ${TESTPMD_BIN} \
121 -l ${cpu_corelist} -n 4 --log-level 8 -v -- \
125 --nb-cores=${nb_cores} \
127 --rxq=${queue_nums} \
128 --txq=$((${nb_cores} + 1)) \
132 --disable-link-check \
136 for attempt in {1..60}; do
137 echo "Checking if testpmd is alive, attempt nr ${attempt}"
138 fgrep "Port 1: link state change event" "${TESTPMDLOG}"
139 if [ "${?}" -eq "0" ]; then