Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] net: gso: segment length of encapsulated GSO packets
@ 2026-12-06  9:23 Julius Bairaktaris
  2026-12-06  9:23 ` [PATCH net v2 1/3] net: gro: set the inner transport header of encapsulated fraglist packets Julius Bairaktaris
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Julius Bairaktaris @ 2026-12-06  9:23 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, horms, sdf.kernel, willemb,
	willemdebruijn.kernel, ncardwell, kuniyu, alice.kernel, wang.zhan,
	marcelo.leitner, lucien.xin, linux-sctp, dsahern, dahern,
	steffen.klassert, nbd

skb_gso_transport_seglen() returns the length of one segment of a GSO
packet, which the MTU checks of IPv4 and IPv6 forwarding and output
compare with the MTU. For an encapsulated packet it counts from the
inner transport header and adds the inner L4 header: fraglist GRO
leaves the inner transport header unset for the inner flow of a tunnel,
and the inner UDP and SCTP headers are not counted.

Patch 1 sets the inner transport header in the fraglist completion of
TCP and UDP GRO, IPv4 and IPv6.
Patch 2 counts the inner UDP header of encapsulated UDP GSO packets.
Patch 3 counts the SCTP header of encapsulated SCTP GSO packets.

Patch 1 is hit by tunnel traffic from the network (VXLAN, FOU/GUE, GRE,
IPIP, SIT) forwarded by a host whose ingress has rx-gro-list on: the
forwarded aggregates are dropped or their segments checked against the
MTU with a wrong length. Patches 2 and 3 are hit by UDP GSO packets in
a UDP tunnel and by SCTP over UDP, forwarded or sent over a smaller
MTU: segments of up to 8 or 12 bytes over the MTU leave whole and are
lost further on.

The bugs were found by Sashiko reviews of earlier versions of "ipmr:
forward GSO multicast packets".

Tested in QEMU (KVM) with network namespaces, on net (6902a2bb708c),
2 runs per case on net and with this series:
- VXLAN with an inner UDP or TCP flow over IPv4 or IPv6, outer UDP
  checksum zero or set, rx-gro-list on the router, forwarded unicast
  over a 1400-byte route, 1000 packets per case: net delivers 33 to 186
  per case (12 cases); with this series all 1000 arrive with valid
  outer and inner checksums, also with checksum offload on the egress.
- An SCTP association over UDP with a 1500-byte path MTU through a
  router whose egress MTU is 1496 bytes: on net the router hands the
  egress 17 to 20 (IPv4) and 28 (IPv6) GSO packets with segments of up
  to 1500 bytes; with this series none.
- ip6gre_{flat,hier}{,_key,_keys}.sh: every test passes on net and
  with this series.

Changes in v2:
- Resend as asked by Stanislav Fomichev; rebased on net 6902a2bb708c,
  no code change. The ip6gre failures NIPA reported on v1 came from
  another patch in the same NIPA branch.
- Cover letter: test results on the new base; trigger and impact
  as prose.
- v1: https://lore.kernel.org/netdev/cover.1795884313.git.julius@bairaktaris.de/

Changes in v1, since "ipmr: forward GSO multicast packets" v6, whose
patches 1 and 3 are patches 1 and 2 here:
- Split out of the ipmr series (Willem de Bruijn).
- Patch 3 (new): count the SCTP header in the encapsulated branch of
  skb_gso_transport_seglen() (Sashiko on v6 patch 3).
- Patches 1 and 2: name the IPv6 users of the segment length in the
  commit message.
- ipmr v6: https://lore.kernel.org/netdev/cover.1795295554.git.julius@bairaktaris.de/

I used Claude (Anthropic) to help write these patches.

Julius Bairaktaris (3):
  net: gro: set the inner transport header of encapsulated fraglist
    packets
  net: gso: count the inner UDP header of encapsulated UDP GSO packets
  net: gso: count the SCTP header of encapsulated SCTP GSO packets

 net/core/gso.c           | 4 ++++
 net/ipv4/tcp_offload.c   | 3 +++
 net/ipv4/udp_offload.c   | 3 +++
 net/ipv6/tcpv6_offload.c | 3 +++
 net/ipv6/udp_offload.c   | 3 +++
 5 files changed, 16 insertions(+)


base-commit: 6902a2bb708c4075d3de6ec18ab6a5864c4c1aa2
-- 
2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-06  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06  9:23 [PATCH net v2 0/3] net: gso: segment length of encapsulated GSO packets Julius Bairaktaris
2026-12-06  9:23 ` [PATCH net v2 1/3] net: gro: set the inner transport header of encapsulated fraglist packets Julius Bairaktaris
2026-12-06  9:23 ` [PATCH net v2 2/3] net: gso: count the inner UDP header of encapsulated UDP GSO packets Julius Bairaktaris
2026-12-06  9:23 ` [PATCH net v2 3/3] net: gso: count the SCTP header of encapsulated SCTP " Julius Bairaktaris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox