mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Jisheng Zhang <jszhang@kernel.org>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: stmmac: Disable checksum insertion for XDP frame TX
Date: Thu, 22 Oct 2026 15:54:54 +0200	[thread overview]
Message-ID: <741319db-17fb-4768-8606-9105df6bf905@lunn.ch> (raw)
In-Reply-To: <atn0mF-dukVTK6Lh@xhacker>

On Thu, Oct 22, 2026 at 07:33:44PM +0800, Jisheng Zhang wrote:
> On Tue, Sep 29, 2026 at 10:29:14PM +0200, Andrew Lunn wrote:
> > On Tue, Sep 29, 2026 at 08:10:25PM +0800, Jisheng Zhang wrote:
> > > stmmac enables TX checksum insertion for XDP frames whenever the queue
> > > supports it. XDP frames carry no TX checksum offload request, so this
> > > can overwrite a checksum already present in the packet.
> > > 
> > > Pass false to stmmac_prepare_tx_desc() when transmitting an XDP frame
> > > so that the packet is sent with its checksum fields unchanged.
> > 
> > This seems odd to me.
> > 
> > If the frame contains a checksum, it is either correct, and the
> > hardware calculated one will come out the same, not an issue.  Or the
> > checksum in the frame is actually wrong, because the frame has got
> > mangled by eBPF before sending it out, and you want the hardware to
> > calculate the correct value.
> > 
> > What an i missing?
> > 
> Hi Andrew and all,
> 
> some discussions happened in below thread
> https://lore.kernel.org/netdev/athAoWfW-xesPhFP@xhacker/
> 
> Since it has been merged. Let's move the discussion back to my patch.
> 
> AIUI, dwmac can only do HW checksum for normal particular packets
> layouts, such as TCP, UDP etc. The stmmac_has_ip_ethertype() has
> well demostrated this limitation.
> Different with normal tx where the common stack supplies the skb->ip_summed
> metadata, XDP path doesn't have the necessary metadata. So to make
> the XDP always work properly when transmiting tranmist arbitrary Eth
> frames, dwmac HW csum needs to be disabled by default currently.

I don't know the XDP code. But...

Zoom out, look at the big picture:

What do other MAC drivers does? Do they also disable hardware checksum
when XDP is enabled on a queue?

Should XDP actually have the needed meta data? Can it be added in a
low overhead way? Does the overhead of having it cost less than
forcing software check sums?

	Andrew

  reply	other threads:[~2026-10-22 13:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 12:10 Jisheng Zhang
2026-09-29 12:34 ` netdev-bot+sinfo
2026-09-29 20:29 ` Andrew Lunn
2026-10-05 23:28   ` Jakub Kicinski
2026-10-22 11:33   ` Jisheng Zhang
2026-10-22 13:54     ` Andrew Lunn [this message]
2026-10-02  6:10 ` 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=741319db-17fb-4768-8606-9105df6bf905@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jszhang@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®