[DAPL] v1.1 white-space cleanup
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 5 Oct 2007 16:58:29 +0000 (16:58 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 5 Oct 2007 16:58:29 +0000 (16:58 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@843 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

16 files changed:
ulp/dapl/dapl/ibal/dapl_ibal_cm.c
ulp/dapl/dapl/ibal/dapl_ibal_util.c
ulp/dapl/dat/include/dat/dat_platform_specific.h
ulp/dapl/dat/include/dat/dat_vendor_specific.h
ulp/dapl/test/udapl/dapltest/dapl_fft_cmd.h
ulp/dapl/test/udapl/dapltest/dapl_limit_cmd.h
ulp/dapl/test/udapl/dapltest/dapl_mdep.c
ulp/dapl/test/udapl/dapltest/dapl_mdep.h
ulp/dapl/test/udapl/dapltest/dapl_performance_cmd.h
ulp/dapl/test/udapl/dapltest/dapl_performance_test.h
ulp/dapl/test/udapl/dapltest/dapl_proto.h
ulp/dapl/test/udapl/dapltest/dapl_quit_cmd.h
ulp/dapl/test/udapl/dapltest/dapl_server_cmd.h
ulp/dapl/test/udapl/dapltest/dapl_test_data.h
ulp/dapl/test/udapl/dapltest/dapl_thread.c
ulp/dapl/test/udapl/dapltest/dapl_transaction_cmd.h

index eacf304..77672da 100644 (file)
@@ -292,7 +292,8 @@ dapls_ib_ns_map_ipaddr (
 \r
     if (NULL == p_ca)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"--> DsNMI: There is no HCA = %d\n", __LINE__);\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "--> DsNMI: NULL HCA @ line# %d?\n", __LINE__ );\r
         return (DAT_INVALID_HANDLE);\r
     }\r
 \r
@@ -305,15 +306,17 @@ dapls_ib_ns_map_ipaddr (
 \r
     if (NULL == p_active_port)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"--> DsNMI: Port %d is not available = %d\n",\r
-                hca_ptr->port_num, __LINE__);\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "--> DsNMI: Port %d !available @ line# %d\n",\r
+                       hca_ptr->port_num, __LINE__);\r
         return (DAT_INVALID_STATE);\r
     }\r
 \r
     if (p_active_port->p_attr->lid == 0) \r
     {\r
-            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"--> DsNMI: Port %d has no LID assigned; can not operate\n", \r
-                    p_active_port->p_attr->port_num);\r
+            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"--> DsNMI: Port %d has no LID "\r
+                           "assigned; can not operate\n", \r
+                           p_active_port->p_attr->port_num );\r
             return (DAT_INVALID_STATE);\r
     }\r
     /*else \r
@@ -338,8 +341,9 @@ dapls_ib_ns_map_ipaddr (
                /* \r
          * Port is DOWN; can not send or recv messages\r
          */\r
-               dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"--> DsNMI: Port %d is DOWN; can not send/recv to/from fabric\n", \r
-                    p_active_port->p_attr->port_num);\r
+               dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> DsNMI: Port %d is DOWN; "\r
+                               "can not send/recv to/from fabric\n", \r
+                               p_active_port->p_attr->port_num );\r
         return (DAT_INVALID_STATE);\r
     }\r
 \r
