]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
Windows specific -
authorArlin Davis <arlin.r.davis@intel.com>
Fri, 4 Jan 2008 16:32:39 +0000 (08:32 -0800)
committerArlin Davis <arlin.r.davis@intel.com>
Fri, 4 Jan 2008 16:32:39 +0000 (08:32 -0800)
   IBAL support in evd_create
   Build IB extensions by default
Common code -
   check return status, evd_free, evd_wait
   add dapl_event_str function
   definitions for dat_os_library_error, dat_os_ungetc

Signed-off by: Stan Smith <stan.smith@intel.com>
Signed-off by: Arlin Davis <ardavis@ichips.intel.com>

dapl/common/dapl_evd_free.c
dapl/common/dapl_evd_util.c
dapl/common/dapl_ia_query.c
dapl/udapl/dapl_evd_wait.c
dat/include/dat/udat_config.h
dat/udat/linux/dat_osd.h

index 407dbc8f92edced978fc6ae05a7e7676ab0265d1..cacb84a7428683f710b2502d836c296f1f6828f8 100755 (executable)
@@ -125,9 +125,11 @@ DAT_RETURN DAT_API dapl_evd_free (
 #endif /* defined(__KDAPL__) */
 
 bail:
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,
-                 "dapl_evd_free () returns 0x%x\n",
-                 dat_status);
+    if ( dat_status )
+    {
+       dapl_dbg_log (DAPL_DBG_TYPE_RTN,
+                       "dapl_evd_free () returns 0x%x\n", dat_status);
+    }
 
     return dat_status;
 }
index 1f55ea318328ad4cc7e5ce374150d75fbe2f8898..c2888f36e9810b3651487041b3ca020c228a63b6 100755 (executable)
@@ -53,6 +53,52 @@ DAT_RETURN dapli_evd_event_alloc (
        IN  DAT_COUNT           qlen);
 
 
+char *dapl_event_str( IN DAT_EVENT_NUMBER  event_num )
+{
+#if defined(DAPL_DBG)
+    struct dat_event_str { char *str; DAT_EVENT_NUMBER num;};
+    static struct dat_event_str events[] = {
+    {"DAT_DTO_COMPLETION_EVENT", DAT_DTO_COMPLETION_EVENT},
+    {"DAT_RMR_BIND_COMPLETION_EVENT", DAT_RMR_BIND_COMPLETION_EVENT},
+    {"DAT_CONNECTION_REQUEST_EVENT", DAT_CONNECTION_REQUEST_EVENT},
+    {"DAT_CONNECTION_EVENT_ESTABLISHED", DAT_CONNECTION_EVENT_ESTABLISHED},
+    {"DAT_CONNECTION_EVENT_PEER_REJECTED", DAT_CONNECTION_EVENT_PEER_REJECTED},
+    {"DAT_CONNECTION_EVENT_NON_PEER_REJECTED", DAT_CONNECTION_EVENT_NON_PEER_REJECTED},
+    {"DAT_CONNECTION_EVENT_ACCEPT_COMPLETION_ERROR", DAT_CONNECTION_EVENT_ACCEPT_COMPLETION_ERROR},
+    {"DAT_CONNECTION_EVENT_DISCONNECTED", DAT_CONNECTION_EVENT_DISCONNECTED},
+    {"DAT_CONNECTION_EVENT_BROKEN", DAT_CONNECTION_EVENT_BROKEN},
+    {"DAT_CONNECTION_EVENT_TIMED_OUT", DAT_CONNECTION_EVENT_TIMED_OUT},
+    {"DAT_CONNECTION_EVENT_UNREACHABLE", DAT_CONNECTION_EVENT_UNREACHABLE},
+    {"DAT_ASYNC_ERROR_EVD_OVERFLOW", DAT_ASYNC_ERROR_EVD_OVERFLOW},
+    {"DAT_ASYNC_ERROR_IA_CATASTROPHIC", DAT_ASYNC_ERROR_IA_CATASTROPHIC},
+    {"DAT_ASYNC_ERROR_EP_BROKEN", DAT_ASYNC_ERROR_EP_BROKEN},
+    {"DAT_ASYNC_ERROR_TIMED_OUT", DAT_ASYNC_ERROR_TIMED_OUT},
+    {"DAT_ASYNC_ERROR_PROVIDER_INTERNAL_ERROR", DAT_ASYNC_ERROR_PROVIDER_INTERNAL_ERROR},
+    {"DAT_HA_DOWN_TO_1", DAT_HA_DOWN_TO_1},
+    {"DAT_HA_UP_TO_MULTI_PATH", DAT_HA_UP_TO_MULTI_PATH},
+    {"DAT_SOFTWARE_EVENT", DAT_SOFTWARE_EVENT},
+#ifdef DAT_EXTENSIONS
+    {"DAT_EXTENSION_EVENT", DAT_EXTENSION_EVENT},
+    {"DAT_IB_EXTENSION_RANGE_BASE", DAT_IB_EXTENSION_RANGE_BASE},
+    {"DAT_IW_EXTENSION_RANGE_BASE", DAT_IW_EXTENSION_RANGE_BASE},
+#endif /* DAT_EXTENSIONS */
+    {NULL,0},
+    };
+    int i;
+
+    for(i=0; events[i].str; i++)
+    {
+        if (events[i].num == event_num)
+            return events[i].str;
+    }
+    return "Unknown DAT event?";
+#else
+    static char str[16];
+    sprintf(str,"%x",event_num);
+    return str;
+#endif
+}
+
 /*
  * dapls_evd_internal_create
  *
@@ -122,7 +168,15 @@ dapls_evd_internal_create (
                                   | DAT_EVD_CONNECTION_FLAG
                                   | DAT_EVD_CR_FLAG) ) )
     {
-
+#if defined(_VENDOR_IBAL_)
+       /* 
+        * The creation of CQ required a PD (PZ) associated with it and
+        * we do not have a PD here; therefore, the work-around is that we
+        * will postpone the creation of the cq till the creation of QP which
+        * this cq will associate with.
+        */
+       evd_ptr->ib_cq_handle = IB_INVALID_HANDLE;
+#else
        dat_status = dapls_ib_cq_alloc (ia_ptr,
                                        evd_ptr,
                                        &cq_len);
