nvme-rdma: probe the discovery ctrlr when the subnqn is set

Change-Id: Ia15d65868773442937ce578f92b842989730804d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/367010
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
GangCao 2017-06-25 16:42:03 -04:00 committed by Daniel Verkamp
parent 8486e38d4a
commit ec7dad7199

View File

@ -1153,6 +1153,12 @@ nvme_rdma_ctrlr_scan(const struct spdk_nvme_transport_id *discovery_trid,
uint16_t recfmt;
struct nvme_completion_poll_status status;
if (strcmp(discovery_trid->subnqn, SPDK_NVMF_DISCOVERY_NQN) != 0) {
/* It is not a discovery_ctrlr info and try to directly connect it */
rc = nvme_ctrlr_probe(discovery_trid, NULL, probe_cb, cb_ctx);
return rc;
}
spdk_nvme_ctrlr_opts_set_defaults(&discovery_opts);
/* For discovery_ctrlr set the timeout to 0 */
discovery_opts.keep_alive_timeout_ms = 0;
@ -1202,8 +1208,6 @@ nvme_rdma_ctrlr_scan(const struct spdk_nvme_transport_id *discovery_trid,
if (rc < 0) {
SPDK_TRACELOG(SPDK_TRACE_NVME, "nvme_fabrics_get_log_discovery_page error\n");
nvme_ctrlr_destruct(discovery_ctrlr);
/* It is not a discovery_ctrlr info and try to directly connect it */
rc = nvme_ctrlr_probe(discovery_trid, NULL, probe_cb, cb_ctx);
return rc;
}