@@ -1718,7 +1718,7 @@ static void iaa_desc_complete(struct idxd_desc *idxd_desc,
iaa_wq_put(idxd_desc->wq);
}
-static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
+static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
struct idxd_wq *wq,
dma_addr_t src_addr, unsigned int slen,
dma_addr_t dst_addr, unsigned int *dlen,
@@ -1778,8 +1778,9 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
" src_addr %llx, dst_addr %llx\n", __func__,
active_compression_mode->name,
src_addr, dst_addr);
- } else if (ctx->async_mode)
- req->base.data = idxd_desc;
+ } else if (ctx->async_mode) {
+ req->data = idxd_desc;
+ }
dev_dbg(dev, "%s: compression mode %s,"
" desc->src1_addr %llx, desc->src1_size %d,"
@@ -1889,8 +1890,9 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,
" src_addr %llx, dst_addr %llx\n", __func__,
active_compression_mode->name,
src_addr, dst_addr);
- } else if (ctx->async_mode && !disable_async)
- req->base.data = idxd_desc;
+ } else if (ctx->async_mode && !disable_async) {
+ req->data = idxd_desc;
+ }
dev_dbg(dev, "%s: decompression mode %s,"
" desc->src1_addr %llx, desc->src1_size %d,"
@@ -81,6 +81,7 @@ struct acomp_req_chain {
* @doff: Destination folio offset
* @slen: Size of the input buffer
* @dlen: Size of the output buffer and number of bytes produced
+ * @data: Private API code data, do not use
* @chain: Private API code data, do not use
* @__ctx: Start of private context data
*/
@@ -101,6 +102,7 @@ struct acomp_req {
unsigned int slen;
unsigned int dlen;
+ void *data;
struct acomp_req_chain chain;
void *__ctx[] CRYPTO_MINALIGN_ATTR;
Since req->base.data is for the user and not for the driver, we define a "void *data" in struct acomp_req for use by driver code. At present, iaa_crypto saves the "struct idxd_desc *idxd_desc" that is allocated in iaa_[de]compress(), in req->data. When batching is introduced in subsequent patches, we will need to support an async "submit-poll" mechanism to achieve parallelism using IAA hardware. To accomplish this, we will submit the descriptors for each request in the batch in iaa_[de]compress(), and return -EINPROGRESS. The polling function will retrieve the descriptor from req->data to check the request's completion status. Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@intel.com> --- drivers/crypto/intel/iaa/iaa_crypto_main.c | 12 +++++++----- include/crypto/acompress.h | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-)