Commit fc912a02 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/nvme: Prioritize aborted_by_request higher than ctrlr_is_unavailable



Abort is used usually for error cases. When abort is done, controller
may not be available. At completion, controller availability was checked
prior to aborted by request. Hence if abort is done when controller is
not available, the aborted request is retried.

Fix the case in this patch.

Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I3e7b356797dd50faed0e5113f6f7a47fea26d9cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14098


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarMichael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 3d59045a
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -1041,8 +1041,8 @@ bdev_nvme_io_complete_nvme_status(struct nvme_bdev_io *bio,
		goto complete;
	}

	if (cpl->status.dnr != 0 || (g_opts.bdev_retry_count != -1 &&
				     bio->retry_count >= g_opts.bdev_retry_count)) {
	if (cpl->status.dnr != 0 || spdk_nvme_cpl_is_aborted_by_request(cpl) ||
	    (g_opts.bdev_retry_count != -1 && bio->retry_count >= g_opts.bdev_retry_count)) {
		goto complete;
	}

@@ -1062,8 +1062,6 @@ bdev_nvme_io_complete_nvme_status(struct nvme_bdev_io *bio,
			}
		}
		delay_ms = 0;
	} else if (spdk_nvme_cpl_is_aborted_by_request(cpl)) {
		goto complete;
	} else {
		bio->retry_count++;

@@ -5855,8 +5853,8 @@ bdev_nvme_admin_passthru_complete_nvme_status(void *ctx)
		goto complete;
	}

	if (cpl->status.dnr != 0 || (g_opts.bdev_retry_count != -1 &&
				     bio->retry_count >= g_opts.bdev_retry_count)) {
	if (cpl->status.dnr != 0 || spdk_nvme_cpl_is_aborted_by_request(cpl) ||
	    (g_opts.bdev_retry_count != -1 && bio->retry_count >= g_opts.bdev_retry_count)) {
		goto complete;
	}

@@ -5867,8 +5865,6 @@ bdev_nvme_admin_passthru_complete_nvme_status(void *ctx)
	    spdk_nvme_cpl_is_aborted_sq_deletion(cpl) ||
	    !nvme_ctrlr_is_available(nvme_ctrlr)) {
		delay_ms = 0;
	} else if (spdk_nvme_cpl_is_aborted_by_request(cpl)) {
		goto complete;
	} else {
		bio->retry_count++;