From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34DECC47077 for ; Tue, 16 Jan 2024 15:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1yNHOTA/qGLWZNzRM9YX0Gr4Vi8M1f0Ne/RS7C8VqkE=; b=dMfPqP/OVTojat WjMv1mt3P3C72f6YQm0dwkAEFN3rhQT8JWmRXvaBOOUcCCZ1b/gDJAt0gr6P+FeZjw+/VRiQM0pEx yRmMK/PYwcIw42hXqRIWpNGLRCurTnC6H9O7OBvMN0mPLYksFY0TftLOHCbwSYzbkl0rX+hajG/Xg /Rq9nfQ+3Rcp7qz1icuS+NYLarJ0ulyW10MEHhtd7JnY8s6HkT9Yn164r1rTO6dd3aNNcNCqWlGH8 QOxcrwbOrd07e++/eRL/nJxlBHI+2MioGY9zJwqcPt4p1PwPPC8ZWvxxGJDh/qmTQSwyXv/L7oxU3 5t/txnByifiuG3hCQaxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPlHQ-00CPYi-0s; Tue, 16 Jan 2024 15:23:08 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rPlHN-00CPXu-31 for linux-arm-kernel@lists.infradead.org; Tue, 16 Jan 2024 15:23:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A6A7D6126A; Tue, 16 Jan 2024 15:23:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AF7FC433C7; Tue, 16 Jan 2024 15:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705418582; bh=AmZdj0eOvsIB/ujpQpyR8C/TssJ81P4jo/0LQq93d8Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nq4ggkoL4EWs4nhCK2iucl9MmiXNhmC6pgZ7TaIeIM/Lg6XVkB87rwndBWwYB4Q3P sPyclCXTudskQ8Je4/NNXPRb8KGgOGlHhnzqXHFAkDmizz2mLMlcGmeqwUlPapk5gl RLCNplQFOJ0ZQDPT6FrjflKizAYloysT3Vs9H/iNzKyyAAjXE2pw/nJlA2nTwPy4ZA /C5LT8PZweUUzWRPgiPlxupO9ja20RncG5jXUvGlDyjhPi35Fpn97B//GgvnA3u4sQ qIULyU8tFAdke8LtHCx1uT4gcbLSQLwP+4gTxyx+zk58r5haZpwFnpZEsdmvQ936HF fvrrmMX8KjY6g== Date: Tue, 16 Jan 2024 07:23:00 -0800 From: Jakub Kicinski To: Romain Gantois Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , Miquel Raynal , Maxime Chevallier , Sylvain Girard , Pascal EBERHARD , Richard Tresidder , Linus Walleij , Vladimir Oltean , Andrew Lunn , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, Vladimir Oltean Subject: Re: [PATCH net v5] net: stmmac: Prevent DSA tags from breaking COE Message-ID: <20240116072300.3a6e0dbe@kernel.org> In-Reply-To: References: <20240111-prevent_dsa_tags-v5-1-63e795a4d129@bootlin.com> <20240112181327.505b424e@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240116_072306_038081_C8BE635E X-CRM114-Status: GOOD ( 15.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 16 Jan 2024 13:14:15 +0100 (CET) Romain Gantois wrote: > > > @@ -4997,7 +5020,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue, > > > stmmac_rx_vlan(priv->dev, skb); > > > skb->protocol = eth_type_trans(skb, priv->dev); > > > > > > - if (unlikely(!coe)) > > > + if (unlikely(!coe) || !stmmac_has_ip_ethertype(skb)) > > > > The lack of Rx side COE checking in this driver is kinda crazy. > > Looking at enh_desc_coe_rdes0() it seems like RDES0_FRAME_TYPE > > may be the indication we need here? > > I don't think that RDES0_FRAME_TYPE would be enough, at least not on its own. > That bit is set by checking the length/ethertype field to see if is an > Ethernet II frame or an IEEE802.3 frame. But even Ethernet II frames with non-IP > ethertypes will not be checksummed. Also protocols with a non-fixed ethertype > field such as DSA_TAG_PROTO could trigger the bit, or not, depending on what > they put in the DSA tag. Hm, the comment in enh_desc_coe_rdes0() says: /* bits 5 7 0 | Frame status * ---------------------------------------------------------- * 0 0 0 | IEEE 802.3 Type frame (length < 1536 octects) * 1 0 0 | IPv4/6 No CSUM errorS. * 1 0 1 | IPv4/6 CSUM PAYLOAD error * 1 1 0 | IPv4/6 CSUM IP HR error * 1 1 1 | IPv4/6 IP PAYLOAD AND HEADER errorS * 0 0 1 | IPv4/6 unsupported IP PAYLOAD * 0 1 1 | COE bypassed.. no IPv4/6 frame * 0 1 0 | Reserved. */ which makes it sound like bit 5 will not be set for a Ethernet II frame with unsupported IP payload, or not an IP frame. Does the bit mean other things in different descriptor formats? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel