lib/nvmf: Always return success and only toggle bit 0 of CDW0 for abort command

Description is not clear but according to the NVMe specification,
always set the completion status to success and differentiate only
the bit 0 of CDW0 between success and failure for abort command.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0195e72fe1d7fcc2592f47e9dcf92ac56912282c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1965
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Shuhei Matsumoto 2020-06-20 13:57:58 +09:00 committed by Tomasz Zawadzki
parent 47b0d4275c
commit 9975d4a1d2

View File

@ -2117,20 +2117,16 @@ nvmf_ctrlr_abort_on_pg(struct spdk_io_channel_iter *i)
if (!nvmf_qpair_abort_aer(qpair, cid)) {
/* TODO: track list of outstanding requests in qpair? */
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "cid %u not found\n", cid);
rsp->status.sct = SPDK_NVME_SCT_GENERIC;
rsp->status.sc = SPDK_NVME_SC_INVALID_FIELD;
spdk_for_each_channel_continue(i, -EINVAL);
spdk_for_each_channel_continue(i, -1);
return;
}
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "abort ctrlr=%p sqid=%u cid=%u successful\n",
qpair->ctrlr, sqid, cid);
rsp->cdw0 = 0; /* Command successfully aborted */
rsp->status.sct = SPDK_NVME_SCT_GENERIC;
rsp->status.sc = SPDK_NVME_SC_SUCCESS;
rsp->cdw0 &= ~1U; /* Command successfully aborted */
/* Return -1 for the status so the iteration across threads stops. */
spdk_for_each_channel_continue(i, -1);
return;
}
}
@ -2142,9 +2138,9 @@ nvmf_ctrlr_abort(struct spdk_nvmf_request *req)
{
struct spdk_nvme_cpl *rsp = &req->rsp->nvme_cpl;
rsp->cdw0 = 1; /* Command not aborted */
rsp->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC;
rsp->status.sc = SPDK_NVME_SC_INVALID_QUEUE_IDENTIFIER;
rsp->cdw0 = 1U; /* Command not aborted */
rsp->status.sct = SPDK_NVME_SCT_GENERIC;
rsp->status.sc = SPDK_NVME_SC_SUCCESS;
/* Send a message to each poll group, searching for this ctrlr, sqid, and command. */
spdk_for_each_channel(req->qpair->ctrlr->subsys->tgt,