Re: [PATCH v2 0/6] Add support for Texas Instruments MCRC64 engine
From: Eric Biggers
Date: Fri Aug 11 2023 - 23:01:24 EST
On Fri, Aug 11, 2023 at 12:58:47AM +0530, Kamlesh Gurudasani wrote:
> Add support for MCRC64 engine to calculate 64-bit CRC in Full-CPU mode
>
> MCRC64 engine calculates 64-bit cyclic redundancy checks (CRC)
> according to the ISO 3309 standard.
>
> The ISO 3309 64-bit CRC model parameters are as follows:
> Generator Polynomial: x^64 + x^4 + x^3 + x + 1
> Polynomial Value: 0x000000000000001B
> Initial value: 0x0000000000000000
> Reflected Input: False
> Reflected Output: False
> Xor Final: 0x0000000000000000
>
> Tested with
> CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
> CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y
>
> and tcrypt,
> sudo modprobe tcrypt mode=329 sec=1
>
> User space application implemented using algif_hash,
> https://gist.github.com/ti-kamlesh/73abfcc1a33318bb3b199d36b6209e59
>
> Signed-off-by: Kamlesh Gurudasani <kamlesh@xxxxxx>
I do not see any in-kernel user of this CRC variant being introduced, which
leaves algif_hash as the only use case.
Can you elaborate on the benefit this brings to your application? Yes, it
allows you to use your hardware CRC engine. But, that comes with all the
overhead from the syscalls, algif_hash, and the driver. How does performance
compare to a properly optimized software CRC implementation on your platform,
i.e. an implementation using carryless multiplication instructions (e.g. ARMv8
CE) if available on your platform, otherwise an implementation using the
slice-by-8 or slice-by-16 method?
- Eric