@@ -153,6 +207,7 @@ dapls_evd_internal_create (
            goto bail;
        }
 
+#endif /* _VENDOR_IBAL_ */
     }
 
     /* We now have an accurate count of events, so allocate them into
index 7596daf0aa6489bf55657ec2a5158647e91147d2..593f356dc55d753ddeec8b01fa520eeaee96bf27 100755 (executable)
@@ -222,9 +222,10 @@ dapl_ia_query (
     }
 
 bail:
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,
-                 "dapl_ia_query () returns 0x%x\n", 
-                 dat_status);
+    if (dat_status != DAT_SUCCESS) {
+       dapl_dbg_log (DAPL_DBG_TYPE_RTN,
+                       "dapl_ia_query () returns 0x%x\n", dat_status);
+    }
 
     return dat_status;
 }
index e4e5b376e0a050b91c31c9c36239da98425b2777..7cfece77fc857e85f2a24e3263547794a34b9a0b 100644 (file)
@@ -273,9 +273,9 @@ DAT_RETURN DAT_API dapl_evd_wait (
     *nmore = dapls_rbuf_count(&evd_ptr->pending_event_queue);
 
  bail:
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,
-                 "dapl_evd_wait () returns 0x%x\n", 
-                 dat_status);
-
+    if ( dat_status ) {
+       dapl_dbg_log (DAPL_DBG_TYPE_RTN,
+                       "dapl_evd_wait () returns 0x%x\n", dat_status);
+    }
     return dat_status;
 }
index 674f579dadc424db1833b0d331c758b7c603d0f7..a72037611d16aad44cf0222c8f72a9e4a854493a 100644 (file)
 #define DAT_THREADSAFE DAT_TRUE
 #endif /* DAT_THREADSAFE */
 
+/*
+ * Enable DAT Extensions
+ */
+#ifndef DAT_EXTENSIONS
+#define DAT_EXTENSIONS 1
+#endif
+
 #endif /* _UDAT_CONFIG_H_ */
index c2ecc16abbe293453871104ea142ad4e24a0cbb5..4a96ab528a406643446c043a354b6c0b655e469c 100644 (file)
@@ -114,6 +114,7 @@ dat_os_dbg_print (
  *********************************************************************/
 
 #define DAT_ERROR(Type, SubType) ((DAT_RETURN)(DAT_CLASS_ERROR | Type | SubType))
+#define dat_os_library_error() dlerror()
 
 typedef size_t                         DAT_OS_SIZE;
 typedef void *                         DAT_OS_LIBRARY_HANDLE;
@@ -296,6 +297,16 @@ dat_os_fgetc (
     return fgetc (file);
 }
 
+/* dat_os_ungetc() returns EOF on error or char 'c'.
+ * Push char 'c' back into specified stream for subsequent read.
+ */
+STATIC INLINE int
+dat_os_ungetc (
+    DAT_OS_FILE *file, int c)
+{
+    return ungetc(c, file);
+}
+
 /* dat_os_fgetc() returns EOF on error or end of file. */
 STATIC INLINE int
 dat_os_fputc (