From bc393d841c844e86b40ff017decd6fcff8c3637a Mon Sep 17 00:00:00 2001 From: paul luse Date: Wed, 4 Aug 2021 10:42:24 -0400 Subject: [PATCH] lib/idxd: translate the completion address for batched commands Was simply missing. Signed-off-by: paul luse Change-Id: I111ad42977f75b8df89a7d63bba6936c5861f657 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9070 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/idxd/idxd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c index 42e88b3ae0..f07a28de66 100644 --- a/lib/idxd/idxd.c +++ b/lib/idxd/idxd.c @@ -782,6 +782,8 @@ _idxd_prep_batch_cmd(struct spdk_idxd_io_channel *chan, spdk_idxd_req_cb cb_fn, { struct idxd_hw_desc *desc; struct idxd_ops *op; + uint64_t op_hw_addr; + int rc; if (_is_batch_valid(batch, chan) == false) { SPDK_ERRLOG("Attempt to add to an invalid batch.\n"); @@ -796,6 +798,12 @@ _idxd_prep_batch_cmd(struct spdk_idxd_io_channel *chan, spdk_idxd_req_cb cb_fn, desc = *_desc = &batch->user_desc[batch->index]; op = *_op = &batch->user_ops[batch->index]; + + rc = _vtophys(&op->hw, &op_hw_addr, sizeof(struct idxd_hw_comp_record)); + if (rc) { + return rc; + } + op->desc = desc; op->batch_op = true; SPDK_DEBUGLOG(idxd, "Prep batch %p index %u\n", batch, batch->index); @@ -803,7 +811,7 @@ _idxd_prep_batch_cmd(struct spdk_idxd_io_channel *chan, spdk_idxd_req_cb cb_fn, batch->index++; desc->flags = IDXD_FLAG_COMPLETION_ADDR_VALID | IDXD_FLAG_REQUEST_COMPLETION; - desc->completion_addr = (uintptr_t)&op->hw; + desc->completion_addr = op_hw_addr; op->cb_arg = cb_arg; op->cb_fn = cb_fn; op->batch = batch;