linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Christoph Paasch <cpaasch@openai.com>,
	 Eric Dumazet <edumazet@google.com>
Cc: Gal Pressman <gal@nvidia.com>,
	 Willem de Bruijn <willemb@google.com>,
	 Bailey Forrest <bcf@google.com>,
	 Catherine Sullivan <csully@google.com>,
	 Saeed Mahameed <saeedm@nvidia.com>,
	 Tariq Toukan <tariqt@nvidia.com>,
	 Mark Bloch <mbloch@nvidia.com>,
	 Leon Romanovsky <leon@kernel.org>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Amir Vadai <amirv@mellanox.com>,
	 netdev@vger.kernel.org,  linux-rdma@vger.kernel.org,
	 hramamurthy@google.com
Subject: Re: [PATCH net] net/mlx5: Correctly set gso_segs when LRO is used
Date: Wed, 30 Jul 2025 13:04:10 -0400	[thread overview]
Message-ID: <688a508a5d70c_1d39272941d@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <CADg4-L-7UWVfWOAFOBjVJ4PXbz06b1riDO3r5d4QpGj+aTVcfw@mail.gmail.com>

Christoph Paasch wrote:
> On Wed, Jul 30, 2025 at 5:28 AM Eric Dumazet <edumazet@google.com> wrote:
> >
> > On Wed, Jul 30, 2025 at 4:06 AM Gal Pressman <gal@nvidia.com> wrote:
> > >
> > > On 29/07/2025 21:34, Christoph Paasch via B4 Relay wrote:
> > > > From: Christoph Paasch <cpaasch@openai.com>
> > > >
> > > > When gso_segs is left at 0, a number of assumptions will end up being
> > > > incorrect throughout the stack.
> > > >
> > > > For example, in the GRO-path, we set NAPI_GRO_CB()->count to gso_segs.
> > > > So, if a non-LRO'ed packet followed by an LRO'ed packet is being
> > > > processed in GRO, the first one will have NAPI_GRO_CB()->count set to 1 and
> > > > the next one to 0 (in dev_gro_receive()).
> > > > Since commit 531d0d32de3e
> > > > ("net/mlx5: Correctly set gso_size when LRO is used")
> > > > these packets will get merged (as their gso_size now matches).
> > > > So, we end up in gro_complete() with NAPI_GRO_CB()->count == 1 and thus
> > > > don't call inet_gro_complete(). Meaning, checksum-validation in
> > > > tcp_checksum_complete() will fail with a "hw csum failure".
> > > >
> > > > Even before the above mentioned commit, incorrect gso_segs means that other
> > > > things like TCP's accounting of incoming packets (tp->segs_in,
> > > > data_segs_in, rcv_ooopack) will be incorrect. Which means that if one
> > > > does bytes_received/data_segs_in, the result will be bigger than the
> > > > MTU.
> > > >
> > > > Fix this by initializing gso_segs correctly when LRO is used.
> > > >
> > > > Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
> > >
> > > Maybe we should put an additional Fixes line for the gso_size patch?
> > > It doesn't directly fix it, but it will clearly emphasize the importance
> > > of picking up this patch together with the other one.
> > >
> > > > Reported-by: Gal Pressman <gal@nvidia.com>
> > > > Closes: https://lore.kernel.org/netdev/6583783f-f0fb-4fb1-a415-feec8155bc69@nvidia.com/
> > > > Signed-off-by: Christoph Paasch <cpaasch@openai.com>
> > >
> > > Thanks Christoph,
> > > Reviewed-by: Gal Pressman <gal@nvidia.com>
> >
> > I do not think we need many Fixes: tag.
> >
> > Reviewed-by: Eric Dumazet <edumazet@google.com>
> >
> > If we really want to be precise, the issue also came when GRO got
> > support for GRO packets ;)
> >
> > commit 5eddb24901ee    gro: add support of (hw)gro packets to gro stack
> >
> > This commit really implied that both gso_size and gso_segs had to be
> > set by drivers RX paths.
> >
> > It seems drivers/net/ethernet/google/gve/gve_rx_dqo.c has a similar issue.
> >
> > gve_rx_complete_rsc() sets gso_size but not gso_segs
> >
> > shinfo->gso_size = le16_to_cpu(desc->rsc_seg_len);
> 
> I see! I can send a fix, but won't have the ability to actually test
> it. So, maybe better if someone else takes this one.

Thanks. The GVE team will send a fix.

  reply	other threads:[~2025-07-30 17:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 18:34 [PATCH net] net/mlx5: Correctly set gso_segs when LRO is used Christoph Paasch via B4 Relay
2025-07-30 11:06 ` Gal Pressman
2025-07-30 12:28   ` Eric Dumazet
2025-07-30 16:31     ` Christoph Paasch
2025-07-30 17:04       ` Willem de Bruijn [this message]
2025-08-01 21:40 ` patchwork-bot+netdevbpf

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=688a508a5d70c_1d39272941d@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=amirv@mellanox.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcf@google.com \
    --cc=cpaasch@openai.com \
    --cc=csully@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=hramamurthy@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).