nvme: unify ctrlr_scan function between rdma & tcp
These functions are functionally equivalent. Just unify the way they wait for completions so that they are completely identical and we can merge them into a common function. Change-Id: Id5d734b6ae613b3ac828d89853d986cdadfb211a Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471936 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
a6f667af1d
commit
c2df8f6d84
@ -321,10 +321,7 @@ nvme_tcp_ctrlr_scan(struct spdk_nvme_probe_ctx *probe_ctx,
|
||||
return rc;
|
||||
}
|
||||
|
||||
while (status.done == false) {
|
||||
spdk_nvme_qpair_process_completions(discovery_ctrlr->adminq, 0);
|
||||
}
|
||||
if (spdk_nvme_cpl_is_error(&status.cpl)) {
|
||||
if (spdk_nvme_wait_for_completion(discovery_ctrlr->adminq, &status)) {
|
||||
SPDK_ERRLOG("nvme_identify_controller failed!\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
@ -340,7 +337,6 @@ nvme_tcp_ctrlr_scan(struct spdk_nvme_probe_ctx *probe_ctx,
|
||||
|
||||
rc = nvme_fabric_ctrlr_discover(discovery_ctrlr, probe_ctx);
|
||||
nvme_ctrlr_destruct(discovery_ctrlr);
|
||||
SPDK_DEBUGLOG(SPDK_LOG_NVME, "leave\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user