๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27337

Re: [PATCH net-next v14 2/5] net: stmmac: remove software VLAN tag stripping

#27337
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 10:51
99 lines
12587 bytes
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] With this patch, the PHY is allowed to stop RXC in LPI on
  dwmac100/dwmac1000 and on DWXLGMAC builds that have no vlhash/vlins.

--

net: stmmac: remove software VLAN tag stripping

This removes the software VLAN stripping fallback in stmmac_rx_vlan().
stmmac_has_ip_ethertype() is reworked so 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 on cores that actually
provide hardware RX VLAN offload.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index b3524d46863da..c429cb9e1ccbe 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

[ ... ]

> @@ -8282,15 +8255,15 @@ 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;
>  	}
> +
> +	if (stmmac_rx_8021ad_offload(priv))
> +		ndev->features |= NETIF_F_HW_VLAN_STAG_RX;
> +

[Severity: Medium]
Can this change let the PHY stop RXC in LPI on cores where it never could
before, with CONFIG_VLAN_8021Q=y?

Before this patch, NETIF_F_HW_VLAN_CTAG_RX was set on every core. Now
dwmac100/dwmac1000 have no .vlan ops, and dwxlgmac2_vlan_ops has no
.rx_hw_vlan. On those cores without vlhash/vlins, NETIF_F_VLAN_FEATURES
is therefore empty by the time stmmac_phylink_setup() runs:

stmmac_phylink_setup() {
    ...
	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;
    ...
}

Because of that, RX clock stop is now on by default for dwmac1000 with EEE
and for DWXLGMAC without vlhash/vlins.

stmmac_set_rx_mode() still writes the MAC address, hash and frame filter
registers through stmmac_set_filter() with BH disabled. It does not call
phylink_rx_clk_stop_block():

 *  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)

If a multicast join, unicast address change or promisc toggle arrives
while the link is idle in LPI and RXC is stopped, can the hardware filter
end up out of sync with the software lists? One example is a missed IPv6
solicited-node multicast address, which would break ND until the next
set_rx_mode call.

The commit message acknowledges this window and says a dedicated
follow-up will fix it. That follow-up does not seem to be part of this
series. At the last commit of the series ("net: stmmac: rework stmmac_rx
to support XDP rx multi-buff"), stmmac_phylink_setup() still uses the
same NETIF_F_VLAN_FEATURES gate.

The patch also carries "Fixes: 534df0c1724b", so stable could pick it up
without the decoupling change. Could eee_rx_clk_stop_enable be decoupled
from NETIF_F_VLAN_FEATURES before this patch, or in the same series?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-stmmac-rx-mb-v14-0-5506796fd39e%40oss.qualcomm.com
Technical Details
Message-ID: <179646788129.3146.10432733850677593398@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377938-linux-kernel-netdev=dewy.ru
References: <20261204-stmmac-rx-mb-v14-2-5506796fd39e@oss.qualcomm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377938-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v14 2/5] net: stmmac: remove software VLAN tag stripping
Date: Sat, 05 Dec 2026 10:51:21 +0000
Organization: Usenet Network
Message-ID: <179646788129.3146.10432733850677593398@kernel.org>
References: <20261204-stmmac-rx-mb-v14-2-5506796fd39e@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3010438"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Z3nHBRUDXcnia8oLoQ9c9AYDv1o= sha256:Nsm+68qdV9PVfzZJY8SevWTXkDwbF6EBbjpPpYQjxiw=
	sha1:FO5BHmp0dWZCefsCuCHOXJJ6ZAA= sha256:ZtQEXXD0VnRFwW5QEWYBjOfXvIhm8eYtByh231pMVsg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 65D92117DEC; Sat,  5 Dec 2026 13:51:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.541
