All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>
Cc: linux-sunxi@lists.linux.dev
Subject: Re: [PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all
Date: Sat, 21 Nov 2026 15:32:39 +0000	[thread overview]
Message-ID: <sashiko-outbox-227127@kernel.org> (raw)
In-Reply-To: <20261120-submit-sun8i-rx-features-v1-v1-2-5058fecba6b3@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] net: stmmac: stale priv->sph_active state in
  stmmac_set_features() [1]
--

commit f9a339d9b6caf3c825c74a9901dfe11d7efeed56
Author: James Hilliard <james.hilliard1@gmail.com>

net: stmmac: dwmac-sun8i: support ethtool rx-all

This commit adds opt-in NETIF_F_RXALL support for dwmac-sun8i so frames
with reported wire errors and runts can be delivered to the networking
stack for packet capture without claiming a verified checksum or counting
them in good-packet and good-byte totals.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 2f33fc0126b11..0a893c2cea78b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

[ ... ]

> @@ -6453,6 +6466,11 @@ static int stmmac_set_features(struct net_device *netdev,
>  {
>  	struct stmmac_priv *priv = netdev_priv(netdev);
>  
> +	if (((netdev->features ^ features) & NETIF_F_RXALL) &&
> +	    netif_running(netdev) && netif_device_present(netdev) &&
> +	    priv->hw->mac->set_rx_all)
> +		priv->hw->mac->set_rx_all(priv, features & NETIF_F_RXALL);
> +
>  	/* Keep the COE Type in case of csum is supporting */
>  	if (features & NETIF_F_RXCSUM)
>  		priv->hw->rx_csum = priv->plat->rx_coe;

[Severity: Critical]
This problem wasn't introduced by this patch, but when NETIF_F_RXCSUM is
disabled in stmmac_set_features(), does leaving priv->sph_active set
[1] corrupt multi-descriptor packets?

Just below this hunk, stmmac_set_features() disables Split Header (SPH) in
hardware when priv->hw->rx_csum is cleared, without updating
priv->sph_active:

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:stmmac_set_features() {
    ...
	if (priv->sph_capable) {
		bool sph_en = (priv->hw->rx_csum > 0) && priv->sph_active;
		u8 chan;

		for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++)
			stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
	}
    ...
}

The hardware then writes payload sequentially into Buffer 1 across all
descriptors, but stmmac_rx_buf1_len() still sees priv->sph_active set and
returns 0 for non-first descriptors (where len > 0), discarding the valid
payload in Buffer 1 and building the SKB from uninitialized memory in
Buffer 2.

[1] https://sashiko.dev/#/bug/linux-c61bc2a2-cd8e-40f1-be85-31573536e5d4

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-submit-sun8i-rx-features-v1-v1-0-5058fecba6b3@gmail.com?part=2

  parent reply	other threads:[~2026-11-21 15:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:32 [PATCH net-next 0/2] net: stmmac: handle RX checksum and wire errors on sun8i James Hilliard
2026-11-20 15:32 ` [PATCH net-next 1/2] net: stmmac: dwmac-sun8i: deliver RX checksum errors to the stack James Hilliard
2026-11-21 15:32   ` sashiko-bot
2026-11-20 15:32 ` [PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all James Hilliard
2026-11-20 18:30   ` Maxime Chevallier
2026-11-20 18:46     ` James Hilliard
2026-11-21 15:32   ` sashiko-bot [this message]
2026-11-20 15:37 ` [PATCH net-next 0/2] net: stmmac: handle RX checksum and wire errors on sun8i netdev-bot+sinfo
2026-11-20 16:29   ` James Hilliard

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=sashiko-outbox-227127@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.