lib/idxd: translate the completion address for batched commands

Was simply missing.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I111ad42977f75b8df89a7d63bba6936c5861f657
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9070
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
paul luse 2021-08-04 10:42:24 -04:00 committed by Tomasz Zawadzki
parent 5bfcd5b329
commit bc393d841c

View File

@ -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_hw_desc *desc;
struct idxd_ops *op; struct idxd_ops *op;
uint64_t op_hw_addr;
int rc;
if (_is_batch_valid(batch, chan) == false) { if (_is_batch_valid(batch, chan) == false) {
SPDK_ERRLOG("Attempt to add to an invalid batch.\n"); 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]; desc = *_desc = &batch->user_desc[batch->index];
op = *_op = &batch->user_ops[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->desc = desc;
op->batch_op = true; op->batch_op = true;
SPDK_DEBUGLOG(idxd, "Prep batch %p index %u\n", batch, batch->index); 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++; batch->index++;
desc->flags = IDXD_FLAG_COMPLETION_ADDR_VALID | IDXD_FLAG_REQUEST_COMPLETION; 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_arg = cb_arg;
op->cb_fn = cb_fn; op->cb_fn = cb_fn;
op->batch = batch; op->batch = batch;