X-Spam-Status: No, score=-3.541 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id aAOVlm9lhFKo;
	Sat,  5 Dec 2026 13:51:39 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-377938-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id B8458117DB3; Sat,  5 Dec 2026 13:51:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 5404F24144; Sat,  5 Dec 2026 10:51:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796467884;
	b=IXwcy2wFrySogZ5WAkET3caNrvU/XKI1G/qo1iQuRQdMHsKh3hR2IsuhMH8r82nU2F4o
	 Z/3Vm5/+ZJZVbodT9bUsoI0+7MUNq0WnrPTemmLSAwj/IuIpO9LLoGjgehTJDzVAf2Dba
	 TyZI0q0VF3WcuLkEoS4X3XwyiNUuJRlDVUgs92WhujMmENMD9KtwZHFZIwbysL0DR2eK8
	 nkGLEYpDaTvEzT2b59QoKIZNBTREXZNqWp3KfYukrundyyWIRIzcW6Ahm47ZoEWsgz5cW
	 Kbz/ZBXBM/OxOLU9Kqf+yIm3+PP78jVUjflmUbVR/AtmfvIi6deKE7Ot5UICncMkVNw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796467884;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=ryw6fYBNqO+itRUr/RKbK1BBXz96hbyVCggeEpVOupo=;
	b=IEWUfNpuQLdIyH/VUgrPdufC5KVlELiDdiIVc1px5c37Ozq+pktouUPlIUbJfyDDedLw
	 bOnCDfIHOMBt/Iw5r4+CcqLNiLWnsW1N48XHiTVSJ7NH13y24UXJ6Efq6PWpJpA8UUAO9
	 5MBPJmn56dJczP8AjfpChSG5BtS2xQHLVdQAyTmOiWVNMFCuRJDkPZJONFYoEuJ178+VC
	 WYOLGvYMzcxIdS/rgxeMkVU2KVjrOX44HoVHcTw3MhQMH5Xx7a4rhofD9PdpI8NxniGmP
	 W8ax+K6jEVPw9dqnGTLGihaqBPBtg9e2fU6/QAXRzsn9S0GnozgnSJuPHOzqXu65DVQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lvkSEkfY;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id AFDC9606A33B;
	Sat,  5 Dec 2026 10:51:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lvkSEkfY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796467883;
	b=TFyJ03K+HWv2ISOAMdFkcr79WBlgnEdR9g5nU7zdRCEHEY4+ApOfXx5bsZsrIduDoNpK
	 Ti5QClabwVSGjmhe/9WFf1Ft6yFB9bVrnikYl5FYsMkFhtFCLlaSydVP2EosOFzvph4/C
	 rBalH3A/WFL4fgkNvP9XOr7DJRx1FXk0L0OBKwe9UA3PZJUM1gF6GVgx/ZiNNdVXdv9TB
	 P0G8qNkjPNIyeriX5yrNNF4BDdv95blihhAaBzqojhV/ZTttP1RNsv1HY5KM2+Df1y+OV
	 GNIRc7fl/q2t6Uhivb/CBNjIDmY80m5BdjowhjK4a5kO9B2kQVZYfnyrDPKLCzsPsnw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796467883;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=ryw6fYBNqO+itRUr/RKbK1BBXz96hbyVCggeEpVOupo=;
	b=3NNGwvzf0cZVoOoxnfjSa5zTSB4GtcO1LqW+dXbOwd/mxlRq9GsJWatrt/H2Suo4AymY
	 JajRma8PGFDL/V6g8+b7hxSDxZFIYlO9/kjUdjazA8SGVTELsYpEtfVfVv/fVHvLMaI+U
	 6bOUY8VTVZVE8ow3nmJrkoBzad027ywUf5BvF/MCS36GMZK4sqCHUgc5Xy1Ft0xnJV4+u
	 l5dF/P+Ov18WRwOv7YRzPDuiHEq7TRmG+mHtxENL+bji/rVEJKewBu/EM6xH6XZYfR90P
	 T93Zi6XvCCfRUNU4dTtkP3bS7XdsDTyRObfqNZIdBBO72WZG4EdNOk3bp0tuDJu6xpw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lvkSEkfY;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD590606A330;
	Sat,  5 Dec 2026 10:51:23 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2D0F1F00936;
	Sat,  5 Dec 2026 10:51:21 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796467883;
	bh=ryw6fYBNqO+itRUr/RKbK1BBXz96hbyVCggeEpVOupo=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=lvkSEkfYKx2n2gd5G4BZmZ39Lvuhl6qpAbR7pNQg2JXp14nbhBRiOOiVR3lJdqrik
	 ox9T9oRA3Ev5Zby/e5L78jPLSpRFB8oZzyw/AfAsduWLUh8Ck8ZJk8qFEJuT2qZnBu
	 /ZGAN/SSzA1dpB4/ZnDqtPbR0RdDT47y/3SqWRvYchb47pHBO290uc4o9OB2jOCMt+
	 PsayPHNl0P+d4mtl9tarG8aUkzMuqvL76Vwa4O2XfaLAm8IdKIR298CT6xyAf5/V24
	 UwdZmH0Jlepzg1nwbgIQnBSciRVdd50gPurQMDUYi7NoGJNLltviZstHodFE/47+9A
	 myHE7IVXTizfA==
X-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, linux@armlinux.org.uk,
 willemb@google.com, netdev@vger.kernel.org,
 linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org, nb@tipi-net.de
X-In-Reply-To: <20261204-stmmac-rx-mb-v14-2-5506796fd39e@oss.qualcomm.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list