Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2078847rbb; Tue, 27 Feb 2024 09:56:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVIenRh+XwJx9ASHjkiENdXpFFJADFPVgBthu9vpASuLpSwVO81Q0dyp5zR6cmd4CZe9EQgYUAtujWjmfLHVCAESTWqmhGqRY9iHMNbXQ== X-Google-Smtp-Source: AGHT+IGR9Wh396p9z6vCLcP4XQWQxfhBH3Th1MEdNhOYoH/57x/KekcvrIzaRau2TvyyDMdz3CSa X-Received: by 2002:a0c:e450:0:b0:68f:edeb:91d5 with SMTP id d16-20020a0ce450000000b0068fedeb91d5mr2638813qvm.16.1709056614380; Tue, 27 Feb 2024 09:56:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709056614; cv=pass; d=google.com; s=arc-20160816; b=xpdQjnnpqNYaHKyiyi+yX6+88E7orX/SX3yIbO8Lf2o7wtyeaPCC1C4twjAJPf4l72 l5PNZa2msQgETlG3D4gpvx5WBU3KZwP1GlvBj4hElrAkJyGd23ioNM6LdqaCRUiri0Vz 2RjMBeFYupgYTYbOFqDTf1wGHgHlDeLleBKe/W3wc6D6wMnxqMsad8IfN6y077aqgy/L 2HERXPUrcr8MFRI+Ww47a0cXDdVZbWQOmJxxiqcGSGurpdumXoacPVaFVQVoJqDfV/t4 ykoacy+018QKtg6aU+4mLk5qtRabkCwa0nUrVsWj075G44N4R7z4PlMK6ORhVPU0eBSq XmOQ== 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=i5BHk1gsyfDXTlAMC9vOKJFtYRHrRdcGURp8h1aQnRA=; fh=s4bCPOPqCu3yGSzr2joQwnTOkTRggTiZwAbjERC4Ke8=; b=Tqk0ue4LjHJ1jg0rjjSKRZ9hbirS00ttgVg8Y1WdZKfvBvBHnsQpE5fYMIcZJuPMhE oLm8ypIezL2cHoGuoCRbxKbhXys7KNb9ZIqejRg3P8jWT3fur+Sh/VxI0gVycK1JIkS+ //UYb3lckXm6Zzj18CHZf8iYQW8INEmJ8YzloGFvfVchlxfi+lMgdHrV0o1HRwfTEIJZ sDzQ6Tx3llvj2zTKiurKubrCps6JHGWN3MoGI/W2kX3x31Z08p0ATBoVCiYLh7mXXa5f bIo3M05lPO+XVcJopCCCObItXZ43FrCXdleeCLsapD/4mCMmT93B8Rs6r6i1/2UpBQMB GbQA==; 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=RRQsf9Z7; 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-83784-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83784-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 f7-20020a056214076700b0068f6a21487esi7888508qvz.556.2024.02.27.09.56.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:56:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83784-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=RRQsf9Z7; 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-83784-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83784-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 168791C226EB for ; Tue, 27 Feb 2024 17:56:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F1901419B3; Tue, 27 Feb 2024 17:56:07 +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="RRQsf9Z7" Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 AAF214F215 for ; Tue, 27 Feb 2024 17:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709056566; cv=none; b=JeBWX0BKiWzdSazA7J7y5EQkJF6BFnyNzgG1kIocX4BXCblDvoaEoi3OfSfH7pPR7TC4U3o1RHC50wI2ooPr0bZ0XCMdGN9JnfFOLS87C3Q/5c1A1O1rfZAXzSrtFun601CTTwihj1V0xQzIPdhEsX2leWlzOgBE0dkYFEQdpCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709056566; c=relaxed/simple; bh=z9krcDPxGhiMV6NuwRcLOtuYoDFDwnE9XGyDTW8IDtY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JXkGyQJ42fxFpmQYrQbXk2jupZPO5lN04yB8SXpHSn4DMpU5ST2mPNNOf56WfMvb07wF77BoOpLji69+NnJCbv/fd4R/SEiFya1QDuD5gBIQ6I2wfXSKXs87gD/Soq4t9V2gkOUJW6Zu1dJWaRJM/hJiMy4oRgbYIhd9TfNnMrI= 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=RRQsf9Z7; arc=none smtp.client-ip=209.85.215.174 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-pg1-f174.google.com with SMTP id 41be03b00d2f7-5cfd95130c6so2724234a12.1 for ; Tue, 27 Feb 2024 09:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1709056563; x=1709661363; 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=i5BHk1gsyfDXTlAMC9vOKJFtYRHrRdcGURp8h1aQnRA=; b=RRQsf9Z70TTzNq16YHYaW+KBw7kH8f535vtHpz0feOh/yirc98RXruK6stB6vi6wBN hK+GeQx9TEi0h3Sxj55Ep4/TknsK3525VfSK+FBDNwBWV+c1ExDXKRz25eGPH18hggIW NGexEvTrJkL029tzX7ErDxh8xDXbapXQyBHkIpwk+6/t2+uYXK/rSLRDdz5HOTgP1+tI bfNffWQPfM+Lot/6JLP25FQgiFTx+C8ZgPzFpTah6G+1xm7eTzUjY2puC6+bP7KSGt3E jXR9m/8NlaN6r8m+KYSEyjhQJs7cmR2+lEGhXS7SJy7xsqgY7jNowOK9JRJ1gTEaDLER nkdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709056563; x=1709661363; 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=i5BHk1gsyfDXTlAMC9vOKJFtYRHrRdcGURp8h1aQnRA=; b=CSJBuHOnIvsfLNjfOqKJ4J55OhnRyd0ulGZeoa0NzLKLb2BSLvzvRTt0xvtGAm/lar pbeHsjtHmmkBs5hLkvcejpnppKiF+LQUoEGfYtShu5bOge4N0jqVSCkFri+d3L4MwvVW VYX8+MV7RDbfGZuHj3DyD8DXAmjqXDvQnqVBn8XC52N85INlJsivaIzNVG3stS/TMBlY T5HVm2w/xPJ/KHyFiDZooWUEacJnC2edq+DFkUE/04O2VSnCAjaoCh5sRpToZA1FZ8NC 4+ie1U7tnCs92Bg+vWzV2QgqiOgbtwwvGP6CZKx3rexmVNQdlggFOj//0IOEFR8jKBpQ bjoA== X-Forwarded-Encrypted: i=1; AJvYcCW6XH9fQ7w3ql/VXMMWnjXJxzGR9ZoABNmQfjhzYjjOjUuVPwh8RmsG6i6//83AtcJ4yNz/7H0rktqNhQSsura4ndalxpyIt+kr2BNA X-Gm-Message-State: AOJu0YyfU/mmfrhzRBNyWsuTCKI8sR0gIRfbATSeesn0/XpLWnlRuJ8O G/ZPj/Q11wC4nmGZUqhiL2rSZxabQzWmJeN5r2+OESvMjjMEpIz3Yhviy4Yq33s= X-Received: by 2002:a17:90a:4094:b0:299:3354:feff with SMTP id l20-20020a17090a409400b002993354feffmr7398886pjg.30.1709056562890; Tue, 27 Feb 2024 09:56:02 -0800 (PST) Received: from ghost (mobile-166-137-160-039.mycingular.net. [166.137.160.39]) by smtp.gmail.com with ESMTPSA id sw8-20020a17090b2c8800b0029abf47ec7fsm4634304pjb.0.2024.02.27.09.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:56:02 -0800 (PST) Date: Tue, 27 Feb 2024 09:55:59 -0800 From: Charlie Jenkins To: Geert Uytterhoeven Cc: Guenter Roeck , David Laight , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Christophe Leroy , Arnd Bergmann , linux-kernel@vger.kernel.org, Palmer Dabbelt 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> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Feb 27, 2024 at 12:17:58PM +0100, Geert Uytterhoeven wrote: > Hi Charlie, > > Thanks for your patch! > > On Fri, Feb 23, 2024 at 11:12 PM Charlie Jenkins wrote: > > 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. > > > > Furthermore, all architectures except the m68k pad "struct > > csum_ipv6_magic_data" to 44 bits. To make compatible with the m68k, > > manually pad this structure to 44 bits. > > s/bits/bytes/ everywhere Whoops, thanks! > > > > > Fixes: 6f4c45cbcb00 ("kunit: Add tests for csum_ipv6_magic and ip_fast_csum") > > Signed-off-by: Charlie Jenkins > > Reviewed-by: Guenter Roeck > > Acked-by: Palmer Dabbelt > > --- > > The ip_fast_csum and csum_ipv6_magic tests did not work on all > > architectures due to differences in misaligned access support. > > Fix those issues by changing endianness of data and aligning the data. > > > > This patch relies upon a patch from Christophe: > > > > [PATCH net] kunit: Fix again checksum tests on big endian CPUs > > > > https://lore.kernel.org/lkml/73df3a9e95c2179119398ad1b4c84cdacbd8dfb6.1708684443.git.christophe.leroy@csgroup.eu/t/ > > --- > > Changes in v10: > > - Christophe Leroy graciously decided to re-write my patch to fit his > > style so I have dropped my endianness+sparse changes and have based by > > alignment fixes on his patch. The link to his patch can be seen above. > > - I dropped Guenter's tested-by but kept his reviewed-by since only the base > > was changed. > > - Link to v9: https://lore.kernel.org/r/20240221-fix_sparse_errors_checksum_tests-v9-0-bff4d73ab9d1@rivosinc.com > > > --- a/lib/checksum_kunit.c > > +++ b/lib/checksum_kunit.c > > > @@ -595,28 +473,31 @@ static void test_ip_fast_csum(struct kunit *test) > > static void test_csum_ipv6_magic(struct kunit *test) > > { > > #if defined(CONFIG_NET) > > - const struct in6_addr *saddr; > > - const struct in6_addr *daddr; > > + struct csum_ipv6_magic_data { > > + const struct in6_addr saddr; > > + const struct in6_addr daddr; > > + __le32 len; > > + __wsum csum; > > + unsigned char proto; > > + unsigned char pad[3]; > > + } *data; > > If having a size of 44 bytes is critical, you really want to add a > BUILD_BUG_ON() check for that. Good idea, I will add that. - Charlie > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds