* [Devel] [PATCH hci-8.1 v3 0/1] selftests: net: skip the veth GRO checks where they cannot run @ 2026-09-28 19:33 Eva Kurchatova 2026-09-28 19:33 ` [Devel] [PATCH hci-8.1 v3 1/1] " Eva Kurchatova 0 siblings, 1 reply; 3+ messages in thread From: Eva Kurchatova @ 2026-09-28 19:33 UTC (permalink / raw) To: khorenko; +Cc: devel Patchset for task https://virtuozzo.atlassian.net/browse/VSTOR-139651 Changes in v3: - Skip the three forwarding checks when UDP encapsulation is in use on the host, instead of asking for UDP GRO on the receiver, which made them pass without testing rx-udp-gro-forwarding. - Drop a comment, the reasoning is within the message. - Retitled. Sent alone, the rest of v2 is merged. - Link to v2: http://lore.virtuozzo.com/kernel/20260922120235.2729869-3-eva.kurchatova@virtuozzo.com/ Changes in v2: - Unchanged, renumbered within the series. - Link to v1: http://lore.virtuozzo.com/kernel/20260831224850.1642265-4-eva.kurchatova@virtuozzo.com/ Eva Kurchatova (1): selftests: net: skip the veth GRO checks where they cannot run tools/testing/selftests/net/veth.sh | 47 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Devel] [PATCH hci-8.1 v3 1/1] selftests: net: skip the veth GRO checks where they cannot run 2026-09-28 19:33 [Devel] [PATCH hci-8.1 v3 0/1] selftests: net: skip the veth GRO checks where they cannot run Eva Kurchatova @ 2026-09-28 19:33 ` Eva Kurchatova 2026-09-30 13:51 ` Konstantin Khorenko 0 siblings, 1 reply; 3+ messages in thread From: Eva Kurchatova @ 2026-09-28 19:33 UTC (permalink / raw) To: khorenko; +Cc: devel 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..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 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v3 1/1] selftests: net: skip the veth GRO checks where they cannot run 2026-09-28 19:33 ` [Devel] [PATCH hci-8.1 v3 1/1] " Eva Kurchatova @ 2026-09-30 13:51 ` Konstantin Khorenko 0 siblings, 0 replies; 3+ messages in thread From: Konstantin Khorenko @ 2026-09-30 13:51 UTC (permalink / raw) To: Eva Kurchatova; +Cc: devel > 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> > > 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@virtuozzo.com> _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-30 13:53 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-09-28 19:33 [Devel] [PATCH hci-8.1 v3 0/1] selftests: net: skip the veth GRO checks where they cannot run Eva Kurchatova 2026-09-28 19:33 ` [Devel] [PATCH hci-8.1 v3 1/1] " Eva Kurchatova 2026-09-30 13:51 ` Konstantin Khorenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox