From 74dd24851ddeec5c745deca8c3023468ffe19094 Mon Sep 17 00:00:00 2001 From: paul Luse Date: Thu, 22 Jul 2021 16:22:21 +0000 Subject: [PATCH] Revert "idxd: Remove the batch_op field because it is not necessary." This reverts commit 585e808e06158ff698f49c6ed5e67e19cb50cfa9. Signed-off-by: paul Luse Change-Id: I578d248d490c27a5806c5a77fb241a15ba85a530 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8908 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto Reviewed-by: Ziye Yang --- lib/idxd/idxd.c | 9 +++++++-- lib/idxd/idxd.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index 4d4821bcb..dc7811b78 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -329,6 +329,8 @@ _track_comp(struct spdk_idxd_io_channel *chan, bool batch_op, uint32_t index, { comp_ctx->desc = desc; comp_ctx->index = index; + /* Tag this as a batched operation or not so we know which bit array index to clear. */ + comp_ctx->batch_op = batch_op; /* Only add non-batch completions here. Batch completions are added when the batch is * submitted. @@ -1093,10 +1095,13 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan) } comp_ctx->hw.status = status = 0; - if (comp_ctx->desc->opcode != IDXD_OPCODE_BATCH) { + + if (comp_ctx->batch_op == false) { assert(spdk_bit_array_get(chan->ring_slots, comp_ctx->index)); spdk_bit_array_clear(chan->ring_slots, comp_ctx->index); - } else { + } + + if (comp_ctx->desc->opcode == IDXD_OPCODE_BATCH) { _free_batch(comp_ctx->batch, chan); } } else { diff --git a/lib/idxd/idxd.h b/lib/idxd/idxd.h index 9c42ddcb0..00f8b067b 100644 --- a/lib/idxd/idxd.h +++ b/lib/idxd/idxd.h @@ -160,6 +160,7 @@ struct idxd_comp { struct idxd_hw_desc *desc; uint32_t *crc_dst; uint32_t index; + bool batch_op; char pad[3]; TAILQ_ENTRY(idxd_comp) link; };