From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE0692032A; Tue, 19 Dec 2023 16:29:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="RCHicHBz" Received: by mail.gandi.net (Postfix) with ESMTPSA id F2335FF80E; Tue, 19 Dec 2023 16:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1703003377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mydg9L5el80VY7v9/6lf4HQRiOoVruSebSkvtjIIK5k=; b=RCHicHBzkk3ecasHwejetnetySEUJUky9lvEoJtH/vUPUx6Yn9tNxp/18WFnh09muHFpYi SQTiKFzzBN7pXkJFKD1bgvWojqGdmEP1rLtncaH6q5pZL9Z6gBz4jIQB07QVIL7gmwWCiP cJFtcT8KfMkZr+pKueN9wHOeUEFleE9XHkV9zezXFOJ6meDmK01+ajJ7HIZrRuOXr5LOdn 0QHM8U6yKMRvmoOoXCnGHEOo9v0aH80DkeRjvbg7WL/PaR6+br7nzCuAeq3Xb80BuRPcXt 9l07cd2tSKDMseQ+TXsT01bpXVEKNUwWqCMimiD+VinTn5Ls8MljFBiBscv7BQ== Date: Tue, 19 Dec 2023 17:29:32 +0100 From: Maxime Chevallier To: Linus Walleij Cc: Vladimir Oltean , Romain Gantois , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Miquel Raynal , Sylvain Girard , Pascal EBERHARD , Richard Tresidder , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH net 1/1] net: stmmac: Prevent DSA tags from breaking COE Message-ID: <20231219172932.13f4b0c3@device-28.home> In-Reply-To: References: <20231218162326.173127-1-romain.gantois@bootlin.com> <20231218162326.173127-2-romain.gantois@bootlin.com> <20231219122034.pg2djgrosa4irubh@skbuf> <20231219140754.7a7a8dbd@device-28.home> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: maxime.chevallier@bootlin.com Hi Linus, On Tue, 19 Dec 2023 15:19:45 +0100 Linus Walleij wrote: > On Tue, Dec 19, 2023 at 2:07=E2=80=AFPM Maxime Chevallier > wrote: >=20 > > So it looks like an acceptable solution would be something along the > > lines of what Linus is suggesting here : > > > > https://lore.kernel.org/netdev/20231216-new-gemini-ethernet-regression-= v2-2-64c269413dfa@linaro.org/ > > > > If so, maybe it's worth adding a new helper for that check ? =20 >=20 > Yeah it's a bit annoying when skb->protocol is not =3D=3D ethertype of bu= ffer. >=20 > I can certainly add a helper such as skb_eth_raw_ethertype() > to that will inspect the actual ethertype in > skb->data. >=20 > It's the most straight-forward approach. Agreed :) > We could also add something like bool custom_ethertype; to > struct sk_buff and set that to true if the tagger adds a custom > ethertype. But I don't know how the network developers feel about > that. I don't think this would be OK, first because sk_buff is pretty sensitive when it comes to cache alignment, adding things for this kind of use-cases isn't necessarily a good idea. Moreover, populating this flag isn't going to be straightforward as well. I guess some ethertype would be compatible with checksum engines, while other wouldn't, so probably what 'custom_ethertype' means will depend on the MAC driver. =46rom my point of view the first approach would indeed be better. Thanks, Maxime