Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: udpgro: no need to load xdp for gro

After commit d7db7775ea2e ("net: veth: do not manipulate GRO when using
XDP"), there is no need to load XDP program to enable GRO. On the other
hand, the current test is failed due to loading the XDP program. e.g.

# selftests: net: udpgro.sh
# ipv4
# no GRO ok
# no GRO chk cmsg ok
# GRO ./udpgso_bench_rx: recv: bad packet len, got 1472, expected 14720
#
# failed

[...]

# 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
ok 1 selftests: net: udpgro.sh

After fix, all the test passed.

# ./udpgro.sh
ipv4
no GRO ok
[...]
multiple GRO socks ok

Fixes: d7db7775ea2e ("net: veth: do not manipulate GRO when using XDP")
Reported-by: Yi Chen <yiche@redhat.com>
Closes: https://issues.redhat.com/browse/RHEL-53858
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hangbin Liu and committed by
David S. Miller
d7818402 7167395a

+1 -8
+1 -8
tools/testing/selftests/net/udpgro.sh
··· 7 7 8 8 readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" 9 9 10 - BPF_FILE="xdp_dummy.bpf.o" 11 - 12 10 # set global exit status, but never reset nonzero one. 13 11 check_err() 14 12 { ··· 36 38 ip -netns "${PEER_NS}" addr add dev veth1 192.168.1.1/24 37 39 ip -netns "${PEER_NS}" addr add dev veth1 2001:db8::1/64 nodad 38 40 ip -netns "${PEER_NS}" link set dev veth1 up 39 - ip -n "${PEER_NS}" link set veth1 xdp object ${BPF_FILE} section xdp 41 + ip netns exec "${PEER_NS}" ethtool -K veth1 gro on 40 42 } 41 43 42 44 run_one() { ··· 203 205 check_err $? 204 206 return $ret 205 207 } 206 - 207 - if [ ! -f ${BPF_FILE} ]; then 208 - echo "Missing ${BPF_FILE}. Run 'make' first" 209 - exit -1 210 - fi 211 208 212 209 if [[ $# -eq 0 ]]; then 213 210 run_all