[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241113134655.GA794@quark.localdomain>
Date: Wed, 13 Nov 2024 08:46:55 -0500
From: Eric Biggers <ebiggers@...nel.org>
To: Zhihang Shao <zhihang.shao.iscas@...il.com>
Cc: herbert@...dor.apana.org.au, davem@...emloft.net, palmer@...belt.com,
paul.walmsley@...ive.com, aou@...s.berkeley.edu,
akpm@...ux-foundation.org, linux-crypto@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] lib/crct10diftest.c add selftests for crct10dif
On Wed, Nov 13, 2024 at 10:40:35AM +0000, Zhihang Shao wrote:
> Add selftests for kernel's implementation of CRC-T10DIF algorithm.
> The test data includes 100 randomly generated test-cases.
> The selftest file is similar to what is done in lib/crc32test.c, and is
> used to verify the correctness and measure performance improvement of
> the CRC-T10DIF algorithm with zbc extension optimization.
>
> Signed-off-by: Zhihang Shao <zhihang.shao.iscas@...il.com>
> ---
> lib/Kconfig | 9 +
> lib/Makefile | 1 +
> lib/crct10diftest.c | 687 ++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 697 insertions(+)
> create mode 100644 lib/crct10diftest.c
crc_t10dif_update() goes through the crypto API, so for now you should be able
to just use the crypto self-tests instead, i.e. boot a kernel with
CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y.
I am planning to fix the crct10dif library to be optimized directly (without
going through the crypto API), like what I am doing for crc32. At that point a
crct10dif library test will be needed, and I'll add one then.
There are also several issues with the existing crc32 test which you're copying,
and which I'd like to address when adding a new test. For example, the test
does not cover short lengths, and it runs the tests with IRQs disabled which
makes optimized code not used on many architectures.
- Eric
Powered by blists - more mailing lists