Skip to content

Patchset to use PCLMULQDQ to accelerate CRC-T10DIF checksum computation

Tim Chen linux-crypto linux-scsi lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v24 patches 8 repliesSuperseded
  3. v14 patches 4 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Wrap crc_t10dif function all to use crypto transform frameworkcrypto/Kconfig crypto/Makefile crypto/crct10dif.c +2 more+234 -20 replies
2/4Accelerated CRC T10 DIF computation with PCLMULQDQ instructionarch/x86/crypto/crct10dif-pcl-asm_64.S+643 -00 replies
3/4Glue code to cast accelerated CRCT10DIF assembly as a crypto transformarch/x86/crypto/Makefile arch/x86/crypto/crct10dif-pclmul_glue.c crypto/Kconfig+170 -00 replies
4/4Simple correctness and speed test for CRCT10DIF hashcrypto/tcrypt.c crypto/testmgr.c crypto/testmgr.h+51 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] Patchset to use PCLMULQDQ to accelerate CRC-T10DIF checksum computation

Currently the CRC-T10DIF checksum is computed using a generic table lookup algorithm. By switching the checksum to PCLMULQDQ based computation, we can speedup the computation by 8x for checksumming 512 bytes and even more for larger buffer size. This will improve performance of SCSI drivers turning on the CRC-T10IDF checksum. In our SSD based experiments, we have seen increase disk throughput by 3.5x with T10DIF for 512 byte block size.

This patch set provides the x86_64 routine using PCLMULQDQ instruction and switches the crc_t10dif library function to use the faster PCLMULQDQ based routine when available.

Tim

v3
1. Update the crct10dif crypto transform used in the crct10dif library in a safe way.
2. Load the accelerated t10dif transform for the x86_64 cpus that support it.
3. Added generic crct10dif crypto transform.

v2
1. Get rid of unnecessary xmm registers save and restore and fix ENDPROC position in PCLMULQDQ version of crc t10dif computation.
2. Fix URL to paper reference of CRC computation with PCLMULQDQ.
3. Add one additional tcrypt test case to exercise more code paths through crc t10dif computation.
4. Fix config dependencies of CRYPTO_CRCT10DIF.

Thanks to Herbert Xu, Matthew Wilcox and Jussi Kivilinna who reviewed the patches and Keith Busch for testing version 1 of the patch set.

Tim Chen (4):
Wrap crc_t10dif function all to use crypto transform framework Accelerated CRC T10 DIF computation with PCLMULQDQ instruction Glue code to cast accelerated CRCT10DIF assembly as a crypto
transform
Simple correctness and speed test for CRCT10DIF hash

 arch/x86/crypto/Makefile                |   2 +
 arch/x86/crypto/crct10dif-pcl-asm_64.S  | 643 ++++++++++++++++++++++++++++++++
 arch/x86/crypto/crct10dif-pclmul_glue.c | 157 ++++++++
 crypto/Kconfig                          |  20 +
 crypto/Makefile                         |   1 +
 crypto/crct10dif.c                      | 126 +++++++
 crypto/tcrypt.c                         |   8 +
 crypto/testmgr.c                        |  10 +
 crypto/testmgr.h                        |  33 ++
 include/linux/crc-t10dif.h              |   5 +
 lib/crc-t10dif.c                        |  95 ++++-
 11 files changed, 1098 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/crypto/crct10dif-pcl-asm_64.S
 create mode 100644 arch/x86/crypto/crct10dif-pclmul_glue.c
 create mode 100644 crypto/crct10dif.c
Signature · 1 line
1.7.11.7