Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
To: herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com,
	marco.chiappero@intel.com,
	Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Subject: [PATCH v2 0/4] crypto: qat - fix dm-crypt related issues
Date: Thu, 31 Mar 2022 16:36:48 +0100	[thread overview]
Message-ID: <20220331153652.37020-1-giovanni.cabiddu@intel.com> (raw)

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.

Changes from v1:
 - Patch #3: removed worqueues. Requests in the backlog queue are now
   resubmitted in the context of the callback of a previously submitted
   request. This reduces the CPU utilization as the resubmit backlog
   function always finds a free slot in the HW queues when resubmits a
   job.

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      | 150 ++++++++++--------
 drivers/crypto/qat/qat_common/qat_algs_send.c |  84 ++++++++++
 drivers/crypto/qat/qat_common/qat_algs_send.h |  11 ++
 drivers/crypto/qat/qat_common/qat_asym_algs.c |  56 ++++---
 drivers/crypto/qat/qat_common/qat_crypto.c    |  10 +-
 drivers/crypto/qat/qat_common/qat_crypto.h    |  39 +++++
 11 files changed, 269 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

-- 
2.35.1


             reply	other threads:[~2022-03-31 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 15:36 Giovanni Cabiddu [this message]
2022-03-31 15:36 ` [PATCH v2 1/4] crypto: qat - use pre-allocated buffers in datapath Giovanni Cabiddu
2022-03-31 15:36 ` [PATCH v2 2/4] crypto: qat - refactor submission logic Giovanni Cabiddu
2022-03-31 15:36 ` [PATCH v2 3/4] crypto: qat - add backlog mechanism Giovanni Cabiddu
2022-03-31 15:36 ` [PATCH v2 4/4] crypto: qat - re-enable registration of algorithms Giovanni Cabiddu
2022-04-07 19:26 ` [PATCH v2 0/4] crypto: qat - fix dm-crypt related issues Giovanni Cabiddu

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=20220331153652.37020-1-giovanni.cabiddu@intel.com \
    --to=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=marco.chiappero@intel.com \
    --cc=qat-linux@intel.com \
    /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