bdev/nvme: bdev_nvme_abort() calls bdev_io_complete() with FAILED if -ENOENT

The completion status of spdk_bdev_abort() is SPDK_BDEV_IO_STATUS_SUCCESS
or SPDK_BDEV_IO_STATUS_FAILED if it is successfully submitted.

In the generic bdev layer, spdk_bdev_abort() does not update cdw0 but
just set SPDK_BDEV_IO_STATUS_SUCCESS or SPDK_BDEV_IO_STATUS_FAILED.

In the NVMe bdev module, for the abort request, spdk_bdev_io_complete()
is called instead of spdk_bdev_io_complete_nvme_status() and the
completion status is SPDK_BDEV_IO_STATUS_SUCCESS or
SPDK_BDEV_IO_STATUS_FAILED.

So let's skip updating cdw0 and call spdk_bdev_io_complete() directly
with SPDK_BDEV_IO_STATUS_SUCCESS or SPDK_BDEV_IO_STATUS_FAILED if
bdev_nvme_abort() does not find the target I/O in any ctrlr.

The next patch will fix spdk_bdev_io_get_nvme_status() for the abort
I/O.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8fb5389cd27d7467cc6ae18e152bd5228f9437f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9976
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Shuhei Matsumoto 2021-10-22 04:48:14 +09:00 committed by Tomasz Zawadzki
parent 72e4a4d46a
commit 4cdd8995a5

View File

@ -4725,11 +4725,7 @@ bdev_nvme_abort(struct nvme_bdev_channel *nbdev_ch, struct nvme_bdev_io *bio,
/* If no command was found or there was any error, complete the abort
* request with failure.
*/
bio->cpl.cdw0 |= 1U;
bio->cpl.status.sc = SPDK_NVME_SC_SUCCESS;
bio->cpl.status.sct = SPDK_NVME_SCT_GENERIC;
bdev_nvme_abort_completion(bio);
spdk_bdev_io_complete(spdk_bdev_io_from_ctx(bio), SPDK_BDEV_IO_STATUS_FAILED);
}
}