๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #1878

Re: [PATCH net 1/2] gre: keep the UDP tunnel GSO type when completing GRO

#1878
From: Eric Dumazet
Date: Sun, 11 Oct 2026 08:55
64 lines
9526 bytes
Le dim. 11 oct. 2026 ร  03:41, Brad Fitzpatrick via B4 Relay
<devnull+bradfitz.tailscale.com@kernel.org> a รฉcrit :
>
> From: Brad Fitzpatrick <bradfitz@tailscale.com>
>
> gre_gro_complete() assigns SKB_GSO_GRE to gso_type rather than OR-ing
> it in. When GRE is carried over UDP by FOU or GUE, udp_gro_complete()
> has already set SKB_GSO_UDP_TUNNEL{,_CSUM} before calling into the FOU
> or GUE gro_complete handler and then gre_gro_complete(), so that bit is
> lost.
>
> That has broken forwarding of such packets since FOU gained GRO: if a
> host with a FOU or GUE socket on the tunnel's port merges transit
> packets and then forwards them out a device that can't segment them
> itself, udp4_ufo_fragment() finds neither tunnel bit and fails, and
> the packets are dropped. Since commit 3d010c8031e3 ("udp: do not accept
> non-tunnel GSO skbs landing in a tunnel"), local receive is broken too:
> udp_unexpected_gso() considers the merged skb, which reaches the
> encapsulation socket without either UDP tunnel bit, unexpected and
> hands it to udp_rcv_segment(). Segmenting fails, so the packet is
> freed and counted in UdpInErrors. Either way, only packets GRO didn't
> merge get through, so TCP over FOU or GUE GRE tunnels slows to about
> one segment per round trip whenever the receiving device has GRO
> enabled.
>
> OR in SKB_GSO_GRE instead, as ipip_gro_complete() and
> sit_gro_complete() do for SKB_GSO_IPXIP4. For plain GRE, gso_type is
> still zero at this point unless the driver set it, so nothing changes
> there in the usual case.
>
> The assignment dates to commit bf5a755f5e91 ("net-gre-gro: Add GRE
> support to the GRO stack"), but nothing set gso_type before it until
> FOU GRO came along, so the Fixes tag points there.
>
> Tested under virtme-ng with bulk TCP over a GRE tunnel between two
> network namespaces joined by a veth, with GRO on the receiving veth and
> segmentation off on the sending one, so GRO sees wire-sized packets.
> 32 MiB took:
>
>                   before                  after
>   FOU over IPv4   26.0s, 9658 UDP errors  0.28s, 0 errors
>   GUE over IPv4   26.1s, 9686 UDP errors  0.39s, 0 errors
>   FOU over IPv6   26.4s, 9860 UDP errors  0.16s, 0 errors
>   plain GRE       0.17s                   0.15s
>
> Forwarding the same FOU traffic through a third namespace with its own
> FOU socket on the port, GRO on its ingress and segmentation off on its
> egress, took 26.0s with 4826 egress drops before and 0.31s with none
> after. On v6.8, before 3d010c8031e3, local receive was fine but
> forwarding failed the same way (25.7s, 4764 drops).
>
> With GRO off on the receiver, all took under 0.2s both before and
> after. The gre_gso.sh and fou_mcast_encap.sh selftests give the same
> results before and after.
>
> Fixes: afe93325bc02 ("fou: Add GRO support")
> Assisted-by: LLM
> Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
> ---

Nice catch, thanks.

Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Technical Details
Message-ID: <CAL4WiioRu30CJBTDo6UhnJCb8jmzYUZaDZ9UQAZ0+rpxtANH0g@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344433-linux-kernel-netdev=dewy.ru
References: <20261011-bradfitz-gre-fou-gro-b4-v1-0-df713aad1531@tailscale.com> <20261011-bradfitz-gre-fou-gro-b4-v1-1-df713aad1531@tailscale.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344433-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/2] gre: keep the UDP tunnel GSO type when completing GRO
Date: Sun, 11 Oct 2026 10:55:38 +0200
Organization: Usenet Network
Message-ID: <CAL4WiioRu30CJBTDo6UhnJCb8jmzYUZaDZ9UQAZ0+rpxtANH0g@mail.gmail.com>
References: <20261011-bradfitz-gre-fou-gro-b4-v1-0-df713aad1531@tailscale.com> <20261011-bradfitz-gre-fou-gro-b4-v1-1-df713aad1531@tailscale.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1503544"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:3J/ziM/2IjAEbLv4O8q4ddmONaQ= sha256:JKRgTgs3QT9BAVbkatsHrAXEBLEZfTC0fMSCsMoHWmY=
	sha1:XnIbaSZ24WcTOKtdHMhmJGJ0bYI= sha256:TIx/S82kgpqGSvKKC90npJ4JVF9KQqmprFpemoNi7Uc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B3BC310F9C7; Sun, 11 Oct 2026 11:56:06 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.341
X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id V7QHitoOaIyD;
	Sun, 11 Oct 2026 11:56:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-344433-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 1ADBD10F57F; Sun, 11 Oct 2026 11:55:57 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id 5AAD326126; Sun, 11 Oct 2026 08:55:53 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E622381EBB;
	Sun, 11 Oct 2026 08:55:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TtGem5H/"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5729C1C75F9
	for <netdev@vger.kernel.org>; Sun, 11 Oct 2026 08:55:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791708951; cv=none; b=IjYV9LXuTDt/xjPbcFb6Kv55Df/pq6ZuIFXVM0f555zgeKnPN1JamEo6RaaTRUU0X9WPFFk9my7/w0mZIvn+D8ebPmmb4/e+2kjr1GzF5WMO4HmNufBJ6/6QTBuG5S3o1rEM+6DXRdHNOAkljm4auroqapcB4uf9C9wjps/gfkk=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791708951; c=relaxed/simple;
	bh=c71GV9Em8N83Q/onaYF06piMYm9Sy1RKY9G8jl/civ0=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=aSvVbscQ3Nm+EvTpKn5ZikMuGZE/Zqm9z7q1IYQX1hBEOQZFJBhf55ItX1jaUpHFWM+dlclFPNgZpfwjb1xJSoLkLrx8mSV7JDh6Ch+vYmlFIkGYmyPm/mHimZHxzhSEN3PEXCFgLFfQAdQNMj+mmw+zqUgWWRMD73wnkVkrpMA=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TtGem5H/; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2140F1F0089C
	for <netdev@vger.kernel.org>; Sun, 11 Oct 2026 08:55:50 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791708950;
	bh=bq8owGPAlvuzDobHhVTg9562ILbptQRMiB+o1O0+JE0=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=TtGem5H/n9sfe4HkWONB9kN5HHL3KAmk9Iei//tLjScYYPayiVeNl7PIVSuyHQspQ
	 FL1kgEdzoJ5UUN26eeHlTQMl4I6HbobjPwKnwgrVoqqB1xHRNmmboU5wZrj4ju6Goq
	 YX2i7Qa2/3uxO/tti6wro2aIfMPf73eaARb2Fooq63Qp2VuaGcsStuG8Za0OtuE3Nd
	 Uftiwf8QTNcjElt3UTNQ7pJa4OfbMGyRrqTbt8ZHPUzmpwlIeMXB7hfeTf40UZOv9H
	 BIgZKxhAoXGlJwkJsx/ZdwWz7HtkUHf5NnpWaVz0RN5w4DVwQRCdYuqbbsNzYIdO/B
	 IU4R3NqBrbsFQ==
X-Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-6df5e315bd1so710880eaf.2
        for <netdev@vger.kernel.org>; Sun, 11 Oct 2026 01:55:50 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvBylx/KbFnWSLlaZZZGYoM/OSPg+Rrgx+jaSwVfWLyxyDG7z828icC3ZqM7+SBfu/yjiYI4PBM0=@vger.kernel.org
X-Gm-Message-State: AFq9FYI+zs1Yd05nFcs1+Gp6y63FFvWPnLE+boMvYTZ2zwTRZ/jcqa4r
	Nop0gJiv58I+jWBeHuPVQ4NKz41OgXLnmhquMbUkfrl148LIeHKQKgr59bI4yu0u2Rxsb+ENICz
	aG3uPhfVDaa2BZsl14ccWG+kdd+3/JjA=
X-Received: by 2002:a05:6820:c2d3:10b0:6f4:ae96:c596 with SMTP id
 006d021491bc7-6f4ae96ccc1mr351008eaf.2.1791708949482; Sun, 11 Oct 2026
 01:55:49 -0700 (PDT)
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261011-bradfitz-gre-fou-gro-b4-v1-1-df713aad1531@tailscale.com>
X-Gmail-Original-Message-ID: <CAL4WiioRu30CJBTDo6UhnJCb8jmzYUZaDZ9UQAZ0+rpxtANH0g@mail.gmail.com>
X-Gm-Features: AclHuK_2L6gfWdm0daVBvQD8sLKYxLb2fL9PO6B1lw50qvYQOGtJGmvz7CgB9gg
X-Cc: "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, 
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>, 
	Antoine Tenart <atenart@kernel.org>, Willem de Bruijn <willemb@google.com>, netdev@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org