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

From: netdev-bot+sashiko

Date: Wed Nov 18 2026 - 02:51:07 EST


Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The patch hard-codes csum=false in stmmac_xdp_xmit_xdpf()
(drivers/net/ethernet/stmicro/stmmac/stmmac_main.c).

--

net: stmmac: Disable checksum insertion for XDP frame TX

This commit stops stmmac from requesting hardware checksum insertion for
frames sent through XDP_TX and ndo_xdp_xmit. It does this by passing false
as the csum argument to stmmac_prepare_tx_desc() in stmmac_xdp_xmit_xdpf().
The bugged_jumbo special case is removed because it is no longer needed.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 25894771e9e9f..aa73801119be8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -5284,7 +5284,6 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
> {
> struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
> struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
> - bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported;

[ ... ]

> @@ -5353,7 +5344,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
> stmmac_set_tx_dma_entry(tx_q, entry, buf_type, dma_addr, len,
> dma_map && frag);
> stmmac_set_desc_addr(priv, desc, dma_addr);
> - stmmac_prepare_tx_desc(priv, desc, !i, len, csum,
> + stmmac_prepare_tx_desc(priv, desc, !i, len, false,
> priv->descriptor_mode, !!i, last_frame,
> xdp_get_frame_len(xdpf));

[Severity: Medium]
Could this break existing XDP setups that rely on the MAC to fix up
checksums?

Since be8b38a722e6 and 8b278a5b69a2, stmmac_xdp_xmit_xdpf() has asked for
hardware checksum insertion on every XDP_TX and redirected frame. At first
it passed true, and since b1eded580ab2 it has passed:

!priv->plat->tx_queues_cfg[queue].coe_unsupported

Some XDP programs rewrite L3/L4 headers without updating the checksums,
for example NAT, L4 load balancers that rewrite addresses or ports, and
encapsulation. On COE-capable dwmac queues these have worked because the
hardware recomputed the checksums. With csum hard-coded to false, it looks
like those frames would go out with stale checksums and receivers would
drop them.

The code change itself seems reasonable, given the stmmac_has_ip_ethertype()
limitation and the lack of checksum metadata on XDP frames. The concern is
how the change is labelled.

The commit carries two Fixes: tags pointing at 2021 commits and has no
stable annotation, so it is likely to be picked up for stable backports.
The commit message says the packet is sent "with its checksum fields
unchanged", but it doesn't mention that this changes on-wire behaviour for
existing users.

For comparison, the earlier commit ecf5985006dd ("net: stmmac: Disable
unsolicited checksum insertion for AF_XDP TX") made the same kind of change
on the AF_XDP zero-copy path. That commit included:

Cc: stable+noautosel@xxxxxxxxxx # high regression risk

and the note "Applications must supply complete checksums".

Would it make sense to add a similar noautosel annotation here? Should the
commit message also say that XDP programs must now supply complete
checksums?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116134848.4793-1-jszhang%40kernel.org