Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1421281rbb; Mon, 26 Feb 2024 08:44:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWiWiRBBmJE8UvZBgZ8qZMxmbUrW1d4Zhe4JV7aMkLN+VElBGaE2NXhtCJ91d4tmTfhrjkPR7UOYoInmnhdkTbwTAVL6AaiBRqGUc5h7g== X-Google-Smtp-Source: AGHT+IGLmaEe7Y3Ec6GK6KdbD22NoKW6sqfKkg25m4FNggL1a2P1wMF94Vo1TCjSFJQKMgQJ87vA X-Received: by 2002:a05:6402:5201:b0:565:a5e1:3a12 with SMTP id s1-20020a056402520100b00565a5e13a12mr4969203edd.3.1708965882070; Mon, 26 Feb 2024 08:44:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708965882; cv=pass; d=google.com; s=arc-20160816; b=PvZg0Smq7DYXFvWJor18XraK90XCFIyP22YxoCT7xJtb4FDrCmzC3qAFJM10B/+F6I 7DMquiwV8Op8og02U4E2oYSCVw0YrcnU0H8R5AWGfUUxSPnHuGp86BiCWccoBwLSnK0n p/FyTnaHqLv1d3QOPRS9fwrPQEYYLkLsmYLzAomoKY644eSuey5QATRVlK2H3MDbQ9AF HWnOZMNWyMuCiCISvEe9hrrtPkMPtJGFiN2KeGHGTGczxEs+nfMvmH49iL/fcyfC7ngy tkX4zLUnhLF7ciSvKRoBmmODWG2/AkvaID6WAZIvWJSvyCUa2r4K4TcCW2l/UlVGdXNw 0sCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=zxugb9XdWaRgpdXTMD7tyXbqwf3R1DPNzl5uXjJ5AUc=; fh=bBAwhtnCQx6YZaq0yu+8RwTL490xeHDue2BqOUezAxE=; b=iMVHa3+J1qOYX0WrP5Qn2emJWyhYAdmeSfE+zps0CvfJnbiHs5KMNTXHjHFrPdWJJZ aOqpShptatAr1IHD3nop5Rhxz4IMC3vWV69Pnz8w85fbR0aUEphJkGIcehSK84XgX7Tf Nz9c3gozx9kYLrjXqxUH6me37SfRBSdYVi5Lho96BmPYL+l58ob4WUQyOWvSZVrLZR4M lBsMSfTuiyAiNt1uxRrfPDJEcLZrUKQ+xBREnD8Jjlg+DHz39t7cyIMpoxR60Kp4tagW SgaobeOXnAv7XR853m2IUrRWytzQcbLotH8dbLUDaJeA6Z+o2TobHEFUyPVy/dBf+sMH 7xwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iSoPquMV; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81925-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81925-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w15-20020a05640234cf00b00565df7ac53fsi1329059edc.481.2024.02.26.08.44.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 08:44:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81925-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iSoPquMV; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81925-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81925-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A43F51F25A6F for ; Mon, 26 Feb 2024 16:44:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90E5312C548; Mon, 26 Feb 2024 16:44:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iSoPquMV" Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (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 02FF8127B4D; Mon, 26 Feb 2024 16:44:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708965874; cv=none; b=SDY5FZEXDwNj2VDU5Nw3wC8PG62FbCEzHyrpIlWjFL2VN3vmUBNa7IBfbNZZa8WCc5tb+gdgg6Z5XKjNJ5PYtP495KK7DrUlfZBSJ40NeAgKAart5YvfQqUhpY45d+rF2aY4Q/z3kF+V80gxhaEBkXfNoSVhaiFL/WY1dMD39dg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708965874; c=relaxed/simple; bh=aQRyn1lfQR3DVLR+bsWK4QpTHl1fxujUVKb7Wo1fA14=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=I3WHZjd0KaMFQc+K8PKankWfL3d/8iaXdMthyiNFTd+yaup74F504MaTVJzo7VrmEQOn/MqrHhGVR/JvWfW/Q+r0RJpJbMW+M+F9kgtScFTBjsdPbyU64Tgf/prO0rYgj2K5TsZMm4/zuNra2MNMs2bqaLyQ/bGrR8H9dEUSCSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iSoPquMV; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6e478057f1aso1530713a34.3; Mon, 26 Feb 2024 08:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708965872; x=1709570672; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=zxugb9XdWaRgpdXTMD7tyXbqwf3R1DPNzl5uXjJ5AUc=; b=iSoPquMV0kbUue9AH3r+Wt1WL/omy5i+oKVV9HG6otuaDCInrCDZoz994iFQwHx6k0 J6n4zN17mh3Eo1KuKSeOsy+laf9XY1+WDra/CEOH5gv5NUL7J/P3Wj0ffKjKADiHAygo Fn5oMN3c4bzs361KygvUTDo8KL9TQxgN6/XW+0ObP/rebKrEr8cTzgY1UB8nhUMweMfI 7lwwCMSWAovNsFu/jPeVm4QGefNoJMNZiLjqMDpWv6xw/qpm/LO+aEX5XBbskD8+CMVs G+VCdupZYYuv6SIexuy7sMrYYt5zbvwi4GjeoV6tEKb7Mac+I80yULRIpjQ8xbVMQNqY rGDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708965872; x=1709570672; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zxugb9XdWaRgpdXTMD7tyXbqwf3R1DPNzl5uXjJ5AUc=; b=prvDsJHH5fHgW/gP5TfIHANj/XLKu36EaUepbsaWMXs7y04olY1/9CnMzMTKKE/RPg KaJHNRGeUHpLDeG/XxFSSHZjjYtcrmdNzqPQwwHmFylcjglMdxTLVO6va1hTkfQ1aR4s kQKVzyxXBJpjzZsl/NGdHpFsRBOQCftnuEWM+CQenYouQz+i68QguwdAZ/OjUycNdfN8 hyNSKSrgHPoks95PxPPoD02z770enQtAIql5aVZLzs+F9fbhKGr89nCgcTaE/WSQr3+p Uw1CPpLECTO8MMFixRprP8nrIQ1JDq0hWgNnsDc/Q+dX5scxB7Tp5e1dv8NkOdZ9mc/k X7OA== X-Forwarded-Encrypted: i=1; AJvYcCXmhNZYur/Ae8OpXd82K9RAVdbP7qK5LjPF5Oz8kg5tfWRPg/NTKPJFmd7BP/a+loHXeZt4ZcQPF+txQTA080Z3kKkc1cDbVEAc8UT7 X-Gm-Message-State: AOJu0YxFqmn+lXaRUehnm/E9UVrmbG5llBmHs3K+wwBnuZw5qCtwSTyv cvduex3Gs55QWQQ1tZObFQqgZ4BkmzDYe0ZBWpsPEeYY7wzRiVB/ X-Received: by 2002:a05:6358:281d:b0:17b:5b6d:ffa3 with SMTP id k29-20020a056358281d00b0017b5b6dffa3mr9522055rwb.5.1708965871968; Mon, 26 Feb 2024 08:44:31 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id bv193-20020a632eca000000b005dc4da2121fsm4044441pgb.6.2024.02.26.08.44.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Feb 2024 08:44:31 -0800 (PST) Sender: Guenter Roeck Message-ID: Date: Mon, 26 Feb 2024 08:44:29 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Content-Language: en-US To: Christophe Leroy , Charlie Jenkins , David Laight , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Arnd Bergmann Cc: "linux-kernel@vger.kernel.org" , Palmer Dabbelt , Linux ARM , Russell King References: <20240223-fix_sparse_errors_checksum_tests-v10-1-b6a45914b7d8@rivosinc.com> <7ae930a7-3b10-4470-94ee-89cb650b3349@csgroup.eu> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHi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sFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <7ae930a7-3b10-4470-94ee-89cb650b3349@csgroup.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/26/24 03:34, Christophe Leroy wrote: > > > Le 23/02/2024 à 23:11, 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. > > I'm still wondering what we are really trying to fix here. > > All other tests are explicitely testing that it works with any alignment. > > Shouldn't ip_fast_csum() and csum_ipv6_magic() work for any alignment as > well ? I would expect it, I see no comment in arm code which explicits > that assumption around those functions. > > Isn't the problem only the following line, because csum_offset is > unaligned ? > > csum = *(__wsum *)(random_buf + i + csum_offset); > > Otherwise, if there really is an alignment issue for the IPv6 source or > destination address, isn't it enough to perform a 32 bits alignment ? > It isn't just arm. Question should be what alignments the functions are supposed to be able to handle, not what they are optimized for. If byte and/or half word alignments are expected to be supported, there is still architecture code which would have to be fixed. Unaligned accesses are known to fail on hppa64/parisc64 and on sh4, for example. If unaligned accesses are expected to be handled, it would probably make sense to add a separate test case, though, to clarify that the test fails due to alignment issues, not due to input parameters. Thanks, Guenter