[DAPL2] tolerate a disconnect callback racing ahead during EP disconnect(), do not...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 24 Dec 2009 00:26:19 +0000 (00:26 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 24 Dec 2009 00:26:19 +0000 (00:26 +0000)
update .rc file to reflect IBAL provider.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2643 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/dapl2/dapl/ibal/dapl_ibal_cm.c
ulp/dapl2/dapl/ibal/udapl.rc

index c3575f6..149bcbf 100644 (file)
@@ -16,7 +16,7 @@
  *
  * PURPOSE: IB Connection routines for access to IBAL APIs
  *
- * $Id: dapl_ibal_cm.c 584 2007-02-07 13:12:18Z sleybo $
+ * $Id$
  *
  **********************************************************************/
 
 #define  DAPL_ATS_NAME              ATS_NAME
 #define  HCA_IPV6_ADDRESS_LENGTH    16
 
+/* until dapl_ibal_util.h define of IB_INVALID_HANDLE which overlaps the
+ * Windows ib_types.h typedef enu ib_api_status_t IB_INVALID_HANDLE is fixed.
+ */
+#undef IB_INVALID_HANDLE
+#define DAPL_IB_INVALID_HANDLE NULL
+
 int g_dapl_loopback_connection = 0;
 extern dapl_ibal_root_t        dapl_ibal_root;
 
@@ -266,7 +272,7 @@ dapli_ib_cm_drep_cb (
         return;
     }
 
-    if (ep_ptr->cm_handle == IB_INVALID_HANDLE )
+    if (ep_ptr->cm_handle == DAPL_IB_INVALID_HANDLE )
     {
          dapl_dbg_log (DAPL_DBG_TYPE_CM,
                   "--> %s: Invalid EP->CM handle?\n", __FUNCTION__); 
@@ -1003,9 +1009,10 @@ dapls_ib_disconnect ( IN   DAPL_EP           *ep_ptr,
     {
          dapl_dbg_log (DAPL_DBG_TYPE_CM,
                   "--> %s: BAD EP Magic EP=%lx\n", __FUNCTION__,ep_ptr); 
+        return DAT_SUCCESS;
     }
 
-    if (ep_ptr->cm_handle == IB_INVALID_HANDLE )
+    if (ep_ptr->cm_handle == DAPL_IB_INVALID_HANDLE )
     {
          dapl_dbg_log (DAPL_DBG_TYPE_CM,
                   "--> %s: Invalid EP->CM handle, OK.\n", __FUNCTION__); 
@@ -1054,21 +1061,24 @@ dapls_ib_disconnect ( IN   DAPL_EP           *ep_ptr,
     {
         ep_ptr->sent_discreq = DAT_TRUE;
         ib_status = ib_cm_dreq ( &cm_dreq );
+
+       if ( ib_status == IB_SUCCESS )
+           dapl_dbg_log (DAPL_DBG_TYPE_CM,
+                       "--> DsD: EP %p  DREQ SENT\n", ep_ptr);
+
        /* tolerate INVALID_STATE error as the other side can race ahead and
         * generate a DREQ before we do.
         */
-       if ( ib_status == IB_INVALID_STATE )
+       if ( ib_status == IB_INVALID_STATE || ib_status == IB_INVALID_HANDLE )
+       {
            ib_status = IB_SUCCESS;
-
-       if (ib_status)
+       }
+       else if (ib_status)
        {
            dapl_dbg_log(DAPL_DBG_TYPE_ERR,
                        "%s() EP %p ib_cm_dreq() status %s\n",
                        __FUNCTION__,ep_ptr,ib_get_err_str(ib_status));
        }
-       if ( ib_status == IB_SUCCESS )
-        dapl_dbg_log (DAPL_DBG_TYPE_CM,
-                               "--> DsD: EP %p  DREQ SENT\n", ep_ptr);
     }
     return ib_status;
 }
@@ -1649,7 +1659,7 @@ dapls_ib_cr_handoff (
         return DAT_INVALID_PARAMETER;
     }
 
-    if (cr_ptr->sp_ptr == IB_INVALID_HANDLE)
+    if (cr_ptr->sp_ptr == DAPL_IB_INVALID_HANDLE)
     {
         dapl_dbg_log ( DAPL_DBG_TYPE_ERR,
                        "--> DsCH: CR = %lx invalid psp handle\n", cr_ptr);
index 7c2505a..e5fc1ac 100644 (file)
 #define VER_FILESUBTYPE                        VFT2_UNKNOWN
 
 #if DBG
-#define VER_FILEDESCRIPTION_STR                "Direct Access Provider Library v2.0 (Debug)"
+#define VER_FILEDESCRIPTION_STR                "Direct Access Provider Library v2.0 (IBAL) (Debug)"
 #define VER_INTERNALNAME_STR           "dapl2d.dll"
 #define VER_ORIGINALFILENAME_STR       "dapl2d.dll"
 #else
-#define VER_FILEDESCRIPTION_STR                "Direct Access Provider Library v2.0"
+#define VER_FILEDESCRIPTION_STR                "Direct Access Provider Library v2.0 (IBAL)"
 #define VER_INTERNALNAME_STR           "dapl2.dll"
 #define VER_ORIGINALFILENAME_STR       "dapl2.dll"
 #endif