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

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: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469933


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f7ddfcf7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -954,7 +954,7 @@ error:
}

int
spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
{
	int rc = 0;
	struct spdk_nvme_qpair	*qpair;
@@ -1034,6 +1034,12 @@ out:
	return rc;
}

int
spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
{
	return nvme_ctrlr_reset(ctrlr);
}

static void
nvme_ctrlr_identify_done(void *arg, const struct spdk_nvme_cpl *cpl)
{
+1 −0
Original line number Diff line number Diff line
@@ -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(struct spdk_nvme_ctrlr *ctrlr);
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);
void	nvme_ctrlr_connected(struct spdk_nvme_probe_ctx *probe_ctx,
			     struct spdk_nvme_ctrlr *ctrlr);