[Devel] [PATCH hci-8.1 v3 1/1] selftests: net: skip the veth GRO checks where they cannot run
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Mon Sep 28 22:33:25 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>
---
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..3fcd63f93be7 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
+ 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.55.0
More information about the Devel
mailing list