From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796560565; b=maU1QzIzuH26hnbQ16+eRpvTZ6WM6TCZvte5zR48LSYci/5wl9t/AjJUFvV9srkEmhcV zadD7VPmwiHEjnLeIUe3ef1uFuIIJyAbKIanSKIuimdyuGcoib/9F+hjGKHmkCZKApCoO YEbor9OD+9dIxisyIypxcYi4+n/Ck8kvsiil0h0OnyA6wPaEHaTwBeg8INx+Zkd3mIFty SuqQCT+0jzAK1ygRywstMq+xmP0PTVpKMK2XkG9CslZWTRgiP0hSxVG0JeDMeyC9pAfqe YdkPij0inAJNWdg3OnRsrvYTBPpb9fCNMGnqrCX7PF0Bpj010D/J8CQ0jTO/Fk0w+dg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796560565; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Proofpoint-Spam-Info: X-Authority-Analysis:X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=BIUmRbVFYihvZkNEjBHpNpWQCWMNsBx3IlYHO5oB2t4=; b=UnYqbVqqmuECYeHaqucyTvo1bzGy77h+bJw730cOIoyjZ/gz40WfDnFej+ZAYjkVp0+d T6EyTw+S8BB2KXv5F4Om5rN8/+7QBHgd9YEdsuuJ0YkuWT0JZMz6t1CyGrjJ/6JrAARBO nuxk/K8k1y5qBn7ciN+BfEHoB4fv62S1CTNCiJhMsSjRzkdDqHur2LgKrxYDZb9kM0imP 7qpx5jv6sBrdwJ6D6h9APRW83nJEw8umy/Ch/N9D5uljn8Ppimdsv57NfNwX9fUbtC2Hq 4xHl7i5p4lKw0uzza1qPBlMITEj1ncDryMDch5MDYbWN4piNUKkcF0aE6eZN7MXI7Qg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=DAbHBjl0; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=HD2RavO8; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 322A0606A31F for ; Sun, 6 Dec 2026 12:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 322A0606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; 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=HD2RavO8 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B6AMP1P254748 for ; Sun, 6 Dec 2026 12:36:04 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-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jcbk53gqf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 06 Dec 2026 12:36:03 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-94975041698so815069585a.0 for ; Sun, 06 Dec 2026 04:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796560562; x=1797165362; darn=vger.kernel.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=HD2RavO8FxduwuucFH3jYSDWAK0xR4GjAA5GYhkqrtXVlboGCJWi+L3P4a1TM3yz/c f3xvN3tU9fPANQFnOOr3SN/bpVWhw7FQFWfUAcPskbNFbXUIt1a+3kw6Ew+fk4pj0JyF GEb3DEM5DUhJv/9X6Z1lD4z75R2nFwRshhW6DpIsvzah3eUS9JAJcWuLa4nysQscgLX/ oSlSWkPwiMS4hd/8Mo3FfsjDFG9zQMhpimJOgUxAlYzJwDFn5R0XbFEAR9MjrGIvEGf5 /BY8r9/jZ1u/NUpmgI4DInOR9fwGknrrBsHWdj1HowdvAiFvLyjEyX1RPtv6epsXgFs8 j6Hg== 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=hlgE1sTIi/t+qfPzy4mcuvHeRp1sjU2dUOM5cAEdbg+BLFWHzGUlSnszDKsyEGAMp9 BmLWQg0UvQTkVuqaEqWNTmQN6r3Oj2Lz2taL8GGCI1bd4slel9lHbn8fo86fVLoY89R4 AAgxlpFx90Y6Z9OT9fb1qjE54igFFRSWoA5aSYf2kLQ23lz7S61H8hlSBfMiT5Qg1fF5 e0G6rk6MuBSa1+KKijHCFIWVBeLfqJUKjIU1ZdgS5EmdmqdsiieomM5DI3tLY+YDkECF QqFi90PcLeizWi7sey6JvLG7Q/gIiCIjlNjs0m645ANCjj3eLlXCm7JxP0PTQUZrZXon SInQ== X-Forwarded-Encrypted: i=1; AL+hErE3DmBW9W8THgiAIbMdNcsy7cqo9d/jQtTvpVNLmZuxZdVBD37fmxdsEJsvxY0yp1QEMKlqLFY=@vger.kernel.org X-Gm-Message-State: APuU4Z+QIKMziEu4CPfG9JbQMonvFt59ulyavdMjPkW1UKJtOqrHjHbG d3l9lAwF3cOPvtOP20pbTNZ76z+MQz7WbR1ow2cIdH8knHrCBMBAeg3Lq8xAI7q+73ZEhJlFwqC JlHFzWg0YT2eTr8bcfrV/YxKCC4xajRvA5DSH44Q0ML9Z+fomLhG42+YkyYg= X-Gm-Gg: AZFdTZfjx2iJTQuxjyqVxY0TlleataZQfNfG3kdA82jsUu3HHGC6Rq65s31YGlvABil xErHraymO6XA/BV8zFIJR0rcI7t1emcNEBDqhPV5ID2+ht+zwMH8WN0JVl0Edf3CpghL5fU48NT 6y/NK4Z+j4Q6KBodH7uDGFuxHczQGNVgCPG2A8y+dyyYyy1fH8n29CuHeXI3/TrW5j2BZVzFx2H UJv+e4WD5+uYv+3+iCFs5twiPEtSj/E/pVT0U11HkCNJPrdv8hbVhc5LaM9nmZAQtyc+hQcT/Up TzGDoMjMExliIgIZ4BFOjmomRcZagMwpGmz9JZVJEUZ7vDSh1oNRL5ovGuw5QFHuQ6QTEYvECKG 0J4305fg6W/AQFW9nACz5yNyX8E04Go9IsWUGMbeTuaWiOgxw9At4iLlqfq1Ukw== X-Received: by 2002:a05:620a:1a0f:b0:949:c64a:82c8 with SMTP id af79cd13be357-94a72354599mr1687452285a.39.1796560561972; 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-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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-Info: AW1haW4tMjYxMjA2MDAzOSBTYWx0ZWRfX6Hno3a/pidsA oRtJ+pGZG/bWX25ft19CTCsPbSGG6V2XnXOpYAzQhJIDe8xesFSs7983fTnyjP/FHTq/3VsOF2t Q+vommU8gYzA0pDeUXiBNen707lYrTI= X-Authority-Analysis: v=2.4 cv=S51MU4sP c=1 sm=1 tr=0 ts=6b1556b4 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=RcFDq6c+avmIvxkL9iwlxA==:17 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=P-IC7800AAAA:8 a=EUspDBNiAAAA:8 a=fPKRT0WanOjbhmrf-NcA:9 a=CjuIK1q_8ugA:10 a=gqd1yb4GUn_MI492CIsA:9 a=NFOGd7dJGGMPyQGDc5-O:22 a=d3PnA9EDa4IxuAV0gXij:22 X-Proofpoint-GUID: 4bfTsp-DHDPxG_XtPVHEjHNLGDFphJ2f X-Proofpoint-ORIG-GUID: 4bfTsp-DHDPxG_XtPVHEjHNLGDFphJ2f X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA2MDAzOSBTYWx0ZWRfX94XPdtbhg/0B yUj4WLDlORNf8JxKsH+s8w1xAa7gT2VszKrwumqvZkulF8ta8OgJgAt+SGQgHNS2/sk8rzY1ejl hk9sgQVO2x0RfFBO7aj/E7CG1Uw2XNZudLH2sDsg9ymzIt2BwM60xh2RxB/TU6u9HVqWO6O3WA/ wba21phI8i9Dg2ceHnM6+CvXzOpRXHht1WnRyCuYO5qkmv0iPpoTOU/1rDU36XeSnO/29qnPrd/ BKTaThXnRWWu31Qw5Onvk+B+FfllOEodZo0QRL320glNSuWa0VlBdfyoFE/p20od/PUBkIOq/5d BJdsOLyfEZA6ICXkRWC8B8skL8IdbNG/TecGNrA6bEei0z98N8NtycYssLHa+AgKUgHULdCzza2 amc5/FeiWsRgyvXCjxV7i6Qo7t/3v8k66RX9sOuk+Q2nIh6NsiAoJJfOv1LZZ3h3lAFsi3EDuXb DNflWsZT38wTkO3NkIQ== 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 malwarescore=0 spamscore=0 phishscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2612040000 definitions=main-2612060039 --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--