mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
selftests: udpgro: report error when receive failed
[ Upstream commit 7167395a4be7930ecac6a33b4e54d7e3dd9ee209 ]
Currently, we only check the latest senders's exit code. If the receiver
report failed, it is not recoreded. Fix it by checking the exit code
of all the involved processes.
Before:
bad GRO lookup ok
multiple GRO socks ./udpgso_bench_rx: recv: bad packet len, got 1452, expected 14520
./udpgso_bench_rx: recv: bad packet len, got 1452, expected 14520
failed
$ echo $?
0
After:
bad GRO lookup ok
multiple GRO socks ./udpgso_bench_rx: recv: bad packet len, got 1452, expected 14520
./udpgso_bench_rx: recv: bad packet len, got 1452, expected 14520
failed
$ echo $?
1
Fixes: 3327a9c463 ("selftests: add functionals test for UDP GRO")
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c0e057794a
commit
4df0fb0391
@@ -46,17 +46,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 +75,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 +96,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 +115,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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user