nvmf: check for zcopy_start failure in request_complete

It ensures that we decrement io_outstanding counter for requests for
which zcopy_start failed.  Also, removed a note stating that such
requests are reverted to regular IO path, as this is not the case.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I8eaee88abfd94b73614b367fef9bb938c9962617
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10791
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Konrad Sztyber 2021-12-08 10:33:08 +01:00 committed by Jim Harris
parent 7a374fbc0b
commit d39038e1b6

View File

@ -3927,7 +3927,6 @@ _nvmf_request_complete(void *ctx)
break;
case NVMF_ZCOPY_PHASE_INIT:
if (spdk_unlikely(spdk_nvme_cpl_is_error(rsp))) {
/* The START failed or was aborted so revert to a normal IO */
req->zcopy_phase = NVMF_ZCOPY_PHASE_INIT_FAILED;
TAILQ_REMOVE(&qpair->outstanding, req, link);
} else {
@ -3956,8 +3955,9 @@ _nvmf_request_complete(void *ctx)
assert(sgroup->mgmt_io_outstanding > 0);
sgroup->mgmt_io_outstanding--;
} else {
if ((req->zcopy_phase == NVMF_ZCOPY_PHASE_NONE) ||
(req->zcopy_phase == NVMF_ZCOPY_PHASE_COMPLETE)) {
if (req->zcopy_phase == NVMF_ZCOPY_PHASE_NONE ||
req->zcopy_phase == NVMF_ZCOPY_PHASE_COMPLETE ||
req->zcopy_phase == NVMF_ZCOPY_PHASE_INIT_FAILED) {
/* End of request */
/* NOTE: This implicitly also checks for 0, since 0 - 1 wraps around to UINT32_MAX. */