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: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469635
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2019-09-26 12:55:30 -07:00 committed by Jim Harris
parent 2c68fef058
commit f5d88e46e2
2 changed files with 10 additions and 1 deletions

View File

@ -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) {

View File

@ -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)
{