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 33D5FC54E49 for ; Mon, 26 Feb 2024 12:04:27 +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:In-Reply-To:MIME-Version:References: 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=556KUN6Ts1psaATYQRZpG+jhJwrdkGIjM5YuVTWzapU=; b=HtYPA+gn2fulN0 /TZS+Qk3D1G2OaouzR6DNfMZZiZvTDMSnNftx9bHADA4daSluZjW9am7p5m0gkRoT7nQlXT6Kcjvb AE73KPEa2R/r3eyjlsavXynkd3aIiw05v87E/Y+yEGM3cNMEbLEhafRFVHRSQmGG16jonHGwI8UWY +HYLdw8UoUaD8Va444F5qkQyyjJQ/WD1vcCJ2a5+K/JFF49RsBkCNteOP5O8QIOGqsS8Wp2GG2Mxj 3lirbNQ/nqo8fzu2pat+v4qorkHUeAmIvtaNLWNHPiOWVR6imqhTqu3IAHTLfGr5gooLKqh+mr/v9 fUy3cOYmE41ebDCGdd3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reZiO-00000000TlO-0sAv; Mon, 26 Feb 2024 12:04:12 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reZiJ-00000000Tik-2URS for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2024 12:04:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=O7pmyULB7JZRz8A9oI6WLG3NRUVeGhF0b+0ptpd76Fs=; b=IojTQrZdEhZrWdsSrZKnx/vZRV VlpJkkFC9Dhu94mGJ6dM2h3W1X6jS012IEPNx0ZyOUN+WmivBv9se9HQqxdhcmaupG+rnB0k1KUDX axg2z/ZFFtH5G9HSBtQ46pW3QWVLTeFMeCph0AiGiCkuzm5QNCgcJBTLu2jXDuEUkwAfwT3pjiHPn +qVDZND4xtlwfUMnhIO4vKERiyhloEAQPm9kC0o029/AP0rZMjqs3/dJV+IBDw6i9rRjSWv9WkCAe ixyTdJAjXWfUPqkU5Gfu88cc0o96Lri3cC5oRu7yF2rpaZI3koypVqmS8CyMdwERP/DfOhCCk5419 JuUGoIRQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:39758) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1reZi1-0003F6-0X; Mon, 26 Feb 2024 12:03:49 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1reZhz-0006PU-MT; Mon, 26 Feb 2024 12:03:47 +0000 Date: Mon, 26 Feb 2024 12:03:47 +0000 From: "Russell King (Oracle)" To: Christophe Leroy Cc: Charlie Jenkins , Guenter Roeck , David Laight , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Arnd Bergmann , "linux-kernel@vger.kernel.org" , Palmer Dabbelt , Linux ARM Subject: Re: [PATCH v10] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Message-ID: References: <20240223-fix_sparse_errors_checksum_tests-v10-1-b6a45914b7d8@rivosinc.com> <7ae930a7-3b10-4470-94ee-89cb650b3349@csgroup.eu> <96b3fcfd-6932-4987-9831-5abdad8d445c@csgroup.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <96b3fcfd-6932-4987-9831-5abdad8d445c@csgroup.eu> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240226_040407_752084_2878BA9A X-CRM114-Status: GOOD ( 21.94 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 26, 2024 at 11:57:24AM +0000, Christophe Leroy wrote: > = > = > Le 26/02/2024 =E0 12:47, Russell King (Oracle) a =E9crit=A0: > > On Mon, Feb 26, 2024 at 11:34:51AM +0000, Christophe Leroy wrote: > >> Le 23/02/2024 =E0 23:11, Charlie Jenkins a =E9crit=A0: > >>> The test cases for ip_fast_csum and csum_ipv6_magic were not properly > >>> aligning the IP header, which were causing failures on architectures > >>> that do not support misaligned accesses like some ARM platforms. To > >>> solve this, align the data along (14 + NET_IP_ALIGN) bytes which is t= he > >>> standard alignment of an IP header and must be supported by the > >>> architecture. > >> > >> I'm still wondering what we are really trying to fix here. > >> > >> All other tests are explicitely testing that it works with any alignme= nt. > >> > >> Shouldn't ip_fast_csum() and csum_ipv6_magic() work for any alignment = as > >> well ? I would expect it, I see no comment in arm code which explicits > >> that assumption around those functions. > > = > > No, these functions are explicitly *not* designed to be used with any > > alignment. They are for 16-bit alignment only. > > = > > I'm not sure where the idea that "any alignment" has come from, but it's > > never been the case AFAIK that we've supported that - or if we do now, > > that's something which has crept in under the radar. > > = > = > Ok, 16-bit is fine for me, then there is no need to require a (14 + = > NET_IP_ALIGN) ie a 16-bytes (128-bit) alignment as this patch is doing. Looking again at these two functions, I'm mistaken - this was written for optimal use with 32-bit alignment, not 16-bit. However, the entire IP layer is written with the assumption that for maximum performance, the IP header will be 32-bit aligned. However, that may not always be the case for incoming packets, and what saves 32-bit Arm is the ability to do unaligned loads in later revisions of the architecture, or the alignment fault handler (slow) on older revisions. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel