From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v4 1/1] selftests: net: skip the veth GRO checks where they cannot run
Date: Mon, 5 Oct 2026 14:23:11 +0300 [thread overview]
Message-ID: <20261005112332.1989594-2-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20261005112332.1989594-1-eva.kurchatova@virtuozzo.com>
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@virtuozzo.com>
---
tools/testing/selftests/net/veth.sh | 47 +++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
index 6bb7dfaa30b6..08ed8781bb08 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 -eq 0 ]; then
+ printf "%-60s" "$msg"
+ echo " skip - UDP encapsulation in use"
+ return
+ fi
+
+ chk_gro "$msg" $expected
+}
+
chk_gro() {
local msg="$1"
local expected=$2
@@ -223,6 +259,11 @@ fi
[ $CPUS -lt 2 ] && echo "Only one CPU available, some tests will be skipped"
[ $STRESS -gt 0 -a $CPUS -lt 3 ] && echo " stress test will be skipped, too"
+udp_encap_in_use
+UDP_ENCAP=$?
+[ $UDP_ENCAP -eq 0 ] && \
+ echo "UDP encapsulation in use, forwarding tests will be skipped"
+
create_ns
chk_gro_flag "default - gro flag" $SRC off
chk_gro_flag " - peer gro flag" $DST off
@@ -241,7 +282,7 @@ chk_tso_flag " - tso flag" $SRC on
chk_tso_flag " - peer tso flag" $DST on
ip netns exec $NS_SRC ethtool -K veth$SRC tx-udp-segmentation off
ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
-chk_gro " - aggregation with TSO off" 1
+chk_gro_fwd " - aggregation with TSO off" 1
cleanup
create_ns
@@ -285,7 +326,7 @@ chk_tso_flag " - peer tso flag" $DST on
ip -n $NS_DST link set dev veth$DST up
ip netns exec $NS_SRC ethtool -K veth$SRC tx-udp-segmentation off
ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
-chk_gro " - aggregation with TSO off" 1
+chk_gro_fwd " - aggregation with TSO off" 1
cleanup
create_ns
@@ -348,7 +389,7 @@ ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
chk_gro " - no aggregation" 10
ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
chk_gro_flag " - gro flag with GRO on" $DST on
-chk_gro " - aggregation" 1
+chk_gro_fwd " - aggregation" 1
ip -n $NS_DST link set dev veth$DST down
--
2.56.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-10-05 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 11:23 [Devel] [PATCH hci-8.1 v4 0/1] " Eva Kurchatova
2026-10-05 11:23 ` Eva Kurchatova [this message]
2026-10-05 11:29 ` [Devel] [PATCH hci-8.1 v4 1/1] " no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261005112332.1989594-2-eva.kurchatova@virtuozzo.com \
--to=eva.kurchatova@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.