From a6c5480f1d80cb22bfaa073b7f11fe3fc103ab95 Mon Sep 17 00:00:00 2001 From: paul luse Date: Tue, 1 Jun 2021 18:10:40 -0400 Subject: [PATCH] lib/idxd: fix batch submission of crc32c Was using reserved field. Similar fix to what was done earlier for direct submission of crc32c operation. fixes #1972 Signed-off-by: paul luse Change-Id: Ie9867e72f60c7f38aa1af0273a036f34580ed4c6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8145 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ziye Yang Reviewed-by: Aleksey Marchuk Community-CI: Mellanox Build Bot --- include/spdk/idxd.h | 4 ++-- lib/idxd/idxd.c | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/spdk/idxd.h b/include/spdk/idxd.h index b622aad93..4a84f6539 100644 --- a/include/spdk/idxd.h +++ b/include/spdk/idxd.h @@ -339,7 +339,7 @@ int spdk_idxd_submit_fill(struct spdk_idxd_io_channel *chan, * * \param chan IDXD channel to submit request. * \param batch Handle provided when the batch was started with spdk_idxd_batch_create(). - * \param dst Resulting calculation. + * \param crc_dst Resulting calculation. * \param src Source virtual address. * \param seed Four byte CRC-32C seed value. * \param nbytes Number of bytes to calculate on. @@ -350,7 +350,7 @@ int spdk_idxd_submit_fill(struct spdk_idxd_io_channel *chan, * \return 0 on success, negative errno on failure. */ int spdk_idxd_batch_prep_crc32c(struct spdk_idxd_io_channel *chan, struct idxd_batch *batch, - uint32_t *dst, void *src, uint32_t seed, uint64_t nbytes, + uint32_t *crc_dst, void *src, uint32_t seed, uint64_t nbytes, spdk_idxd_req_cb cb_fn, void *cb_arg); /** diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index 72da96ea6..c27091664 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -972,12 +972,12 @@ spdk_idxd_batch_prep_dualcast(struct spdk_idxd_io_channel *chan, struct idxd_bat int spdk_idxd_batch_prep_crc32c(struct spdk_idxd_io_channel *chan, struct idxd_batch *batch, - uint32_t *dst, void *src, uint32_t seed, uint64_t nbytes, + uint32_t *crc_dst, void *src, uint32_t seed, uint64_t nbytes, spdk_idxd_req_cb cb_fn, void *cb_arg) { struct idxd_hw_desc *desc; struct idxd_comp *comp; - uint64_t src_addr, dst_addr; + uint64_t src_addr; int rc; /* Common prep. */ @@ -991,18 +991,14 @@ spdk_idxd_batch_prep_crc32c(struct spdk_idxd_io_channel *chan, struct idxd_batch return rc; } - rc = _vtophys(dst, &dst_addr, nbytes); - if (rc) { - return rc; - } - /* Command specific. */ desc->opcode = IDXD_OPCODE_CRC32C_GEN; - desc->dst_addr = dst_addr; + desc->dst_addr = 0; /* per specification */ desc->src_addr = src_addr; desc->flags &= IDXD_CLEAR_CRC_FLAGS; desc->crc32c.seed = seed; desc->xfer_size = nbytes; + comp->crc_dst = crc_dst; return 0; }