Commit 1e557246 authored by David S. Miller's avatar David S. Miller

Merge branch 'selftests-udpgro-fixes'

Hangbin Liu says:

====================
selftests: Fix udpgro failures

There are 2 issues for the current udpgro test. The first one is the testing
doesn't record all the failures, which may report pass but the test actually
failed. e.g.
https://netdev-3.bots.linux.dev/vmksft-net/results/725661/45-udpgro-sh/stdout

The other one is after commit d7db7775 ("net: veth: do not manipulate
GRO when using XDP"), there is no need to load xdp program to enable GRO
on veth device.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2d742304 d7818402
...@@ -7,8 +7,6 @@ source net_helper.sh ...@@ -7,8 +7,6 @@ source net_helper.sh
readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
BPF_FILE="xdp_dummy.bpf.o"
# set global exit status, but never reset nonzero one. # set global exit status, but never reset nonzero one.
check_err() check_err()
{ {
...@@ -38,7 +36,7 @@ cfg_veth() { ...@@ -38,7 +36,7 @@ cfg_veth() {
ip -netns "${PEER_NS}" addr add dev veth1 192.168.1.1/24 ip -netns "${PEER_NS}" addr add dev veth1 192.168.1.1/24
ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad
ip -netns "${PEER_NS}" link set dev veth1 up ip -netns "${PEER_NS}" link set dev veth1 up
ip -n "${PEER_NS}" link set veth1 xdp object ${BPF_FILE} section xdp ip netns exec "${PEER_NS}" ethtool -K veth1 gro on
} }
run_one() { run_one() {
...@@ -46,17 +44,19 @@ run_one() { ...@@ -46,17 +44,19 @@ run_one() {
local -r all="$@" local -r all="$@"
local -r tx_args=${all%rx*} local -r tx_args=${all%rx*}
local -r rx_args=${all#*rx} local -r rx_args=${all#*rx}
local ret=0
cfg_veth cfg_veth
ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${rx_args} && \ ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${rx_args} &
echo "ok" || \ local PID1=$!
echo "failed" &
wait_local_port_listen ${PEER_NS} 8000 udp wait_local_port_listen ${PEER_NS} 8000 udp
./udpgso_bench_tx ${tx_args} ./udpgso_bench_tx ${tx_args}
ret=$? check_err $?
wait $(jobs -p) wait ${PID1}
check_err $?
[ "$ret" -eq 0 ] && echo "ok" || echo "failed"
return $ret return $ret
} }
...@@ -73,6 +73,7 @@ run_one_nat() { ...@@ -73,6 +73,7 @@ run_one_nat() {
local -r all="$@" local -r all="$@"
local -r tx_args=${all%rx*} local -r tx_args=${all%rx*}
local -r rx_args=${all#*rx} local -r rx_args=${all#*rx}
local ret=0
if [[ ${tx_args} = *-4* ]]; then if [[ ${tx_args} = *-4* ]]; then
ipt_cmd=iptables ipt_cmd=iptables
...@@ -93,16 +94,17 @@ run_one_nat() { ...@@ -93,16 +94,17 @@ run_one_nat() {
# ... so that GRO will match the UDP_GRO enabled socket, but packets # ... so that GRO will match the UDP_GRO enabled socket, but packets
# will land on the 'plain' one # will land on the 'plain' one
ip netns exec "${PEER_NS}" ./udpgso_bench_rx -G ${family} -b ${addr1} -n 0 & ip netns exec "${PEER_NS}" ./udpgso_bench_rx -G ${family} -b ${addr1} -n 0 &
pid=$! local PID1=$!
ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${family} -b ${addr2%/*} ${rx_args} && \ ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${family} -b ${addr2%/*} ${rx_args} &
echo "ok" || \ local PID2=$!
echo "failed"&
wait_local_port_listen "${PEER_NS}" 8000 udp wait_local_port_listen "${PEER_NS}" 8000 udp
./udpgso_bench_tx ${tx_args} ./udpgso_bench_tx ${tx_args}
ret=$? check_err $?
kill -INT $pid kill -INT ${PID1}
wait $(jobs -p) wait ${PID2}
check_err $?
[ "$ret" -eq 0 ] && echo "ok" || echo "failed"
return $ret return $ret
} }
...@@ -111,20 +113,26 @@ run_one_2sock() { ...@@ -111,20 +113,26 @@ run_one_2sock() {
local -r all="$@" local -r all="$@"
local -r tx_args=${all%rx*} local -r tx_args=${all%rx*}
local -r rx_args=${all#*rx} local -r rx_args=${all#*rx}
local ret=0
cfg_veth cfg_veth
ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${rx_args} -p 12345 & ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${rx_args} -p 12345 &
ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 2000 -R 10 ${rx_args} && \ local PID1=$!
echo "ok" || \ ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 2000 -R 10 ${rx_args} &
echo "failed" & local PID2=$!
wait_local_port_listen "${PEER_NS}" 12345 udp wait_local_port_listen "${PEER_NS}" 12345 udp
./udpgso_bench_tx ${tx_args} -p 12345 ./udpgso_bench_tx ${tx_args} -p 12345
check_err $?
wait_local_port_listen "${PEER_NS}" 8000 udp wait_local_port_listen "${PEER_NS}" 8000 udp
./udpgso_bench_tx ${tx_args} ./udpgso_bench_tx ${tx_args}
ret=$? check_err $?
wait $(jobs -p) wait ${PID1}
check_err $?
wait ${PID2}
check_err $?
[ "$ret" -eq 0 ] && echo "ok" || echo "failed"
return $ret return $ret
} }
...@@ -196,11 +204,6 @@ run_all() { ...@@ -196,11 +204,6 @@ run_all() {
return $ret return $ret
} }
if [ ! -f ${BPF_FILE} ]; then
echo "Missing ${BPF_FILE}. Run 'make' first"
exit -1
fi
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
run_all run_all
elif [[ $1 == "__subprocess" ]]; then elif [[ $1 == "__subprocess" ]]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment