🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16877

Re: [PATCH net v5 3/4] ipmr: set up GSO state for tunnel vifs

#16877
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 00:47
97 lines
11510 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The new early drop in the VIFF_TUNNEL branch of
  ipmr_prepare_xmit() (net/ipv4/ipmr.c:1959-1960, `if (skb_is_gso(skb)…

--

ipmr: set up GSO state for tunnel vifs

This commit sets up the GSO state in ip_encap() for VIFF_TUNNEL vifs. It
calls iptunnel_handle_offloads() and skb_set_inner_ipproto(), reserves one
outer IP ID per segment, and sets the outer length with iph_set_totlen().
It also drops GSO packets that are already marked as encapsulated before
they reach a tunnel vif.

> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> index 836f3f95b20c4..09d6b0ff1ffb7 100644
> --- a/net/ipv4/ipmr.c
> +++ b/net/ipv4/ipmr.c

[ ... ]

> @@ -1951,6 +1955,9 @@ static int ipmr_prepare_xmit(struct net *net, struct mr_table *mrt,
>  	}
>  
>  	if (vif->flags & VIFF_TUNNEL) {
> +		/* The inner headers can describe one tunnel only */
> +		if (skb_is_gso(skb) && skb->encapsulation)
> +			return -1;

[Severity: Medium]
Does this check also drop IPIP and SIT GRO aggregates that used to be
forwarded correctly?

ipip_gro_complete() in net/ipv4/af_inet.c and sit_gro_complete() in
net/ipv6/ip6_offload.c both set the encapsulation bit and the IPXIP4 GSO
type:

    skb->encapsulation = 1;
    skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP4;

ipip_gso_segment() and sit_gso_segment() only reject packets that lack
SKB_GSO_IPXIP4:

    if (!(skb_shinfo(skb)->gso_type & SKB_GSO_IPXIP4))
        return ERR_PTR(-EINVAL);

    return inet_gso_segment(skb, features);

Before this patch, an IPIP-in-IPIP or SIT-in-IPIP aggregate passed this
check. inet_gso_segment() then recursed through each IP layer and fixed
tot_len, id and the checksum at every level. The MTU check in
ip_finish_output_gso() also looked right, because
skb_gso_transport_seglen() counts the inner headers when encapsulation is
set.

With this patch, these packets return -1 before the route lookup. The
callers then free them with no MIB counter bumped:

ip_mr_forward()->ipmr_queue_fwd_xmit()
    if (ipmr_prepare_xmit(net, mrt, skb, vifi))
        goto out_free;
    ...
out_free:
    kfree_skb(skb);

ipmr_queue_output_xmit() behaves the same way.

The commit message says these packets are dropped "as segmentation
dropped it before". Is that only true for GRE and UDP tunnel GSO types
that do not carry SKB_GSO_IPXIP4?

This check is unchanged at the end of the series, so the later commit
"ipmr: do not drop GSO packets that fit the MTU after segmentation" does
not fix it. That later commit would otherwise let DF-set aggregates of
this kind through the MTU check, but this drop stops them first.

Would a narrower condition keep the previous behaviour for these
packets? For example, the drop could be skipped when gso_type already
contains SKB_GSO_IPXIP4.

>  		rt = ip_route_output_ports(net, &fl4, NULL,
>  					   vif->remote, vif->local,
>  					   0, 0,

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794151759.git.julius%40bairaktaris.de
Technical Details
Message-ID: <179479005048.3136.13054780886372350388@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363967-linux-kernel-netdev=dewy.ru
References: <cbd032be365b09f1108faed42ca165531d5dd99d.1794151759.git.julius@bairaktaris.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363967-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v5 3/4] ipmr: set up GSO state for tunnel vifs
Date: Mon, 16 Nov 2026 00:47:30 +0000
Organization: Usenet Network
Message-ID: <179479005048.3136.13054780886372350388@kernel.org>
References: <cbd032be365b09f1108faed42ca165531d5dd99d.1794151759.git.julius@bairaktaris.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1945835"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dThSuB1yP3tQq2FurrH5g85/2a4= sha256:ojWoagKbjdp7a2DpfkU+mNh/gW7WkEpNwO+Sb0M//hM=
	sha1:pK2GhFtyOBhDUcjAin4zvHu+BF4= sha256:h4t3gQWVU8HKkAutVLBLCQ7U43orPiQ9mU72KKi6Wmo=
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 924FF114AD9; Mon, 16 Nov 2026 03:47:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=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 ZGWEOXQu88Ss;
	Mon, 16 Nov 2026 03:47:51 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363967-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 7A7D0114ACC; Mon, 16 Nov 2026 03:47:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 5AAC92FB86; Mon, 16 Nov 2026 00:47:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794790058;
	b=qsW5WiTJD/Vy24HuK4NA+4QQKqcOSG0Wnw4riMhb5te3/zO3xDYqvNdm/Q+cArHUE6xf
	 tE1cIIELwu2B64D21vMUYheTx/lRMwGSqLWyYdIoejciFVdwfMRr96j6SVAyHNzMZzPxw
	 W4aqrlej+Xgf09gqW5+CwWse01pJkhLSDRzTzL9x4urxqFcJ1pI0HWZQeAaynBhH7zmJl
	 EBrQHEN/y9I/5mgnvsyUXzlFGBEM+5U0EspfC7f5+ghz12Eh2B5A4I81YeAxkycPSxaFf
	 aiLTSPSd553W2187EPe3Ksg8DCUmCKFKclTlTSSQ/QQ0QlLLZDzOrV/Ew6mPHworHkw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794790058;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=tXBNJhV2JVPO7xRWdzrt7Q5c46ZVzXaj/J1TQj/HRCc=;
	b=YYQJEThAbm/9WRKWLApCnMx5BIiUWC+odU3cAg6fpcjZW1yqquOHORUmFfoa0reRlYv+
	 RchoRzZ81kcW8NAaEdYnG4Ev5gEIlKheW4kextUoV827eJDPXHVSAhOg9L1J4/cDGln8O
	 ncEbhMkJUeJEihlt9tDBWo85Ss270WDZ8CLxXOcELJKYjanFqr0lkFesLKwi5NeLhu2zR
	 7eFNnActGD7shUwwQBm51GutoKmv868T4/9FezvGCjap0eTfytcPZyH9auyvH3Qc9FFms
	 UYp6UUbP6phZrseEdudUdO5ZdVJf10XrvsqrQt25uzY/oamAbnQ5SNcyibvgZc9RiwQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cOpaTUZK;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D63D606A329;
	Mon, 16 Nov 2026 00:47:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cOpaTUZK
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794790052;
	b=WixwU07uCZiak6KHTFSJvBaDguKPBOP0XxEKTdtE4fNm6Vd9V5TItl0ASN6HSzI0vUxK
	 +2A0jOKyWYy8dWee8ZiNO46ZRtZ3lfS8VVBmGBPHbjTezPm2i40J62WhPAw28V2Z3KSbj
	 OAsHzbb3bgohCLsXf/VlnOTs4qymQVh4PYQbwl8UXAreuKsJRzSOAqmpxLwe+n9N7FmjK
	 1sheKDhntOEMR6AjIc6cWJZvsEyXp2lZn+g9ITQ8mVxvjVQc50xL70pjqJoPeGKHfyHCI
	 p4ii1i/xgcedXAC0Vq4z2pEVLZA36DfCitaOAEXJo2LjI2PstZv54Hm5Mf5HIawXbZQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794790052;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=tXBNJhV2JVPO7xRWdzrt7Q5c46ZVzXaj/J1TQj/HRCc=;
	b=kIvw/cIPlSAhY/4lkKgEkjy3hvF7f43bALYSRnOO8bwPElyHyWCYqwFnl1cVe/O5g4qI
	 PLuKxAT9FaDfu1QuTSlxl36wmZ7Iul2hGb6vWBu9jnK613k/zn1S5IjXaSqQIYIZHqo3o
	 hCNvmCHHEbOf7G3EXt7ZOAsxP3R6A48GDeCiwdIe3a+hWrD9xR4C3eOMH9yo10OOaXCIG
	 D7/9AnFx6eSkHDHyQ9+wS/GeV0pu+cyO1cwZZe22TFowp8f3+6kq6HbuaUzRbascZdr6Q
	 d2LwP2J8j8d3MiRr8SXLXpfr26TQ1gsLEzl/XrxJH6L3nEGTazqBOVKQRTuzjx/9f0A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cOpaTUZK;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C8FE606A332;
	Mon, 16 Nov 2026 00:47:32 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7D421F000C4;
	Mon, 16 Nov 2026 00:47:30 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794790052;
	bh=tXBNJhV2JVPO7xRWdzrt7Q5c46ZVzXaj/J1TQj/HRCc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=cOpaTUZK0LvCsbtnUUynkZGp/Qhg3EGlxbpSj+Mwcln+jkVCJQS2ZUGZF329M85dU
	 NCYwVMc8Pjb9MWv3KGma3eOpD7ut0tqQvhFk9YAMIU1y9ykrgvKnetgfNZTIOZe/qF
	 XEYTw2LIg7x4N5DOA9MV6azo6dPpm/OxeMT8w0TNQkvNwkeq7BcP6MDfEMxRavWQeJ
	 edhHEejpZ7Kc+CuRcyWzNYc/q98XcTswjIOLZ8axdRJJsyyN8AmMcTYp4d25AzPtYF
	 IOERaaF5LGSCjelgnvlGXJweal9eDbngDtrpKAPOerj+eD1dvQnMr+GcMu5oV19DcI
	 KuvPJeCkdLmaQ==
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, dsahern@kernel.org,
 idosch@nvidia.com, willemb@google.com, steffen.klassert@secunet.com,
 jiayuan.chen@linux.dev, mfleming@cloudflare.com, almasrymina@google.com,
 bigeasy@linutronix.de, richardbgobert@gmail.com, ecree.xilinx@gmail.com,
 bsdhenrymartin@gmail.com, linux-kernel@vger.kernel.org
X-In-Reply-To: <cbd032be365b09f1108faed42ca165531d5dd99d.1794151759.git.julius@bairaktaris.de>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list