Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1587308rbb; Mon, 26 Feb 2024 14:36:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW84Ppfndnm5I5vtrdIcr4cn7sQ33cFmPgvl8cYopQbUMMMdGB297J8Ns1kzI5a+0QRnixmCptEYpIfe/DavxDb11PZK0E3ky0FQeO9Eg== X-Google-Smtp-Source: AGHT+IEPTBtxCZIQ2wpxiViWNDIAldpSRyIirlPRctpvT8igukx0twQ+Q/ErDb7xA+v4tVax2VLx X-Received: by 2002:a17:90a:f3c3:b0:299:365a:3db0 with SMTP id ha3-20020a17090af3c300b00299365a3db0mr5807155pjb.5.1708986994050; Mon, 26 Feb 2024 14:36:34 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id me4-20020a17090b17c400b0029ae11bd874si205945pjb.167.2024.02.26.14.36.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:36:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82408-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-82408-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82408-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BF9E4B234C8 for ; Mon, 26 Feb 2024 22:34:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89B05134757; Mon, 26 Feb 2024 22:34:04 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (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 4F480134737 for ; Mon, 26 Feb 2024 22:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708986844; cv=none; b=C/1vBnNqYfvj49WnL23JVXLowKlEgRuY9sRLJc/Qa+q2CAGSBJqWTU/4ELLNIZxIZ/Sol1u3+gJK/lTETUEs/HJiX243K4hgntMDtZTioYpP7BSiEQhB1xc/bU6XxZ+2QdErH69WQfQC/5dF/RRsYnmQ93RgeO5/8MaMjo9kKe8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708986844; c=relaxed/simple; bh=8YwRDCw8u7OiS5I+dqtgAvNb327qcrJIgDvZkaOACo4=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=kRQuwdi7CJTQDj0fZBVbIoyp4W4D2wTI4SA1NgHKi02iT+XSsFb2nsQ1ExggS81rGdmLvrCCXyCvxZErlClSLTwLabNuWgxaq3tO/ws8MKZM7SRwWZD4KayWK5VPz3RpZk4+RaligZJooI6Btnyz7xAxgPVgMb0i3/xeQoSJW3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.86.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-23-WxwTNdofNyCIwID63HDNlQ-1; Mon, 26 Feb 2024 22:33:58 +0000 X-MC-Unique: WxwTNdofNyCIwID63HDNlQ-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 26 Feb 2024 22:33:56 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Mon, 26 Feb 2024 22:33:56 +0000 From: David Laight To: 'Russell King' , Charlie Jenkins CC: Guenter Roeck , Christophe Leroy , 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 Thread-Topic: [PATCH v10] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Thread-Index: AQHaaOb3nOScRpPJiESuqwXNhBxv4rEdMNJg Date: Mon, 26 Feb 2024 22:33:56 +0000 Message-ID: References: <20240223-fix_sparse_errors_checksum_tests-v10-1-b6a45914b7d8@rivosinc.com> <7ae930a7-3b10-4470-94ee-89cb650b3349@csgroup.eu> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable .. > I think you misunderstand. "NET_IP_ALIGN offset is what the kernel > defines to be supported" is a gross misinterpretation. It is not > "defined to be supported" at all. It is the _preferred_ alignment > nothing more, nothing less. I'm sure I've seen code that would realign IP headers to a 4 byte boundary before processing them - but that might not have been in Linux. I'm also sure there are cpu which will fault double length misaligned memory transfers - which might be used to marginally speed up code. Assuming more than 4 byte alignment for the IP header is likely 'wishful thinking'. There is plenty of ethernet hardware that can only write frames to even boundaries and plenty of cpu that fault misaligned accesses. There are even cases of both on the same silicon die. You also pretty much never want a fault handler to fixup misaligned ethernet frames (or really anything else for that matter). It is always going to be better to check in the code itself. x86 has just made people 'sloppy' :-) =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)