Thread (5 messages) 5 messages, 5 authors, 10d ago

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

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-10-05 23:28:30
Also in: linux-arm-kernel, lkml

On Tue, 29 Sep 2026 22:29:14 +0200 Andrew Lunn wrote:
On Tue, Sep 29, 2026 at 08:10:25PM +0800, Jisheng Zhang wrote:
quoted
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?
Oops, missed this before applying. Fair, but also we shouldn't modify
the frame if user didn't ask for it. Perhaps 0 UDP csum is used, or
user is trying to build a testing tool and intentionally send bad csum.
I applied the patch to net-next. It can hurt as much as help, but the
direction seems right. At the very least any AF_XDP app expecting csum
insertion without asking for it would not be portable to other drivers.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help