[Devel] [PATCH vz10 4/7] selftests: net: make the veth GRO checks independent of host tunnels

Eva Kurchatova eva.kurchatova at virtuozzo.com
Tue Sep 1 01:48:22 MSK 2026


Three aggregation checks report 10 packets where they want 1 on a host
that has a vxlan, and pass on a host that does not. The kernel is doing
what it is written to do.

udp4_gro_receive() looks up the receiving socket only when
udp_encap_needed_key is on, and that key is global: any UDP
encapsulation socket on the machine, in any namespace, turns it on.
udp_gro_receive() then aggregates for a packet that has no socket, or
for a socket that asked for UDP GRO, and consults NETIF_F_GRO_UDP_FWD
only in the first case. So with a vxlan somewhere on the box the lookup
finds the test's own receiver, and rx-udp-gro-forwarding never gets a
say.

Ask for UDP GRO on the receiving socket, which makes the aggregation
happen either way. Where no encapsulation socket exists the lookup
still does not happen and the device flag still decides, so what the
checks cover there does not change.

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 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
index 6bb7dfaa30b6..b95167f0b4c2 100755
--- a/tools/testing/selftests/net/veth.sh
+++ b/tools/testing/selftests/net/veth.sh
@@ -105,7 +105,15 @@ chk_gro() {
 	NSTAT_HISTORY=$STATS ip netns exec $NS_DST nstat -n
 
 	printf "%-60s" "$msg"
-	ip netns exec $BASE$DST ./udpgso_bench_rx -C 1000 -R 10 &
+	# -G makes the receiving socket ask for UDP GRO.  Without it the
+	# aggregation checks depend on no UDP encapsulation socket existing
+	# anywhere on the machine: udp4_gro_receive() only looks up the
+	# socket when udp_encap_needed_key is on, and that key is global.
+	# With a vxlan on the host the lookup finds this receiver, and
+	# NETIF_F_GRO_UDP_FWD is then not consulted at all, so nothing is
+	# aggregated.  On a machine without such a socket the lookup does
+	# not happen and the device flag still decides, as before.
+	ip netns exec $BASE$DST ./udpgso_bench_rx -G -C 1000 -R 10 &
 	local spid=$!
 	sleep 0.1
 
-- 
2.55.0



More information about the Devel mailing list