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 98A0FC54E49 for ; Fri, 1 Mar 2024 17:30:41 +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=HsA8fjv/NVvlBGbAGnBl0mW8uKSRqD8mkyCbbJ9ZcvI=; b=hIO2aZCQsYuqQD rIvCzi8fHiGo7N7EJIS/ifRU6/wIrPScEBwReAfUncGxtu5CbAHRiG8o9LtBiDVfir6OMn6ieiZC4 qX98RQQbVIIS1p11Y0ngKpNDVROWrUbkd48KF7Nrn13dX8sCwZZBOc9EKr8eeD/PY2J90cCHspI61 HHDczsP2PkG75trkSXC2V3g4ANdnaxscLELZ/WPy1mlG3beDEKCeZuq553JuQjKD+5oxNPyESM/MN /kZoBhhNf40bQMZYr3uCoCpzsdQb3VQjPYFAXA2Nq87uk34LW0kL8I479jL4vNg4KLwGVlwE8fVhY ufdIe0ZJ5aciyZ0rg2Tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rg6iM-00000001LYH-0RbI; Fri, 01 Mar 2024 17:30:30 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rg6iK-00000001LXN-0Ew6 for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2024 17:30:29 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6e558a67f70so2357137b3a.0 for ; Fri, 01 Mar 2024 09:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1709314227; x=1709919027; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=UD7pU/mT2bb+4Cmi3ewKbhC8HoIrfKGME5sdau3RcUE=; b=fgw5OGY3QqRM5Bcd0DXbPkp5h87ApYqx/pN2amYB7VbVb59YqK5WU0XlIz836NMola UGPfSG2Qx6oJlkavLE0vsgcjXbewKJXZa2L8lgtxsXinl1BdudR2pyCWjVcPC+5qMPg9 n77U5OpphkKjCZngrHuR5bFA2UkwhjrzHWJM2rVQe8PbwPotY0ftsAhb2PgcYwakvs4F pHGTk0WlE2Jv0vJDpHu0+XlUqp056lDSXfn0rbH1rM82RC069Q6ISl+CoU3eEoYMVDYW ML2gBvEl5oI4+5IjGS+aS/JJfM4PbGTANSFrH2P9I5TJEpg1r/MZFCF8UWqYUoY1mo5Q MUUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709314227; x=1709919027; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UD7pU/mT2bb+4Cmi3ewKbhC8HoIrfKGME5sdau3RcUE=; b=B9o4LTQTG0QOKC9MLr8ONyaJMejPNgk3bjKi/jnDtDt/nPnJJF7yhbGZFuNjb/e9wI +QYnPNTZtIY8PMgoO8zUHa0QLdiyy7WSZH8V7zkmqTrz4fpvWUeawlUJqdm90rGCdIf0 OaN/kXejQiwXY6elrhYYBQwgKaJ5RIICHCdAa/zt1Vlm4cBaSl++uxRNI3o70fCw3DHE qGEfzzteohFdeoJy5W1UXfNft2ZQUxaZx3OkhhG4IsbSXkUwVn7lHeseRhFioF5B38Ly GWhmMbSHoEeR6p/97tKtU3yijUQ7tsa2UsME+wHucn+9JKIEkPZZBICNixViAWBJIh78 n2ag== X-Forwarded-Encrypted: i=1; AJvYcCVKm6TjaRGMIvksZIi5TltXteSQf/2IfN8Ckv/hBekVY6U+Voy7CAQmzPPLnwtuAJUgZvsc/CbnwpM2umKr+29Lv0O0vhezd9yfHRCRau/vQ9co3po= X-Gm-Message-State: AOJu0YwuEaaNEdC7EClB2EtNZl4S3JKJjzjy8SEvdcXNnNLW1vpsfm0L cy7D6CM7muYodcnRitgUosVAIHJ4CtX/wvod7ZVYG5TCbC5XPqzIkHtkQtdL54x5+mZsgtq70su na1w= X-Google-Smtp-Source: AGHT+IHRAjmqQhV6njtbvelkZP08z5IbrdiljIAzhjSqP9o/OiaKYeQb6dzbZYimmaJlB0BUs7qVOQ== X-Received: by 2002:a05:6a00:8611:b0:6e5:db1b:27cd with SMTP id hg17-20020a056a00861100b006e5db1b27cdmr524539pfb.6.1709314225954; Fri, 01 Mar 2024 09:30:25 -0800 (PST) Received: from ghost ([2601:647:5700:6860:2a1e:5647:311:1139]) by smtp.gmail.com with ESMTPSA id g24-20020a62e318000000b006e571bef670sm3214689pfh.70.2024.03.01.09.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:30:25 -0800 (PST) Date: Fri, 1 Mar 2024 09:30:23 -0800 From: Charlie Jenkins To: David Laight Cc: Christophe Leroy , 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 Message-ID: References: <20240229-fix_sparse_errors_checksum_tests-v11-1-f608d9ec7574@rivosinc.com> <41a5d1e8-6f30-4907-ba63-8a7526e71e04@csgroup.eu> <3e0e2b25ea2d4ab99e78aff04af94b69@AcuMS.aculab.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3e0e2b25ea2d4ab99e78aff04af94b69@AcuMS.aculab.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240301_093028_128618_ED758F75 X-CRM114-Status: GOOD ( 42.17 ) 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 Fri, Mar 01, 2024 at 05:24:39PM +0000, David Laight wrote: > From: Charlie Jenkins > > Sent: 01 March 2024 17:09 > > = > > On Fri, Mar 01, 2024 at 07:17:38AM +0000, Christophe Leroy wrote: > > > +CC netdev ARM Russell > > > > > > Le 29/02/2024 =E0 23:46, Charlie Jenkins a =E9crit=A0: > > > > The test cases for ip_fast_csum and csum_ipv6_magic were not proper= ly > > > > 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. > > > > > > In your description, please provide more details on platforms that ha= ve > > > a problem, what the problem is exactly (Failed calculation, slowlines= s, > > > kernel Oops, panic, ....) on each platform. > > > > > > And please copy maintainers and lists of platforms your are specifica= lly > > > addressing with this change. And as this is network related, netdev l= ist > > > 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 s= aid > > > and I fully agree with that: > > > > > > IMHO the tests should validate the expected functionality. If a test > > > fails, either functionality is missing or behaves wrong, or the test > > > is wrong. > > > > > > What is the point of writing tests for a core functionality like net= work > > > checksumming 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. Limit= ing > > > the test to a 16-bytes alignment deeply reduces the usefullness of th= e test. > > > > > = > > 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 :-) > = > David > = > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1= 1PT, UK > Registration No: 1397386 (Wales) > = Can you elaborate on how exactly you suggest the tests to be changed to accomidate what you are saying here? I don't understand how what I have proposed doesn't represent the use case of these functions. - Charlie _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel