cma: fix open_query mode, initialize attributes
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 29 Nov 2016 21:18:47 +0000 (13:18 -0800)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 29 Nov 2016 21:18:47 +0000 (13:18 -0800)
Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dapl/openib_cma/device.c

index ff6c174..326df62 100644 (file)
@@ -282,14 +282,6 @@ DAT_RETURN dapls_ib_open_hca(IN IB_HCA_NAME hca_name,
                      sizeof(DAT_SOCK_ADDR6)))
                return DAT_INVALID_ADDRESS;
 
-       if (flags & DAPL_OPEN_QUERY) {
-               dapl_log(DAPL_DBG_TYPE_WARN,
-                        " WARNING! open_hca: %s %s - %p in %s\n",
-                        PROVIDER_NAME, hca_name, hca_ptr,
-                        flags & DAPL_OPEN_QUERY ? "QUERY MODE":"");
-               goto done;
-       }
-
        /* Setup the global cm event channel */
        dapl_os_lock(&g_hca_lock);
        if (g_cm_events == NULL) {
@@ -361,6 +353,14 @@ DAT_RETURN dapls_ib_open_hca(IN IB_HCA_NAME hca_name,
                                IB_CM_RESPONSE_TIMEOUT);
        hca_ptr->ib_trans.max_cm_retries =
            dapl_os_get_env_val("DAPL_MAX_CM_RETRIES", IB_CM_RETRIES);
+
+       if (flags & DAPL_OPEN_QUERY) {
+               dapl_log(DAPL_DBG_TYPE_WARN,
+                        " WARNING! open_hca: %s %s - %p in %s\n",
+                        PROVIDER_NAME, hca_name, hca_ptr,
+                        flags & DAPL_OPEN_QUERY ? "QUERY MODE":"");
+               goto done;
+       }
        
        dat_status = dapli_ib_thread_init();
        if (dat_status != DAT_SUCCESS)