@@ -351,7 +355,9 @@ dapls_ib_ns_map_ipaddr (
      * query SA for IPAddress\r
      */\r
     //service_rec.service_id    = CL_HTON64 (DAPL_ATS_SERVICE_ID);\r
-       dapl_os_memcpy( service_rec.service_name, ATS_NAME, __min (sizeof(ATS_NAME), sizeof(ib_svc_name_t)));\r
+    dapl_os_memcpy ( service_rec.service_name,\r
+                     ATS_NAME,\r
+                     __min (sizeof(ATS_NAME), sizeof(ib_svc_name_t)) );\r
     service_rec.service_gid.unicast.interface_id = gid.guid;\r
     service_rec.service_gid.unicast.prefix       = gid.gid_prefix;\r
        service_rec.service_pkey = IB_DEFAULT_PKEY;\r
@@ -360,10 +366,10 @@ dapls_ib_ns_map_ipaddr (
     user_query.method         = IB_MAD_METHOD_GETTABLE;\r
     user_query.attr_id        = IB_MAD_ATTR_SERVICE_RECORD;\r
 \r
-       user_query.comp_mask      = IB_SR_COMPMASK_SGID      |\r
-                                                               IB_SR_COMPMASK_SPKEY     |\r
-                                                               IB_SR_COMPMASK_SLEASE    |      \r
-                                                               IB_SR_COMPMASK_SNAME;\r
+    user_query.comp_mask      = IB_SR_COMPMASK_SGID      |\r
+                                IB_SR_COMPMASK_SPKEY     |\r
+                                IB_SR_COMPMASK_SLEASE    |     \r
+                                IB_SR_COMPMASK_SNAME;\r
 \r
     user_query.attr_size      = sizeof (ib_service_record_t);\r
     user_query.p_attr         = (void *)&service_rec;\r
@@ -373,6 +379,7 @@ dapls_ib_ns_map_ipaddr (
     query_req.flags           = IB_FLAGS_SYNC;  /* this is a blocking call */\r
     query_req.timeout_ms      = 1 * 1000;       /* 1 second */\r
     query_req.retry_cnt       = 5;\r
+\r
     /* query SA using this port */\r
     query_req.port_guid       = p_active_port->p_attr->port_guid;\r
     query_req.query_context   = (void *) &user_query;\r
@@ -382,17 +389,19 @@ dapls_ib_ns_map_ipaddr (
 \r
     if (ib_status != IB_SUCCESS)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"ns_map_ipaddr: exits status %s @line = %d\n", \r
-                ib_get_err_str(ib_status), __LINE__);\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "ns_map_ipaddr: exits status %s @line %d\n", \r
+                       ib_get_err_str(ib_status), __LINE__);\r
         return (dapl_ib_status_convert (ib_status));\r
     }\r
   \r
     /* ***********************\r
      * return the IP_address\r
      *************************/ \r
-       dapl_os_memcpy ((void *)&((struct sockaddr_in *)p_ia_address)->sin_addr.s_net,\r
-                    (const void *)&service_rec.service_data8[ATS_IPV4_OFFSET], 4);\r
-                    //HCA_IPV6_ADDRESS_LENGTH);\r
+    dapl_os_memcpy (\r
+                  (void *)&((struct sockaddr_in *)p_ia_address)->sin_addr.s_net,\r
+                  (const void *)&service_rec.service_data8[ATS_IPV4_OFFSET],\r
+                  4 ); //HCA_IPV6_ADDRESS_LENGTH);\r
     ((DAT_SOCK_ADDR6 *)p_ia_address)->sin6_family = AF_INET;\r
        \r
     return (DAT_SUCCESS);\r
@@ -443,14 +452,17 @@ dapli_ib_sa_query_cb (
 \r
     if (IB_SUCCESS != p_query_rec->status)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: SA query callback failed status %s\n",\r
-                 ib_get_err_str(p_query_rec->status));\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "sa_query_cb: SA query callback failed status %s\n",\r
+                       ib_get_err_str(p_query_rec->status) );\r
         return;\r
     }\r
 \r
     if (!p_query_rec->p_result_mad)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: SA query callback [no mad] @line %d\n",__LINE__);\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "sa_query_cb: SA query callback [no mad] @line %d\n",\r
+                       __LINE__ );\r
         return;\r
     }\r
 \r
@@ -466,14 +478,15 @@ dapli_ib_sa_query_cb (
                 dapl_os_memcpy ((void * __ptr64) p_query_rec->query_context, \r
                                 (void *) p_path_rec,\r
                                 sizeof (ib_path_rec_t));\r
-                dapl_dbg_log (\r
-                       DAPL_DBG_TYPE_CM | DAPL_DBG_TYPE_CALLBACK,\r
-                       "sa_query_cb: path {slid: 0x%x, dlid: 0x%x}\n",\r
-                       p_path_rec->slid, p_path_rec->dlid);\r
+                dapl_dbg_log ( DAPL_DBG_TYPE_CM | DAPL_DBG_TYPE_CALLBACK,\r
+                               "sa_query_cb: path {slid: 0x%x, dlid: 0x%x}\n",\r
+                               p_path_rec->slid, p_path_rec->dlid );\r
             }\r
             else\r
             {\r
-                dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: return NULL? @line %d\n",__LINE__);\r
+                dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                               "sa_query_cb: NULL path_rec? @line %d\n",\r
+                               __LINE__ );\r
                 return;\r
             }\r
             break;\r
@@ -497,7 +510,8 @@ dapli_ib_sa_query_cb (
             }\r
             else\r
             {\r
-                dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: return NULL? @line %d\n",__LINE__);\r
+                dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                               "sa_query_cb: return NULL? @line %d\n",__LINE__);\r
                 return;\r
             }\r
             break;\r
