Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp1290749rbe; Fri, 1 Mar 2024 09:33:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV6cfG7Ki204niujv+r+AylqAhOoP6SKxlII2+7+yyhmK+8Vr8lbsPTL3FHHgxk7RBK1roneGve0MpA3n8e3pyl+E2I2NuD2peDU7sLkw== X-Google-Smtp-Source: AGHT+IEe9OkiNxu+ZToucYtpT20r11gQCwDhoGgok5osW24Dk2LSkTeo2utGu4aOXcbguDB54fhj X-Received: by 2002:a05:620a:15af:b0:787:fd91:e674 with SMTP id f15-20020a05620a15af00b00787fd91e674mr2429861qkk.7.1709314395271; Fri, 01 Mar 2024 09:33:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709314395; cv=pass; d=google.com; s=arc-20160816; b=s9TBlO3ZuNHZvVIAtspT/OvJALJtWXki2VIVDXkO4LwwKVyY9V4QL4KEBezDPWiC3s UWzw5qDKlkYufHTcbN4d4Q3bwmAn+gYnvhAUZNoNI09b/pUFfllm3p81d3DQ78TVpYLy h6z6qmxI4LtEv38VPfJ+4liuZ57dHwVTX9Yndt4l0EofBqtAdugDda48zHp1B1gJY1Iq vT6qlBOb8z+bcCstxgz46vqOdU7+xGR/JD5/19VEvO4SEUUZB5Nzm2GhyWMonEHWblPi 2VGU91doK0t1o54lXTK0mYfURsOYDzY46RnYf22F6kQH7vPBzwQ9PN1o5Jx7a6gWnmDz JKEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=UD7pU/mT2bb+4Cmi3ewKbhC8HoIrfKGME5sdau3RcUE=; fh=SmNeI1dyDsVhugtqfpEI+2q+ygutTb0L6+1ql7H6gBM=; b=WvOVmMLH9k3D2Y88YJkjWb1KCOx2ssbP5w/ThJ09U8wxg70RVjShJ8ebQQqqtBPDO/ cPUHyDTWERROr3Fm7xue9p+AtZDw8C/6q3RHsMReVB4XGUzMUIOeHBHSKMCbhf/v51Jt XLD7s0DK6mIEh3NgREEcZaeV9cGHEwWHE2g9x5mNM8+VEpdGgaTz6AEGPtZg39AXg0n0 GumC5YydOliWbS+hRUK1olXnZbkMf3cScVSLc/lBzxEJvfXQnRd8m4sc7NHgCr9CFHDe 3bCVygD8NT20BNbRnIgrJBktdY5PYWp892hED6bYzlwh5HQhXlF3vN0Izv1noffNPD9t 2Fgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Eyz3nZP0; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-88834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88834-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o19-20020a05620a2a1300b007877cdf78d0si4203749qkp.81.2024.03.01.09.33.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:33:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Eyz3nZP0; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-88834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88834-linux.lists.archive=gmail.com@vger.kernel.org" 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 F05B31C20B9A for ; Fri, 1 Mar 2024 17:33:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70E9D12B89; Fri, 1 Mar 2024 17:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="Eyz3nZP0" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9854CF9D7 for ; Fri, 1 Mar 2024 17:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314229; cv=none; b=BpRz51CHY6bVNl1YDcbYv4Q7C8ickF90gyTeM3aTDitQ1COEBagCGNu2n+M9a+lj4H1iggZHpNIrZ8fXTtPa3ubu06CkwQ9BsG66MdZOg+hmFg4jFcFaYl/f670vEEkLjOBSGvGpqjwKrD0iWm6Fmnjaowh0lB/P6WWgE45K5LE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314229; c=relaxed/simple; bh=ORpLEw2Dml0htr9PDhqhLA57rxjohRb0o0PDLtuEWfY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HMcUb05KHjeyE63M7jjwOmUuxbGWrdodQkP1WT35/dHOXsvd3gVz1HOc/zAKP1D9TLDaAjLxYTV3EX1a+Nc4eHuk1DnyIiOU2v7ytfnNjd18e82nq4cmYv1uf7V/MbvPh259J7gj7DMBQ/HinNNSVi+4Y6ztEJQGarjZ/6DjHI0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=Eyz3nZP0; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e56a5b2812so1583701b3a.1 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=vger.kernel.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=Eyz3nZP0pDzuhv8XC6W75sE9+itGb007xOeLROAHa6yHadSReb+nSqTmz2aFDZIuCN Uxots+68N+njP5SHKm53AgA9x9MBHm8CuUpvWiTEQoqR7usWUAVEv1rfP5itRq/9YX4F JZkuzUfVk67G7mkf8905cEgB/D+ZKiDrmuKVuchF7E+z9L/9I8lBHe2uL4obfhy4hKw6 FccR1voMndOZDXVJMqbRuhF9/Wpyj1sRfYI3G58zM2Ld8BadiSZWyRnhr5tWr0ovamSq VJNoBcRR/BHameAAHn9VjsGmQi4IBS1Wppc2PSYi8tOe4MHXYtREf8/BQv8ZS1Dm8t9m /6Mg== 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=WHE1tcI47lbCX4gmITScXpwxkYiE4eqoBd7YknE4CVxtD6v53VOGhvm6GA3SZbmFvu NMaUidI0nNqSZSQ+DrRy/5ZxvTSehbu5exijznSId6U3+0J+9dbryhodvNbJbXW1mUEh gVUuivz5ysJpALU95QL1fLhhmzQozPNA7pHvNYwMS6lH3wZikP8vjdlJXKkrMHJfSWc9 155i+2LHJ++66j78Qqk0XO7hc9q4Oa+WrbO3IGPaBqJm8QJmMhsKxV1rpypMVhD3JOsj l661y8Q8KAqSx+gxKq3VIx2lwmtbeaukPP8EvhL5WqATQvardddR1yt5LNs/MflVgZpQ MFBg== X-Forwarded-Encrypted: i=1; AJvYcCX6YQQ5JLSrt05gQrAYr3m4uRXi4lK5hQju6rag8RxsPe/G3RtxGgseT3HEYHurFGvCQ4igp4QgY7Mjq+Mp/4TLTkK5E8izlFbw14zM X-Gm-Message-State: AOJu0Yx62r+HpXIVuH9HVRNazEEeZKKSij52X5edmbbyaI6CDDtilTGV reoM6LMyQsnL+PubjjHogf/BoX6dv2CYAkxj6cFF9NxjpD8+obvbYwZXoW4Hkck= 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> 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: <3e0e2b25ea2d4ab99e78aff04af94b69@AcuMS.aculab.com> 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 ? 23:46, 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. > > > > > > 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 specifically > > > addressing with this change. And as this is network related, netdev list > > > 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 said > > > 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 network > > > 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. Limiting > > > the test to a 16-bytes alignment deeply reduces the usefullness of the 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