nvme: move spdk_nvme_ctrlr_reset.

By moving the contents of spdk_nvme_ctrlr_reset to a new internal
function, I am paving the way for providing two reset paths. One, which
can be used by the user as an external API function and which provides
the same legacy behavior. Specifically, that it will always fail the
ctrlr after an attempted reset, and a second, internal path, which will
be used by the qpair reconnect code which will defer failing the qpair
to the qpair code.

Change-Id: I9ec9df55c1fecc2f00476c175bcf988207c31257
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469933
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.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-30 11:09:08 -07:00 committed by Jim Harris
parent f7ddfcf743
commit 4dd94a25a3
2 changed files with 8 additions and 1 deletions

View File

@ -954,7 +954,7 @@ error:
} }
int int
spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
{ {
int rc = 0; int rc = 0;
struct spdk_nvme_qpair *qpair; struct spdk_nvme_qpair *qpair;
@ -1034,6 +1034,12 @@ out:
return rc; return rc;
} }
int
spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
{
return nvme_ctrlr_reset(ctrlr);
}
static void static void
nvme_ctrlr_identify_done(void *arg, const struct spdk_nvme_cpl *cpl) nvme_ctrlr_identify_done(void *arg, const struct spdk_nvme_cpl *cpl)
{ {

View File

@ -827,6 +827,7 @@ int nvme_ctrlr_construct(struct spdk_nvme_ctrlr *ctrlr);
void nvme_ctrlr_destruct_finish(struct spdk_nvme_ctrlr *ctrlr); void nvme_ctrlr_destruct_finish(struct spdk_nvme_ctrlr *ctrlr);
void nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr); void nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr);
void nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove); void nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove);
int nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr);
int nvme_ctrlr_process_init(struct spdk_nvme_ctrlr *ctrlr); int nvme_ctrlr_process_init(struct spdk_nvme_ctrlr *ctrlr);
void nvme_ctrlr_connected(struct spdk_nvme_probe_ctx *probe_ctx, void nvme_ctrlr_connected(struct spdk_nvme_probe_ctx *probe_ctx,
struct spdk_nvme_ctrlr *ctrlr); struct spdk_nvme_ctrlr *ctrlr);