2 # SPDX-License-Identifier: GPL-2.0
4 # Run a series of udpgso benchmarks
6 readonly GREEN
='\033[0;92m'
7 readonly YELLOW
='\033[0;33m'
8 readonly RED
='\033[0;31m'
9 readonly NC
='\033[0m' # No Color
19 kselftest_test_exitcode
() {
22 if [[ ${exitcode} -eq ${KSFT_PASS} ]]; then
23 num_pass
=$
(( $num_pass + 1 ))
24 elif [[ ${exitcode} -eq ${KSFT_SKIP} ]]; then
25 num_skip
=$
(( $num_skip + 1 ))
27 num_err
=$
(( $num_err + 1 ))
32 echo -e "$(basename $0): PASS=${num_pass} SKIP=${num_skip} FAIL=${num_err}"
34 if [[ $num_err -ne 0 ]]; then
35 echo -e "$(basename $0): ${RED}FAIL${NC}"
39 if [[ $num_skip -ne 0 ]]; then
40 echo -e "$(basename $0): ${YELLOW}SKIP${NC}"
44 echo -e "$(basename $0): ${GREEN}PASS${NC}"
49 local -r jobs="$(jobs -p)"
51 if [[ "${jobs}" != "" ]]; then
52 kill -1 ${jobs} 2>/dev
/null
55 trap wake_children EXIT
61 .
/udpgso_bench_rx
-t &
63 .
/udpgso_bench_tx
${args}
69 .
/in_netns.sh
$0 __subprocess
${args}
70 kselftest_test_exitcode $?
80 run_in_netns
${args} -S 0
82 echo "udp gso zerocopy"
83 run_in_netns
${args} -S 0 -z
85 echo "udp gso timestamp"
86 run_in_netns
${args} -S 0 -T
88 echo "udp gso zerocopy audit"
89 run_in_netns
${args} -S 0 -z -a
91 echo "udp gso timestamp audit"
92 run_in_netns
${args} -S 0 -T -a
94 echo "udp gso zerocopy timestamp audit"
95 run_in_netns
${args} -S 0 -T -z -a
102 run_in_netns
${args} -t
105 run_in_netns
${args} -t -z
107 # excluding for now because test fails intermittently
108 # add -P option to include poll() to reduce possibility of lost messages
109 #echo "tcp zerocopy audit"
110 #run_in_netns ${args} -t -z -P -a
114 local -r core_args
="-l 3"
115 local -r ipv4_args
="${core_args} -4 -D 127.0.0.1"
116 local -r ipv6_args
="${core_args} -6 -D ::1"
119 run_tcp
"${ipv4_args}"
120 run_udp
"${ipv4_args}"
123 run_tcp
"${ipv4_args}"
124 run_udp
"${ipv6_args}"
127 if [[ $# -eq 0 ]]; then
130 elif [[ $1 == "__subprocess" ]]; then