OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns
@ 2026-10-27 17:27 Konstantin Khorenko
  2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 1/2] selftests: net: veth: check UDP GRO forwarding on forwarded traffic Konstantin Khorenko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Konstantin Khorenko @ 2026-10-27 17:27 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

Patchset for task https://virtuozzo.atlassian.net/browse/VSTOR-151678

This patchset replaces the kernel patch that was declined upstream, on
the grounds that the kselftest itself should use a separate netns.

Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Link: https://lore.kernel.org/netdev/CAF=yD-LZSec9g_0bBgrcQvq2OO1BrxMSRHH=uU7eamCmWcTO_A@mail.gmail.com/
Assisted-by: LLM
---
Changes in v2:
- Patch 1, message: GRO looks the socket up only behind the static key
  since f2e9de210d50, not 36707061d6ba, and a UDP_GRO socket turns that
  key on as well as a tunnel does.
- Patch 1: create the fwd veth pair inside the namespaces, so the test
  adds no interface names to init_net.
- Patch 1: drop the two comments that restated variable names; the
  one left in create_ns() no longer ties the lookup to tunnels only.
- Link to v1: http://lore.virtuozzo.com/20261026120854.600354-1-eva.kurchatova@virtuozzo.com

---
Eva Kurchatova (2):
      selftests: net: veth: check UDP GRO forwarding on forwarded traffic
      Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation"

 net/ipv4/udp_offload.c              |  2 +-
 tools/testing/selftests/net/veth.sh | 24 ++++++++++++++++++++----
 2 files changed, 21 insertions(+), 5 deletions(-)
---
base-commit: 02401c5e378f282fbf11bdc65996253ff65dad9b
change-id: 20261027-b4-prep-khorenko-vstor-151678-veth-udp-gro-fwd-bb2a01c8acfd

