From patchwork Thu Feb 22 02:37:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 204525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1428501dyc; Wed, 21 Feb 2024 18:38:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUML6bpTRP0UmJbE07+xx/TbRMHY6W+9Pxdcioh5R0YfWzkLl0OtFiD4wq5l3nI6KpNkDeIMcvdyN8xP9DTU4KSVMl/SQ== X-Google-Smtp-Source: AGHT+IGUUomyl1bzS5KQtY6INPZQUus/JCi404exB1KZGmBpu2qonQj/ueenlWBjlD7efe6rRwr1 X-Received: by 2002:a05:6a00:80dc:b0:6e4:ce00:677a with SMTP id ei28-20020a056a0080dc00b006e4ce00677amr176515pfb.16.1708569511210; Wed, 21 Feb 2024 18:38:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708569511; cv=pass; d=google.com; s=arc-20160816; b=Gy1cLmQYq5SNrjIfodzMCoytbx2nnom911GFz75Hi8AwG5fFsORG0pFzbgOY9tIxBR PqCjp3aFU757lAHSbzzL+XrsibjGHFuNJ2jK00zuwN0ee6ITYygi3cJ2YRoabjo0N21T /PVEzuNg/vpZko5xTkuQ6KgKjlDieBJkeeVSTYxFgNGWj7ZL9nXJxcu8q2dX0LRI3Lm/ C6wunLBcz7ZBu5k17sdcTFKjv4PNC7jPHDi3KWN6TKqt9A35CZ7j83/CrWINEtXbskwq l3hqzU3VkuFaTddPoUHzkt+2uMZEgzIW/LG557RX4gIH753bHE2y3uJAXrUiOcD8vqmG FjGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ZGrNzxe3gyC6VQWPSLHOaYx0WPaI3IQ/8Jr8tyLxsyE=; fh=QMNR4pAGGzk9qTS2KUlm1tMXgHlruS0wyeJohLlujnQ=; b=DLJ9PinzO4TrqTmAlsqWYxV0XtJ7z7U8GGgXDzAc9Fg6VdWH0IqzLk+V3YWcC5QmqM Gx3HACvVOkNeTE//p+TybfmLIywSXEoXT2i0Qe9fmoBokgT+3tkRr/bynY7BDe/aVeiq EiKpdcu7ZznthuRwt2X4PycVPgqJh1cFU4BrEOH6LjsFr4Kl08rcjR4VUl+HQ+Fa6cht /WVfWWFlVKBCiAVPFIlIESS5Ve9eUdJ/eU53D3B5RAEx1C0NbJu/uMbwcRCmXRHaFmXW ibJfdmhqFpsozGGmDRf1vsHjxyQ/tTysI/f5RDf/i7sWrDdi5gs+g/rS3atKPbPS8gnq DKEw==; 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=bDqLaH4M; 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-75803-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75803-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lb12-20020a056a004f0c00b006e376b9203esi8127207pfb.213.2024.02.21.18.38.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 18:38:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75803-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=bDqLaH4M; 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-75803-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75803-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0B937283CDB for ; Thu, 22 Feb 2024 02:38:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4C2A179A8; Thu, 22 Feb 2024 02:37:41 +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="bDqLaH4M" Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (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 72C0D17562 for ; Thu, 22 Feb 2024 02:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708569458; cv=none; b=aebnoRNHm/MKwtQqcXrkVrd6+lOAHC5ThRHwtue40bGBSczII0dfsxG/ixNHhIannzQ60+iphClFBL3vOr8fSss/cEjpJjTAZ74Hcsg/v8GvLFXxo6Oh40XFqfCM2S6z7NEA+xAiLdc+j2ryZUVTNRgvuK1FJPcNAcuMPZlElwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708569458; c=relaxed/simple; bh=loWpjUeaU5B9E/ejxOfrGk83272NpESpvlB1T6y7RcU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JKVudTO9EvgZ6k+wGknB8rw8thv8jBMP+RJTEW3woFk1i9Xnabzn302yuzove6qdbnqcSS6cO8cavzdBfBQCjCIEDeofqU0ATl5TlyDWDgGqwJ7hTLptkzNGzMhgqwwT7+9Yh+A5OSzqidwNKpHbsnfbD3au6/UkWPHF73YuKYc= 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=bDqLaH4M; arc=none smtp.client-ip=209.85.167.182 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-oi1-f182.google.com with SMTP id 5614622812f47-3c1404d05bfso5399589b6e.3 for ; Wed, 21 Feb 2024 18:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1708569456; x=1709174256; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZGrNzxe3gyC6VQWPSLHOaYx0WPaI3IQ/8Jr8tyLxsyE=; b=bDqLaH4Mz6HBVCQH8/bzqJM/xjCxIxcGrIh8PIEU0TYPLwt6nH79zDhos0DOTlmk/R sewKpdEG84CTfUkO4fqkKo+KLgPemD7mqj176D+7eicT/3SoHLmguQVgQkvNX5ol1zoE 1W7S3IroWirVSWaPWLLTcdWP2uQMrDsflRj7BxPghmFDaR2YAXMEKZSs0qejzkCxbjGA SPlxggHVkvmjfUHi8n+B1W5tu/YIAmEF7fyYfycUAhwAiGUCgm2UfQa7df201Dg9OBTJ /MxdofkD0gNu3TRQycgc42xIeApQf4q278El0L7milqb7PMFVtXnJXTxROIBSCctm+Os siJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708569456; x=1709174256; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZGrNzxe3gyC6VQWPSLHOaYx0WPaI3IQ/8Jr8tyLxsyE=; b=LDbsMdPocSxwD6xvsAQuVvXWZzxYeVS5Zdvvc2g242RDPiH5dChfvNv+UhYNOmgJCI a/e+8INKfTnwuGKqZpgMescGpv+0rp1pe4couY/dbNQyhPX/k9kMFGnSEDdTzfAZnq69 /sOta1CwMwxTmzFfgvoWT83NnKOeSaSU2M4qCmjFqTfwf/yiJzqZaNSm26+xOFCTaJNE CfdzPIZNhybqLCaGVPyZ2ejG+yHnW/HbXwYAT3IrAbzAwTekbV7DS/Ig48BAsQGKR6E4 sE64geUVJl5JsalxdhgRMHTnDQcB/c1SL48raq9/ZC2kHzJwquwT3BBUNvTgvH+Zn//Z iy5w== X-Forwarded-Encrypted: i=1; AJvYcCVML9mFzUwqT1CeRe4WsC+8JnJgsYkdL+cZCLRS11PDJ2VTPaWJq8lqxkmp/bqwGslu2ioDvvdoixqpGkYEJf7Zp7/Sl0SbWHdK+Zoe X-Gm-Message-State: AOJu0Yz3+/O+4k/o+/ZopE1hezttOa87pCDWBdC7VpJVHe952cXSWppr DV1o8cqdFQ4inxFoyBWfKTOJTpGpvtSaG79VSq8QvB7bcUy9E1LrJt+bTbcrGEKeAwMSEs3k2+5 S X-Received: by 2002:a05:6359:45a9:b0:17b:335c:fa07 with SMTP id no41-20020a05635945a900b0017b335cfa07mr13781339rwb.32.1708569455998; Wed, 21 Feb 2024 18:37:35 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id kt21-20020a056a004bb500b006e465e1573esm6469705pfb.74.2024.02.21.18.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 18:37:35 -0800 (PST) From: Charlie Jenkins Date: Wed, 21 Feb 2024 18:37:13 -0800 Subject: [PATCH 3/4] parisc: checksum: Remove folding from csum_partial Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-parisc_use_generic_checksum-v1-3-ad34d895fd1b@rivosinc.com> References: <20240221-parisc_use_generic_checksum-v1-0-ad34d895fd1b@rivosinc.com> In-Reply-To: <20240221-parisc_use_generic_checksum-v1-0-ad34d895fd1b@rivosinc.com> To: "James E.J. Bottomley" , Helge Deller , Arnd Bergmann , Andrew Morton , Guenter Roeck Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708569451; l=1119; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=loWpjUeaU5B9E/ejxOfrGk83272NpESpvlB1T6y7RcU=; b=xtNabUDylbAE6Wad/8orZRl3dAazwQY8qAbie+Ef8VKsiWBGicqZfawURBgIzMindz5keC/GQ JFElQKZrZefDR+vZaVkejbXrGuxRi9Xb6hk2IyfNMsmFd1KK3OjfEjC X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791564983562969416 X-GMAIL-MSGID: 1791564983562969416 The parisc implementation of csum_partial previously folded the result into 16 bits instead of returning all 32 bits and letting consumers like ip_compute_csum do the folding. Since ip_compute_csum no longer depends on this requirement, remove the folding so that the parisc implementation operates the same as other architectures. Signed-off-by: Charlie Jenkins --- arch/parisc/lib/checksum.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c index 05f5ca4b2f96..eaa660491e24 100644 --- a/arch/parisc/lib/checksum.c +++ b/arch/parisc/lib/checksum.c @@ -95,14 +95,11 @@ unsigned int do_csum(const unsigned char *buff, int len) /* * computes a partial checksum, e.g. for TCP/UDP fragments */ -/* - * why bother folding? - */ __wsum csum_partial(const void *buff, int len, __wsum sum) { unsigned int result = do_csum(buff, len); addc(result, sum); - return (__force __wsum)from32to16(result); + return (__force __wsum)result; } EXPORT_SYMBOL(csum_partial);