* [PATCH net-next 1/6] ipip: Enable BIG TCP packets
2026-11-24 1:31 [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Haishuang Yan
@ 2026-11-24 1:31 ` Haishuang Yan
2026-11-24 1:31 ` [PATCH net-next 2/6] gre: " Haishuang Yan
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Haishuang Yan @ 2026-11-24 1:31 UTC (permalink / raw)
To: netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Alice Mikityanska, linux-kselftest, linux-kernel
Commit f3d0f753f066 ("vxlan: Enable BIG TCP packets") and
commit 03ebe91b0f61 ("geneve: Enable BIG TCP packets") allowed BIG TCP
on UDP tunnels. ipip can carry BIG TCP packets as well: the outer IPv4
header gets its total length from iph_set_totlen() on output, the GSO
and GRO paths already handle IPv4 BIG TCP, and FOU and GUE encapsulation
set the UDP length with udp_set_len() since commit 47282504ad21 ("udp:
Support BIG TCP GSO packets where they can occur").
Bump tso_max_size up to GSO_MAX_SIZE so that the admin can use BIG TCP
with ipip. The default gso_max_size and gso_ipv4_max_size stay at 64KB,
so nothing changes unless they are raised explicitly.
iperf3 TCP over ipip between two netns connected by veth, without
encapsulation, 3 runs of 10 seconds each, in a KVM guest with 8 vCPUs
on an Intel Core i7-14700 host:
gso_max_size/gso_ipv4_max_size 65536: 94.2, 97.4, 97.2 Gbit/s
gso_max_size/gso_ipv4_max_size 196608: 133.7, 128.5, 130.5 Gbit/s (+36%)
A later patch in this series extends big_tcp_tunnels.sh to cover ipip
without encapsulation, and with FOU and GUE.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
net/ipv4/ipip.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 15189e1fa06..74af06b1d94 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -416,6 +416,7 @@ static void ipip_tunnel_setup(struct net_device *dev)
dev->addr_len = 4;
dev->lltx = true;
netif_keep_dst(dev);
+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
dev->features |= IPIP_FEATURES;
dev->hw_features |= IPIP_FEATURES;
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH net-next 2/6] gre: Enable BIG TCP packets
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 ` Haishuang Yan
2026-11-25 1:34 ` netdev-bot+sashiko
2026-11-24 1:31 ` [PATCH net-next 3/6] sit: " Haishuang Yan
` (4 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Haishuang Yan @ 2026-11-24 1:31 UTC (permalink / raw)
To: netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Alice Mikityanska, linux-kselftest, linux-kernel
Commit f3d0f753f066 ("vxlan: Enable BIG TCP packets") and
commit 03ebe91b0f61 ("geneve: Enable BIG TCP packets") allowed BIG TCP
on UDP tunnels. gre and gretap can carry BIG TCP packets as well: the
outer IPv4 header gets its total length from iph_set_totlen() on output,
the GRE header has no length field, the GSO and GRO paths already handle
IPv4 BIG TCP, and FOU and GUE encapsulation set the UDP length with
udp_set_len() since commit 47282504ad21 ("udp: Support BIG TCP GSO
packets where they can occur").
Bump tso_max_size up to GSO_MAX_SIZE so that the admin can use BIG TCP
with gre and gretap. erspan is left alone. The default gso_max_size and
gso_ipv4_max_size stay at 64KB, so nothing changes unless they are
raised explicitly.
iperf3 TCP over gre and gretap between two netns connected by veth,
without encapsulation, 3 runs of 10 seconds each, in a KVM guest with 8
vCPUs on an Intel Core i7-14700 host:
gre, 65536: 92.9, 94.2, 93.0 Gbit/s
gre, 196608: 130.6, 128.6, 123.3 Gbit/s (+37%)
gretap, 65536: 105.5, 106.6, 106.6 Gbit/s
gretap, 196608: 124.7, 129.7, 127.5 Gbit/s (+20%)
A later patch in this series extends big_tcp_tunnels.sh to cover gre and
gretap with IPv4 and IPv6 traffic, without encapsulation, and with FOU
and GUE.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
net/ipv4/ip_gre.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index f8a7c435350..41ec54dcbfd 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);
}
@@ -1394,6 +1395,7 @@ static void ipgre_tap_setup(struct net_device *dev)
dev->netdev_ops = &gre_tap_netdev_ops;
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
ip_tunnel_setup(dev, gre_tap_net_id);
}
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH net-next 2/6] gre: Enable BIG TCP packets
2026-11-24 1:31 ` [PATCH net-next 2/6] gre: " Haishuang Yan
@ 2026-11-25 1:34 ` netdev-bot+sashiko
0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-25 1:34 UTC (permalink / raw)
To: yanhaishuang
Cc: netdev, dsahern, idosch, davem, edumazet, kuba, pabeni, horms,
shuah, alice.kernel, linux-kselftest, linux-kernel
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH net-next 3/6] sit: Enable BIG TCP packets
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-24 1:31 ` Haishuang Yan
2026-11-24 1:31 ` [PATCH net-next 4/6] ip6_tunnel: " Haishuang Yan
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Haishuang Yan @ 2026-11-24 1:31 UTC (permalink / raw)
To: netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Alice Mikityanska, linux-kselftest, linux-kernel
Commit f3d0f753f066 ("vxlan: Enable BIG TCP packets") and
commit 03ebe91b0f61 ("geneve: Enable BIG TCP packets") allowed BIG TCP
on UDP tunnels. sit can carry BIG TCP packets as well: the outer IPv4
header gets its total length from iph_set_totlen() on output, the GSO
path already handles BIG TCP, and FOU encapsulation sets the UDP length
with udp_set_len() since commit 47282504ad21 ("udp: Support BIG TCP GSO
packets where they can occur").
Bump tso_max_size up to GSO_MAX_SIZE so that the admin can use BIG TCP
with sit. The default gso_max_size and gso_ipv4_max_size stay at 64KB,
so nothing changes unless they are raised explicitly.
iperf3 TCP over sit between two netns connected by veth, without
encapsulation, 3 runs of 10 seconds each, in a KVM guest with 8 vCPUs
on an Intel Core i7-14700 host:
gso_max_size 65536: 96.0, 95.4, 98.0 Gbit/s
gso_max_size 196608: 136.9, 131.0, 129.8 Gbit/s (+37%)
On the receive side, GRO does not build sit packets larger than 64KB, so
the gain comes from the sender when the underlay offloads GSO.
A later patch in this series extends big_tcp_tunnels.sh to cover sit
without encapsulation and with FOU.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
net/ipv6/sit.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index a7ec800216a..97044b1cad2 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1577,6 +1577,7 @@ static void ipip6_tunnel_setup(struct net_device *dev)
dev->max_mtu = IP6_MAX_MTU - t_hlen;
dev->flags = IFF_NOARP;
netif_keep_dst(dev);
+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
dev->addr_len = 4;
dev->lltx = true;
dev->features |= SIT_FEATURES;
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH net-next 4/6] ip6_tunnel: Enable BIG TCP packets
2026-11-24 1:31 [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Haishuang Yan
` (2 preceding siblings ...)
2026-11-24 1:31 ` [PATCH net-next 3/6] sit: " Haishuang Yan
@ 2026-11-24 1:31 ` Haishuang Yan
2026-11-24 1:31 ` [PATCH net-next 5/6] ip6_gre: " Haishuang Yan
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Haishuang Yan @ 2026-11-24 1:31 UTC (permalink / raw)
To: netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Alice Mikityanska, linux-kselftest, linux-kernel
Commit f3d0f753f066 ("vxlan: Enable BIG TCP packets") and
commit 03ebe91b0f61 ("geneve: Enable BIG TCP packets") allowed BIG TCP
on UDP tunnels. ip6tnl can carry BIG TCP packets as well: IPv6 BIG TCP
no longer needs a hop-by-hop jumbo header, the GSO and GRO paths already
handle it, and FOU encapsulation sets the UDP length with udp_set_len()
since commit 47282504ad21 ("udp: Support BIG TCP GSO packets where they
can occur").
Bump tso_max_size up to GSO_MAX_SIZE so that the admin can use BIG TCP
with ip6tnl. The default gso_max_size and gso_ipv4_max_size stay at
64KB, so nothing changes unless they are raised explicitly.
iperf3 TCP over ip6tnl, with IPv4 traffic between two netns connected by
veth, without encapsulation, 3 runs of 10 seconds each, in a KVM guest
with 8 vCPUs on an Intel Core i7-14700 host:
gso_max_size/gso_ipv4_max_size 65536: 93.0, 90.8, 83.3 Gbit/s
gso_max_size/gso_ipv4_max_size 196608: 134.8, 123.4, 112.8 Gbit/s (+39%)
A later patch in this series extends big_tcp_tunnels.sh to cover ip6tnl
with IPv4 and IPv6 traffic, without encapsulation and with FOU.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
net/ipv6/ip6_tunnel.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 64a184bca46..040012cdf15 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1919,6 +1919,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
dev->lltx = true;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
netif_keep_dst(dev);
+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
dev->features |= IPXIPX_FEATURES;
dev->hw_features |= IPXIPX_FEATURES;
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH net-next 5/6] ip6_gre: Enable BIG TCP packets
2026-11-24 1:31 [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Haishuang Yan
` (3 preceding siblings ...)
2026-11-24 1:31 ` [PATCH net-next 4/6] ip6_tunnel: " Haishuang Yan
@ 2026-11-24 1:31 ` Haishuang Yan
2026-11-24 1:31 ` [PATCH net-next 6/6] selftests: net: big_tcp_tunnels: Cover IP tunnels Haishuang Yan
2026-11-24 11:38 ` [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Alice Mikityanska
6 siblings, 0 replies; 10+ messages in thread
From: Haishuang Yan @ 2026-11-24 1:31 UTC (permalink / raw)
To: netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Alice Mikityanska, linux-kselftest, linux-kernel
Commit f3d0f753f066 ("vxlan: Enable BIG TCP packets") and
commit 03ebe91b0f61 ("geneve: Enable BIG TCP packets") allowed BIG TCP
on UDP tunnels. ip6gre and ip6gretap can carry BIG TCP packets as well:
IPv6 BIG TCP no longer needs a hop-by-hop jumbo header, the GRE header
has no length field, the GSO and GRO paths already handle it, and FOU
encapsulation sets the UDP length with udp_set_len() since
commit 47282504ad21 ("udp: Support BIG TCP GSO packets where they can
occur").
Bump tso_max_size up to GSO_MAX_SIZE so that the admin can use BIG TCP
with ip6gre and ip6gretap. ip6erspan is left alone. The default
gso_max_size and gso_ipv4_max_size stay at 64KB, so nothing changes
unless they are raised explicitly.
iperf3 TCP over ip6gre and ip6gretap, with IPv4 traffic between two
netns connected by veth, without encapsulation, 3 runs of 10 seconds
each, in a KVM guest with 8 vCPUs on an Intel Core i7-14700 host:
ip6gre, 65536: 84.7, 84.4, 90.2 Gbit/s
ip6gre, 196608: 117.7, 112.5, 128.4 Gbit/s (+38%)
ip6gretap, 65536: 103.1, 97.9, 102.4 Gbit/s
ip6gretap, 196608: 123.0, 125.7, 124.8 Gbit/s (+23%)
A later patch in this series extends big_tcp_tunnels.sh to cover ip6gre
and ip6gretap with IPv4 and IPv6 traffic, without encapsulation and with
FOU.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
net/ipv6/ip6_gre.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 26c0e1c4de1..0ace21db3b4 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1462,6 +1462,7 @@ static void ip6gre_tunnel_setup(struct net_device *dev)
dev->flags |= IFF_NOARP;
dev->addr_len = sizeof(struct in6_addr);
netif_keep_dst(dev);
+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
/* This perm addr will be used as interface identifier by IPv6 */
dev->addr_assign_type = NET_ADDR_RANDOM;
eth_random_addr(dev->perm_addr);
@@ -1934,6 +1935,7 @@ static void ip6gre_tap_setup(struct net_device *dev)
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
netif_keep_dst(dev);
+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
}
static bool ip6gre_netlink_encap_parms(struct nlattr *data[],
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH net-next 6/6] selftests: net: big_tcp_tunnels: Cover IP tunnels
2026-11-24 1:31 [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Haishuang Yan
` (4 preceding siblings ...)
2026-11-24 1:31 ` [PATCH net-next 5/6] ip6_gre: " Haishuang Yan
@ 2026-11-24 1:31 ` 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
6 siblings, 1 reply; 10+ messages in thread
From: Haishuang Yan @ 2026-11-24 1:31 UTC (permalink / raw)
To: netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
Alice Mikityanska, linux-kselftest, linux-kernel
Now that ipip, gre, gretap, sit, ip6tnl, ip6gre and ip6gretap allow BIG
TCP too, run the same checks over them as for vxlan, geneve and
bareudp, without encapsulation and with FOU, and with GUE too on an
IPv4 underlay.
sit only carries IPv6, and is only run with veth tx checksum offload
enabled: GRO does not build sit packets larger than 64KB, so with
software GSO on the sender the receiver does not see any BIG TCP
packet.
fou is not loaded on demand when it is built as a module, so load fou
and fou6 first, like pmtu.sh does.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
.../testing/selftests/net/big_tcp_tunnels.sh | 131 +++++++++++++++++-
1 file changed, 128 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/big_tcp_tunnels.sh b/tools/testing/selftests/net/big_tcp_tunnels.sh
index 9c1482b842b..9f185eb2065 100755
--- a/tools/testing/selftests/net/big_tcp_tunnels.sh
+++ b/tools/testing/selftests/net/big_tcp_tunnels.sh
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0
#
-# Testing for IPv4 and IPv6 BIG TCP over VXLAN, GENEVE and bareudp tunnels.
+# Testing for IPv4 and IPv6 BIG TCP over VXLAN, GENEVE and bareudp tunnels,
+# and over ipip, gre, gretap, sit, ip6tnl, ip6gre and ip6gretap tunnels,
+# without encapsulation and with FOU and GUE.
source "$(dirname "$0")/lib.sh"
@@ -17,6 +19,8 @@ CLIENT_IP6="2001:db8::1:2"
CLIENT_IP4_TUN="192.168.2.2"
CLIENT_IP6_TUN="2001:db8::2:2"
+FOU_PORT=5555
+
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
@@ -71,15 +75,80 @@ setup_bareudp() {
return 1
}
+# $1: tunnel type, $2: traffic family
+# Prints the IP protocol carried by FOU for this tunnel.
+fou_ipproto() {
+ case "$1" in
+ ipip)
+ echo 4
+ ;;
+ sit)
+ echo 41
+ ;;
+ ip6tnl)
+ if [ "$2" = 4 ]; then
+ echo 4
+ else
+ echo 41
+ fi
+ ;;
+ *)
+ echo 47
+ ;;
+ esac
+}
+
+# Create an IP tunnel device, with FOU or GUE encapsulation if requested.
+# $1: netns, $2: device, $3: tunnel type, $4: tunnel family,
+# $5: traffic family, $6: encapsulation (none, fou or gue),
+# $7: local underlay address, $8: remote one
+setup_ip_tunnel() {
+ local encap_args=()
+ local fou_args=()
+ local mode=()
+
+ if [ "$4" = 6 ]; then
+ fou_args=(-6)
+ fi
+ if [ "$6" = fou ]; then
+ ip -netns "$1" fou add port "$FOU_PORT" \
+ ipproto "$(fou_ipproto "$3" "$5")" "${fou_args[@]}" ||
+ return 1
+ elif [ "$6" = gue ]; then
+ ip -netns "$1" fou add port "$FOU_PORT" gue "${fou_args[@]}" ||
+ return 1
+ fi
+ if [ "$6" != none ]; then
+ encap_args=(encap "$6" encap-sport auto encap-dport "$FOU_PORT")
+ fi
+ if [ "$3" = ip6tnl ]; then
+ if [ "$5" = 4 ]; then
+ mode=(mode ipip6)
+ else
+ mode=(mode ip6ip6)
+ fi
+ fi
+
+ ip -netns "$1" link add "$2" type "$3" "${mode[@]}" \
+ local "$7" remote "$8" "${encap_args[@]}"
+}
+
+# $1: tunnel type, $2: tunnel family, $3: veth tx csum offload,
+# and for IP tunnels: $4: traffic family, $5: encapsulation
setup_tunnel() {
+ local name="${1^^}"
+
+ if [ "${5:-none}" != none ]; then
+ name="$name/${5^^}"
+ fi
if [ "$2" = 4 ]; then
SERVER_IP="$SERVER_IP4"
CLIENT_IP="$CLIENT_IP4"
- echo "Setting up ${1^^} over IPv4, veth tx csum offload $3"
+ echo "Setting up $name over IPv4, veth tx csum offload $3"
else
SERVER_IP="$SERVER_IP6"
CLIENT_IP="$CLIENT_IP6"
- echo "Setting up ${1^^} over IPv6, veth tx csum offload $3"
+ echo "Setting up $name over IPv6, veth tx csum offload $3"
fi
case "$1" in
@@ -95,6 +164,10 @@ setup_tunnel() {
setup_bareudp "$CLIENT_NS" tun0 "$CLIENT_IP" "$SERVER_IP" ||
return 1
;;
+ *)
+ setup_ip_tunnel "$CLIENT_NS" tun0 "$1" "$2" "$4" "$5" \
+ "$CLIENT_IP" "$SERVER_IP" || return 1
+ ;;
esac
ip -netns "$CLIENT_NS" link set tun0 up
ip -netns "$CLIENT_NS" addr replace "$CLIENT_IP4_TUN/24" dev tun0
@@ -115,6 +188,10 @@ setup_tunnel() {
setup_bareudp "$SERVER_NS" tun1 "$SERVER_IP" "$CLIENT_IP" ||
return 1
;;
+ *)
+ setup_ip_tunnel "$SERVER_NS" tun1 "$1" "$2" "$4" "$5" \
+ "$SERVER_IP" "$CLIENT_IP" || return 1
+ ;;
esac
ip -netns "$SERVER_NS" link set tun1 up
ip -netns "$SERVER_NS" addr replace "$SERVER_IP4_TUN/24" dev tun1
@@ -127,9 +204,22 @@ setup_tunnel() {
ip netns exec "$SERVER_NS" ethtool -K link1 tx-checksumming "$3" > /dev/null
}
+# For IP tunnels: $1: tunnel family, $2: encapsulation
cleanup_tunnel() {
+ local fou_args=()
+ local ns
+
ip -netns "$CLIENT_NS" link del tun0
ip -netns "$SERVER_NS" link del tun1
+ if [ "${2:-none}" = none ]; then
+ return 0
+ fi
+ if [ "$1" = 6 ]; then
+ fou_args=(-6)
+ fi
+ for ns in "$CLIENT_NS" "$SERVER_NS"; do
+ ip -netns "$ns" fou del port "$FOU_PORT" "${fou_args[@]}"
+ done
}
cleanup() {
@@ -240,6 +330,26 @@ if ! ip link help 2>&1 | grep gso_ipv4_max_size &> /dev/null; then
exit "$ksft_skip"
fi
+# $1: tunnel type, $2: tunnel family, $3: traffic family, $4: encapsulation
+run_ip_tunnel() {
+ local csum_offload
+
+ for csum_offload in on off; do
+ # GRO does not build sit packets larger than 64KB, so with
+ # software GSO on the sender there is nothing big to receive.
+ if [ "$1" = sit ] && [ "$csum_offload" = off ]; then
+ continue
+ fi
+ setup_tunnel "$1" "$2" "$csum_offload" "$3" "$4" || exit "$?"
+ do_test "$2" "$3" "$csum_offload" || exit "$?"
+ cleanup_tunnel "$2" "$4"
+ done
+}
+
+# fou is not loaded on demand when built as a module
+modprobe -q fou
+modprobe -q fou6
+
WORKDIR=$(mktemp -d)
trap cleanup EXIT
setup
@@ -254,3 +364,18 @@ for tunnel in vxlan geneve bareudp; do
done
done
done
+for encap in none fou gue; do
+ run_ip_tunnel ipip 4 4 "$encap"
+ for traffic_family in 4 6; do
+ run_ip_tunnel gre 4 "$traffic_family" "$encap"
+ run_ip_tunnel gretap 4 "$traffic_family" "$encap"
+ done
+ # GUE is only supported on an IPv4 underlay
+ [ "$encap" = gue ] && continue
+ run_ip_tunnel sit 4 6 "$encap"
+ for traffic_family in 4 6; do
+ run_ip_tunnel ip6tnl 6 "$traffic_family" "$encap"
+ run_ip_tunnel ip6gre 6 "$traffic_family" "$encap"
+ run_ip_tunnel ip6gretap 6 "$traffic_family" "$encap"
+ done
+done
--
2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH net-next 6/6] selftests: net: big_tcp_tunnels: Cover IP tunnels
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
0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-25 1:34 UTC (permalink / raw)
To: yanhaishuang
Cc: netdev, dsahern, idosch, davem, edumazet, kuba, pabeni, horms,
shuah, alice.kernel, linux-kselftest, linux-kernel
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] In the main loop of
tools/testing/selftests/net/big_tcp_tunnels.sh (lines 373-374), the…
- [Low] The commit message says fou and fou6 are loaded "like pmtu.sh
does".
- [Low] The comment in run_ip_tunnel() (big_tcp_tunnels.sh lines 338-339)
explains the skipped sit csum-off case as "GRO does not build sit…
--
selftests: net: big_tcp_tunnels: Cover IP tunnels
This patch extends big_tcp_tunnels.sh to run the BIG TCP checks over
ipip, gre, gretap, sit, ip6tnl, ip6gre and ip6gretap. They run without
encapsulation and with FOU, and with GUE on an IPv4 underlay. sit runs
only with veth tx checksum offload enabled, and fou/fou6 are loaded with
modprobe before the tests start.
> diff --git a/tools/testing/selftests/net/big_tcp_tunnels.sh b/tools/testing/selftests/net/big_tcp_tunnels.sh
> index 9c1482b842bfc..9f185eb20652e 100755
> --- a/tools/testing/selftests/net/big_tcp_tunnels.sh
> +++ b/tools/testing/selftests/net/big_tcp_tunnels.sh
[ ... ]
> @@ -240,6 +330,26 @@ if ! ip link help 2>&1 | grep gso_ipv4_max_size &> /dev/null; then
> exit "$ksft_skip"
> fi
>
> +# $1: tunnel type, $2: tunnel family, $3: traffic family, $4: encapsulation
> +run_ip_tunnel() {
> + local csum_offload
> +
> + for csum_offload in on off; do
> + # GRO does not build sit packets larger than 64KB, so with
> + # software GSO on the sender there is nothing big to receive.
[Severity: Low]
Is this the real reason the csum-off sit case has nothing big to receive?
In csum-off mode, do_test() counts packets over 64KB on PREROUTING
-i tun1, after decapsulation. The sender did software GSO, so those
packets can only exist if receive-side GRO aggregated them.
ipip and gre get that aggregation through ip_tunnel_rcv():
net/ipv4/ip_tunnel.c:ip_tunnel_rcv() {
...
gro_cells_receive(&tunnel->gro_cells, skb);
...
}
sit has no gro_cells and ends in a plain netif_rx():
net/ipv6/sit.c:ipip6_rcv() {
...
dev_sw_netstats_rx_add(tunnel->dev, skb->len);
netif_rx(skb);
...
}
veth also has GRO disabled by default (veth_disable_gro()), and the test
never enables it. So the 64KB limit for encapsulated packets (the
p->encapsulation check in skb_gro_receive()) never applies here, because
sit packets don't go through GRO at all on this receive path.
Would it be more accurate to say that sit does not use gro_cells on
receive? The commit message gives the same explanation.
> + if [ "$1" = sit ] && [ "$csum_offload" = off ]; then
> + continue
> + fi
> + setup_tunnel "$1" "$2" "$csum_offload" "$3" "$4" || exit "$?"
> + do_test "$2" "$3" "$csum_offload" || exit "$?"
> + cleanup_tunnel "$2" "$4"
> + done
> +}
> +
> +# fou is not loaded on demand when built as a module
> +modprobe -q fou
> +modprobe -q fou6
[Severity: Low]
The commit message says fou and fou6 are loaded "like pmtu.sh does".
pmtu.sh, however, turns a modprobe failure into a skip:
tools/testing/selftests/net/pmtu.sh:setup_fou_or_gue() {
...
modprobe fou || return $ksft_skip
...
modprobe fou6 || return $ksft_skip
...
}
Here the errors are silenced and the result is not checked. If fou or
fou6 is not available, won't the script report a failure instead of a
skip?
setup_ip_tunnel()
ip -netns "$1" fou add port "$FOU_PORT" ... || return 1
setup_tunnel()
setup_ip_tunnel ... || return 1
run_ip_tunnel()
setup_tunnel ... || exit "$?"
The script then exits 1, after the vxlan, geneve, bareudp and
encap-none cases have already passed. A kernel that passed
big_tcp_tunnels.sh before this patch would now fail it.
tools/testing/selftests/net/config sets CONFIG_NET_FOU=y and
CONFIG_IPV6_FOU=m, so only kernels built with a different config are
affected.
Could a modprobe failure here exit with ksft_skip, or skip only the fou
and gue cases?
> WORKDIR=$(mktemp -d)
> trap cleanup EXIT
> setup
[ ... ]
> @@ -254,3 +364,18 @@ for tunnel in vxlan geneve bareudp; do
> done
> done
> done
> +for encap in none fou gue; do
> + run_ip_tunnel ipip 4 4 "$encap"
> + for traffic_family in 4 6; do
> + run_ip_tunnel gre 4 "$traffic_family" "$encap"
> + run_ip_tunnel gretap 4 "$traffic_family" "$encap"
> + done
> + # GUE is only supported on an IPv4 underlay
> + [ "$encap" = gue ] && continue
> + run_ip_tunnel sit 4 6 "$encap"
[Severity: Medium]
Is this comment accurate? net/ipv6/fou6.c defines gue6_build_header()
and registers GUE for IPv6 tunnels:
net/ipv6/fou6.c:fou6_init() {
...
ret = ip6_tnl_encap_add_ops(&gue_ip6tun_ops, TUNNEL_ENCAP_GUE);
...
}
Also, pmtu.sh in the same directory already runs
pmtu_ipv4_gue6_exception and pmtu_ipv6_gue6_exception.
The continue also comes before the sit line, and sit uses an IPv4
underlay. Like ipip, sit sets up its encap with ip_tunnel_encap_setup()
and calls ip_tunnel_encap() in ipip6_tunnel_xmit(). pmtu.sh also tests
sit over gue4. Was sit meant to be skipped for GUE?
As written, sit, ip6tnl, ip6gre and ip6gretap never get BIG TCP coverage
with GUE. The earlier patches in the series still raise tso_max_size for
these devices whatever the encap type.
The loop also doesn't match the new file header:
# and over ipip, gre, gretap, sit, ip6tnl, ip6gre and ip6gretap tunnels,
# without encapsulation and with FOU and GUE.
It doesn't match the commit message either, which says "with GUE too on
an IPv4 underlay".
Could the continue move below the sit line, with the comment corrected?
Could GUE also be run for the IPv6 underlay tunnels?
> + for traffic_family in 4 6; do
> + run_ip_tunnel ip6tnl 6 "$traffic_family" "$encap"
> + run_ip_tunnel ip6gre 6 "$traffic_family" "$encap"
> + run_ip_tunnel ip6gretap 6 "$traffic_family" "$encap"
> + done
> +done
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124013124.3693-1-yanhaishuang%40cmss.chinamobile.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets
2026-11-24 1:31 [PATCH net-next 0/6] ip tunnels: Enable BIG TCP packets Haishuang Yan
` (5 preceding siblings ...)
2026-11-24 1:31 ` [PATCH net-next 6/6] selftests: net: big_tcp_tunnels: Cover IP tunnels Haishuang Yan
@ 2026-11-24 11:38 ` Alice Mikityanska
6 siblings, 0 replies; 10+ messages in thread
From: Alice Mikityanska @ 2026-11-24 11:38 UTC (permalink / raw)
To: Haishuang Yan, netdev
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
linux-kselftest, linux-kernel
On Tue, Nov 24, 2026, at 03:31, Haishuang Yan wrote:
> Following vxlan and geneve, this series allows BIG TCP on ipip, gre,
> gretap, sit, ip6tnl, ip6gre and ip6gretap, which also covers their FOU
> and GUE encapsulation. The UDP length of FOU and GUE is already handled
> since commit 47282504ad21 ("udp: Support BIG TCP GSO packets where they
> can occur").
>
> Each driver patch bumps tso_max_size to GSO_MAX_SIZE in the setup of
> the device, like vxlan and geneve do. The default gso_max_size and
> gso_ipv4_max_size stay at 64KB. vti, erspan and ip6erspan are left
> alone.
Thanks for your patches!
Reviewed-by: Alice Mikityanska <alice.kernel@fastmail.im>
> Patch 6 extends big_tcp_tunnels.sh, which already covers vxlan, geneve
> and bareudp, to check that BIG TCP packets go through all these devices,
> without encapsulation and with FOU and GUE, with and without veth tx
> checksum offload. sit is only checked with checksum offload, as GRO does
> not build sit packets larger than 64KB.
Do you know why GRO doesn't aggregate >64K with sit? I had patches to
enable BIG TCP on IP tunnels too, but I've never submitted mine because
I didn't have a chance to investigate this specific failure. It would be
interesting to lift this limitation of GRO with sit, as it aggregates
>64K just fine in all other cases.
> With iperf3 over veth in a KVM guest, raising gso_max_size from 64KB to
> 196608 gives +20% to +39% depending on the tunnel, see the commit
> messages for the numbers.
>
> This work was done with the help of an AI coding assistant.
>
> Haishuang Yan (6):
> ipip: Enable BIG TCP packets
> gre: Enable BIG TCP packets
> sit: Enable BIG TCP packets
> ip6_tunnel: Enable BIG TCP packets
> ip6_gre: Enable BIG TCP packets
> selftests: net: big_tcp_tunnels: Cover IP tunnels
>
> net/ipv4/ip_gre.c | 2 +
> net/ipv4/ipip.c | 1 +
> net/ipv6/ip6_gre.c | 2 +
> net/ipv6/ip6_tunnel.c | 1 +
> net/ipv6/sit.c | 1 +
> .../testing/selftests/net/big_tcp_tunnels.sh | 131 +++++++++++++++++-
> 6 files changed, 135 insertions(+), 3 deletions(-)
>
>
> base-commit: eb6d6c80d35449c27471b1874f13066c09a8964d
> --
> 2.43.0
^ permalink raw reply [flat|nested] 10+ messages in thread