aboutsummaryrefslogtreecommitdiff
path: root/lib/Kconfig
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2024-12-01 17:20:46 -0800
committerEric Biggers <ebiggers@google.com>2024-12-01 17:23:13 -0800
commit0961c3bcefa64d5f0999e2b703391862c733bb52 (patch)
tree0bd98a15d64963236f3a438198895ed92fe93655 /lib/Kconfig
parentbe3c45b070cba3be4dd248b38d4798e3e2859451 (diff)
lib/crc-t10dif: add support for arch overrides
Following what was done for CRC32, add support for architecture-specific override of the CRC-T10DIF library. This will allow the CRC-T10DIF library functions to access architecture-optimized code directly. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20241202012056.209768-3-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'lib/Kconfig')
-rw-r--r--lib/Kconfig32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index be59f7cdf448..e52a38d8d783 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -161,6 +161,38 @@ config CRC_T10DIF
kernel tree needs to calculate CRC checks for use with the
SCSI data integrity subsystem.
+config ARCH_HAS_CRC_T10DIF
+ bool
+
+choice
+ prompt "CRC-T10DIF implementation"
+ depends on CRC_T10DIF
+ default CRC_T10DIF_IMPL_ARCH if ARCH_HAS_CRC_T10DIF
+ default CRC_T10DIF_IMPL_GENERIC if !ARCH_HAS_CRC_T10DIF
+ help
+ This option allows you to override the default choice of CRC-T10DIF
+ implementation.
+
+config CRC_T10DIF_IMPL_ARCH
+ bool "Architecture-optimized" if ARCH_HAS_CRC_T10DIF
+ help
+ Use the optimized implementation of CRC-T10DIF for the selected
+ architecture. It is recommended to keep this enabled, as it can
+ greatly improve CRC-T10DIF performance.
+
+config CRC_T10DIF_IMPL_GENERIC
+ bool "Generic implementation"
+ help
+ Use the generic table-based implementation of CRC-T10DIF. Selecting
+ this will reduce code size slightly but can greatly reduce CRC-T10DIF
+ performance.
+
+endchoice
+
+config CRC_T10DIF_ARCH
+ tristate
+ default CRC_T10DIF if CRC_T10DIF_IMPL_ARCH
+
config CRC64_ROCKSOFT
tristate "CRC calculation for the Rocksoft model CRC64"
select CRC64