@@ -508,14 +522,14 @@ dapli_ib_sa_query_cb (
         {\r
             ib_user_query_t    *p_user_query;\r
 \r
-            p_user_query = (ib_user_query_t * __ptr64) p_query_rec->query_context;\r
+            p_user_query =(ib_user_query_t * __ptr64)p_query_rec->query_context;\r
             if (p_user_query)\r
             {\r
                 switch (p_user_query->attr_id)\r
                 {\r
                     case IB_MAD_ATTR_SERVICE_RECORD:\r
                     {\r
-                        ib_service_record_t          *p_svc_rec;\r
+                        ib_service_record_t   *p_svc_rec;\r
 \r
                         p_svc_rec = ib_get_query_svc_rec (p_query_rec->p_result_mad, 0);\r
                         if (p_svc_rec) \r
@@ -526,14 +540,15 @@ dapli_ib_sa_query_cb (
                             dapl_dbg_log (\r
                                DAPL_DBG_TYPE_CM | DAPL_DBG_TYPE_CALLBACK,\r
                                "sa_query_cb: GID{0x" F64x ", 0x" F64x "} record count %d\n",\r
-                              cl_hton64( p_svc_rec->service_gid.unicast.prefix ),\r
-                              cl_hton64( p_svc_rec->service_gid.unicast.interface_id ),\r
-                                                          p_query_rec->result_cnt);\r
+                              cl_hton64(p_svc_rec->service_gid.unicast.prefix),\r
+                              cl_hton64(p_svc_rec->service_gid.unicast.interface_id ),\r
+                             p_query_rec->result_cnt);\r
                         }\r
                         else\r
                         {\r
-                            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: return NULL? @line %d\n",\r
-                                    __LINE__);\r
+                            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                                           "sa_query_cb: NULL svc_rec? @line %d\n",\r
+                                           __LINE__);\r
                             return;\r
                         }\r
                         break;\r
@@ -541,15 +556,18 @@ dapli_ib_sa_query_cb (
                     }\r
                     default:\r
                     {\r
-                        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: USER_DEFINED %d\n",\r
-                                p_user_query->attr_id);\r
+                        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                                       "sa_query_cb: USER_DEFINED %d\n",\r
+                                       p_user_query->attr_id );\r
                         break;\r
                     }\r
                 }\r
             }\r
             else\r
             {\r
-                dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: return NULL? @line %d\n",__LINE__);\r
+                dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                               "sa_query_cb: NULL user_query? @line %d\n",\r
+                               __LINE__ );\r
                 return;\r
             }\r
             break;\r
@@ -557,8 +575,9 @@ dapli_ib_sa_query_cb (
 \r
         default:\r
         {\r
-            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: unsupportedTYPE %d\n",\r
-                    p_query_rec->query_type);\r
+            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                           "sa_query_cb: unsupported TYPE %d?\n",\r
+                           p_query_rec->query_type );\r
             break;\r
         }\r
 \r
@@ -566,8 +585,8 @@ dapli_ib_sa_query_cb (
 \r
     if ((ib_status = ib_put_mad (p_query_rec->p_result_mad)) != IB_SUCCESS)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"sa_query_cb: can not free MAD %s\n", \r
-                ib_get_err_str(ib_status));\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "sa_query_cb: can not free MAD %s\n", \r
+                       ib_get_err_str(ib_status) );\r
     } \r
 }\r
 \r
@@ -576,16 +595,15 @@ static void
 dapli_ibal_listen_err_cb (\r
         IN    ib_listen_err_rec_t          *p_listen_err_rec )\r
 {\r
-       UNUSED_PARAM( p_listen_err_rec );\r
-    dapl_dbg_log (DAPL_DBG_TYPE_CM, "--> %s: CM callback listen error\n",\r
-                  "DiLEcb");\r
+    UNUSED_PARAM( p_listen_err_rec );\r
+    dapl_dbg_log (DAPL_DBG_TYPE_CM, "--> DiLEcb: CM callback listen error\n");\r
 }\r
 \r
 static void \r
 dapli_ib_cm_apr_cb (\r
         IN    ib_cm_apr_rec_t          *p_cm_apr_rec )\r
 {\r
-       UNUSED_PARAM( p_cm_apr_rec );\r
+    UNUSED_PARAM( p_cm_apr_rec );\r
     dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
                   "--> DiCAcb: CM callback APR (Alternate Path Request)\n");\r
 }\r
@@ -594,7 +612,7 @@ static void
 dapli_ib_cm_lap_cb (\r
         IN    ib_cm_lap_rec_t          *p_cm_lap_rec )\r
 {\r
-       UNUSED_PARAM( p_cm_lap_rec );\r
+    UNUSED_PARAM( p_cm_lap_rec );\r
     dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
                   "--> DiCLcb: CM callback LAP (Load Alternate Path)\n");\r
 }\r
