From: Demian Shulhan <demyansh@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>,
David Laight <david.laight.linux@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Gow <david@davidgow.net>,
Brendan Higgins <brendan.higgins@linux.dev>,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] arm64: csum: Add fused copy and Internet checksum
Date: Fri, 20 Nov 2026 23:03:22 +0100 [thread overview]
Message-ID: <20261120220330.1067165-1-demyansh@gmail.com> (raw)
Add a single-pass csum_partial_copy_nocheck() for arm64 and KUnit
coverage (plus an optional throughput benchmark) in checksum_kunit.
On ARM Neoverse-V2 (3.0 GHz), this reaches 39.2-45.1 GB/s aligned
(1.8-1.9x) and 36.5-43.8 GB/s unaligned (2.0-2.2x) for >= 1368B buffers
vs generic memcpy() + csum_partial().
Changes in v3:
- Use a 64B carry-tree primitive unrolled 4x to 256B (~21 insns/64B,
pure leaf function, zero spills on GCC 15 and Clang 21).
- Align @src to 16B for len >= 272, stashing the odd-offset bit in
bit 62 of the carry counter.
- Add zero-length, 72/256/272B threshold, and dst[-1]/dst[len]
sentinel checks to checksum_kunit.
Changes in v2:
- Drop the NEON path and separate csum-copy* files, folding the scalar
implementation directly into arch/arm64/lib/csum.c (resolves the
<asm/neon-intrinsics.h> include issue noted by Nathan Chancellor).
- Switch the scalar loop to four __uint128_t accumulators (David Laight).
- Canonicalize 0xffff (-0) to 0x0000 (+0) after csum_fold() in KUnit to
fix x86_64 test failures on zero/all-zero inputs (Jakub Kicinski).
Link: https://lore.kernel.org/r/20261114045500.v2-1-demyansh@gmail.com
Demian Shulhan (2):
arm64: csum: Add fused copy and Internet checksum
lib/tests: checksum: Add KUnit tests for csum_partial_copy_nocheck()
arch/arm64/include/asm/checksum.h | 3 +
arch/arm64/lib/csum.c | 189 +++++++++++++
lib/Kconfig.debug | 10 +
lib/tests/checksum_kunit.c | 453 ++++++++++++++++++++++++++++++
4 files changed, 655 insertions(+)
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
--
2.53.0
next reply other threads:[~2026-11-20 22:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 22:03 Demian Shulhan [this message]
2026-11-20 22:03 ` [PATCH v3 1/2] arm64: csum: Add fused copy and Internet checksum Demian Shulhan
2026-11-20 22:03 ` [PATCH v3 2/2] lib/tests: checksum: Add KUnit tests for csum_partial_copy_nocheck() Demian Shulhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120220330.1067165-1-demyansh@gmail.com \
--to=demyansh@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brendan.higgins@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=david.laight.linux@gmail.com \
--cc=david@davidgow.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox