Re: [PATCH net-next 2/6] gre: Enable BIG TCP packets

From: netdev-bot+sashiko

Date: Tue Nov 24 2026 - 20:35:06 EST


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