From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02BEB606A32F for ; Sun, 6 Dec 2026 12:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=37nbp4GN; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=DAbHBjl0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=OPjui0ah DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=BIUmRbVFYihvZkNEjBHpNpWQCWMNsBx3IlYHO5oB2t4=; b=37nbp4GNGwkt91ryzoOemGzXHb OBH88sP98cFugLMp/eF/jugMwu+PjhbolAG2v451Pr2TL/JGnF2ylHE9kIeis3q5+JZuZaSEJPS3I Xs2x0xcYlrOf+S+ofM7nNcGCuuTtAVzgQ1DBhnb/ssB1d9p4Sg0W4MRmHKzKRynQK9EpBl5IjeNx5 y1Nj3dtqVJyBI7bYAJiJyEgBeNmmIkeHWjexFObjnm2G5yGJGzADHbFUSeKW1tZYUx1XFyheh70cY Yqs+QELtLA9gpvOxL99kWdRZwlBHMpz7yKa75jAD++pEFKG7yMSeYASi+A5iEvuXsBMThplRhLqFZ UEpdJQxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xaBTN-00000003a4h-3c6x; Sun, 06 Dec 2026 12:36:09 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xaBTK-00000003a4I-3wfE for linux-arm-kernel@lists.infradead.org; Sun, 06 Dec 2026 12:36:08 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B6ALlNd4151798 for ; Sun, 6 Dec 2026 12:36:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=BIUmRbVFYihvZkNEjBHpNpWQ CWMNsBx3IlYHO5oB2t4=; b=DAbHBjl0iG1Lgn+4X8KpO/XXUijNe1v9vP+i2qwp 7cXML3AP0TReV6yolciI8RBYp4mSoGpfZNnf22Aj2/E2mHjL2u+AeK2xvWTITbuj ihTlxSeO7sW9iP0d8Ohaiq5asRBpoISe3TJ62Km082VTL6ro9zAV9a+0AvXzJbAg PRPzFke20fl0B30Ov5kEUFK7VD+XgB+W27KbjxKVpYtDYK8RL0GpzsJtfgXyaJt/ +DwPMhWXkEnsohpPTFyksx86J5OBd7d1wLokDB/nc0tQQdcPZeZsxLNihV8hKZTh cnjNH57m7lwCNKKnMNW+AcQQ0sO4UrhZOuIe/cRZhTflDQ== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jcbjtkj1a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 06 Dec 2026 12:36:05 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-94a92c98adcso190597385a.1 for ; Sun, 06 Dec 2026 04:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796560562; x=1797165362; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=BIUmRbVFYihvZkNEjBHpNpWQCWMNsBx3IlYHO5oB2t4=; b=OPjui0ahHaRTf4fXhyNr+xP29d7NMnv+wr0UKZaWrCfOFAPqy+68FE8dDIQa6kGx+H PTGeEFIussLmGLZyYPbvxdTqn6UcDWrEEw3PyjY/woTdFg1FjPve8pbNI94Hc2ZMO/ko YA+Cj7kRjeLtsmAVDN+a9FkQpCwslsrX0faQgQ29Ibwp3cZ6yJapA6gAPkLizfGOTVZf VrhNiC1P/RGD5UWvbe7z3unddMGkK+Wk9PZHhYvOfyBxg6YUJdaTLzmYxunw+pCNUiHZ 0a1kqbhRq6PAZfiYYzxD+8sVP6Lt2KaIexhs+DAZP+FdKIq0Gb3DfNmCu4EtHK1sYpdD /jyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796560562; x=1797165362; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BIUmRbVFYihvZkNEjBHpNpWQCWMNsBx3IlYHO5oB2t4=; b=mw4Q3sjW3bbrBHHmReAQkTQ3S0/Od8uRSSKe366nGFcCP+8vsHHBMZPVm7knhaIcNY O1ZpIIsg6qw4RMrqahtlLuXYqhXqiB91lrQs6K+dqpn1uchLej1bCy4YgbDuEDgdIh/F SIBGPeQBvVWs4ecUSzpk8cPIVmUMUuTuPQ68AXstBRaF6K+nbnvCaqma/G+DuZPgfFE3 eWbftab8DfNVkmQYj9/OQMNqnLQJjuo49az6q2W5/aK1G2jf0fTEcqgD+Hjyb7VZ1vbp PcaTHhHwIE8TkGIw/h8dC2w4pzLYFMV7yTyAD8LD4nLjQKQkWz/pG4lkk5xxuaDoyR6D DBZg== X-Forwarded-Encrypted: i=1; AL+hErEoUe8xiOfltVFtTkFTiYiHpAodtDckovDr+qD5CKxrOwyOUA1CywjS1Q+Lh8QSt6qOAgekWgwtoGP5zbzD7VWb@lists.infradead.org X-Gm-Message-State: APuU4Z9JhhHNAotJDRL/ro4+l9RvADAew/zcg17w2i//DnC3I+rG8h0m p4f0EQURYclZMCWShQiFHFzBmDFm9AwEQMLPmBLeQ7uaZvVz9XvpeWx+n3BcKfQfLHfTF/tiPkN uQo7KFHeCT6h5/t0YQxgTjQiH2F+H7JuPTS8aeKEdlvwJXgJjHqFmt4eCC1r6A+O7ZOL1X/vrfP 5Tlg== X-Gm-Gg: AZFdTZeH4Dvfm5tpig1ENP0pRNvvV6pYHmJDfo7RlRD2XOteA2gTNG7sy7zWBJbgKoK MB9tO/dTTmaSIUtwh8zMKJ0ZW6thZEPOMvj4fx09/GmB1wviKwXg7JG/cesdC2wOnLti3PQFREm fX+bfQJsVJxYHQtYakAfLnHhoK38VmfC0K+29/uGWo2ZV0IlosoDNZs1z7vBI2DtAsd3rAkE2ub te66+txhejStB1nIDBZ/DUJ1ie4k4Dc8sNYeHN5acqIKej450YYXYUeo1vull+eJeS5PpB/YEa3 oP7zjlB1XimdNcq3WBjc+AdqfFxnz00PmV8a3F/g46CEveaSDJCHxZZtkhq/m3oBnYKxScf9ekJ 4nJ9/MBtzUSI8WI+0WmmFJfaRXPDgdfhm7r0tbEZyBezpwwvZztWouvDrnC+aZQ== X-Received: by 2002:a05:620a:1a0f:b0:949:c64a:82c8 with SMTP id af79cd13be357-94a72354599mr1687450385a.39.1796560561764; Sun, 06 Dec 2026 04:36:01 -0800 (PST) X-Received: by 2002:a05:620a:1a0f:b0:949:c64a:82c8 with SMTP id af79cd13be357-94a72354599mr1687448085a.39.1796560561220; Sun, 06 Dec 2026 04:36:01 -0800 (PST) Received: from localhost ([130.25.105.85]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbf168b1fcsm88730735e9.0.2026.12.06.04.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 04:36:00 -0800 (PST) Date: Sun, 6 Dec 2026 13:35:59 +0100 From: Lorenzo Bianconi To: Maxime Chevallier Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Lai Peter Jun Ann , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net] net: stmmac: do not toggle RX VLAN offload while running Message-ID: References: <20261205-stmmac-do-not-flip-vlan-offload-v1-1-5b3fa52c306b@oss.qualcomm.com> <5d6b1d95-d942-4cb8-b452-29f980223c27@bootlin.com> X-Archived-By: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J/7j42m6RTcF4K6I" Content-Disposition: inline In-Reply-To: <5d6b1d95-d942-4cb8-b452-29f980223c27@bootlin.com> X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA2MDAzOSBTYWx0ZWRfXy1yk5ur/BwVy zqh4LsH3gHCjgOCg9R0sb5IA96qpQSxdes3T1uPfMf1aGIEzcht/nfvzpPqy9hKlhZvdFRnfG8X 7+pI9jHx1ZFQAT26KrfQ+FwKK0YWC3W+wjOMe4ZCe01ztF/4PGhCh1wquomc4UlzS0fsdycHC0n eut39TBexq3H+XVPfWIBbECHml2DBgfsUbU05HsyNqOFPqAQH/cNOApDanOK4jU0RyNt+i6adgU 3w8DQYYDULSC+AJeXFXzH//npHd4+Py5+sUbYJxEM8KLg3UaMfp/q968YX+IkpZ8p4vInFYr69V LLZgNa4EyNhB7B3LLM51TvTnmqMmFhF0JJ9XJfz0duCzTh/armdKcb2BQ/18ZSIJibUEK1QJSGa NRTL1V6x0hO2oN4XvIZ+S1TBD2kOptturBRlimhNUy8WNwTZwSNQUsC18Z+K2mDh5ikgGaOw7+m 2qeEaI2OspMjuPd9ijw== X-Proofpoint-GUID: _FMagptx2UE9IA2LNGMlGNPJfLgzFv9f X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA2MDAzOSBTYWx0ZWRfXxtQd63aOrWFk UOaI9EyCbij4/9fNPYkjdM8VkVNe/E8KSY/JBAHLGtjc4Utq6jvHi0AdaeXKPwqo0mhCVv4gg+o e/G/tjwJczPhPiIJy9bfdS6yYXhpJPw= X-Authority-Analysis: v=2.4 cv=c4U+0h9l c=1 sm=1 tr=0 ts=6b1556b5 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=RcFDq6c+avmIvxkL9iwlxA==:17 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=P-IC7800AAAA:8 a=EUspDBNiAAAA:8 a=fPKRT0WanOjbhmrf-NcA:9 a=CjuIK1q_8ugA:10 a=gqd1yb4GUn_MI492CIsA:9 a=PEH46H7Ffwr30OY-TuGO:22 a=d3PnA9EDa4IxuAV0gXij:22 X-Proofpoint-ORIG-GUID: _FMagptx2UE9IA2LNGMlGNPJfLgzFv9f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-06_03,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 phishscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2612040000 definitions=main-2612060039 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261206_043607_099859_5EAD11F5 X-CRM114-Status: GOOD ( 38.94 ) X-Spam-Score: -2.8 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 --J/7j42m6RTcF4K6I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Dec 06, Maxime Chevallier wrote: > Hi Lorenzo, >=20 > On 12/5/26 18:26, Lorenzo Bianconi wrote: > > The RX VLAN offload mode is consumed by the receive path: stmmac_rx() > > and stmmac_dispatch_skb_zc() use hw_vlan_en to decide whether to take > > the VLAN tag from the RX descriptor, and the software stripping path > > uses the advertised RX VLAN feature bits. > >=20 > > stmmac_set_features() changes that state at runtime, while RX NAPI can > > run concurrently. A frame received with one setting can therefore be > > processed after the setting has changed, which may lose a tag that was > > stripped or duplicate a tag that is still in the frame. The MAC register > > update also cannot be made atomic with respect to frames already in > > flight without stopping RX DMA and flushing the descriptor rings. > >=20 > > Since this is an RX offload mode change and there is no cheap way to > > synchronize it with the receive path, only allow it while the interface > > is down. Mask the RX VLAN feature bits back to their currently advertis= ed > > state in stmmac_fix_features() when the device is running, so > > ndo_set_features() never changes the mode under a live RX path. A reque= st > > made while the interface is running is ignored and is not deferred to t= he > > next open; userspace must bring the interface down to change the RX VLAN > > offload. > >=20 > > Fixes: 750011e239a5 ("net: stmmac: Add support for HW-accelerated VLAN = stripping") > > Signed-off-by: Lorenzo Bianconi >=20 > This triggered some new failures on the Netdev CI for 6 stmmac runners: >=20 > - https://netdevci.bootlin.com/stmmac/outputs/941929-bootlin-stmmac-rk3= 568/test-outputs/24-vlan-py/ > - https://netdevci.bootlin.com/stmmac/outputs/941929-bootlin-stmmac-imx= 8mp/test-outputs/24-vlan-py/ > - https://netdevci.bootlin.com/stmmac/outputs/941929-bootlin-stmmac-jh7= 110/test-outputs/24-vlan-py/ > - https://netdevci.bootlin.com/stmmac/outputs/941929-bootlin-stmmac-soc= fpga-agilex5/test-outputs/24-vlan-py/ > - https://netdevci.bootlin.com/stmmac/outputs/941929-bootlin-stmmac-stm= 32mp1/test-outputs/24-vlan-py/ > - https://netdevci.bootlin.com/stmmac/outputs/941929-bootlin-stmmac-stm= 32mp2/test-outputs/24-vlan-py/ >=20 > The test fails precisely because we can't switch offload mode while inter= face is on. >=20 > Besides the selftest, is it worth fixing ? We may have an error on one fr= ame > while it's being actively reconfigured, I guess a lot of other drivers are > subject to the same class of problem... Is it a bit too defensive ? >=20 > I may be wrong here, I don't know exactly what's the netdev policy regard= ing > wether it's OK to have potentially one frame corrupt while the user is > reconfiguring offloads... Hi Maxime, If it is ok to receive corrupted frames during offload reconfiguration, I a= m fine to drop this patch, I was just fixing a comment from sashiko that seemed re= asonable to me :) Regards, Lorenzo >=20 > Maxime >=20 > > --- > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > >=20 > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_main.c > > index d32d3e7b1b8c..b978e64399d4 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > @@ -6371,6 +6371,8 @@ static netdev_features_t stmmac_fix_features(stru= ct net_device *dev, > > netdev_features_t features) > > { > > struct stmmac_priv *priv =3D netdev_priv(dev); > > + netdev_features_t vlan_rx =3D NETIF_F_HW_VLAN_CTAG_RX | > > + NETIF_F_HW_VLAN_STAG_RX; > > =20 > > if (priv->plat->rx_coe =3D=3D STMMAC_RX_COE_NONE) > > features &=3D ~NETIF_F_RXCSUM; > > @@ -6393,6 +6395,15 @@ static netdev_features_t stmmac_fix_features(str= uct net_device *dev, > > features &=3D ~NETIF_F_HW_VLAN_STAG_RX; > > } > > =20 > > + /* The RX VLAN mode cannot be changed while RX is running: frames > > + * received under the old mode might otherwise be processed with the > > + * new one. Keep the current mode and defer the change until the > > + * interface is down. > > + */ > > + if (netif_running(dev) && > > + (features & vlan_rx) !=3D (dev->features & vlan_rx)) > > + features =3D (features & ~vlan_rx) | (dev->features & vlan_rx); > > + > > return features; > > } > > =20 > >=20 > > --- > > base-commit: e9d78fc6741ac06d438cf64e314c28e57014432a > > change-id: 20261205-stmmac-do-not-flip-vlan-offload-613a9cad635b > >=20 > > Best regards, >=20 --J/7j42m6RTcF4K6I Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaxVWrwAKCRA6cBh0uS2t rD78AP4k35g1LGKfZv65eOPAtNVMUQ8v0kr8mPEUzz1YRLIiVQD+NhPG3qtMbsUE QfEalpUROoMLuFr7BYbYO/49bvBwtQg= =nEFq -----END PGP SIGNATURE----- --J/7j42m6RTcF4K6I--