diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2024-02-03 13:45:23 +0300 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2024-02-16 16:30:17 +0300 |
commit | dcd3e1de9d17dc43dfed87a9fc814b9dec508043 (patch) | |
tree | f4dc28be4bafb8cde3a619428250517fac82244d /arch/s390/include/asm/checksum.h | |
parent | cb2a1dd589a0ce97429bf2beeb560e5b030c2ccc (diff) | |
download | linux-dcd3e1de9d17dc43dfed87a9fc814b9dec508043.tar.xz |
s390/checksum: provide csum_partial_copy_nocheck()
With csum_partial(), which reads all bytes into registers it is easy to
also implement csum_partial_copy_nocheck() which copies the buffer while
calculating its checksum.
For a 512 byte buffer this reduces the runtime by 19%. Compared to the old
generic variant (memcpy() + cksm instruction) runtime is reduced by 42%).
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/checksum.h')
-rw-r--r-- | arch/s390/include/asm/checksum.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/include/asm/checksum.h b/arch/s390/include/asm/checksum.h index 00095cc20afa..b89159591ca0 100644 --- a/arch/s390/include/asm/checksum.h +++ b/arch/s390/include/asm/checksum.h @@ -32,6 +32,9 @@ static inline __wsum cksm(const void *buff, int len, __wsum sum) __wsum csum_partial(const void *buff, int len, __wsum sum); +#define _HAVE_ARCH_CSUM_AND_COPY +__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len); + /* * Fold a partial checksum without adding pseudo headers. */ |