index e39cb5d..4a23cd1 100644 (file)
@@ -1371,10 +1371,11 @@ dapls_ib_mr_register (
     ib_mr_handle_t      mr_handle;\r
     ib_mr_create_t      mr_create;\r
     uint32_t            l_key, r_key; \r
-       if ( ia == NULL || ia->header.magic != DAPL_MAGIC_IA )\r
-       {\r
-               return DAT_INVALID_HANDLE;\r
-       }\r
+\r
+    if ( ia == NULL || ia->header.magic != DAPL_MAGIC_IA )\r
+    {\r
+       return DAT_INVALID_HANDLE;\r
+    }\r
     mr_create.vaddr         = (void *) virt_addr;\r
     mr_create.length        = (size_t)length;\r
     mr_create.access_ctrl   = dapl_lmr_convert_privileges (privileges);\r
@@ -1406,8 +1407,8 @@ dapls_ib_mr_register (
         return (dapl_ib_status_convert (ib_status));\r
     }\r
     \r
-    dapl_dbg_log (DAPL_DBG_TYPE_UTIL, \r
-               "--> DsIMR: lmr (%p) lkey = 0x%x r_key= %#x mr_handle %p vaddr 0x%LX len 0x%LX\n", \r
+    dapl_dbg_log (DAPL_DBG_TYPE_UTIL, "--> DsIMR: lmr (%p) lkey 0x%x r_key %#x "\r
+                  "mr_handle %p vaddr 0x%LX len 0x%LX\n", \r
                   lmr, l_key, r_key, mr_handle, virt_addr, length);\r
 \r
     lmr->param.lmr_context = l_key;\r
@@ -1878,86 +1879,99 @@ DAT_RETURN dapls_ib_query_hca (
     ib_ca_attr_t      *p_hca_attr;\r
     dapl_ibal_ca_t    *p_ca;\r
     ib_api_status_t   ib_status;\r
-       ib_hca_port_t     port_num;\r
-       GID gid;\r
-       DAT_SOCK_ADDR6   *p_sock_addr;\r
-       DAT_RETURN dat_status = DAT_SUCCESS;\r
-       port_num = hca_ptr->port_num;\r
+    ib_hca_port_t     port_num;\r
+    GID               gid;\r
+    DAT_SOCK_ADDR6    *p_sock_addr;\r
+    DAT_RETURN dat_status = DAT_SUCCESS;\r
 \r
-       p_ca = (dapl_ibal_ca_t *) hca_ptr->ib_hca_handle;\r
+    port_num = hca_ptr->port_num;\r
+\r
+    p_ca = (dapl_ibal_ca_t *) hca_ptr->ib_hca_handle;\r
 \r
     if (p_ca == NULL)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,  "--> %s: invalid handle %p",\r
-                 "DsIQH", hca_ptr);\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> DsIQH: invalid handle %p",\r
+                       hca_ptr );\r
         return (DAT_INVALID_HANDLE);\r
     }\r
 \r
-    ib_status = ib_query_ca (\r
-                          p_ca->h_ca,\r
-                          p_ca->p_ca_attr,\r
-                          &p_ca->ca_attr_size);\r
+    ib_status = ib_query_ca ( p_ca->h_ca,\r
+                              p_ca->p_ca_attr,\r
+                              &p_ca->ca_attr_size );\r
+\r
     if (ib_status != IB_SUCCESS)\r
     {\r
-        dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> DsIQH: ib_query_ca returned failed status = %s\n", \r
-                ib_get_err_str(ib_status));\r
+        dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "--> DsIQH: ib_query_ca returned failed status = %s\n", \r
+                       ib_get_err_str(ib_status));\r
         return (dapl_ib_status_convert (ib_status));\r
     }\r
 \r
     p_hca_attr = p_ca->p_ca_attr;\r
 \r
