From 96d4c7a36d0f8e6f73024cc70e64ee814aefb263 Mon Sep 17 00:00:00 2001 From: paul luse Date: Wed, 9 Jun 2021 15:15:47 -0400 Subject: [PATCH] lib/accel: have accel and idxd engine use task->crc_dst For clarity, this element was added when crc+copy API was added so might as well have all the CRC related functions use it instead of `dst` to avoid confusion. Signed-off-by: paul luse Change-Id: Ic43adbd0df51c1a349847701ef318f452306d0b3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8229 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Ziye Yang --- lib/accel/accel_engine.c | 17 +++++++++-------- module/accel/idxd/accel_engine_idxd.c | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/accel/accel_engine.c b/lib/accel/accel_engine.c index b935ea5af1..5f4f644b5e 100644 --- a/lib/accel/accel_engine.c +++ b/lib/accel/accel_engine.c @@ -312,7 +312,7 @@ spdk_accel_submit_crc32c(struct spdk_io_channel *ch, uint32_t *crc_dst, void *sr return -ENOMEM; } - accel_task->dst = (void *)crc_dst; + accel_task->crc_dst = crc_dst; accel_task->src = src; accel_task->v.iovcnt = 0; accel_task->seed = seed; @@ -345,8 +345,8 @@ crc32cv_done(void *cb_arg, int status) ~(*((uint32_t *)accel_task->crc_dst)), accel_task->chained.cb_fn, accel_task->chained.cb_arg); } else { - status = spdk_accel_submit_crc32cv(ch, accel_task->dst, ++accel_task->v.iovs, - accel_task->v.iovcnt - 1, ~(*((uint32_t *)accel_task->dst)), + status = spdk_accel_submit_crc32cv(ch, accel_task->crc_dst, ++accel_task->v.iovs, + accel_task->v.iovcnt - 1, ~(*((uint32_t *)accel_task->crc_dst)), accel_task->chained.cb_fn, accel_task->chained.cb_arg); } @@ -390,7 +390,7 @@ spdk_accel_submit_crc32cv(struct spdk_io_channel *ch, uint32_t *crc_dst, struct accel_task->v.iovs = iov; accel_task->v.iovcnt = iov_cnt; - accel_task->dst = (void *)crc_dst; + accel_task->crc_dst = crc_dst; accel_task->seed = seed; accel_task->op_code = ACCEL_OPCODE_CRC32C; @@ -635,7 +635,7 @@ spdk_accel_batch_prep_crc32c(struct spdk_io_channel *ch, struct spdk_accel_batch return -ENOMEM; } - accel_task->dst = crc_dst; + accel_task->crc_dst = crc_dst; accel_task->src = src; accel_task->v.iovcnt = 0; accel_task->seed = seed; @@ -664,8 +664,9 @@ batched_crc32cv_done(void *cb_arg, int status) assert(accel_task->chained.cb_arg != NULL); if (spdk_likely(!status)) { - status = spdk_accel_batch_prep_crc32cv(ch, batch, accel_task->dst, - ++accel_task->v.iovs, accel_task->v.iovcnt - 1, ~(*((uint32_t *)accel_task->dst)), + status = spdk_accel_batch_prep_crc32cv(ch, batch, accel_task->crc_dst, + ++accel_task->v.iovs, accel_task->v.iovcnt - 1, + ~(*((uint32_t *)accel_task->crc_dst)), accel_task->chained.cb_fn, accel_task->chained.cb_arg); if (spdk_likely(!status)) { return; @@ -707,7 +708,7 @@ spdk_accel_batch_prep_crc32cv(struct spdk_io_channel *ch, struct spdk_accel_batc accel_task->v.iovs = iovs; accel_task->v.iovcnt = iov_cnt; - accel_task->dst = crc_dst; + accel_task->crc_dst = crc_dst; accel_task->seed = seed; accel_task->op_code = ACCEL_OPCODE_CRC32C; diff --git a/module/accel/idxd/accel_engine_idxd.c b/module/accel/idxd/accel_engine_idxd.c index 107af77ae2..5babc47ae9 100644 --- a/module/accel/idxd/accel_engine_idxd.c +++ b/module/accel/idxd/accel_engine_idxd.c @@ -164,7 +164,7 @@ _process_single_task(struct spdk_io_channel *ch, struct spdk_accel_task *task) break; case ACCEL_OPCODE_CRC32C: src = (task->v.iovcnt == 0) ? task->src : task->v.iovs[0].iov_base; - rc = spdk_idxd_submit_crc32c(chan->chan, task->dst, src, task->seed, task->nbytes, idxd_done, + rc = spdk_idxd_submit_crc32c(chan->chan, task->crc_dst, src, task->seed, task->nbytes, idxd_done, task); break; case ACCEL_OPCODE_COPY_CRC32C: