Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp363739rdg; Thu, 12 Oct 2023 07:51:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbHhcl/Ei3oHUksIWWb+wUVKRDI2MEJtRXhDPEjM4+XYzA2RgmgUQFXT6vIdDd93YkBgak X-Received: by 2002:a05:6a00:369a:b0:69f:b6c4:51e0 with SMTP id dw26-20020a056a00369a00b0069fb6c451e0mr11759375pfb.1.1697122293227; Thu, 12 Oct 2023 07:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697122293; cv=none; d=google.com; s=arc-20160816; b=CSfYK8BivZNlbg24yaNk6fwC21zh0Vyc7hKSxH4nhLP5x6P4a1XXw37Qh0bSvl0TWt WTl0+BObh7bKw2ooDzcqmnVeK7ZZEHVxm1sRa7mYsju7x2B9BtQIEn12Ydjzvu67NL/O Wr8wPMqkdrNrIc2lIfhG2OmiZ015pnDbvN5RyTIwpaCHA4hKhTUXY1PU7ZYyEunzjYQi xA49ZIzzlls6JOZP3lo+NzGhnjkAg64tdeJwYBF2hXjVBtj3aab2ZGqogmFrhX5QnK4n ixHj2XxdEU3TuWMt9cSQqNne3dImkMKbUOPCjli25+8zGkSgzVBAzofUn4e75hwDhphk SFDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wqv0aMFviPoQeVyTgKecIjkAPSYVjNP8POVgnpwp2A8=; fh=tO/lcMJ3vGu8ZcXExs9o7YHAcRH2d2ZInzY70+XfvRQ=; b=H1IeQCZaMOsxJejkzyT7SxneJuU0G7+h6utr+oCHSlYAx3A1Wi1WE6aSg2osVUIoKj b5cH07qSIrPpSexlorbdkpiUMhIzEaed1I3HWwzIx0Zl/6wG4eOd1P9p807PU6iNc/qW Jjleq5r1tutxyWS+xq5pQNmEsy75he+c9NlnV/i+iccN9uszwM0Bddt4pr5ofyWbGJjy WPOp9pv1XGIZg0zaELjP8Nl7JRgaw1wkg8NPnEQ9S+AtGvrv/ia6585H+qzMV34s0V1M KBMQ/DbiKkmyjwfFotgQkKI3nvmKAYrDyYH54YWtVMz4UtH0I5pzd6Y+eJlG3Lw9Z6XG 1YMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dB8tl3Z6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x5-20020a654145000000b00573f7d09445si2350179pgp.330.2023.10.12.07.51.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 07:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dB8tl3Z6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 77BDD8060526; Thu, 12 Oct 2023 07:51:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235747AbjJLOvJ (ORCPT + 99 others); Thu, 12 Oct 2023 10:51:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235742AbjJLOvH (ORCPT ); Thu, 12 Oct 2023 10:51:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E31BEC0; Thu, 12 Oct 2023 07:51:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 762A7C433CA; Thu, 12 Oct 2023 14:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697122265; bh=5AiZVeDGvVMMzOjXejlLspSrRouelQDKxA7XAhxJnas=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dB8tl3Z6BJ+PO1/HesfFNW+WQJk5CCvdZmDK6a2BOTBbPcKkooxLRLOqzZj0h07pV LmpoAwv9uaWH6OwmYrvCz39FTMZSlYnXsWJwynCLLVy2S8UXKGgNvDmbDA905OnI/w s7rtEUeeNAt06tIoAVgUu7ZdFwCvcWJ8TItK6AW+l83pQ2vtJJFG+7JGhr9P0218o3 2iH3AXTpIzuFbbNnhtp8kSIvyKFutihIX+ar5/5ErBUC5ZKk9EMAEgAQRLWUYYTd4F k3gOp5cm4ne+ZbFIs3XbMPUeoZkZdEKm/2eXtrapRmbfqS0mHigk1FCgSJRiOpkoe+ X92Hlk1B2PrTg== Date: Thu, 12 Oct 2023 15:51:01 +0100 From: Conor Dooley To: Charlie Jenkins Cc: Palmer Dabbelt , Samuel Holland , David Laight , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Paul Walmsley , Albert Ou , Arnd Bergmann Subject: Re: [PATCH v7 3/4] riscv: Add checksum library Message-ID: <20231012-extradite-charbroil-32c0808c6669@spud> References: <20230919-optimize_checksum-v7-0-06c7d0ddd5d6@rivosinc.com> <20230919-optimize_checksum-v7-3-06c7d0ddd5d6@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VacEKFf8B2xXnVnJ" Content-Disposition: inline In-Reply-To: <20230919-optimize_checksum-v7-3-06c7d0ddd5d6@rivosinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 07:51:22 -0700 (PDT) --VacEKFf8B2xXnVnJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey, On Tue, Sep 19, 2023 at 11:44:32AM -0700, Charlie Jenkins wrote: > Provide a 32 and 64 bit version of do_csum. When compiled for 32-bit > will load from the buffer in groups of 32 bits, and when compiled for > 64-bit will load in groups of 64 bits. >=20 > Signed-off-by: Charlie Jenkins > --- > arch/riscv/include/asm/checksum.h | 12 +++ > arch/riscv/lib/Makefile | 1 + > arch/riscv/lib/csum.c | 217 ++++++++++++++++++++++++++++++++= ++++++ > 3 files changed, 230 insertions(+) >=20 > diff --git a/arch/riscv/include/asm/checksum.h b/arch/riscv/include/asm/c= hecksum.h > index dc0dd89f2a13..7fcd07edb8b3 100644 > --- a/arch/riscv/include/asm/checksum.h > +++ b/arch/riscv/include/asm/checksum.h > @@ -12,6 +12,18 @@ > =20 > #define ip_fast_csum ip_fast_csum > =20 > +extern unsigned int do_csum(const unsigned char *buff, int len); > +#define do_csum do_csum > + > +/* Default version is sufficient for 32 bit */ > +#ifdef CONFIG_64BIT > +#define _HAVE_ARCH_IPV6_CSUM > +__sum16 csum_ipv6_magic(const struct in6_addr *saddr, > + const struct in6_addr *daddr, > + __u32 len, __u8 proto, __wsum sum); > +#endif > + > +// Define riscv versions of functions before importing asm-generic/check= sum.h As a nit item, you're using two different one-line comment styles in this hunk. Otherwise, looks like you've addressed the things I didn't like, as much as was possible. You get an a-b, not an r-b since I've not reviewed the actual algorithm here. Acked-by: Conor Dooley Thanks, Conor. --VacEKFf8B2xXnVnJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZSgH1QAKCRB4tDGHoIJi 0h4WAQDwylCfzxPDoqr8tU1izNvd8jH06hOEnbBlIXVTGp5uoAEAkT0Xj8ctwWNV Ach6DncKx4c7MkjcvHe8OfU1sEoIdQA= =QVL8 -----END PGP SIGNATURE----- --VacEKFf8B2xXnVnJ--