-       if (ip_addr != NULL)\r
-       {\r
-               p_sock_addr = dapl_os_alloc(sizeof(DAT_SOCK_ADDR6));\r
-               if ( !p_sock_addr )\r
-               {\r
-                       dat_status = DAT_INSUFFICIENT_RESOURCES;\r
-                       dapl_dbg_log ( DAPL_DBG_TYPE_ERR, " Query Hca alloc Err: status %d\n", dat_status);\r
-                       return dat_status;\r
-               }\r
-               dapl_os_memzero(p_sock_addr, sizeof(DAT_SOCK_ADDR6));\r
-\r
-               gid.gid_prefix = p_hca_attr->p_port_attr[port_num-1].p_gid_table->unicast.prefix;\r
-               gid.guid = p_hca_attr->p_port_attr[port_num-1].p_gid_table->unicast.interface_id;\r
+    if (ip_addr != NULL)\r
+    {\r
+       p_sock_addr = dapl_os_alloc(sizeof(DAT_SOCK_ADDR6));\r
+       if ( !p_sock_addr )\r
+       {\r
+               dat_status = DAT_INSUFFICIENT_RESOURCES;\r
+               dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
+                              " Query Hca alloc Err: status %d\n", dat_status);\r
+               return dat_status;\r
+       }\r
+       dapl_os_memzero(p_sock_addr, sizeof(DAT_SOCK_ADDR6));\r
+\r
+       gid.gid_prefix =\r
+          p_hca_attr->p_port_attr[port_num-1].p_gid_table->unicast.prefix;\r
+\r
+       gid.guid =\r
+          p_hca_attr->p_port_attr[port_num-1].p_gid_table->unicast.interface_id;\r
        \r
-               dat_status = dapls_ns_map_ipaddr(hca_ptr, gid, (DAT_IA_ADDRESS_PTR)p_sock_addr);\r
+       dat_status = dapls_ns_map_ipaddr(hca_ptr, gid,\r
+                                         (DAT_IA_ADDRESS_PTR)p_sock_addr);\r
        \r
-               if ( dat_status != DAT_SUCCESS )\r
-               {\r
-                       dapl_dbg_log (DAPL_DBG_TYPE_ERR, " SA Query for local IP failed= %d\n", dat_status );\r
-                       /* what to do next ? */\r
-               }\r
-               else\r
-               {\r
-                       dapl_dbg_log (DAPL_DBG_TYPE_CM, "SA query GID for IP: ");\r
-                               dapl_dbg_log ( DAPL_DBG_TYPE_CM, "%0d:%d:%d:%d\n", \r
-                                       (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[2]&0xff,\r
-                                       (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[3]&0xff,\r
-                                       (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[4]&0xff,\r
-                                       (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[5]&0xff);\r
-               }\r
-\r
-               hca_ptr->hca_address = *p_sock_addr;\r
-\r
-               /* if structure address not from our hca_ptr */\r
-               if ( ip_addr  != &hca_ptr->hca_address )\r
-               {\r
-                       *ip_addr = *p_sock_addr;\r
-               }\r
-               dapl_os_free (p_sock_addr, sizeof(DAT_SOCK_ADDR6));\r
-       } /* ip_addr != NULL */\r
-\r
-       if ( ia_attr != NULL )\r
-    {\r
-        dapl_os_memzero(ia_attr->adapter_name, (int)sizeof(ia_attr->adapter_name ));\r
-        dapl_os_memcpy(ia_attr->adapter_name,\r
+       if ( dat_status != DAT_SUCCESS )\r
+       {\r
+            dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
+                          " SA Query for local IP failed= %d\n",\r
+                          dat_status );\r
+               /* what to do next ? */\r
+       }\r
+       else\r
+       {\r
+               dapl_dbg_log (DAPL_DBG_TYPE_CM, "SA query GID for IP: ");\r
+                       dapl_dbg_log ( DAPL_DBG_TYPE_CM, "%0d:%d:%d:%d\n", \r
+                  (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[2]&0xff,\r
+                  (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[3]&0xff,\r
+                  (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[4]&0xff,\r
+                  (uint8_t)((DAT_IA_ADDRESS_PTR )p_sock_addr)->sa_data[5]&0xff);\r
+       }\r
+\r
+       hca_ptr->hca_address = *p_sock_addr;\r
+\r
+       /* if structure address not from our hca_ptr */\r
+       if ( ip_addr  != &hca_ptr->hca_address )\r
+       {\r
+               *ip_addr = *p_sock_addr;\r
+       }\r
+       dapl_os_free (p_sock_addr, sizeof(DAT_SOCK_ADDR6));\r
+     } /* ip_addr != NULL */\r
+\r
+     if ( ia_attr != NULL )\r
+     {\r
+        dapl_os_memzero (ia_attr->adapter_name,\r
+                         (int)sizeof(ia_attr->adapter_name ));\r
+        dapl_os_memcpy (ia_attr->adapter_name,\r
                         DAT_ADAPTER_NAME, \r
-                        min ( (int)dapl_os_strlen(DAT_ADAPTER_NAME), (int)(DAT_NAME_MAX_LENGTH)-1 ) );\r
+                        min ( (int)dapl_os_strlen(DAT_ADAPTER_NAME),\r
+                              (int)(DAT_NAME_MAX_LENGTH)-1 ) );\r
 \r
-        dapl_os_memzero (ia_attr->vendor_name, (int)sizeof(ia_attr->vendor_name));\r
+        dapl_os_memzero (ia_attr->vendor_name,\r
+                         (int)sizeof(ia_attr->vendor_name));\r
         dapl_os_memcpy(ia_attr->vendor_name, \r
                        DAT_VENDOR_NAME,\r
-                       min ((int)dapl_os_strlen(DAT_VENDOR_NAME), (int)(DAT_NAME_MAX_LENGTH)-1 ));\r
+                       min ((int)dapl_os_strlen(DAT_VENDOR_NAME),\r
+                            (int)(DAT_NAME_MAX_LENGTH)-1 ));\r
         \r
         /* FIXME : Vu\r
          *         this value should be revisited\r
@@ -1993,17 +2007,17 @@ DAT_RETURN dapls_ib_query_hca (
         ia_attr->num_vendor_attr          = 0;\r
         ia_attr->vendor_attr              = NULL;\r
        \r
+       dapl_dbg_log(DAPL_DBG_TYPE_UTIL, " --> DsIMU_qHCA: (ver=%x) ep %d "\r
+                     "ep_q %d evd %d evd_q %d\n", \r
+                     ia_attr->hardware_version_major,\r
+                     ia_attr->max_eps, ia_attr->max_dto_per_ep,\r
+                     ia_attr->max_evds, ia_attr->max_evd_qlen );\r
        dapl_dbg_log(DAPL_DBG_TYPE_UTIL, \r
-                       " --> DsIMU_qHCA: (ver=%x) ep %d ep_q %d evd %d evd_q %d\n", \r
-                       ia_attr->hardware_version_major,\r
-                       ia_attr->max_eps, ia_attr->max_dto_per_ep,\r
-                       ia_attr->max_evds, ia_attr->max_evd_qlen );\r
-       dapl_dbg_log(DAPL_DBG_TYPE_UTIL, \r
-                       " --> DsIMU_qHCA: mtu %llu rdma %llu iov %d lmr %d rmr %d"\r
-                       " rdma_io %d\n", \r
-                       ia_attr->max_mtu_size, ia_attr->max_rdma_size,\r
-                       ia_attr->max_iov_segments_per_dto, ia_attr->max_lmrs, \r
-                       ia_attr->max_rmrs, ia_attr->max_rdma_read_per_ep );\r
+                      " --> DsIMU_qHCA: mtu %llu rdma %llu iov %d lmr %d rmr %d"\r
+                      " rdma_io %d\n", \r
+                      ia_attr->max_mtu_size, ia_attr->max_rdma_size,\r
+                      ia_attr->max_iov_segments_per_dto, ia_attr->max_lmrs, \r
+                      ia_attr->max_rmrs, ia_attr->max_rdma_read_per_ep );\r
     }\r
 \r
     if ( ep_attr != NULL )\r
@@ -2024,12 +2038,13 @@ DAT_RETURN dapls_ib_query_hca (
         ep_attr->max_rdma_read_out= p_hca_attr->max_qp_resp_res;\r
        \r
        dapl_dbg_log(DAPL_DBG_TYPE_UTIL, \r
-                       " --> DsIMU_qHCA: msg %llu dto %d iov %d rdma i%d,o%d\n", \r
-                       ep_attr->max_mtu_size,\r
-                       ep_attr->max_recv_dtos, ep_attr->max_recv_iov,\r
-                       ep_attr->max_rdma_read_in, ep_attr->max_rdma_read_out);\r
+                     " --> DsIMU_qHCA: msg %llu dto %d iov %d rdma i%d,o%d\n", \r
+                     ep_attr->max_mtu_size,\r
+                     ep_attr->max_recv_dtos, ep_attr->max_recv_iov,\r
+                     ep_attr->max_rdma_read_in, ep_attr->max_rdma_read_out);\r
     }\r
-       return DAT_SUCCESS;\r
+\r
+    return DAT_SUCCESS;\r
 }\r
 \r
 \r
index 326e654..3ce32fa 100644 (file)
@@ -143,7 +143,8 @@ typedef struct sockaddr_in6    DAT_SOCK_ADDR6; /* Socket address header native t
 \r
 /* Linux */\r
 \r
-#elif defined(_MSC_VER) || defined(_WIN32) /* NT. MSC compiler, Win32 platform */\r
+#elif defined(_MSC_VER) || defined(_WIN32) || defined(_WIN64)\r
+/* NT. MSC compiler, Win32 platform */\r
 #include <basetsd.h>\r
 typedef unsigned __int32        DAT_UINT32;     /* Unsigned host order, 32 bits */\r
 typedef unsigned __int64        DAT_UINT64;     /* unsigned host order, 64 bits */\r
index 54f1398..81e6d10 100644 (file)
@@ -56,7 +56,13 @@ extern "C"
 {\r
 #endif\r
 \r
-typedef struct dat_ia_attr\r
+#if defined(__ia64__) || defined(_M_IA64) \r
+#define _ALIGN8 __declspec(align(8))\r
+#else\r
+#define _ALIGN8\r
+#endif\r
+\r
+typedef _ALIGN8 struct dat_ia_attr\r
     {\r
     char                        adapter_name[DAT_NAME_MAX_LENGTH];\r
     char                        vendor_name[DAT_NAME_MAX_LENGTH];\r
index 2a12f84..45e24c6 100644 (file)
@@ -52,7 +52,6 @@ typedef enum
 } FFT_Type_e;\r
 \r
 \r
-#pragma pack(1)\r
 typedef struct\r
 {\r
     FFT_Type_e         fft_type;\r
@@ -71,47 +70,4 @@ typedef struct
     int        (*fun) ( FFT_Cmd_t*);\r
 } FFT_Testfunc_t;\r
 \r
-#pragma pack()\r
-\r
-/*\r
-   typedef struct\r
-   {\r
-   Mdep_LockType       Thread_counter_lock;\r
-   int                 Thread_counter;\r
-   \r
-   Mdep_LockType       Thread_success_lock;\r
-   int                 Thread_success_counter;\r
-   } Stress_glob_t;\r
-   \r
-   typedef struct \r
-   {\r
-   Stress_glob_t       *glob;\r
-   Thread              *thread_ptr;\r
-   \r
-   FFT_Cmd_t           *cmd;\r
-   int                 flag;\r
-   unsigned int        discriminator;\r
-   bool                is_server;\r
-   } Stress_arg_t;\r
-   \r
-   \r
-   typedef struct\r
-   {\r
-   VIP_VI_HANDLE       vi_handle;\r
-   Bpool               *bp;\r
-   VIP_DESCRIPTOR      *recv_desc;\r
-   } Stress_vi_context_t;\r
- */\r
-\r
-//#pragma pack (2)\r
-//typedef struct\r
-//{\r
-//    char        server_name[256];   /* -s */\r
-//    char        device_name[256];   /* -D */\r
-//    DAT_UINT32  debug;              /* -d */\r
-//    DAT_QOS     ReliabilityLevel;   /* -R */\r
-//} Quit_Cmd_t;\r
-//#pragma pack (8)\r
-\r
-\r
 #endif\r
index 20730b6..4d495de 100644 (file)
@@ -47,7 +47,6 @@ typedef enum
 } Limit_Index;\r
 \r
 //-------------------------------------\r
-#pragma pack(1)\r
 typedef struct\r
 {\r
     char               device_name[256];       /* -D */\r
@@ -57,6 +56,5 @@ typedef struct
     DAT_UINT32         maximum;                /* -m */\r
     DAT_UINT32                 Test_List[ LIM_NUM_TESTS ];\r
 } Limit_Cmd_t;\r
-#pragma pack()\r
 \r
 #endif\r
index ff887dd..8f205bf 100644 (file)
@@ -63,7 +63,7 @@
 #include <pthread.h>                   /* needed for pthread_atfork() */\r
 #include <signal.h>                    /* needed for thread setup */\r
 \r
-#elif defined(WIN32)\r
+#elif defined(WIN32) || defined(_WIN64)\r
 #include <process.h>\r
 #else\r
 #error "Undefined Platform"\r
index 539ff02..8b28870 100644 (file)
@@ -144,7 +144,7 @@ typedef pthread_mutex_t DT_Mdep_LockType;
 typedef pthread_mutex_t DT_Mdep_LockType;\r
 \r
 #elif defined(WIN32)\r
-typedef HANDLE  DT_Mdep_LockType;\r
+typedef __declspec(align(8)) HANDLE  DT_Mdep_LockType;\r
 \r
 #else\r
 #error "Undefined Platform"\r
@@ -171,7 +171,7 @@ typedef struct
 \r
 #elif defined(WIN32)\r
 \r
-typedef HANDLE DT_WAIT_OBJECT;\r
+typedef __declspec(align(8)) HANDLE DT_WAIT_OBJECT;\r
 \r
 #else\r
 \r
@@ -181,28 +181,28 @@ typedef HANDLE DT_WAIT_OBJECT;
  * Thread types\r
  */\r
 #if defined(__linux__)\r
-typedef pthread_t   DT_Mdep_ThreadHandleType;\r
+typedef pthread_t DT_Mdep_ThreadHandleType;\r
 typedef void      (*DT_Mdep_ThreadFunction) (void *param);\r
-typedef void *      DT_Mdep_Thread_Start_Routine_Return_Type;\r
+typedef void *    DT_Mdep_Thread_Start_Routine_Return_Type;\r
 #define DT_MDEP_DEFAULT_STACK_SIZE 65536\r
 \r
 #elif defined(__solaris__)\r
-typedef pthread_t   DT_Mdep_ThreadHandleType;\r
+typedef pthread_t DT_Mdep_ThreadHandleType;\r
 typedef void      (*DT_Mdep_ThreadFunction) (void *param);\r
-typedef void *      DT_Mdep_Thread_Start_Routine_Return_Type;\r
+typedef void *    DT_Mdep_Thread_Start_Routine_Return_Type;\r
 #define DT_MDEP_DEFAULT_STACK_SIZE 65536\r
 \r
-#elif defined(WIN32)\r
-typedef HANDLE   DT_Mdep_ThreadHandleType;\r
-typedef void          (*DT_Mdep_ThreadFunction) (void *param);\r
-typedef void            DT_Mdep_Thread_Start_Routine_Return_Type;\r
+#elif defined(WIN32) || defined(_WIN64)\r
+typedef __declspec(align(8)) HANDLE   DT_Mdep_ThreadHandleType;\r
+typedef void     (*DT_Mdep_ThreadFunction) (void *param);\r
+typedef void     DT_Mdep_Thread_Start_Routine_Return_Type;\r
 #define DT_MDEP_DEFAULT_STACK_SIZE 65536\r
 \r
 #else\r
 #error "Undefined Platform"\r
 #endif\r
 \r
-typedef struct\r
+typedef __declspec(align(8)) struct\r
 {\r
     void                       (*function) (void *);\r
     void                       *param;\r
@@ -212,7 +212,7 @@ typedef struct
     pthread_attr_t             attr;       /* Thread attributes */\r
 #endif\r
 #if defined (WIN32)\r
-       LPDWORD         threadId;\r
+    LPDWORD                    threadId;\r
 #endif\r
 } Thread;\r
 \r
index fb89ec1..6a0d9b4 100644 (file)
@@ -37,7 +37,6 @@ typedef enum
     POLLING_MODE\r
 } Performance_Mode_Type;\r
 \r
-#pragma pack (1)\r
 typedef struct\r
 {\r
     DAT_UINT32      transfer_type;\r
@@ -57,9 +56,8 @@ typedef struct
     DAT_UINT32                 num_iterations;         /* -i */\r
     DAT_UINT32                 pipeline_len;           /* -p */\r
     Performance_Cmd_Op_t       op;\r
-       DAT_UINT32                      use_rsp;            /* -r */\r
+    DAT_UINT32                 use_rsp;                /* -r */\r
 \r
 } Performance_Cmd_t;\r
-#pragma pack()\r
 \r
 #endif\r
index ff220f4..fda5e14 100644 (file)
@@ -38,7 +38,6 @@
 #define DT_PERF_SYNC_BUFF_SIZE         sizeof(RemoteMemoryInfo)\r
 #define DT_PERF_DFLT_EVD_LENGTH                8\r
 \r
-#pragma pack(1)\r
 typedef struct\r
 {\r
     DT_Transfer_Type        transfer_type;\r
@@ -82,5 +81,5 @@ typedef struct
     DAT_EVD_HANDLE             creq_evd_hdl;   /* "" request   */\r
     Performance_Ep_Context_t   ep_context;\r
 } Performance_Test_t;\r
-#pragma pack()\r
+\r
 #endif\r
index 559fab9..8a92abf 100644 (file)
@@ -147,15 +147,14 @@ void            DT_Mdep_Thread_Init_Attributes (Thread * thread_ptr);
 void            DT_Mdep_Thread_Destroy_Attributes (Thread * thread_ptr);\r
 bool            DT_Mdep_Thread_Start (Thread * thread_ptr);\r
 \r
-void                   DT_Mdep_Thread_Detach (int thread_id);\r
-int                    DT_Mdep_Thread_SELF ( void ); \r
-void                   DT_Mdep_Thread_EXIT ( void * thread_handle ); \r
-int                            DT_Mdep_wait_object_init ( IN DT_WAIT_OBJECT *wait_obj);\r
-int                    DT_Mdep_wait_object_wait (\r
-                                                   IN  DT_WAIT_OBJECT *wait_obj, \r
-                                                   IN  int timeout_val);\r
-int                    DT_Mdep_wait_object_wakeup ( IN DT_WAIT_OBJECT *wait_obj);\r
-int                    DT_Mdep_wait_object_destroy ( IN DT_WAIT_OBJECT *wait_obj);\r
+void           DT_Mdep_Thread_Detach (int thread_id);\r
+int            DT_Mdep_Thread_SELF ( void ); \r
+void           DT_Mdep_Thread_EXIT ( void * thread_handle ); \r
+int            DT_Mdep_wait_object_init ( IN DT_WAIT_OBJECT *wait_obj);\r
+int            DT_Mdep_wait_object_wait ( IN   DT_WAIT_OBJECT *wait_obj, \r
+                                          IN  int timeout_val);\r
+int            DT_Mdep_wait_object_wakeup ( IN DT_WAIT_OBJECT *wait_obj);\r
+int            DT_Mdep_wait_object_destroy ( IN DT_WAIT_OBJECT *wait_obj);\r
 \r
 \r
 DT_Mdep_Thread_Start_Routine_Return_Type\r
index c8276a4..e78ea5f 100644 (file)
@@ -28,7 +28,6 @@
 #define __DAPL_QUIT_CMD_H__\r
 \r
 \r
-#pragma pack(1)\r
 typedef struct\r
 {\r
     char        server_name[256];   /* -s */\r
@@ -36,6 +35,5 @@ typedef struct
     DAT_UINT32  debug;              /* -d */\r
     DAT_QOS     ReliabilityLevel;   /* -R */\r
 } Quit_Cmd_t;\r
-#pragma pack()\r
 \r
 #endif\r
index 0bee79f..ee44d9d 100644 (file)
 \r
 #include "dapl_mdep.h"\r
 \r
-#pragma pack(1)\r
-\r
 typedef struct\r
 {\r
     bool            debug;              /* -d */\r
     char            dapl_name[256];     /* -D device name */\r
     DAT_QOS         ReliabilityLevel;   /* -R */\r
 } Server_Cmd_t;\r
-#pragma pack()\r
 \r
 #endif\r
index 6b68213..7ec0824 100644 (file)
@@ -51,7 +51,7 @@ extern                DT_Mdep_LockType    g_PerfTestLock;
  * check memory leaking extern int              alloc_count ; extern\r
  * DT_Mdep_LockType        Alloc_Count_Lock;\r
  */\r
-#pragma pack(1)\r
+\r
 typedef struct\r
 {\r
     int                NextPortNumber;\r
@@ -102,5 +102,5 @@ typedef struct
     int                Countdown_Counter;\r
 \r
 } Per_Test_Data_t;\r
-#pragma pack()\r
+\r
 #endif\r
index 3f7a405..466a354 100644 (file)
@@ -77,13 +77,13 @@ DT_Thread_End (Per_Test_Data_t * pt_ptr)
  * NOTE: This routine does NOT create a thread as the name implies. The thread\r
  * is created in DT_Thread_Start (which is counter intuitive)\r
  */\r
-Thread         *\r
+Thread *\r
 DT_Thread_Create (Per_Test_Data_t * pt_ptr,\r
               void (*fn) (void *),\r
               void *param,\r
               unsigned int stacksize)\r
 {\r
-    Thread         *thread_ptr;\r
+    Thread     *thread_ptr;\r
     thread_ptr = (Thread *) DT_MemListAlloc (pt_ptr, "thread.c", THREAD, sizeof (Thread));\r
     if (thread_ptr == NULL)\r
     {\r
index a1190e7..849f50c 100644 (file)
@@ -33,7 +33,6 @@
 #define MAX_OPS 100\r
 #define NAME_SZ 256\r
 \r
-#pragma pack(1)\r
 typedef struct\r
 {\r
     DAT_UINT32      server_initiated;\r
@@ -61,6 +60,5 @@ typedef struct
     DAT_UINT32      num_ops;\r
     Transaction_Cmd_Op_t op[MAX_OPS];\r
 } Transaction_Cmd_t;\r
-#pragma pack()\r
 \r
 #endif\r