udpgro.sh (fe33c0fbed75dd464747c0faaedf94c7d8eb4101) udpgro.sh (98cb12eb52a780e682bea8372fdb2912c08132dd)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3#
4# Run a series of udpgro functional tests.
5
6source net_helper.sh
7
8readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
9
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3#
4# Run a series of udpgro functional tests.
5
6source net_helper.sh
7
8readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
9
10BPF_FILE="../bpf/xdp_dummy.bpf.o"
10BPF_FILE="xdp_dummy.o"
11
12# set global exit status, but never reset nonzero one.
13check_err()
14{
15 if [ $ret -eq 0 ]; then
16 ret=$1
17 fi
18}

--- 173 unchanged lines hidden (view full) ---

192 run_nat_test "bad GRO lookup" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 10 -l 1452"
193 check_err $?
194 run_2sock_test "multiple GRO socks" "${ipv6_args} -M 1 -s 14520 -S 0 " "-n 1 -l 14520 -S 1452"
195 check_err $?
196 return $ret
197}
198
199if [ ! -f ${BPF_FILE} ]; then
11
12# set global exit status, but never reset nonzero one.
13check_err()
14{
15 if [ $ret -eq 0 ]; then
16 ret=$1
17 fi
18}

--- 173 unchanged lines hidden (view full) ---

192 run_nat_test "bad GRO lookup" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 10 -l 1452"
193 check_err $?
194 run_2sock_test "multiple GRO socks" "${ipv6_args} -M 1 -s 14520 -S 0 " "-n 1 -l 14520 -S 1452"
195 check_err $?
196 return $ret
197}
198
199if [ ! -f ${BPF_FILE} ]; then
200 echo "Missing ${BPF_FILE}. Build bpf selftest first"
200 echo "Missing ${BPF_FILE}. Run 'make' first"
201 exit -1
202fi
203
204if [[ $# -eq 0 ]]; then
205 run_all
206elif [[ $1 == "__subprocess" ]]; then
207 shift
208 run_one $@
209elif [[ $1 == "__subprocess_nat" ]]; then
210 shift
211 run_one_nat $@
212elif [[ $1 == "__subprocess_2sock" ]]; then
213 shift
214 run_one_2sock $@
215fi
216
217exit $?
201 exit -1
202fi
203
204if [[ $# -eq 0 ]]; then
205 run_all
206elif [[ $1 == "__subprocess" ]]; then
207 shift
208 run_one $@
209elif [[ $1 == "__subprocess_nat" ]]; then
210 shift
211 run_one_nat $@
212elif [[ $1 == "__subprocess_2sock" ]]; then
213 shift
214 run_one_2sock $@
215fi
216
217exit $?