diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index 6f3e253c8..35999e746 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -712,14 +712,11 @@ _track_comp(struct spdk_idxd_io_channel *chan, bool batch_op, uint32_t 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. + */ if (batch_op == false) { TAILQ_INSERT_TAIL(&chan->comp_ctx_oustanding, comp_ctx, link); - } else { - /* Build up completion addresses for batches but don't add them to - * the outstanding list until submission as it simplifies batch - * cancellation. - */ - batch->comp_ctx[index] = comp_ctx; } } @@ -1090,7 +1087,8 @@ spdk_idxd_batch_submit(struct spdk_idxd_io_channel *chan, struct idxd_batch *bat /* Add the batch elements completion contexts to the outstanding list to be polled. */ for (i = 0 ; i < batch->index; i++) { - TAILQ_INSERT_TAIL(&chan->comp_ctx_oustanding, (struct idxd_comp *)batch->comp_ctx[i], link); + TAILQ_INSERT_TAIL(&chan->comp_ctx_oustanding, (struct idxd_comp *)&batch->user_completions[i], + link); } /* Add one for the batch desc itself, we use this to determine when diff --git a/lib/idxd/idxd.h b/lib/idxd/idxd.h index 2435d9ee6..59bb1e45b 100644 --- a/lib/idxd/idxd.h +++ b/lib/idxd/idxd.h @@ -79,16 +79,13 @@ static inline void movdir64b(void *dst, const void *src) #define IDXD_MAX_QUEUES 64 /* Each pre-allocated batch structure goes on a per channel list and - * contains the memory for both user descriptors. The array of comp_ctx - * holds the list of completion contexts that we will add to the list - * used by the poller. The list is updated when the batch is submitted. + * contains the memory for both user descriptors. */ struct idxd_batch { struct idxd_hw_desc *user_desc; struct idxd_comp *user_completions; uint32_t remaining; bool submitted; - void *comp_ctx[DESC_PER_BATCH]; uint8_t index; TAILQ_ENTRY(idxd_batch) link; };