[Devel] [PATCH hci-8.1 v3 1/1] selftests: net: skip the veth GRO checks where they cannot run
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Sep 30 16:51:44 MSK 2026
> The three rx-udp-gro-forwarding checks in veth.sh count 10 packets
> where they expect 1 on a host that has a vxlan or another UDP tunnel,
> in any namespace, and pass on a host that has none.
>
> Any UDP encapsulation socket on the machine moves UDP GRO to the socket
> lookup path, see commit f2e9de210d50 ("udp: gro behind static key"),
> and rx-udp-gro-forwarding is then not consulted at all, see commit
> 36707061d6ba ("udp: allow forwarding of plain (non-fraglisted) UDP GRO
> packets"). The switch is global, so the test namespaces do not help,
> and nothing the test can set brings the device flag back.
>
> Skip those three checks when UDP encapsulation is in use: a vxlan,
> geneve or bareudp device, a fou port or an l2tp tunnel in any
> namespace, or a socket on the vxlan or geneve port.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-139651
> Feature: fix selftests
> Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
>
> diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
> index 6bb7dfaa30b6a..3fcd63f93be72 100755
> --- a/tools/testing/selftests/net/veth.sh
> +++ b/tools/testing/selftests/net/veth.sh
> @@ -97,6 +97,42 @@ chk_channels() {
> fi
> }
>
> +udp_encap_in_use() {
> + local ns cmd t
> +
> + for ns in "" `ip netns list 2>/dev/null | awk '{print $1}'`; do
> + if [ -n "$ns" ]; then
> + cmd="ip netns exec $ns"
> + else
> + cmd=""
> + fi
> +
> + for t in vxlan geneve bareudp; do
> + $cmd ip -o link show type $t 2>/dev/null | \
> + grep -q . && return 0
> + done
> + $cmd ip fou show 2>/dev/null | grep -q . && return 0
> + $cmd ip l2tp show tunnel 2>/dev/null | grep -q . && return 0
> + $cmd ss -uapn 2>/dev/null | \
> + grep -qE ':(4789|6081)([^0-9]|$)' && return 0
> + done
> + return 1
> +}
> +
> +# Only meaningful where nothing else has turned udp_encap_needed_key on
> +chk_gro_fwd() {
> + local msg="$1"
> + local expected=$2
> +
> + if [ $UDP_ENCAP -ne 0 ]; then
Bug: chk_gro_fwd skips the checks on a clean host and runs them on a host with a tunnel.
udp_encap_in_use returns 0 when encapsulation is found, so UDP_ENCAP=$? yields 0 = "in use". The top level gets this
right:
[ $UDP_ENCAP -eq 0 ] && \
echo "UDP encapsulation in use, forwarding tests will be skipped"
but the helper has it backwards:
if [ $UDP_ENCAP -ne 0 ]; then
...
echo " skip - UDP encapsulation in use"
-ne 0 is true when there is no encapsulation.
--
Konstantin Khorenko <khorenko at virtuozzo.com>
More information about the Devel
mailing list