mbox series

[0/4] crypto: qat - fix dm-crypt related issues

Message ID 20220328130714.31606-1-giovanni.cabiddu@intel.com (mailing list archive)
Headers show
Series crypto: qat - fix dm-crypt related issues | expand

Message

Cabiddu, Giovanni March 28, 2022, 1:07 p.m. UTC
This set fixes the issues related with the dm-crypt + QAT driver
use-case.

The first patch fixes a potential dead-lock that might occur when using
dm-crypt + QAT in out of memory conditions. The datapaths of the aead
and skcipher implementations have been changed to use pre-allocated
buffers that are part of the request contexts.
The also removes the CRYPTO_ALG_ALLOCATES_MEMORY flag from the aead and
skcipher implementations.

The second patch refactors the submission logic in preparation for the
introduction of a backlog queue to handle crypto requests with the
CRYPTO_TFM_REQ_MAY_BACKLOG flag set.

The third patch addresses a stall in the dm-crypt + QAT usecase by
adding support for the CRYPTO_TFM_REQ_MAY_BACKLOG flag. If the HW queue
is full, the driver enqueues the request in a list and resubmit it at
a later time, avoiding losing it.

The last, re-enables the crypto instances in the QAT driver which were
disabled due to the issues above.

Giovanni Cabiddu (4):
  crypto: qat - use pre-allocated buffers in datapath
  crypto: qat - refactor submission logic
  crypto: qat - add backlog mechanism
  crypto: qat - re-enable registration of algorithms

 drivers/crypto/qat/qat_4xxx/adf_drv.c         |   7 -
 drivers/crypto/qat/qat_common/Makefile        |   1 +
 drivers/crypto/qat/qat_common/adf_transport.c |  11 ++
 drivers/crypto/qat/qat_common/adf_transport.h |   1 +
 .../qat/qat_common/adf_transport_internal.h   |   1 +
 drivers/crypto/qat/qat_common/qat_algs.c      | 148 +++++++++---------
 drivers/crypto/qat/qat_common/qat_algs_send.c |  91 +++++++++++
 drivers/crypto/qat/qat_common/qat_algs_send.h |  10 ++
 drivers/crypto/qat/qat_common/qat_asym_algs.c |  54 ++++---
 drivers/crypto/qat/qat_common/qat_crypto.c    |  37 ++++-
 drivers/crypto/qat/qat_common/qat_crypto.h    |  40 +++++
 11 files changed, 299 insertions(+), 102 deletions(-)
 create mode 100644 drivers/crypto/qat/qat_common/qat_algs_send.c
 create mode 100644 drivers/crypto/qat/qat_common/qat_algs_send.h