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 DA5C9C41535 for ; Tue, 19 Dec 2023 13:08:29 +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=Zbc97ovCqOcxUbrDVjc+Cqz5h24/wIc59HKeb4BMY8w=; b=DhY6VXrIPanMqz aOrdU92CRz5oORdXKvTzsUzx3V8pMIBTPOyMJ9XSUD8FrFslXHzjJpzBq/hloXoh80n/JB17Aapsd qah53eVHKjWPNnLd11CyUADz7WZD/4H2J+G9VXrx+Bdr/O4E+9DF2v5FBdIWhJikjFqYNDA0kWyuh 8HQF/zOaGEa3EkBjq/CwLL0rnE1PGELmqZXf1zpBPG3+EfhX5KmfsqDOnS2Eqy4MW2Yl91HsJIWjS WwQoW0ivq4dCzTr5/DTp87tM9hvWIN5F8oS+/pZU8QERDa9AQyNguU8/95H0MWFiKrtEFFGMHRrE7 GayY0k5PVfGNd/5t3DOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFZpM-00E8xr-1L; Tue, 19 Dec 2023 13:08:04 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFZpJ-00E8wm-2G for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2023 13:08:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id C78DE1C000F; Tue, 19 Dec 2023 13:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702991278; 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=/vOCGtitF2HXWOLXDqhpNdoEBncyC42eynFv1ljek8s=; b=J/IGMFa4EEj/d/lEkcPk0xSpQNuPyk2FE6kqlPgm/6jdbO/ngl3pGC/pYFd7akxBt6Rl03 BYOB11oXgmQCP8b/zIbLG98RzZqD6r5v56IqxtnFM5iwOS2q37v4N7weF3RdGiYKdcPjRJ LESkn5eU0dafsjzWts/m6HqmXaIG0t8dyvd8ynrXs/9TL0pOHh394ZN8XxUIQZOWhO7aGc 0Mqtli1bCPm1Tx1YCc2tdp1NNMB/zTytaqteHcmQ/4gH4ODU2UM/x6sQQ7aNJqYdwqOE6a Ge79Fcd8q2q2CDcOKiBfI3xBJDTNcfcVJDUAZx8ynU5q5b1CYpWq2AGWdaE7uQ== Date: Tue, 19 Dec 2023 14:07:54 +0100 From: Maxime Chevallier To: Vladimir Oltean Cc: 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, Linus Walleij Subject: Re: [PATCH net 1/1] net: stmmac: Prevent DSA tags from breaking COE Message-ID: <20231219140754.7a7a8dbd@device-28.home> In-Reply-To: <20231219122034.pg2djgrosa4irubh@skbuf> References: <20231218162326.173127-1-romain.gantois@bootlin.com> <20231218162326.173127-2-romain.gantois@bootlin.com> <20231219122034.pg2djgrosa4irubh@skbuf> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_050802_042958_494CDA9E X-CRM114-Status: GOOD ( 20.92 ) 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 Hi Vlad, + Linus Walleij On Tue, 19 Dec 2023 14:20:34 +0200 Vladimir Oltean wrote: > Hi Romain, > > On Mon, Dec 18, 2023 at 05:23:23PM +0100, Romain Gantois wrote: > > Some stmmac cores have Checksum Offload Engines that cannot handle DSA tags > > properly. These cores find the IP/TCP headers on their own and end up > > computing an incorrect checksum when a DSA tag is inserted between the MAC > > header and IP header. > > > > Add an additional check on stmmac link up so that COE is deactivated > > when the stmmac device is used as a DSA conduit. > > > > Add a new dma_feature flag to allow cores to signal that their COEs can't > > handle DSA tags on TX. > > > > Fixes: 6b2c6e4a938f ("net: stmmac: propagate feature flags to vlan") > > Cc: stable@vger.kernel.org > > Reported-by: Richard Tresidder > > Closes: https://lore.kernel.org/netdev/e5c6c75f-2dfa-4e50-a1fb-6bf4cdb617c2@electromag.com.au/ > > Reported-by: Romain Gantois > > Closes: https://lore.kernel.org/netdev/c57283ed-6b9b-b0e6-ee12-5655c1c54495@bootlin.com/ > > Signed-off-by: Romain Gantois > > --- > > DSA_TAG_PROTO_LAN9303, DSA_TAG_PROTO_SJA1105 and DSA_TAG_PROTO_SJA1110 > construct tags with ETH_P_8021Q as EtherType. Do you still think it > would be correct to say that all DSA tags break COE on the stmmac, as > this patch assumes? > > The NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM convention is not about > statically checking whether the interface using DSA, but about looking > at each packet before deciding whether to use the offload engine or to > call skb_checksum_help(). 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 ? Maxime _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel