nvme: allow fabrics commands during reconnect.

When doing a reset on an NVMe-oF target with active I/O qpairs, we need
to be able to submit fabrics commands on them in order to perform a reset.
Currently, resetting a fabric controller with any I/O qpairs active will
cause the reset to hang indefinitely.

Change-Id: Ic972a301390a4dd64adabedfe01aa4e5253e40b0
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469935
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2019-09-30 15:46:03 -07:00 committed by Jim Harris
parent 797aa7d813
commit 4473732398
2 changed files with 5 additions and 9 deletions

View File

@ -637,8 +637,8 @@ _nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *r
if (spdk_likely(qpair->is_enabled)) {
rc = nvme_transport_qpair_submit_request(qpair, req);
} else if (nvme_qpair_is_admin_queue(qpair) && req->cmd.opc == SPDK_NVME_OPC_FABRIC) {
/* Always allow fabrics commands through on the admin qpair - these get
} else if (req->cmd.opc == SPDK_NVME_OPC_FABRIC && qpair->is_connecting) {
/* Always allow fabrics commands through - these get
* the controller out of reset state.
*/
rc = nvme_transport_qpair_submit_request(qpair, req);

View File

@ -182,13 +182,9 @@ nvme_transport_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_
int
nvme_transport_ctrlr_connect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair)
{
if (nvme_qpair_is_admin_queue(qpair)) {
qpair->is_connecting = 1;
}
NVME_TRANSPORT_CALL(ctrlr->trid.trtype, ctrlr_connect_qpair, (ctrlr, qpair));
if (nvme_qpair_is_admin_queue(qpair)) {
qpair->is_connecting = 0;
}
}
volatile struct spdk_nvme_registers *