Best regards,
--  
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Devel] [PATCH hci-8.1 v2 1/2] selftests: net: veth: check UDP GRO forwarding on forwarded traffic
  2026-10-27 17:27 [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Konstantin Khorenko
@ 2026-10-27 17:27 ` Konstantin Khorenko
  2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 2/2] Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation" Konstantin Khorenko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Konstantin Khorenko @ 2026-10-27 17:27 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

The rx-udp-gro-forwarding checks fail with "got 10 packets, expected 1"
on a host with a UDP tunnel or UDP_GRO socket open, a vxlan say, and
pass on a host without one.

Since commit f2e9de210d50 ("udp: gro behind static key") GRO looks the
receiving socket up only while such a socket exists, in any netns. Since
commit 36707061d6ba ("udp: allow forwarding of plain (non-fraglisted)
UDP GRO packets") the feature aggregates only datagrams GRO finds no
socket for. The checks send to a socket in the receiving namespace, so
they pass only while GRO does not look it up.

This tree made them pass by changing the kernel instead, in
commit 8ce3afeec4ca ("udp: let rx-udp-gro-forwarding aggregate under
encapsulation"), which upstream did not take.

Let the destination forward the datagrams to a receiver in a namespace
behind it: no socket is found there, whatever the host runs, and the
checks count what the destination receives as before.

Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Link: https://lore.kernel.org/netdev/CAF=yD-LZSec9g_0bBgrcQvq2OO1BrxMSRHH=uU7eamCmWcTO_A@mail.gmail.com/
https://virtuozzo.atlassian.net/browse/VSTOR-151678
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 tools/testing/selftests/net/veth.sh | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
index 6bb7dfaa30b6a..87d11f854221f 100755
--- a/tools/testing/selftests/net/veth.sh
+++ b/tools/testing/selftests/net/veth.sh
@@ -9,10 +9,13 @@ readonly DST=1
 readonly DST_NAT=100
 readonly NS_SRC=$BASE$SRC
 readonly NS_DST=$BASE$DST
+readonly RCV=3
+readonly NS_RCV=$BASE$RCV
 
 # "baremetal" network used for raw UDP traffic
 readonly BM_NET_V4=192.168.1.
 readonly BM_NET_V6=2001:db8::
+readonly RCV_NET_V4=192.168.2.
 
 readonly CPUS=`nproc`
 ret=0
@@ -24,7 +27,7 @@ cleanup() {
 	[ -n "${jobs}" ] && kill -1 ${jobs} 2>/dev/null
 	rm -f $STATS
 
-	for ns in $NS_SRC $NS_DST; do
+	for ns in $NS_SRC $NS_DST $NS_RCV; do
 		ip netns del $ns 2>/dev/null
 	done
 }
@@ -46,6 +49,17 @@ create_ns() {
 		ip -n $BASE$ns addr add dev veth$ns $BM_NET_V4$ns/24
 		ip -n $BASE$ns addr add dev veth$ns $BM_NET_V6$ns/64 nodad
 	done
+
+	# Forwarded, the datagrams find no local socket, whatever the host runs
+	ip netns add $NS_RCV
+	ip -n $NS_RCV link set dev lo up
+	ip -n $NS_DST link add name fwd$DST type veth peer name fwd$RCV netns $NS_RCV
+	ip -n $NS_DST link set dev fwd$DST up
+	ip -n $NS_RCV link set dev fwd$RCV up
+	ip -n $NS_DST addr add dev fwd$DST $RCV_NET_V4$DST/24
+	ip -n $NS_RCV addr add dev fwd$RCV $RCV_NET_V4$RCV/24
+	ip netns exec $NS_DST sysctl -wq net.ipv4.ip_forward=1
+	ip -n $NS_RCV route add default via $RCV_NET_V4$DST
 }
 
 __chk_flag() {
@@ -101,15 +115,17 @@ chk_gro() {
 	local msg="$1"
 	local expected=$2
 
-	ip netns exec $BASE$SRC ping -qc 1 $BM_NET_V4$DST >/dev/null
+	# Taking veth$SRC down drops the route, so set it for every check
+	ip -n $NS_SRC route replace ${RCV_NET_V4}0/24 via $BM_NET_V4$DST
+	ip netns exec $BASE$SRC ping -qc 1 $RCV_NET_V4$RCV >/dev/null
 	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 &
+	ip netns exec $NS_RCV ./udpgso_bench_rx -C 1000 -R 10 &
 	local spid=$!
 	sleep 0.1
 
-	ip netns exec $NS_SRC ./udpgso_bench_tx -4 -s 13000 -S 1300 -M 1 -D $BM_NET_V4$DST
+	ip netns exec $NS_SRC ./udpgso_bench_tx -4 -s 13000 -S 1300 -M 1 -D $RCV_NET_V4$RCV
 	local retc=$?
 	wait $spid
 	local rets=$?

-- 
2.43.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Devel] [PATCH hci-8.1 v2 2/2] Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation"
  2026-10-27 17:27 [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Konstantin Khorenko
  2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 1/2] selftests: net: veth: check UDP GRO forwarding on forwarded traffic Konstantin Khorenko
@ 2026-10-27 17:27 ` Konstantin Khorenko
  2026-10-27 17:57 ` [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Eva Kurchatova (Virtuozzo)
  2026-10-29 15:16 ` Konstantin Khorenko
  3 siblings, 0 replies; 5+ messages in thread
From: Konstantin Khorenko @ 2026-10-27 17:27 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

This reverts commit 8ce3afeec4cab80d99076986395ac93e891d1df6.

The change made rx-udp-gro-forwarding aggregate for a socket the lookup
found, which the feature never meant: it is for packets no local socket
takes. A found tunnel socket without its own GRO, wireguard or L2TP, had
its packets aggregated and segmented again on delivery, work the host
never did before. The veth.sh checks it was made for expect local
delivery aggregated, which only happens where nothing looks the socket
up; the test was wrong there, not the kernel, and the previous patch
fixes the test. Withdrawn upstream on the same grounds.

Link: https://lore.kernel.org/netdev/179180161935.434549.5518274080541032248@kernel.org/
https://virtuozzo.atlassian.net/browse/VSTOR-151678
Feature: fix ms/udp
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 net/ipv4/udp_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 375273572ecb4..4245522d42014 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -650,7 +650,7 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb,
 		if (skb->dev->features & NETIF_F_GRO_FRAGLIST)
 			NAPI_GRO_CB(skb)->is_flist = sk ? !udp_test_bit(GRO_ENABLED, sk) : 1;
 
-		if ((skb->dev->features & NETIF_F_GRO_UDP_FWD) ||
+		if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
 		    (sk && udp_test_bit(GRO_ENABLED, sk)) || NAPI_GRO_CB(skb)->is_flist)
 			return call_gro_receive(udp_gro_receive_segment, head, skb);
 

-- 
2.43.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns
  2026-10-27 17:27 [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Konstantin Khorenko
  2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 1/2] selftests: net: veth: check UDP GRO forwarding on forwarded traffic Konstantin Khorenko
  2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 2/2] Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation" Konstantin Khorenko
