]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
Windows specific -
authorArlin Davis <arlin.r.davis@intel.com>
Fri, 4 Jan 2008 16:31:27 +0000 (08:31 -0800)
committerArlin Davis <arlin.r.davis@intel.com>
Fri, 4 Jan 2008 16:31:27 +0000 (08:31 -0800)
   Add dapl_ep fields ibal_cm_handle, recv_disc, sent_disc for IBAL provider
   Support for direct object on CQ
   INIT and FINI changes
   setup dat.conf default path, fix sr parsing
Common code -
   Add Stan Smith as contributor
   O/S independent dat_os_library_error()

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

AUTHORS
dapl/common/dapl_adapter_util.h
dapl/common/dapl_ep_util.c
dapl/common/dapl_sp_util.c
dapl/include/dapl.h
dapl/udapl/dapl_init.c
dat/common/dat_sr.c
dat/udat/udat_sr_parser.c

diff --git a/AUTHORS b/AUTHORS
index 7c609ba8230183b60f0780396fe92db0a461cc8b..b2c6a581301a1acda93abca52708438b44f84508 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,5 +12,6 @@ DAPL project:
  Gil Rubin
  Steve Sears
  Randy Smith
+ Stan Smith
  Anthony Topper
  Steve Wise 
index 0483839026b80e737341ea692dba66ee5d483de3..37fb77b72e7e49dfd16dae0daa64bd3b48c8201c 100755 (executable)
@@ -290,6 +290,8 @@ dapls_cqe_to_event_extension(
 #include "dapl_dummy_dto.h"
 #elif OPENIB
 #include "dapl_ib_dto.h"
+#else
+#include "dapl_ibal_dto.h"
 #endif
 
 
index 4518a2b2e21893aecc19b6ff164c34cadaa71cd0..cf90d46e28f6d73a26a974f34e7d1fb02d43b023 100644 (file)
@@ -238,6 +238,14 @@ dapl_ep_dealloc (
        dapl_os_free ( ep_ptr->cxn_timer, sizeof ( DAPL_OS_TIMER ) );
     }
 
+#if defined(_WIN32) || defined(_WIN64)
+    if ( ep_ptr->ibal_cm_handle )
+    {
+        dapl_os_free ( ep_ptr->ibal_cm_handle,
+                       sizeof ( *ep_ptr->ibal_cm_handle ) );
+        ep_ptr->ibal_cm_handle = NULL;
+    }
+#endif
     dapl_os_free (ep_ptr, sizeof (DAPL_EP) + sizeof (DAT_SOCK_ADDR) );
 }
 
index 1ca1204162c17a23639dcb074d516d55a31307cb..1e2ca14cbd235e7ebd16cba4d8e9375066909910 100644 (file)
@@ -39,6 +39,7 @@
 #include "dapl_sp_util.h"
 #include "dapl_cr_util.h"
 
+
 /*
  * Local definitions
  */
@@ -97,6 +98,9 @@ dapls_sp_alloc (
     dapl_llist_init_entry (&sp_ptr->header.ia_list_entry);
     dapl_os_lock_init (&sp_ptr->header.lock);
 
+#if defined(_WIN32) || defined(_WIN64)
+    dapl_os_wait_object_init( &sp_ptr->wait_object );
+#endif
     /*
      * Initialize the Body (set to NULL above)
      */
@@ -129,8 +133,11 @@ dapls_sp_free_sp (
                    sp_ptr->header.magic == DAPL_MAGIC_RSP);
     dapl_os_assert (dapl_llist_is_empty (&sp_ptr->cr_list_head));
 
+#if defined(_WIN32) || defined(_WIN64)
+    dapl_os_wait_object_destroy( &sp_ptr->wait_object );
+#endif
     dapl_os_lock (&sp_ptr->header.lock);
-    sp_ptr->header.magic = DAPL_MAGIC_INVALID; /* reset magic to prevent reuse */
+    sp_ptr->header.magic = DAPL_MAGIC_INVALID;/* reset magic to prevent reuse */
     dapl_os_unlock (&sp_ptr->header.lock);
     dapl_os_free (sp_ptr, sizeof (DAPL_SP));
 }
index ade101b2ce3b09f5be89c57330d820be5eed09da..d6c1a8c7a3b12869ad83b122b5545a0b47be691c 100755 (executable)
@@ -64,6 +64,8 @@
 #include "dapl_dummy_util.h"
 #elif OPENIB
 #include "dapl_ib_util.h"
