From: Jisheng Zhang <jszhang@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
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 19:33:44 +0800 [thread overview]
Message-ID: <atn0mF-dukVTK6Lh@xhacker> (raw)
In-Reply-To: <f0d8c25f-96e1-4da8-af6c-3286610338ba@lunn.ch>
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.
Thanks
next prev parent reply other threads:[~2026-10-22 11:53 UTC|newest]
Thread overview: 6+ 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 [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=atn0mF-dukVTK6Lh@xhacker \
--to=jszhang@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--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®