Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: yanhaishuang@cmss.chinamobile.com
Cc: netdev@vger.kernel.org, dsahern@kernel.org, idosch@nvidia.com,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, shuah@kernel.org,
	alice.kernel@fastmail.im, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/6] gre: Enable BIG TCP packets
Date: Wed, 25 Nov 2026 01:34:55 +0000	[thread overview]
Message-ID: <179557049527.3135.5031926005314724834@kernel.org> (raw)
In-Reply-To: <20261124013124.3693-3-yanhaishuang@cmss.chinamobile.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch turns on BIG TCP for gre and gretap (tso_max_size =
  GSO_MAX_SIZE in ipgre_tunnel_setup()/ipgre_tap_setup()).

--

gre: Enable BIG TCP packets

This commit raises tso_max_size to GSO_MAX_SIZE for gre and gretap
devices, so an admin can use BIG TCP on them by raising gso_max_size and
gso_ipv4_max_size. erspan is not changed, and the defaults stay at 64KB.

> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
> index f8a7c43535020..41ec54dcbfdcc 100644
> --- a/net/ipv4/ip_gre.c
> +++ b/net/ipv4/ip_gre.c
> @@ -1007,6 +1007,7 @@ static void ipgre_tunnel_setup(struct net_device *dev)
>  {
>  	dev->netdev_ops		= &ipgre_netdev_ops;
>  	dev->type		= ARPHRD_IPGRE;
> +	netif_set_tso_max_size(dev, GSO_MAX_SIZE);
>  	ip_tunnel_setup(dev, ipgre_net_id);
>  }

[Severity: Low]

The commit message says FOU and GUE are covered because they "set the UDP
length with udp_set_len()". That covers transmit. Is the receive side in
net/ipv4/fou_core.c also ready for these packets?

Take gre over FOU/GUE with gso_ipv4_max_size raised. A GSO packet larger
than 64KB leaves __ip_local_out() with an outer tot_len of 0, set by
iph_set_totlen(). udp_set_len() also sets uh->len to 0.

On the receiver, ip_rcv_core() accepts this through iph_totlen(), and
__udp4_lib_rcv() accepts it through udp_get_len(). The skb then reaches
fou_recv_pull() and gue_udp_recv(). Both of them do this:

net/ipv4/fou_core.c:fou_recv_pull() {
    ...
	if (fou->family == AF_INET)
		ip_hdr(skb)->tot_len = htons(ntohs(ip_hdr(skb)->tot_len) - len);
    ...
}

Doesn't this wrap when tot_len is 0? For plain FOU it becomes 0 - 8 =
65528. For GUE it becomes 0 - (8 + 4 + optlen).

That non-zero length is written back into the outer header, while the skb
can hold up to 512KB. It breaks the convention that a tot_len of 0 means
"use skb->len".

No in-kernel reader seems to misbehave on this value. After the pull, the
skb is resubmitted as IPPROTO_GRE and goes through
gre_rcv()->ipgre_rcv()->ip_tunnel_rcv(). That path only reads daddr and
tos from the outer header before it drops the header.

The wrong length is still visible in two places:

- raw IPPROTO_GRE sockets, which get the outer header back through the
  skb_push() in raw_rcv()
- the header quoted by icmp_send() when no tunnel matches

The big_tcp_tunnels.sh extension later in this series runs this path with
FOU and GUE.

The AF_INET6 branch in both functions has the same pattern for
payload_len. The later ip6_tunnel and ip6_gre patches in the series make
that branch reachable, and no later patch changes fou_core.c.

Would something like iph_set_totlen(iph, iph_totlen(skb, iph) - len) fit
here? Another option is to skip the adjustment when tot_len is 0.

The gretap change in ipgre_tap_setup() exposes the same path.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124013124.3693-1-yanhaishuang%40cmss.chinamobile.com

  reply	other threads:[~2026-11-25  1:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  1:31 [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Haishuang Yan
2026-11-24  1:31 ` [PATCH net-next 1/6] ipip: " Haishuang Yan
2026-11-24  1:31 ` [PATCH net-next 2/6] gre: " Haishuang Yan
2026-11-25  1:34   ` netdev-bot+sashiko [this message]
2026-11-24  1:31 ` [PATCH net-next 3/6] sit: " Haishuang Yan
2026-11-24  1:31 ` [PATCH net-next 4/6] ip6_tunnel: " Haishuang Yan
2026-11-24  1:31 ` [PATCH net-next 5/6] ip6_gre: " Haishuang Yan
2026-11-24  1:31 ` [PATCH net-next 6/6] selftests: net: big_tcp_tunnels: Cover IP tunnels Haishuang Yan
2026-11-25  1:34   ` netdev-bot+sashiko
2026-11-24 11:38 ` [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Alice Mikityanska

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=179557049527.3135.5031926005314724834@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alice.kernel@fastmail.im \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=yanhaishuang@cmss.chinamobile.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