Commit f5d88e46 authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

nvme: always set ctrlr->is_failed through API



Use the standard API function to fail the controller in all cases.

This patch, and the several following patches are aimed at creating a
mechanism for reporting up to the application layer that a controller is
failed and or removed. To do this, I use the reset_cb to inform the
upper layer that the controller is failed.
This also requires changes to how we handle a controller reset to
pave the way for doing optional reset retries in the libraries.

Change-Id: I06dfce08326c23472a1caa8f6efbac2fd1a720f2
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469635


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 2c68fef0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -454,7 +454,7 @@ spdk_nvme_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
	ret = nvme_transport_qpair_process_completions(qpair, max_completions);
	if (ret < 0) {
		SPDK_ERRLOG("CQ error, abort requests after transport retry counter exceeded\n");
		qpair->ctrlr->is_failed = true;
		nvme_ctrlr_fail(qpair->ctrlr, false);
	}
	qpair->in_completion_context = 0;
	if (qpair->delete_after_completion_context) {
+9 −0
Original line number Diff line number Diff line
@@ -48,6 +48,15 @@ struct nvme_driver _g_nvme_driver = {
	.lock = PTHREAD_MUTEX_INITIALIZER,
};

void
nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove)
{
	if (hot_remove) {
		ctrlr->is_removed = true;
	}
	ctrlr->is_failed = true;
}

void
nvme_transport_qpair_abort_reqs(struct spdk_nvme_qpair *qpair, uint32_t dnr)
{