Skip to content

crypto: engine - add acomp support and adapt Hisilicon HPRE and ZIP drivers

Chenghai Huang linux-crypto lkml llvm oe-kbuild-all 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4crypto: engine - clear busy and recheck running in the retry pump loopcrypto/crypto_engine.c+2 -20 replies
2/4crypto: engine - add acomp supportcrypto/crypto_engine.c include/crypto/acompress.h include/crypto/engine.h +1 more+88 -330 replies
3/4crypto: hisilicon/hpre - use crypto engine frameworkdrivers/crypto/hisilicon/Kconfig drivers/crypto/hisilicon/hpre/hpre.h drivers/crypto/hisilicon/hpre/hpre_crypto.c+314 -1050 replies
4/4crypto: hisilicon/zip - adapt to use crypto enginedrivers/crypto/hisilicon/Kconfig drivers/crypto/hisilicon/zip/zip.h drivers/crypto/hisilicon/zip/zip_crypto.c+245 -1190 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4] crypto: engine - add acomp support and adapt Hisilicon HPRE and ZIP drivers

This series adds asynchronous compression (acomp) support to the crypto engine framework, then converts the Hisilicon HPRE and ZIP drivers to use it instead of their hand-rolled backlog / queue-retry mechanisms.

Patch 1 fixes the retry pump loop in the engine core: it skips the idle check that clears engine->busy and rechecks engine->running, so after the queue drains a later request can be enqueued without a pump and stall the engine, and crypto_engine_stop() can spin on the stale busy flag up to -EBUSY.

Patch 2 adds struct acomp_engine_alg with transfer/finalize helpers and a register/unregister interface, mirroring the existing akcipher and kpp support. struct acomp_alg moves to <crypto/acompress.h> so that engine.h can embed it.

Patch 3 gives each HPRE QP (DH/RSA/ECDH) its own crypto engine. MAY_BACKLOG requests are routed through the engine, which provides the backlog queue and retries on -ENOSPC; other requests are sent directly with bounded retries, and in-flight requests are cleaned up by the completion callback.

Patch 4 gives ZIP a per-device engine pool, with each QP context borrowing an engine by its QP id so compression and decompression queue independently. Requests are sent to the hardware when it has room; on a full queue they are parked in the engine queue and retried, with the DMA mappings kept across retries.

Chenghai Huang (3):
crypto: engine - clear busy and recheck running in the retry pump loop
crypto: engine - add acomp support
crypto: hisilicon/zip - adapt to use crypto engine

Weili Qian (1):
crypto: hisilicon/hpre - use crypto engine framework

 crypto/crypto_engine.c                      |  46 ++-
 drivers/crypto/hisilicon/Kconfig            |   2 +
 drivers/crypto/hisilicon/hpre/hpre.h        |   4 +
 drivers/crypto/hisilicon/hpre/hpre_crypto.c | 414 +++++++++++++++-----
 drivers/crypto/hisilicon/zip/zip.h          |   5 +
 drivers/crypto/hisilicon/zip/zip_crypto.c   | 358 +++++++++++------
 include/crypto/acompress.h                  |  33 ++
 include/crypto/engine.h                     |  13 +
 include/crypto/internal/acompress.h         |  33 --
 9 files changed, 649 insertions(+), 259 deletions(-)
Signature · 1 line
2.43.0