BPF List
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
To: netdev-bot+sashiko@kernel.org
Cc: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, 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, Jose.Abreu@synopsys.com,
	boon.leong.ong@intel.com, horms@kernel.org, andrii@kernel.org,
	eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev,
	song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org,
	emil@etsalapatis.com, ihor.solodrai@linux.dev,
	matthew.gerlach@altera.com, boon.khai.ng@altera.com,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	bpf@vger.kernel.org, nb@tipi-net.de
Subject: Re: [PATCH net-next v13 2/5] net: stmmac: remove software VLAN tag stripping
Date: Fri, 27 Nov 2026 10:54:53 +0100	[thread overview]
Message-ID: <awlTbaxfzMZyCdzU@lore-desk> (raw)
In-Reply-To: <179570462642.3135.18427694806922403936@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 7540 bytes --]

> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 2
> 
> 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] In __stmmac_dvr_probe()
>   (drivers/net/ethernet/stmicro/stmmac/stmmac_main.c),…
> - [Low] The patch carries 'Fixes: 534df0c1724b', which marks it for
>   stable backporting.
> - [Low] On DWXGMAC (stmmac_rx_8021ad_offload() true),
>   __stmmac_dvr_probe() now adds NETIF_F_HW_VLAN_STAG_RX to…
> 
> --
> 
> net: stmmac: remove software VLAN tag stripping
> 
> This removes the software VLAN stripping in stmmac_rx_vlan() and changes
> stmmac_has_ip_ethertype() so that it still recognises IPv4/IPv6 behind a
> single in-payload C-tag on RX. NETIF_F_HW_VLAN_CTAG_RX and
> NETIF_F_HW_VLAN_STAG_RX are now advertised only when the VLAN ops and the
> descriptor ops provide real RX VLAN offload.
> 
> > The DWXLGMAC mis-advertisement was introduced when the RX VLAN offload
> > gate was widened to all xmac cores, so tag the fix accordingly.
> >
> > With NETIF_F_VLAN_FEATURES possibly empty, EEE RX clock stop may be
> > enabled on some platforms; the preceding selftests patch blocks RX
> > clock stop while the ethtool selftests run.
> >
> > This depends on the preceding selftests fix.
> >
> > Fixes: 534df0c1724b ("net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN stripping")
> 
> [Severity: Low]
> Is the Fixes: tag in proportion to the change? On DWXLGMAC,
> dwxlgmac2_vlan_ops has no .rx_hw_vlan:
> 
> const struct stmmac_vlan_ops dwxlgmac2_vlan_ops = {
> 	.update_vlan_hash = dwxgmac2_update_vlan_hash,
> 	.enable_vlan = vlan_enable,
> 	.set_hw_vlan_mode = dwxlgmac2_set_hw_vlan_mode,
> };
> 
> With the old hw_vlan_en = true, stmmac_rx_hw_vlan() did nothing, and
> dwxlgmac2_set_hw_vlan_mode() only sets EDVLP. The tag stayed in the
> payload and the VLAN core removed it in software. The only visible effect
> seems to have been the wrong CTAG_RX/STAG_RX advertisement.
> 
> The same Fixes-tagged patch also does the following:
> 
> - removes the software stripping path;
> - drops CTAG_RX on every dwmac100/dwmac1000;
> - changes the RX checksum trust rules in stmmac_has_ip_ethertype();
> - makes STAG_RX user-visible in hw_features;
> - depends on the preceding selftests patch.
> 
> Through the NETIF_F_VLAN_FEATURES check in stmmac_phylink_setup(), it also
> enables EEE RX clock stop on every such platform that does not set
> STMMAC_FLAG_RX_CLK_RUNS_IN_LPI, not only on "some platforms".
> 
> Could the minimal DWXLGMAC advertisement fix be split out for net, with
> the cleanup and its EEE side effects going to net-next?
> 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index ca4c7fb11b73f..7896364c43e95 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> 
> [ ... ]
> 
> > @@ -8275,15 +8248,17 @@ static int __stmmac_dvr_probe(struct device *device,
> >  	ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
> >  	ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
> >  #ifdef STMMAC_VLAN_TAG_USED
> > -	/* Both mac100 and gmac support receive VLAN tag detection */
> > -	ndev->features |= NETIF_F_HW_VLAN_CTAG_RX;
> > -	if (priv->plat->core_type == DWMAC_CORE_XGMAC)
> > -		ndev->features |= NETIF_F_HW_VLAN_STAG_RX;
> > -
> > -	if (dwmac_is_xmac(priv->plat->core_type)) {
> > +	if (stmmac_rx_8021q_offload(priv)) {
> > +		ndev->features |= NETIF_F_HW_VLAN_CTAG_RX;
> >  		ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
> >  		priv->hw->hw_vlan_en = true;
> >  	}
> 
> [Severity: Medium]
> Does this make RX clock stop reachable from set_rx_mode again?
> 
> dwmac1000 has no .vlan ops, and neither does DWXLGMAC without
> vlhash/vlins. With CONFIG_VLAN_8021Q enabled, these cores now end up with
> no NETIF_F_VLAN_FEATURES. stmmac_phylink_setup() then does:
> 
> 	if (!(priv->plat->flags & STMMAC_FLAG_RX_CLK_RUNS_IN_LPI) &&
> 	    !(priv->dev->features & NETIF_F_VLAN_FEATURES))
> 		config->eee_rx_clk_stop_enable = true;
> 
> As a result the PHY may stop RXC while the link is in LPI.
> 
> stmmac_set_rx_mode() runs with BH disabled under netif_addr_lock_bh(). It
> cannot use phylink_rx_clk_stop_block(), which needs RTNL and a sleeping
> MDIO access:
> 
>  *  FIXME: This may need RXC to be running, but it may be called with BH
>  *  disabled, which means we can't call phylink_rx_clk_stop*().
>  */
> static void stmmac_set_rx_mode(struct net_device *dev)
> {
> 	struct stmmac_priv *priv = netdev_priv(dev);
> 
> 	stmmac_set_filter(priv, priv->hw, dev);
> 
> Commit c171e679ee66 notes that the hardware needs RXC when MAC address
> configuration registers are written. On these platforms, could a
> multicast join/leave, a promisc/allmulti change or a secondary unicast
> address update reach stmmac_set_filter() while RXC is stopped? That would
> leave the address or hash filter unprogrammed.
> 
> The selftests patch covers the ethtool selftests, but the commit message
> does not mention this path. dwmac100 should not be affected because it
> has no EEE.
> 
> These platforms did run with RX clock stop before c171e679ee66, and they
> still do with CONFIG_VLAN_8021Q=n. Whether dwmac1000 filter writes
> actually fail without RXC is therefore a hardware question.

I think this is a real problem, but the fix we have in place is quite frigile
and error prone (we already have the same problem with CONFIG_VLAN_8021Q=n).
I think this problem should be properly addressed with a specific patch not
included in this series.

> 
> > +
> > +	if (stmmac_rx_8021ad_offload(priv)) {
> > +		ndev->features |= NETIF_F_HW_VLAN_STAG_RX;
> > +		ndev->hw_features |= NETIF_F_HW_VLAN_STAG_RX;
> > +	}
> 
> [Severity: Low]
> Should STAG_RX be added to hw_features here? On DWXGMAC this tells
> userspace the bit can be toggled on its own, but stmmac_fix_features()
> ties it to CTAG_RX:
> 
> 	if (stmmac_rx_8021ad_offload(priv)) {
> 		if (features & NETIF_F_HW_VLAN_CTAG_RX)
> 			features |= NETIF_F_HW_VLAN_STAG_RX;
> 		else
> 			features &= ~NETIF_F_HW_VLAN_STAG_RX;
> 	}
> 
> stmmac_set_features() also has only one combined hw_vlan_en state.
> 
> So "ethtool -K <dev> rx-vlan-stag-hw-parse off" with rxvlan on, or "on"
> with rxvlan off, is always undone. ethtool then reports [requested off]
> or [requested on].
> 
> Before this patch STAG_RX was only in features and showed as [fixed],
> which matched the coupling. The coupling in stmmac_fix_features() already
> adds STAG_RX back when CTAG_RX is re-enabled.

I guess this is managed by stmmac_fix_features() disabling
NETIF_F_HW_VLAN_STAG_RX if NETIF_F_HW_VLAN_CTAG_RX is not enabled.

Regards,
Lorenzo

> 
> > +
> >  	if (priv->dma_cap.vlhash) {
> >  		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> >  		if (priv->plat->core_type == DWMAC_CORE_XGMAC)
> 
> [ ... ]
> 
> -- 
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125-stmmac-rx-mb-v13-0-0f6bac53e8d5%40oss.qualcomm.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-27  9:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 14:48 [PATCH net-next v13 0/5] net: stmmac: introduce XDP rx multi-buff support Lorenzo Bianconi
2026-11-25 14:48 ` [PATCH net-next v13 1/5] net: stmmac: selftests: Prevent RXC from being disabled in LPI Lorenzo Bianconi
2026-11-25 14:48 ` [PATCH net-next v13 2/5] net: stmmac: remove software VLAN tag stripping Lorenzo Bianconi
2026-11-26 14:50   ` netdev-bot+sashiko
2026-11-27  9:54     ` Lorenzo Bianconi [this message]
2026-11-25 14:48 ` [PATCH net-next v13 3/5] net: xdp: add xdp_buff_shrink_tail() helper Lorenzo Bianconi
2026-11-25 14:48 ` [PATCH net-next v13 4/5] net: xdp: add __xdp_return_buff() helper Lorenzo Bianconi
2026-11-25 14:48 ` [PATCH net-next v13 5/5] net: stmmac: rework stmmac_rx to support XDP rx multi-buff Lorenzo Bianconi
2026-11-26 14:50   ` netdev-bot+sashiko
2026-11-27 10:22     ` Lorenzo Bianconi
2026-11-25 14:53 ` [PATCH net-next v13 0/5] net: stmmac: introduce XDP rx multi-buff support netdev-bot+sinfo
2026-11-26  8:48   ` Lorenzo Bianconi

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=awlTbaxfzMZyCdzU@lore-desk \
    --to=lorenzo.bianconi@oss.qualcomm.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=boon.khai.ng@altera.com \
    --cc=boon.leong.ong@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=martin.lau@linux.dev \
    --cc=matthew.gerlach@altera.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=memxor@gmail.com \
    --cc=nb@tipi-net.de \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox