From bdc2b486238c93b7e0e54655b4b859393c029c05 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Fri, 21 Jan 2022 12:57:49 -0700 Subject: [PATCH] idxd: Correctly propagate the callback when converting a 1 sized batch to a single command Signed-off-by: Ben Walker Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11209 (master) (cherry picked from commit 097ccf06a9ef9b77b72cdc582364ffa3096dd33a) Change-Id: Ic0ca65b7399f3cbc4153327d83de7db69de48709 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11281 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- lib/idxd/idxd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index cc18ad156..01035d029 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -500,6 +500,10 @@ idxd_batch_submit(struct spdk_idxd_io_channel *chan, struct idxd_batch *batch, completion_addr = desc->completion_addr; memcpy(desc, &batch->user_desc[0], sizeof(*desc)); desc->completion_addr = completion_addr; + op->cb_fn = batch->user_ops[0].cb_fn; + op->cb_arg = batch->user_ops[0].cb_arg; + op->crc_dst = batch->user_ops[0].crc_dst; + _free_batch(batch, chan); } else { /* Command specific. */ desc->opcode = IDXD_OPCODE_BATCH;