Whamcloud - gitweb
* vibnal 6361 fix: change QP creation tunables & HCA name
authoreeb <eeb>
Thu, 9 Jun 2005 17:53:11 +0000 (17:53 +0000)
committereeb <eeb>
Thu, 9 Jun 2005 17:53:11 +0000 (17:53 +0000)
*  vibnal 6436 fix: don't LBUG when QP creation fails

lnet/klnds/viblnd/viblnd.c
lnet/klnds/viblnd/viblnd.h

index 7995610..e36ee53 100644 (file)
@@ -998,7 +998,7 @@ kibnal_create_conn (cm_cep_handle_t cep)
         }
 
         /* Mark QP created */
         }
 
         /* Mark QP created */
-        conn->ibc_state = IBNAL_CONN_INIT;
+        conn->ibc_state = IBNAL_CONN_INIT_QP;
         conn->ibc_connvars->cv_local_qpn = rspattr.create_return.qp_num;
 
         if (rspattr.create_return.receive_max_outstand_wr < 
         conn->ibc_connvars->cv_local_qpn = rspattr.create_return.qp_num;
 
         if (rspattr.create_return.receive_max_outstand_wr < 
@@ -1013,6 +1013,9 @@ kibnal_create_conn (cm_cep_handle_t cep)
                 goto failed;
         }
 
                 goto failed;
         }
 
+        /* Mark init complete */
+        conn->ibc_state = IBNAL_CONN_INIT;
+
         /* 1 ref for caller */
         atomic_set (&conn->ibc_refcount, 1);
         return (conn);
         /* 1 ref for caller */
         atomic_set (&conn->ibc_refcount, 1);
         return (conn);
@@ -1050,6 +1053,11 @@ kibnal_destroy_conn (kib_conn_t *conn)
                 /* fall through */
 
         case IBNAL_CONN_INIT:
                 /* fall through */
 
         case IBNAL_CONN_INIT:
+                vvrc = cm_destroy_cep(conn->ibc_cep);
+                LASSERT (vvrc == vv_return_ok);
+                /* fall through */
+
+        case IBNAL_CONN_INIT_QP:
                 kibnal_set_qp_state(conn, vv_qp_state_reset);
                 vvrc = vv_qp_destroy(kibnal_data.kib_hca, conn->ibc_qp);
                 if (vvrc != vv_return_ok)
                 kibnal_set_qp_state(conn, vv_qp_state_reset);
                 vvrc = vv_qp_destroy(kibnal_data.kib_hca, conn->ibc_qp);
                 if (vvrc != vv_return_ok)
@@ -1073,9 +1081,6 @@ kibnal_destroy_conn (kib_conn_t *conn)
         if (conn->ibc_peer != NULL)
                 kibnal_peer_decref(conn->ibc_peer);
 
         if (conn->ibc_peer != NULL)
                 kibnal_peer_decref(conn->ibc_peer);
 
-        vvrc = cm_destroy_cep(conn->ibc_cep);
-        LASSERT (vvrc == vv_return_ok);
-
         PORTAL_FREE(conn, sizeof (*conn));
 
         atomic_dec(&kibnal_data.kib_nconns);
         PORTAL_FREE(conn, sizeof (*conn));
 
         atomic_dec(&kibnal_data.kib_nconns);
@@ -1706,7 +1711,7 @@ kibnal_api_startup (nal_t *nal, ptl_pid_t requested_pid,
         }
 
         /* TODO: apparently only one adapter is supported */
         }
 
         /* TODO: apparently only one adapter is supported */
-        vvrc = vv_hca_open("ANY_HCA", NULL, &kibnal_data.kib_hca);
+        vvrc = vv_hca_open("InfiniHost0", NULL, &kibnal_data.kib_hca);
         if (vvrc != vv_return_ok) {
                 CERROR ("Can't open CA: %d\n", vvrc);
                 goto failed;
         if (vvrc != vv_return_ok) {
                 CERROR ("Can't open CA: %d\n", vvrc);
                 goto failed;
index e3720b6..c887209 100644 (file)
 #define IBNAL_LOCAL_SUB          1
 #define IBNAL_TRAFFIC_CLASS      0
 #define IBNAL_SOURCE_PATH_BIT    0
 #define IBNAL_LOCAL_SUB          1
 #define IBNAL_TRAFFIC_CLASS      0
 #define IBNAL_SOURCE_PATH_BIT    0
-#define IBNAL_OUS_DST_RD         32
+#define IBNAL_OUS_DST_RD         1
 #define IBNAL_IB_MTU             vv_mtu_1024
 
 /* sdp-hca-params.h */
 #define IBNAL_IB_MTU             vv_mtu_1024
 
 /* sdp-hca-params.h */
@@ -379,16 +379,17 @@ typedef struct kib_conn
 } kib_conn_t;
 
 #define IBNAL_CONN_INIT_NOTHING       0         /* incomplete init */
 } kib_conn_t;
 
 #define IBNAL_CONN_INIT_NOTHING       0         /* incomplete init */
-#define IBNAL_CONN_INIT               1         /* completed init */
-#define IBNAL_CONN_ACTIVE_ARP         2         /* active arping */
-#define IBNAL_CONN_ACTIVE_CONNECT     3         /* active sending req */
-#define IBNAL_CONN_ACTIVE_CHECK_REPLY 4         /* active checking reply */
-#define IBNAL_CONN_ACTIVE_RTU         5         /* active sending rtu */
-#define IBNAL_CONN_PASSIVE_WAIT       6         /* passive waiting for rtu */
-#define IBNAL_CONN_ESTABLISHED        7         /* connection established */
-#define IBNAL_CONN_DISCONNECT1        8         /* disconnect phase 1 */
-#define IBNAL_CONN_DISCONNECT2        9         /* disconnect phase 2 */
-#define IBNAL_CONN_DISCONNECTED       10        /* disconnect complete */
+#define IBNAL_CONN_INIT_QP            1         /* QP allocated */
+#define IBNAL_CONN_INIT               2         /* completed init */
+#define IBNAL_CONN_ACTIVE_ARP         3         /* active arping */
+#define IBNAL_CONN_ACTIVE_CONNECT     4         /* active sending req */
+#define IBNAL_CONN_ACTIVE_CHECK_REPLY 5         /* active checking reply */
+#define IBNAL_CONN_ACTIVE_RTU         6         /* active sending rtu */
+#define IBNAL_CONN_PASSIVE_WAIT       7         /* passive waiting for rtu */
+#define IBNAL_CONN_ESTABLISHED        8         /* connection established */
+#define IBNAL_CONN_DISCONNECT1        9         /* disconnect phase 1 */
+#define IBNAL_CONN_DISCONNECT2        10        /* disconnect phase 2 */
+#define IBNAL_CONN_DISCONNECTED       11        /* disconnect complete */
 
 typedef struct kib_peer
 {
 
 typedef struct kib_peer
 {