Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp1285989rbe; Fri, 1 Mar 2024 09:24:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCfeqEb0/Favi64LOnRvgasYzE0T7q3iAA6yLZNq/1b3T+LHa3+plw4vY1XnQbv2YKDXGoyoLVTX3ynSX2dIk8YJgdcXYtEwJWycTdbg== X-Google-Smtp-Source: AGHT+IEgtYFBGtwyMgUZPWwiVDn25Uuz6tf8sVvmcw7kQsFBzw8mfl6CQOQDV+JEZLUuvwD29LbG X-Received: by 2002:a05:6e02:148e:b0:365:1d36:91d7 with SMTP id n14-20020a056e02148e00b003651d3691d7mr2880066ilk.27.1709313895260; Fri, 01 Mar 2024 09:24:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709313895; cv=pass; d=google.com; s=arc-20160816; b=D9tGW3IkHI5wjgBZ0FLJJD5eb9jBCPWm8m922YrttKXb6JAPtFKZNkHNLrRMEY2irz Zpu7p2p6VKf2FNL7o/t8bN+PUHQO3ECLLaVGXiO/7dV3t9PnyWsyQt/cCuRQOZFaA1eB stt4Dcce3Ddl0WOUlleL9F/MUzJYHp6nphTGlxxBacA1kPC2Kvg80x8B/BKG5v/ATcXK pvPqHXgLzX5r4UoWvJeaqSXKLXeW/MJiWbrbH6M/iFdn0Hz9scyRLQSu70ZJdmY/4mv2 f3FFXD0mY/V+T3ylkLChb0PdK6683JUUtOq1I1YttLVVmwbjfPZuycYasS8MXDVNwfs0 KueQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=PJMHjKe6hWM+ryfgXplgXtFixp42WWqyT8LFBEy7568=; fh=yfhcmL/3yu9qkZCXkkZrsxzrDaol1kbmTvDY4y2++tY=; b=sg+4X19hyytXa6cCMeyKpJh7h1kZPsK++b9I1JYDuua9f8cEKzyrcWjFtJEy8Eez0Q b3UOzTsUe+krdQZyOadTDR6q3T7g7ddjJY5a+p2xSg4diFV8LYYkZyPprbXDg9nqV0K2 GgFHHYlEit3ssUO9mheuyFro9EMGjEBeB/wY5DVlqfqI1RxDBTZvxFFHIfZRV8gRxqcR qzabdAGApQhYQjhBysnrWljoKqKJk9GwiDZnnWsMN1MwZDh8xPUXF3RtxZsoM5fH+w6W gq9AyNC1nMKVrAQfoP4dcJPNd/OI1GBoy/U+UZEuv6/xdrT0W4jelo3BLQ2O9zby0RKg cmRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-88819-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a1-20020a631a41000000b005ced6c45233si3826461pgm.712.2024.03.01.09.24.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:24:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88819-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-88819-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88819-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EA13528232F for ; Fri, 1 Mar 2024 17:24:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B1618BFC; Fri, 1 Mar 2024 17:24:46 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.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 B02315228 for ; Fri, 1 Mar 2024 17:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.85.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709313885; cv=none; b=LymygdJtmWgr9JLnY7VrVVeZ2C9QhGj3d9971RZvCc1ireFbUFJW2T7j76DBF5abTZhxBob8B+yLmct3vrhWooMBds8NPknqNweAa0U242QQGNCQ+K7cke79IRbJ/uC4Hr0TTq0rIX9mObLykjGnZDlfcCwImW1xR31XF/m4XdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709313885; c=relaxed/simple; bh=h58DFjaPojLEK3fLX4+ixq3XIVk5I8uJifwq7HQg9ig=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=IPkCSVSMePBErOX3jer5HpzKH4ket3RQQ8oATQj20hYNdudNDbmQJ0regcP0fSGHSYEhyJECcxX/lorwCYgDc1FmVb4U/DAgyw1jpENNosfiYS+75/tF2U5quUdV9Bn0WAu9nNvC8oZWyDgh4IBExfs2wqsBpVpvyxnADX6Gs9E= 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.85.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-208-tXp_pUJVPlyy9kGWfCrWjw-1; Fri, 01 Mar 2024 17:24:41 +0000 X-MC-Unique: tXp_pUJVPlyy9kGWfCrWjw-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; Fri, 1 Mar 2024 17:24:39 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 1 Mar 2024 17:24:39 +0000 From: David Laight To: 'Charlie Jenkins' , Christophe Leroy CC: Guenter Roeck , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Arnd Bergmann , "Geert Uytterhoeven" , Russell King , "linux-kernel@vger.kernel.org" , Palmer Dabbelt , Linux ARM , "netdev@vger.kernel.org" Subject: RE: [PATCH v11] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Thread-Topic: [PATCH v11] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Thread-Index: AQHaa/sz2G6zh0QEYUOonhCQoX0NCrEjHqIg Date: Fri, 1 Mar 2024 17:24:39 +0000 Message-ID: <3e0e2b25ea2d4ab99e78aff04af94b69@AcuMS.aculab.com> References: <20240229-fix_sparse_errors_checksum_tests-v11-1-f608d9ec7574@rivosinc.com> <41a5d1e8-6f30-4907-ba63-8a7526e71e04@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 From: Charlie Jenkins > Sent: 01 March 2024 17:09 >=20 > On Fri, Mar 01, 2024 at 07:17:38AM +0000, Christophe Leroy wrote: > > +CC netdev ARM Russell > > > > Le 29/02/2024 =C3=A0 23:46, Charlie Jenkins a =C3=A9crit=C2=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. > > > > In your description, please provide more details on platforms that have > > a problem, what the problem is exactly (Failed calculation, slowliness, > > kernel Oops, panic, ....) on each platform. > > > > And please copy maintainers and lists of platforms your are specificall= y > > addressing with this change. And as this is network related, netdev lis= t > > should have been copied as well. > > > > I still think that your patch is not the good approach, it looks like > > you are ignoring all the discussion. Below is a quote of what Geert sai= d > > and I fully agree with that: > > > > =09IMHO the tests should validate the expected functionality. If a tes= t > > =09fails, either functionality is missing or behaves wrong, or the test > > =09is wrong. > > > > =09What is the point of writing tests for a core functionality like net= work > > =09checksumming that do not match the expected functionality? > > > > > > So we all agree that there is something to fix, because today's test > > does odd-address accesses which is unexpected for those functions, but > > 2-byte alignments should be supported hence tested by the test. Limitin= g > > the test to a 16-bytes alignment deeply reduces the usefullness of the = test. > > >=20 > Maybe I am lost in the conversations. This isn't limited to 16-bytes > alignment? It aligns along 14 + NET_IP_ALIGN. That is 16 on some > platforms and 14 on platforms where unaligned accesses are desired. > These functions are expected to be called with this offset. Testing with > any other alignment is not the expected behavior. These tests are > testing the expected functionality. Aligned received frames can have a 4 byte VLAN header (or two) removed. So the alignment of the IP header is either 4n or 4n+2. If the cpu fault misaligned accesses you really want the alignment to be 4n. You pretty much never want to trap and fixup a misaligned access. Especially in the network stack. I suspect it is better to do a realignment copy of the entire frame. At some point the data will be copied again, although you may want a CBU (crystal ball unit) to decide whether to align on an 8n or 8n+4 boundary to optimise a later copy. CPU that support misaligned transfers just make coders sloppy :-) =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)