mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: julius@bairaktaris.de
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
Subject: Re: [PATCH net v5 3/4] ipmr: set up GSO state for tunnel vifs
Date: Mon, 16 Nov 2026 00:47:30 +0000	[thread overview]
Message-ID: <179479005048.3136.13054780886372350388@kernel.org> (raw)
In-Reply-To: <cbd032be365b09f1108faed42ca165531d5dd99d.1794151759.git.julius@bairaktaris.de>

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

  reply	other threads:[~2026-11-16  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 18:26 [PATCH net v5 0/4] ipmr: forward GSO multicast packets Julius Bairaktaris
2026-11-14 18:26 ` [PATCH net v5 1/4] net: make room for the tunnel header in skb_segment_list() Julius Bairaktaris
2026-11-14 18:26 ` [PATCH net v5 2/4] net: gso: count the inner UDP header of encapsulated UDP GSO packets Julius Bairaktaris
2026-11-16  0:47   ` netdev-bot+sashiko
2026-11-14 18:26 ` [PATCH net v5 3/4] ipmr: set up GSO state for tunnel vifs Julius Bairaktaris
2026-11-16  0:47   ` netdev-bot+sashiko [this message]
2026-11-14 18:27 ` [PATCH net v5 4/4] ipmr: do not drop GSO packets that fit the MTU after segmentation Julius Bairaktaris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179479005048.3136.13054780886372350388@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=almasrymina@google.com \
    --cc=bigeasy@linutronix.de \
    --cc=bsdhenrymartin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=jiayuan.chen@linux.dev \
    --cc=julius@bairaktaris.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfleming@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardbgobert@gmail.com \
    --cc=steffen.klassert@secunet.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®