All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Rosen Penev" <rosenp@gmail.com>, <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Willem de Bruijn" <willemb@google.com>,
	"Simon Horman" <horms@kernel.org>,
	"Neal Cardwell" <ncardwell@google.com>,
	"Kuniyuki Iwashima" <kuniyu@google.com>, <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next] net: gro: skip the checksum of fraglist GRO packets
Date: Mon, 23 Nov 2026 06:51:29 +0000	[thread overview]
Message-ID: <DN2E3KPRKZL5.3PSJD3I9JFARH@gmail.com> (raw)
In-Reply-To: <20261123042735.139550-1-rosenp@gmail.com>

On Sun, Nov 22, 2026 at 08:27 PM Rosen Penev <rosenp@gmail.com> wrote:
> Make __skb_checksum_complete() verify each packet against its own
> headers instead, and mark the skb CHECKSUM_UNNECESSARY when they all
> match. This covers whatever asks for the checksum later: conntrack with
> nf_conntrack_checksum enabled, and local delivery, which happens for

It doesn't. This breaks tc progs.
Today the skb is CHECKSUM_UNNECESSARY when a tc ingress prog runs.
With the patch valid packets fail skb_flist_csum_ok() after the prog:

  helper                  what skb_flist_tcp_csum_ok() gets
  ----------------------  -------------------------------------------
  bpf_skb_pull_data()     2 packets, mss 536, thlen 20, all pulled:
                          len = 1092 bytes, th->check covers 556
  bpf_skb_change_proto()  6 to 4: ipv6 = false, frag_list has IPv6
                          headers, iph->ihl = 0

TCP drops the skb and conntrack marks it invalid.
CLAT has no IPv6 socket, so GRO always picks fraglist for it.

> A fraglist skb whose geometry was changed after GRO, by NAT or
> bpf_skb_pull_data(), is segmented by skb_segment(), which computes new
> checksums. Such a packet is now forwarded with a valid checksum even if
> it was corrupted before it arrived; the packet boundaries needed to
> check it are gone by then.

That's silent data corruption. It's not an option.
tcp4_gso_segment() also takes that path on SKB_GSO_DODGY.
bpf_skb_adjust_room() and bpf_skb_change_proto() set it on every GSO skb.
Willem's series adds skb->encapsulation, like seg6 encap or ESP offload:
https://lore.kernel.org/bpf/20261120044733.222627-3-willemdebruijn.kernel@gmail.com/

> At the full MSS the router already forwards at line rate in each
> direction, and csum_partial(), which took 27% of the cycles, drops out
> of the profile.

So there is no throughput win at full MSS.
With the default nf_conntrack_checksum the work only moves to conntrack.
Paolo suggests to remove fraglist GSO. This adds another state to it:
https://lore.kernel.org/bpf/ce3e6832-ca9f-4e91-8302-b5bd7cf2f178@redhat.com/

Nack.

pw-bot: cr

  reply	other threads:[~2026-11-23  6:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  4:27 [PATCH net-next] net: gro: skip the checksum of fraglist GRO packets Rosen Penev
2026-11-23  6:51 ` Alexei Starovoitov [this message]
2026-11-24  4:27 ` sashiko-bot
2026-11-24  4:47 ` netdev-bot+sashiko

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=DN2E3KPRKZL5.3PSJD3I9JFARH@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rosenp@gmail.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.