Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Willem de Bruijn
Thu, 15 Oct 2026 02:56
Re: [PATCH] udp: let rx-udp-gro-forwarding aggregate under encapsulation
Author: Willem de Bruijn
Date: Thu, 15 Oct 2026 02:56
Date: Thu, 15 Oct 2026 02:56
56 lines
10522 bytes
10522 bytes
Eva Kurchatova wrote:
> The rx-udp-gro-forwarding checks of the veth kselftest fail with "got
> 10 packets, expected 1" on a host where something uses UDP
> encapsulation, a vxlan say, and pass on a host where nothing does.
Uses encapsulation in the same network namespace as where the test
runs? If different namespaces, the socket lookup should fail and
thus the behavior be the same as on a host without a tunnel.
In general, I think the fix here, if any, is to address the flakiness
of the test, not to change the lookup behavior, which is as is
intentionally.
> Since commit f2e9de210d50 ("udp: gro behind static key") the receiving
> socket is looked up only once a tunnel socket exists, and commit
> 36707061d6ba ("udp: allow forwarding of plain (non-fraglisted) UDP GRO
> packets") takes "no socket found" for "forwarded" and aggregates only
> then. So the device setting works on a host without a tunnel and stops
> working with one.
These heuristics were chosen for a reason:
to avoid expensive coalescing + resegmenting if packets are likely to
hit a normal (i.e., without UDP_GRO) local UDP socket.
> Aggregate whenever the device asks, socket found or not. That is what
> every host without a tunnel has done all along: a local socket without
without a tunnel, or with a tunnel?
> UDP_GRO gets the packets resegmented on delivery, and a tunnel socket
> keeps its own receive path.
>
> Fixes: 36707061d6ba ("udp: allow forwarding of plain (non-fraglisted) UDP GRO packets")
> Signed-off-by: Eva Kurchatova <eva.kurchatova@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 cf07c3c6611a..d4e0e6bb9959 100644
> --- a/net/ipv4/udp_offload.c
> +++ b/net/ipv4/udp_offload.c
> @@ -804,7 +804,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 ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
> + if ((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.56.0
>
Re: [PATCH] udp: let rx-udp-gro-forwarding aggregate under encapsulation
Author: Willem de Bruijn
Date: Mon, 19 Oct 2026 18:19
Date: Mon, 19 Oct 2026 18:19
57 lines
14173 bytes
14173 bytes
On Sun, Oct 18, 2026 at 12:54 PM Eva Kurchatova (Virtuozzo)
<eva.kurchatova@virtuozzo.com> wrote:
>
>
> On Wed, 15 Oct 2026 02:56, Willem de Bruijn wrote:
> > Uses encapsulation in the same network namespace as where the test
> > runs? If different namespaces, the socket lookup should fail and
> > thus the behavior be the same as on a host without a tunnel.
>
> Different one: the vxlan sat in the init namespace, the test in the
> ns it creates. The static key is global, though, so the tunnel turns
> the lookup on everywhere, and the lookup then runs in the test's
> receiving namespace, where it finds the test's own receiver: a plain
> socket bound to any address, without UDP_GRO. That is why the check
> goes from 1 to 10 the moment a tunnel exists anywhere on the host.
I also don't have a straightforward fix to the test. Maybe just make
this one optionally SKIP if it fails.
This is the following test in veth.sh, right?
"
chk_gro() {
local msg="$1"
local expected=$2
ip netns exec $BASE$SRC ping -qc 1 $BM_NET_V4$DST >/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 &
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
local retc=$?
wait $spid
local rets=$?
"
which gets called both to verify coalsecing and no coalescing
"
ip netns exec $NS_SRC ethtool -K veth$SRC tx-udp-segmentation off
chk_gro " - aggregation with TSO off" 10
...
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
"
The full solution would be to add a third true routing namespace in
between, which would not have that local socket without -G..
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads