[PATCH] net: stmmac: Disable checksum insertion for XDP frame TX

Jisheng Zhang jszhang at kernel.org
Thu Oct 22 04:33:44 PDT 2026


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



More information about the linux-arm-kernel mailing list