[DAPL+DAPL2] tolerate IB_INVALID_HANDLE error as the other side of the connection...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Feb 2008 20:33:34 +0000 (20:33 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Feb 2008 20:33:34 +0000 (20:33 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@955 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/dapl/dapl/common/dapl_evd_dequeue.c
ulp/dapl/dapl/ibal/dapl_ibal_cm.c
ulp/dapl2/dapl/ibal/dapl_ibal_cm.c

index bc67cab..91ec67f 100644 (file)
@@ -115,12 +115,11 @@ DAT_RETURN dapl_evd_dequeue (
      * This keeps events in order if dat_evd_wait() has copied events\r
      * from CQ to EVD.  \r
      */\r
-    local_event = (DAT_EVENT *)dapls_rbuf_remove (&evd_ptr->pending_event_queue);\r
+    local_event = (DAT_EVENT *)dapls_rbuf_remove(&evd_ptr->pending_event_queue);\r
     if (local_event != NULL)\r
     {\r
        *event = *local_event;\r
-       dat_status = dapls_rbuf_add (&evd_ptr->free_event_queue, \r
-                                    local_event);\r
+       dat_status = dapls_rbuf_add (&evd_ptr->free_event_queue, local_event);\r
        DAPL_CNTR(DCNT_EVD_DEQUEUE_FOUND);\r
     }\r
     else if (evd_ptr->ib_cq_handle != IB_INVALID_HANDLE)\r
index 55de120..d15eaaa 100644 (file)
@@ -1343,14 +1343,10 @@ DAT_RETURN
         IN        DAPL_EP                     *ep_ptr,\r
         IN        DAT_CLOSE_FLAGS             disconnect_flags)\r
 {\r
-    DAPL_IA                        *ia_ptr;\r
-    ib_api_status_t                ib_status;\r
-    ib_cm_dreq_t                   cm_dreq;\r
+    ib_api_status_t    ib_status = IB_SUCCESS;\r
+    ib_cm_dreq_t       cm_dreq;\r
 \r
-       UNUSED_PARAM( disconnect_flags );\r
-\r
-    ia_ptr    = ep_ptr->header.owner_ia;\r
-    ib_status = IB_SUCCESS;\r
+    UNUSED_PARAM( disconnect_flags );\r
 \r
     dapl_os_memzero(&cm_dreq, sizeof(ib_cm_dreq_t));\r
 \r
@@ -1370,14 +1366,25 @@ DAT_RETURN
      */\r
     cm_dreq.p_dreq_pdata   = NULL;\r
 \r
-    if ( (ep_ptr->recv_discreq == DAT_FALSE ) && (ep_ptr->sent_discreq == DAT_FALSE ) )\r
+    if ( (ep_ptr->recv_discreq == DAT_FALSE )\r
+        && (ep_ptr->sent_discreq == DAT_FALSE ) )\r
          //(disconnect_flags == DAT_CLOSE_ABRUPT_FLAG ) )\r
     {\r
        ep_ptr->sent_discreq = DAT_TRUE;\r
         ib_status = ib_cm_dreq ( &cm_dreq );\r
         \r
-       dapl_dbg_log (DAPL_DBG_TYPE_CM,"--> DsD: EP=%p  QP= %p  DREQ SENT status =%s\n", \r
-                       ep_ptr, ep_ptr->qp_handle,ib_get_err_str(ib_status));\r
+       /* tolerate INVALID_STATE error as the other side can race ahead and\r
+        * generate a DREQ before we do.\r
+        */ \r
+       if ( ib_status == IB_INVALID_STATE )\r
+           ib_status = IB_SUCCESS;\r
+\r
+       if (ib_status )\r
+       {\r
+           dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
+               "--> DsD: EP=%p  QP= %p  DREQ SEND status %s\n", \r
+               ep_ptr, ep_ptr->qp_handle,ib_get_err_str(ib_status));\r
+       }\r
     }\r
     return dapl_ib_status_convert (ib_status);\r
 }\r
index da902d9..5c75cd5 100644 (file)
@@ -1000,8 +1000,8 @@ DAT_RETURN
 dapls_ib_disconnect ( IN   DAPL_EP           *ep_ptr,\r
                       IN   DAT_CLOSE_FLAGS   disconnect_flags )\r
 {\r
-    ib_api_status_t                ib_status;\r
-    ib_cm_dreq_t                   cm_dreq;\r
+    ib_api_status_t    ib_status = IB_SUCCESS;\r
+    ib_cm_dreq_t       cm_dreq;\r
 \r
     dapl_os_assert(ep_ptr);\r
 \r
@@ -1063,17 +1063,20 @@ dapls_ib_disconnect ( IN   DAPL_EP           *ep_ptr,
        /* tolerate INVALID_STATE error as the other side can race ahead and\r
         * generate a DREQ before we do.\r
         */\r
-       if (ib_status && (ib_status != IB_INVALID_STATE))\r
+       if ( ib_status == IB_INVALID_STATE )\r
+           ib_status = IB_SUCCESS;\r
+\r
+       if (ib_status)\r
        {\r
-           dapl_dbg_log(DAPL_DBG_TYPE_CM,\r
-                       "%s() EP %p Ignored ib_cm_dreq() status %s\n",\r
+           dapl_dbg_log(DAPL_DBG_TYPE_ERR,\r
+                       "%s() EP %p ib_cm_dreq() status %s\n",\r
                        __FUNCTION__,ep_ptr,ib_get_err_str(ib_status));\r
        }\r
        if ( ib_status == IB_SUCCESS )\r
                dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
                                "--> DsD: EP %p  DREQ SENT\n", ep_ptr);\r
     }\r
-    return DAT_SUCCESS;\r
+    return ib_status;\r
 }\r
 \r
 \r