nvme: plumb disconnect/connect in reset path

This will (finally) enable resets for fabrics
controllers.

Move some of the work previously done in enable_admin_queue
up to this new disconnect/connect logic.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6239f0c0f36192db921d33f2322b1874b9382a01

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453939
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2019-05-09 13:14:38 -07:00
parent 5309873d39
commit bb01a08915
2 changed files with 11 additions and 3 deletions

View File

@ -845,10 +845,15 @@ spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
nvme_transport_admin_qpair_abort_aers(ctrlr->adminq);
/* Disable all queues before disabling the controller hardware. */
nvme_qpair_disable(ctrlr->adminq);
TAILQ_FOREACH(qpair, &ctrlr->active_io_qpairs, tailq) {
nvme_qpair_disable(qpair);
nvme_transport_ctrlr_disconnect_qpair(ctrlr, qpair);
}
nvme_qpair_disable(ctrlr->adminq);
nvme_qpair_complete_error_reqs(ctrlr->adminq);
nvme_transport_qpair_abort_reqs(ctrlr->adminq, 0 /* retry */);
nvme_transport_ctrlr_disconnect_qpair(ctrlr, ctrlr->adminq);
nvme_transport_ctrlr_connect_qpair(ctrlr, ctrlr->adminq);
/* Doorbell buffer config is invalid during reset */
nvme_ctrlr_free_doorbell_buffer(ctrlr);
@ -1917,9 +1922,7 @@ static void
nvme_ctrlr_enable_admin_queue(struct spdk_nvme_ctrlr *ctrlr)
{
nvme_transport_qpair_reset(ctrlr->adminq);
nvme_qpair_complete_error_reqs(ctrlr->adminq);
nvme_qpair_enable(ctrlr->adminq);
nvme_transport_qpair_abort_reqs(ctrlr->adminq, 0 /* retry */);
}
/**

View File

@ -174,6 +174,11 @@ nvme_transport_ctrlr_connect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nv
return 0;
}
void
nvme_transport_ctrlr_disconnect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair)
{
}
int
nvme_transport_qpair_reset(struct spdk_nvme_qpair *qpair)
{