From: Eric Biggers <ebiggers@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: linux-crypto@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
kunit-dev@googlegroups.com, Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH 2/3] lib/crc: tests: Add CRC_ENABLE_ALL_FOR_KUNIT
Date: Thu, 5 Mar 2026 19:35:56 -0800 [thread overview]
Message-ID: <20260306033557.250499-3-ebiggers@kernel.org> (raw)
In-Reply-To: <20260306033557.250499-1-ebiggers@kernel.org>
Now that crc_kunit uses the standard "depends on" pattern, enabling the
full set of CRC tests is a bit difficult, mainly due to CRC7 being
rarely used. Add a kconfig option to make it easier. It is visible
only when KUNIT, so hopefully the extra prompt won't be too annoying.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
lib/crc/Kconfig | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/crc/Kconfig b/lib/crc/Kconfig
index 9ddfd1a29757..cca228879bb5 100644
--- a/lib/crc/Kconfig
+++ b/lib/crc/Kconfig
@@ -105,10 +105,24 @@ config CRC_KUNIT_TEST
Unit tests for the CRC library functions.
This is intended to help people writing architecture-specific
optimized versions. If unsure, say N.
+config CRC_ENABLE_ALL_FOR_KUNIT
+ tristate "Enable all CRC functions for KUnit test"
+ depends on KUNIT
+ select CRC7
+ select CRC16
+ select CRC_T10DIF
+ select CRC32
+ select CRC64
+ help
+ Enable all CRC functions that have test code in CRC_KUNIT_TEST.
+
+ Enable this only if you'd like the CRC KUnit test suite to test all
+ the CRC variants, even ones that wouldn't otherwise need to be built.
+
config CRC_BENCHMARK
bool "Benchmark for the CRC functions"
depends on CRC_KUNIT_TEST
help
Include benchmarks in the KUnit test suite for the CRC functions.
--
2.53.0
next prev parent reply other threads:[~2026-03-06 3:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 3:35 [PATCH 0/3] lib/crc: Fix crc_kunit dependency and add kunitconfig Eric Biggers
2026-03-06 3:35 ` [PATCH 1/3] lib/crc: tests: Make crc_kunit test only the enabled CRC variants Eric Biggers
2026-03-06 3:35 ` Eric Biggers [this message]
2026-03-06 3:35 ` [PATCH 3/3] lib/crc: tests: Add a .kunitconfig file Eric Biggers
2026-03-14 0:03 ` [PATCH 0/3] lib/crc: Fix crc_kunit dependency and add kunitconfig Eric Biggers
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=20260306033557.250499-3-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=ardb@kernel.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.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