Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1256825rbb; Mon, 26 Feb 2024 04:04:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVAKRG1lpemGEqpvJsLKyMO6JUO3MGPv6drlkHF399wFg0s6WSN2wOrqdJmXDjc/OxmfNcDRK05D5A6U3Kr3VefHKS9GSOk8R+vbWH9gg== X-Google-Smtp-Source: AGHT+IGQafnYMVv0IRYfchHL78zMjV6dvStf7xk93lBSsT5YiWSQTq8q2J+0eF5srJwKfxZsNLYB X-Received: by 2002:a05:622a:309:b0:42d:f63d:98fe with SMTP id q9-20020a05622a030900b0042df63d98femr7962588qtw.47.1708949050029; Mon, 26 Feb 2024 04:04:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708949050; cv=pass; d=google.com; s=arc-20160816; b=R18VtGA3i1Qvr3vll9nXqU8RWO2St+ZnBjAJOMvNLjVYwb6muYOEBjV6BdMXlqbAh7 GNV7H+kMpn9Lcyr1/3ZrEqLQTt8Oe0K7d+OYwAjt9U+//s0qYg4Ff0pNFgkc/4c1vm7k wMvmJGtegGh9Au8fmCeJBMyOLr3VLZCdR/bbBJ9WtXWDZoVtrmp6iF+cUNT6cQ+D00a9 /Z9xJlXpRhnbBJYKtOw5rLAYGHy8jg78gxH0JD7cEHeRTnk5tULzjJBI2FBRzRXu0pvq gwVeME/Mr9CVIcGKXzKrkysaOi35bnhlR/Q/m1QsL9cNgpV9LkFyQluGuCPpL0hW9Bha AwkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O7pmyULB7JZRz8A9oI6WLG3NRUVeGhF0b+0ptpd76Fs=; fh=83A5beVkH386USJGuSijTGIBR5Ag4GyqpZsHJ203LnA=; b=nToMfGWy+1p1MXSR3rSWqWV9f1nqm0eKKk5baD+WaqRPzZTA30rYSxYQtyC+IbcbEs hQliAfQddb3PWo4YhEdqgniOoLlpdJbrnjxj63KdNfdKN5maAoWkCVqtESWLjlOgbZjf q8W2toq1tgLul4SaFPMn+cYrZ2kzV87vICNIZWGYCqRRGI0qbbxrgRRzPhoHSEnVQD/O ujchasDroRWiSVy/xywHRurM6xIFFjsw1sre+sMN/Udkck0KLtukGOTP7bTFH5feBaxl 0pNvyi1B3Xhh3jKlbd0+mr/A/w1bPbtEYFL6YUfg+kMh9qhDg+nIhcuomZnaxpxHvgor 9/dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=IojTQrZd; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-81325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c3-20020ac85183000000b0042e6c3b5cf0si4937486qtn.495.2024.02.26.04.04.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:04:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=IojTQrZd; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-81325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C57921C26AA6 for ; Mon, 26 Feb 2024 12:04:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EE125B66F; Mon, 26 Feb 2024 12:04:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="IojTQrZd" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 C24775B663; Mon, 26 Feb 2024 12:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708949043; cv=none; b=P5i7Q2Ag95nsyEGx/3NJTfKzL2RCuaaG7nCmIgFCpbv71NahFpVwn5ZdJYHNXBN5uWPM5VZD+hUWpXoo6laS4BbpUbsB73hE7EDt3g8SVsHwKizem9kP3QzPMv+cUXLdUczYeMMVE1Brx74xhswuG7C9McK/uIMJjMvN7nuyit8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708949043; c=relaxed/simple; bh=bSIYi307UAifxZYKBFL5Z4FCz6CO5J9gTDCXhlKnU+A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=osguSYYaaQXDiYYuMoeqArE3LOmHG1347rAiblypQV2IT08pEMXhGJZ+oh7CD3bsm+fIaxlB7RiPsLFUBZLPRaFsDuRP5mPbIJTseNAWp5+hlmtDKdUnVWDlv9YRDUxqhCv0SAA4Dk86tQJwYKchrrDaxjUZW1x7FGAQab2B5hI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=IojTQrZd; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <96b3fcfd-6932-4987-9831-5abdad8d445c@csgroup.eu> Sender: Russell King (Oracle) On Mon, Feb 26, 2024 at 11:57:24AM +0000, Christophe Leroy wrote: > > > Le 26/02/2024 ? 12:47, Russell King (Oracle) a ?crit?: > > On Mon, Feb 26, 2024 at 11:34:51AM +0000, Christophe Leroy wrote: > >> Le 23/02/2024 ? 23:11, Charlie Jenkins a ?crit?: > >>> 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 the > >>> 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 alignment. > >> > >> 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!