All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, edumazet@kernel.org,
	pabeni@redhat.com, horms@kernel.org,
	Willem de Bruijn <willemb@google.com>
Subject: [PATCH net v2 0/2] net: gso: fraglist segmentation fixes
Date: Thu, 19 Nov 2026 23:46:38 -0500	[thread overview]
Message-ID: <20261120044733.222627-1-willemdebruijn.kernel@gmail.com> (raw)

From: Willem de Bruijn <willemb@google.com>

Fix two issues when segmenting SKB_GSO_FRAGLIST packets.

Patch 1 unshares the head before the TCP fallback to skb_segment()
rewrites the TCP checksum field.

Patch 2 falls back to skb_segment() in more cases where
skb_segment_list() produces incorrect checksums: tunnels with outer
checksums, and CHECKSUM_PARTIAL packets sent to a device without
checksum offload.

Testing

Tested in virtme-ng. A sender injects TCP and UDP GSO packets (20
packets of 20 segments of 1000B) over a veth with TSO disabled. The
peer veth has GRO and rx-gro-list enabled, and forwards the fraglist
skbs to a tap device without offloads, in three ways:

- routed
- routed into a vxlan device with udpcsum, over the tap
- bridged

Each for IPv4 and IPv6, and with sender checksum offload enabled
(CHECKSUM_PARTIAL) and disabled (complete checksums): 24 cases.

A reader on the tap verifies the IP, TCP and UDP checksums of every
segment, including inside vxlan. For TCP, a packet socket on the
ingress veth holds clones of the GRO packets, and checks whether their
TCP checksum field was modified in place.

- net/main: 14 of 24 cases fail.
  CHECKSUM_PARTIAL to the tap has incorrect L4 checksums, routed and
  bridged. Vxlan has incorrect outer UDP checksums: with IPv6 inner
  packets always, with IPv4 inner packets only with CHECKSUM_PARTIAL.
- This series without the skb_cow_head() of patch 1: the bridged TCP
  CHECKSUM_PARTIAL cases, IPv4 and IPv6, modify all clones. Routed
  cases are not affected, as ip_forward() unshares the head.
- This series: all 24 cases pass.

Changes
  v1 -> v2
    - new patch 1/2
    - patch 2/2: move the test into helper skb_gso_fraglist_ok()
    - patch 2/2: rebase onto commit 22b7cb932c6a ("udp: check frag_list
      IP family before using skb_segment_list()")
    - patch 2/2: commit message: explain the skb->encapsulation test,
      reference the existing skb_segment() fallback, drop the claim that
      skb_segment() is always safe
  v1: https://lore.kernel.org/netdev/20261111221129.829218-1-willemdebruijn.kernel@gmail.com/

Willem de Bruijn (2):
  net: gso: cow head on tcp fraglist fallback to skb_segment
  net: gso: fall back to skb_segment when fraglist cannot satisfy
    checksum

 include/net/gso.h        | 33 +++++++++++++++++++++++++++++++++
 net/ipv4/tcp_offload.c   | 10 +++++++---
 net/ipv4/udp_offload.c   |  5 +++--
 net/ipv6/tcpv6_offload.c | 11 ++++++++---
 4 files changed, 51 insertions(+), 8 deletions(-)

-- 
2.56.1.750.gf70dc682cf-goog


             reply	other threads:[~2026-11-20  4:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  4:46 Willem de Bruijn [this message]
2026-11-20  4:46 ` [PATCH net v2 1/2] net: gso: cow head on tcp fraglist fallback to skb_segment Willem de Bruijn
2026-11-20  4:46 ` [PATCH net v2 2/2] net: gso: fall back to skb_segment when fraglist cannot satisfy checksum Willem de Bruijn

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=20261120044733.222627-1-willemdebruijn.kernel@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.