@ 2026-10-27 17:57 ` Eva Kurchatova (Virtuozzo)
  2026-10-29 15:16 ` Konstantin Khorenko
  3 siblings, 0 replies; 5+ messages in thread
From: Eva Kurchatova (Virtuozzo) @ 2026-10-27 17:57 UTC (permalink / raw)
  To: Konstantin Khorenko; +Cc: devel


On 10/27/26 19:27, Konstantin Khorenko wrote:
> Patchset for task https://virtuozzo.atlassian.net/browse/VSTOR-151678
>
> This patchset replaces the kernel patch that was declined upstream, on
> the grounds that the kselftest itself should use a separate netns.
>
> Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Link: https://lore.kernel.org/netdev/CAF=yD-LZSec9g_0bBgrcQvq2OO1BrxMSRHH=uU7eamCmWcTO_A@mail.gmail.com/
> Assisted-by: LLM
> ---
> Changes in v2:
> - Patch 1, message: GRO looks the socket up only behind the static key
>    since f2e9de210d50, not 36707061d6ba, and a UDP_GRO socket turns that
>    key on as well as a tunnel does.
> - Patch 1: create the fwd veth pair inside the namespaces, so the test
>    adds no interface names to init_net.
> - Patch 1: drop the two comments that restated variable names; the
>    one left in create_ns() no longer ties the lookup to tunnels only.
> - Link to v1: http://lore.virtuozzo.com/20261026120854.600354-1-eva.kurchatova@virtuozzo.com
>
> ---
> Eva Kurchatova (2):
>        selftests: net: veth: check UDP GRO forwarding on forwarded traffic
>        Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation"
>
>   net/ipv4/udp_offload.c              |  2 +-
>   tools/testing/selftests/net/veth.sh | 24 ++++++++++++++++++++----
>   2 files changed, 21 insertions(+), 5 deletions(-)
> ---
> base-commit: 02401c5e378f282fbf11bdc65996253ff65dad9b
> change-id: 20261027-b4-prep-khorenko-vstor-151678-veth-udp-gro-fwd-bb2a01c8acfd
>
> Best regards,
> --
> Konstantin Khorenko,
> Virtuozzo Linux Kernel Team


Thanks. All good, tested on the dev node and it passes with a vxlan.


Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns
  2026-10-27 17:27 [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Konstantin Khorenko
                   ` (2 preceding siblings ...)
  2026-10-27 17:57 ` [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Eva Kurchatova (Virtuozzo)
@ 2026-10-29 15:16 ` Konstantin Khorenko
  3 siblings, 0 replies; 5+ messages in thread
From: Konstantin Khorenko @ 2026-10-29 15:16 UTC (permalink / raw)
  To: Eva Kurchatova, Konstantin Khorenko; +Cc: devel

On Tue, 27 Oct 2026 18:27:49 +0100, Konstantin Khorenko wrote:
> selftests: net: veth: run under separate netns
> 
> Patchset for task https://virtuozzo.atlassian.net/browse/VSTOR-151678
> 
> This patchset replaces the kernel patch that was declined upstream, on
> the grounds that the kselftest itself should use a separate netns.
> 
> [...]

Applied to branch-rh10-6.12.0-211.52.1.22.x.vz10-ovz, will be released in rh10-6.12.0-211.52.1.22.12.vz10, thanks!

[1/2] selftests: net: veth: check UDP GRO forwarding on forwarded traffic
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/428f0c58dd00
[2/2] Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation"
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/4f459e5fec0f

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-29 15:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 17:27 [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Konstantin Khorenko
2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 1/2] selftests: net: veth: check UDP GRO forwarding on forwarded traffic Konstantin Khorenko
2026-10-27 17:27 ` [Devel] [PATCH hci-8.1 v2 2/2] Revert "udp: let rx-udp-gro-forwarding aggregate under encapsulation" Konstantin Khorenko
2026-10-27 17:57 ` [Devel] [PATCH hci-8.1 v2 0/2] selftests: net: veth: run under separate netns Eva Kurchatova (Virtuozzo)
2026-10-29 15:16 ` Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox