Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jszhang@kernel.org
Cc: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, ast@kernel.org,
	daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
	sdf@fomichev.me, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH v2] net: stmmac: Disable checksum insertion for XDP frame TX
Date: Wed, 18 Nov 2026 07:51:02 +0000	[thread overview]
Message-ID: <179498826255.3136.11066531883770287407@kernel.org> (raw)
In-Reply-To: <20261116134848.4793-1-jszhang@kernel.org>

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@kernel.org # 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


      parent reply	other threads:[~2026-11-18  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 13:48 [PATCH v2] net: stmmac: Disable checksum insertion for XDP frame TX Jisheng Zhang
2026-11-16 14:12 ` netdev-bot+sinfo
2026-11-18  7:51 ` netdev-bot+sashiko [this message]

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=179498826255.3136.11066531883770287407@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.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=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /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