Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: james.hilliard1@gmail.com
Cc: netdev@vger.kernel.org, maxime.chevallier@bootlin.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, boon.leong.ong@intel.com,
	wens@kernel.org, jernej.skrabec@gmail.com, samuel@sholland.org,
	clabbe.montjoie@gmail.com, kuba@kernel.org,
	o.rempel@pengutronix.de, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all
Date: Tue, 24 Nov 2026 15:47:13 +0000	[thread overview]
Message-ID: <179553523359.3135.5161173895419384474@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 more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The patch adds a `set_rx_all` member to `struct stmmac_ops`
  (drivers/net/ethernet/stmicro/stmmac/hwif.h:322) but no…

--

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

This adds opt-in NETIF_F_RXALL support for dwmac-sun8i. With it, complete
frames with a reported wire error, and runts the MAC can forward, are
delivered to the stack and are not counted in the good packet and byte
totals. A new set_rx_all op in struct stmmac_ops updates the runt
forwarding bit in RX_CTL1, and a new spinlock serializes those updates
against the DMA start/stop bits.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> index 047d809b8b889..2cfadc6861047 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> @@ -319,6 +319,7 @@ struct stmmac_ops {
>  	void (*set_mac)(void __iomem *ioaddr, bool enable);
>  	/* Enable and verify that the IPC module is supported */
>  	int (*rx_ipc)(struct mac_device_info *hw);
> +	void (*set_rx_all)(struct stmmac_priv *priv, bool enable);
>  	/* Enable RX Queues */
>  	void (*rx_queue_enable)(struct mac_device_info *hw, u8 mode, u32 queue);
>  	/* RX Queues Priority */
> 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);
> +

[Severity: Low]
This isn't a bug, but should the new op get a stmmac_set_rx_all() wrapper
in hwif.h like the other struct stmmac_ops members have?

Every other MAC op in that table goes through stmmac_do_callback() or
stmmac_do_void_callback(), which checks both hw->mac and the op pointer
for NULL:

drivers/net/ethernet/stmicro/stmmac/hwif.h:
#define stmmac_core_init(__priv, __args...) \
	stmmac_do_void_callback(__priv, mac, core_init, __args)
...
#define stmmac_rx_ipc(__priv, __args...) \
	stmmac_do_callback(__priv, mac, rx_ipc, __args)

Here stmmac_set_features() calls priv->hw->mac->set_rx_all() directly
and does its own NULL check. A few lines below, the same function calls
stmmac_rx_ipc() through the wrapper.

__stmmac_dvr_probe() also reads priv->hw->mac->set_rx_all directly to
decide whether to advertise NETIF_F_RXALL.

Both sites check for NULL today, so nothing breaks now. Only
sun8i_dwmac_ops sets this op, though. If a later caller copies the
direct call without the NULL check, could it oops on every other MAC?

>  	/* Keep the COE Type in case of csum is supporting */
>  	if (features & NETIF_F_RXCSUM)
>  		priv->hw->rx_csum = priv->plat->rx_coe;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120-submit-sun8i-rx-features-v1-v1-0-5058fecba6b3%40gmail.com

  parent reply	other threads:[~2026-11-24 15:47 UTC|newest]

Thread overview: 14+ 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-24 15:47   ` netdev-bot+sashiko
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-24 15:47   ` netdev-bot+sashiko [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
  -- strict thread matches above, loose matches on Subject: below --
2026-11-22  7:45 [PATCH net-next 0/2] net: stmmac: support ethtool rx-all " James Hilliard
2026-11-22  7:45 ` [PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all James Hilliard
2026-11-22 18:38   ` Andrew Lunn
2026-11-22 20:05     ` James Hilliard
2026-11-22 20:57       ` Andrew Lunn
2026-11-22 18:41   ` Andrew Lunn

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=179553523359.3135.5161173895419384474@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=boon.leong.ong@intel.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=samuel@sholland.org \
    --cc=wens@kernel.org \
    /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