Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / lnet / klnds / openiblnd / openiblnd.c
index 3850d7e..73cecc6 100644 (file)
@@ -443,7 +443,7 @@ kibnal_handle_svcqry (struct socket *sock)
         }
 
         version = (msg->ibm_magic == IBNAL_MSG_MAGIC) ?
-                  msg->ibm_version : __swab32(msg->ibm_version);
+                  msg->ibm_version : __swab16(msg->ibm_version);
         /* Peer is a different protocol version: reply in my current protocol
          * to tell her I'm "old" */
         if (version != IBNAL_MSG_VERSION &&
@@ -786,6 +786,10 @@ kibnal_add_persistent_peer (lnet_nid_t nid, __u32 ip, int port)
 
         write_lock_irqsave (&kibnal_data.kib_global_lock, flags);
 
+        /* I'm always called with a reference on kibnal_data.kib_ni
+         * so shutdown can't have started */
+        LASSERT (kibnal_data.kib_nonewpeers == 0);
+
         peer2 = kibnal_find_peer_locked (nid);
         if (peer2 != NULL) {
                 kibnal_peer_decref(peer);
@@ -984,12 +988,12 @@ kibnal_create_conn (void)
                 }
         }
 
-        /* We can post up to IBLND_MSG_QUEUE_SIZE immediate/req messages and
-         * the same # of ack/nak/rdma+done messages */
+        /* We can post up to IBNAL_RX_MSGS, which may also include an
+         * additional RDMA work item */
 
         params.qp_create = (struct ib_qp_create_param) {
                 .limit = {
-                        .max_outstanding_send_request    = 3 * IBNAL_MSG_QUEUE_SIZE,
+                        .max_outstanding_send_request    = 2 * IBNAL_RX_MSGS,
                         .max_outstanding_receive_request = IBNAL_RX_MSGS,
                         .max_send_gather_element         = 1,
                         .max_receive_scatter_element     = 1,