+#else /* windows - IBAL and/or IBAL+Sock_CM */
+#include "dapl_ibal_util.h"
 #endif
 
 /*********************************************************************
@@ -448,19 +450,24 @@ struct dapl_ep
     DAPL_ATOMIC                        req_count;
     DAPL_ATOMIC                        recv_count;
 
-    DAPL_COOKIE_BUFFER         req_buffer;
-    DAPL_COOKIE_BUFFER         recv_buffer;
+    DAPL_COOKIE_BUFFER req_buffer;
+    DAPL_COOKIE_BUFFER recv_buffer;
 
-    ib_data_segment_t          *recv_iov;
+    ib_data_segment_t  *recv_iov;
     DAT_COUNT                  recv_iov_num;
 
-    ib_data_segment_t          *send_iov;
+    ib_data_segment_t  *send_iov;
     DAT_COUNT                  send_iov_num;
 #ifdef DAPL_DBG_IO_TRC
     int                        ibt_dumped;
     struct io_buf_track *ibt_base;
     DAPL_RING_BUFFER   ibt_queue;
 #endif /* DAPL_DBG_IO_TRC */
+#if defined(_WIN32) || defined(_WIN64)
+    DAT_BOOLEAN         recv_discreq;
+    DAT_BOOLEAN         sent_discreq;
+    dp_ib_cm_handle_t   ibal_cm_handle;
+#endif
 };
 
 /* DAPL_SRQ maps to DAT_SRQ_HANDLE */
index cdd90d8cf0945931a548276214df7b299f69b081..2c4595688178f473da22789ad32622362da5a4cd 100644 (file)
@@ -184,6 +184,13 @@ DAT_PROVIDER_INIT_FUNC_NAME (
     provider = NULL;
     hca_ptr = NULL;
 
+#if defined(_WIN32) || defined(_WIN64)
+    /* initialize DAPL library here as when called from DLL context in DLLmain()
+     * the IB (ibal) call hangs.
+     */
+    dapl_init();
+#endif
+
     dat_status = dapl_provider_list_insert(provider_info->ia_name, &provider);
     if ( DAT_SUCCESS != dat_status ) 
     {
@@ -289,6 +296,13 @@ DAT_PROVIDER_FINI_FUNC_NAME (
     dapl_hca_free (provider->extension);
 
     (void) dapl_provider_list_remove(provider_info->ia_name);
+
+#if defined(_WIN32) || defined(_WIN64)
+    /* cleanup DAPL library - relocated here from OSD DLL context as the IBAL
+     * calls hung in the DLL context?
+     */
+    dapl_fini();
+#endif
 }
 
 
index ee5037571aab34f83ffe262d28255e3ce29866d3..76991a8c77b36aacbec35cee994530c3c4364fa2 100755 (executable)
@@ -388,7 +388,7 @@ dat_sr_provider_open (
                    fncptr = dat_os_library_sym(data->lib_handle,
                                                 "dapl_extensions");
 
-                    if ((dlerror() != NULL) || (fncptr == NULL)) 
+                    if ((dat_os_library_error() != NULL) || (fncptr == NULL)) 
                    {
                             dat_os_dbg_print(DAT_OS_DBG_TYPE_SR,
                                  "DAT Registry: WARNING: library %s, "
index 64c4114408199de67d70bf28f9924a0af4b30c68..84b5b9d39f337a80ca93b624021c5eaab7af089c 100644 (file)
  *********************************************************************/
 
 #define DAT_SR_CONF_ENV                "DAT_OVERRIDE"
+#if defined(_WIN32) || defined(_WIN64)
+#define DAT_SR_CONF_DEFAULT            "C:\\DAT\\dat.conf"
+#else
 #define DAT_SR_CONF_DEFAULT            "/etc/dat.conf"
+#endif
 
 #define DAT_SR_TOKEN_THREADSAFE        "threadsafe"
 #define DAT_SR_TOKEN_NONTHREADSAFE     "nonthreadsafe"
@@ -1474,7 +1478,7 @@ dat_sr_read_quoted_str (
        }
        else
        {
-           token->value[j] = c;
+           token->value[j] = (char)c;
            j++;
 
            is_prev_char_backslash = DAT_FALSE;
@@ -1521,5 +1525,5 @@ dat_sr_read_comment (
     } while ( (DAT_SR_CHAR_NEWLINE != c) && (EOF != c) );
 
     /* put back the newline */
-    dat_os_fputc (file, c);
+    dat_os_ungetc (file, c);
 }