idxd: Do not assign the results if there is error on completion.

If there is hardware issues, we do not need to assign
the result. Because we will report the error status to the uplayer.

Change-Id: I647ddd609a1d5d0d52cc4fee59699b9992da4fa4
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8864
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Ziye Yang 2021-07-21 23:08:16 +08:00 committed by Tomasz Zawadzki
parent 39827dd445
commit 50472c44cf

View File

@ -1155,11 +1155,13 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan)
break;
case IDXD_OPCODE_CRC32C_GEN:
case IDXD_OPCODE_COPY_CRC:
*comp_ctx->crc_dst = comp_ctx->hw.crc32c_val;
*comp_ctx->crc_dst ^= ~0;
if (spdk_likely(status == 0)) {
*comp_ctx->crc_dst = comp_ctx->hw.crc32c_val;
*comp_ctx->crc_dst ^= ~0;
}
break;
case IDXD_OPCODE_COMPARE:
if (status == 0) {
if (spdk_likely(status == 0)) {
status = comp_ctx->hw.result;
}
break;
@ -1169,8 +1171,8 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan)
comp_ctx->cb_fn(comp_ctx->cb_arg, status);
}
/* reinit the status in the completion context */
comp_ctx->hw.status = status = 0;
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);