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 <paul.e.luse@intel.com>
Change-Id: Ie9867e72f60c7f38aa1af0273a036f34580ed4c6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8145
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
paul luse 2021-06-01 18:10:40 -04:00 committed by Tomasz Zawadzki
parent fa99984283
commit a6c5480f1d
2 changed files with 6 additions and 10 deletions

View File

@ -339,7 +339,7 @@ int spdk_idxd_submit_fill(struct spdk_idxd_io_channel *chan,
* *
* \param chan IDXD channel to submit request. * \param chan IDXD channel to submit request.
* \param batch Handle provided when the batch was started with spdk_idxd_batch_create(). * \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 src Source virtual address.
* \param seed Four byte CRC-32C seed value. * \param seed Four byte CRC-32C seed value.
* \param nbytes Number of bytes to calculate on. * \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. * \return 0 on success, negative errno on failure.
*/ */
int spdk_idxd_batch_prep_crc32c(struct spdk_idxd_io_channel *chan, struct idxd_batch *batch, 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); spdk_idxd_req_cb cb_fn, void *cb_arg);
/** /**

View File

@ -972,12 +972,12 @@ spdk_idxd_batch_prep_dualcast(struct spdk_idxd_io_channel *chan, struct idxd_bat
int int
spdk_idxd_batch_prep_crc32c(struct spdk_idxd_io_channel *chan, struct idxd_batch *batch, 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) spdk_idxd_req_cb cb_fn, void *cb_arg)
{ {
struct idxd_hw_desc *desc; struct idxd_hw_desc *desc;
struct idxd_comp *comp; struct idxd_comp *comp;
uint64_t src_addr, dst_addr; uint64_t src_addr;
int rc; int rc;
/* Common prep. */ /* Common prep. */
@ -991,18 +991,14 @@ spdk_idxd_batch_prep_crc32c(struct spdk_idxd_io_channel *chan, struct idxd_batch
return rc; return rc;
} }
rc = _vtophys(dst, &dst_addr, nbytes);
if (rc) {
return rc;
}
/* Command specific. */ /* Command specific. */
desc->opcode = IDXD_OPCODE_CRC32C_GEN; desc->opcode = IDXD_OPCODE_CRC32C_GEN;
desc->dst_addr = dst_addr; desc->dst_addr = 0; /* per specification */
desc->src_addr = src_addr; desc->src_addr = src_addr;
desc->flags &= IDXD_CLEAR_CRC_FLAGS; desc->flags &= IDXD_CLEAR_CRC_FLAGS;
desc->crc32c.seed = seed; desc->crc32c.seed = seed;
desc->xfer_size = nbytes; desc->xfer_size = nbytes;
comp->crc_dst = crc_dst;
return 0; return 0;
} }