Skip to content

arm64: csum: Add fused copy and Internet checksum

Demian Shulhan linux-arm-kernel linux-kselftest lkml netdev 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 3 repliesSuperseded
  3. v12 patches 12 repliesSuperseded

Changes in v3 from the cover letter

- 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.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm64: csum: Add fused copy and Internet checksumarch/arm64/include/asm/checksum.h arch/arm64/lib/csum.c+192 -00 replies
2/2lib/tests: checksum: Add KUnit tests for csum_partial_copy_nocheck()lib/Kconfig.debug lib/tests/checksum_kunit.c+463 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] arm64: csum: Add fused copy and Internet checksum

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).

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

Signature · 1 line
2.53.0