[DAPL] match winof 1.1
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 3 Jun 2008 19:36:03 +0000 (19:36 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 3 Jun 2008 19:36:03 +0000 (19:36 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1230 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

18 files changed:
ulp/dapl/dapl/common/dapl_debug.c
ulp/dapl/dapl/common/dapl_ep_post_rdma_write.c
ulp/dapl/dapl/common/dapl_ep_post_recv.c
ulp/dapl/dapl/common/dapl_ep_post_send.c
ulp/dapl/dapl/common/dapl_evd_dequeue.c
ulp/dapl/dapl/common/dapl_evd_wait.c
ulp/dapl/dapl/common/dapl_ia_close.c
ulp/dapl/dapl/common/dapl_ia_query.c
ulp/dapl/dapl/ibal/dapl_ibal_cm.c
ulp/dapl/dapl/ibal/dapl_ibal_dto.h
ulp/dapl/dapl/ibal/dapl_ibal_kmod.h
ulp/dapl/dapl/ibal/dapl_ibal_qp.c
ulp/dapl/dapl/ibal/dapl_ibal_util.c
ulp/dapl/dapl/ibal/dapl_ibal_util.h
ulp/dapl/dapl/include/dapl.h
ulp/dapl/dapl/include/dapl_debug.h
ulp/dapl/doc/dapl_end_point_design.txt
ulp/dapl/doc/dapl_shared_memory_design.txt

index bd4b20a..4dd3683 100644 (file)
 #include <stdarg.h>\r
 #include <stdlib.h>\r
 \r
-#ifdef DAPL_DBG\r
 DAPL_DBG_TYPE g_dapl_dbg_type;         /* initialized in dapl_init.c */\r
 DAPL_DBG_DEST g_dapl_dbg_dest;         /* initialized in dapl_init.c */\r
 \r
+#ifdef DAPL_DBG\r
+\r
 void dapl_internal_dbg_log ( DAPL_DBG_TYPE type, const char *fmt, ...)\r
 {\r
     va_list args;\r
@@ -54,6 +55,21 @@ void dapl_internal_dbg_log ( DAPL_DBG_TYPE type, const char *fmt, ...)
     }\r
 }\r
 \r
+#endif /* DAPL_DBG */\r
+\r
+void dapl_internal_log ( DAPL_DBG_TYPE type, const char *fmt, ...)\r
+{\r
+    va_list args;\r
+\r
+    if ( type & g_dapl_dbg_type )\r
+    {\r
+       va_start (args, fmt);\r
+       dapl_os_vprintf (fmt, args);\r
+       va_end (args);\r
+    }\r
+}\r
+\r
+\r
 #if defined(DAPL_COUNTERS)\r
 long dapl_dbg_counters[DAPL_CNTR_MAX];\r
 \r
@@ -85,7 +101,5 @@ char  *dapl_dbg_counter_names[] = {
        "dapls_timer_cancel",\r
        0\r
 };\r
-\r
 #endif /* DAPL_COUNTERS */\r
-#endif\r
 \r
index 40e09ff..3e92b29 100644 (file)
@@ -94,11 +94,11 @@ dapl_ep_post_rdma_write (
                                  completion_flags, \r
                                  DAPL_DTO_TYPE_RDMA_WRITE,\r
                                  OP_RDMA_WRITE);\r
-\r
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
-                "dapl_ep_post_rdma_write () returns 0x%x",\r
-                dat_status);\r
-\r
+    if (dat_status)\r
+    {\r
+           dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
+                "dapl_ep_post_rdma_write () returns 0x%x", dat_status);\r
+    }\r
 \r
     return dat_status;\r
 }\r
index b0bb794..cbde689 100644 (file)
@@ -125,9 +125,11 @@ dapl_ep_post_recv (
     }\r
 \r
 bail:\r
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
-                 "dapl_ep_post_recv () returns 0x%x\n",\r
-                 dat_status);\r
+    if (dat_status)\r
+    {\r
+       dapl_dbg_log (DAPL_DBG_TYPE_RTN, "dapl_ep_post_recv () returns 0x%x\n",\r
+                       dat_status);\r
+    }\r
 \r
     return dat_status;\r
 }\r
index 31074f9..335cc4b 100644 (file)
@@ -90,11 +90,11 @@ dapl_ep_post_send (
                                  completion_flags,\r
                                  DAPL_DTO_TYPE_SEND,\r
                                  OP_SEND);\r
-\r
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
-                 "dapl_ep_post_send () returns 0x%x\n",\r
-                 dat_status);\r
-\r
+    if (dat_status)\r
+    {\r
+        dapl_dbg_log (DAPL_DBG_TYPE_RTN, "dapl_ep_post_send () returns 0x%x\n",\r
+                                       dat_status);\r
+    }\r
 \r
     return dat_status;\r
 }\r
index 91ec67f..e1a8030 100644 (file)
@@ -70,10 +70,11 @@ DAT_RETURN dapl_evd_dequeue (
     DAT_EVENT  *local_event;\r
     DAT_RETURN dat_status;\r
 \r
-    dapl_dbg_log (DAPL_DBG_TYPE_API,\r
+    dapl_dbg_log (DAPL_DBG_TYPE_EVENT_DQ,\r
                  "dapl_evd_dequeue (%p, %p)\n",\r
                  evd_handle, \r
                  event);\r
+\r
     DAPL_CNTR(DCNT_EVD_DEQUEUE);\r
 \r
     evd_ptr = (DAPL_EVD *)evd_handle;\r
@@ -135,9 +136,17 @@ DAT_RETURN dapl_evd_dequeue (
 \r
     dapl_os_unlock ( &evd_ptr->header.lock );\r
  bail:\r
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
-                 "dapl_evd_dequeue () returns 0x%x\n", \r
-                 dat_status);\r
+\r
+#ifdef DAPL_DBG        // XXX STAN\r
+    if ( DAPL_DBG_TYPE_EVENT_DQ & g_dapl_dbg_type )\r
+       {\r
+        if ( dat_status && ((dat_status & 0xd0000) != 0xd0000) )\r
+        {\r
+           dapl_log (DAPL_DBG_TYPE_EVENT_DQ, "dapl_evd_dequeue () returns 0x%x\n", \r
+                                       dat_status);\r
+        }\r
+       }\r
+#endif\r
 \r
     return dat_status;\r
 }\r
index b71d40a..d4189e4 100644 (file)
@@ -273,9 +273,11 @@ DAT_RETURN dapl_evd_wait (
     *nmore = dapls_rbuf_count(&evd_ptr->pending_event_queue);\r
 \r
  bail:\r
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
-                 "dapl_evd_wait () returns 0x%x\n", \r
-                 dat_status);\r
+    if (dat_status)\r
+    {\r
+        dapl_dbg_log (DAPL_DBG_TYPE_RTN, "dapl_evd_wait () returns 0x%x\n", \r
+                                               dat_status);\r
+    }\r
 \r
     return dat_status;\r
 }\r
index e34fb2f..d2652f2 100644 (file)
@@ -91,6 +91,10 @@ dapl_ia_close (
     }\r
 \r
  bail:\r
+\r
+    if (dat_status)\r
+        printf ("dapl_ia_close (%p, %d) RC %d\n",ia_handle,ia_flags,dat_status);\r
+\r
     return dat_status;\r
 }\r
 \r
index 1527d1b..c213b05 100644 (file)
@@ -206,9 +206,11 @@ dapl_ia_query (
     }\r
 \r
 bail:\r
-    dapl_dbg_log (DAPL_DBG_TYPE_RTN,\r
-                 "dapl_ia_query () returns 0x%x\n", \r
-                 dat_status);\r
+    if (dat_status)\r
+    {\r
+           dapl_dbg_log (DAPL_DBG_TYPE_RTN, "dapl_ia_query () returns 0x%x\n", \r
+                                               dat_status);\r
+    }\r
 \r
     return dat_status;\r
 }\r
index 38cfe0d..d05e3b5 100644 (file)
@@ -1096,8 +1096,8 @@ dapls_ib_connect (
         IN        DAT_EP_HANDLE                ep_handle,\r
         IN        DAT_IA_ADDRESS_PTR           remote_ia_address,\r
         IN        DAT_CONN_QUAL                remote_conn_qual,\r
-        IN          DAT_COUNT                       prd_size,\r
-        IN          DAPL_PRIVATE                       *prd_ptr )\r
+        IN        DAT_COUNT                    prd_size,\r
+        IN        DAPL_PRIVATE                 *prd_ptr )\r
 {\r
     DAPL_EP                      *ep_ptr;\r
     DAPL_IA                      *ia_ptr;\r
@@ -1738,6 +1738,7 @@ dapls_ib_accept_connection (
 \r
        cm_rep.sq_depth          = 0;\r
     cm_rep.rq_depth          = 0;\r
+    /* max num of oustanding RDMA read/atomic will use */\r
     cm_rep.init_depth        = (uint8_t)ep_ptr->param.ep_attr.max_rdma_read_out;\r
     cm_rep.flow_ctrl         = TRUE;\r
     cm_rep.flags             = 0;\r
index 7decf91..ae38bf5 100644 (file)
@@ -30,7 +30,7 @@ dapls_cqe_opcode_convert (ib_work_completion_t *cqe_p);
 \r
 extern DAT_RETURN\r
 dapls_ib_cq_late_alloc (\r
-       IN  ib_pd_handle_t       pd_handle,\r
+       IN  ib_pd_handle_t      pd_handle,\r
        IN  DAPL_EVD            *evd_ptr);\r
 \r
 #define                DAPL_DEFAULT_DS_ENTRIES         8\r
@@ -137,7 +137,7 @@ dapls_ib_post_send (
        {\r
                ib_qp_attr_t             qp_attr;\r
 \r
-               ib_query_qp ( ep_ptr->qp_handle, &qp_attr );\r
+               (void) ib_query_qp ( ep_ptr->qp_handle, &qp_attr );\r
 \r
                dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
                       "--> DsPS: !CONN EP (%p) ep_state=%d QP_state=%d\n", \r
index 9d4f939..89ce48a 100644 (file)
@@ -62,7 +62,7 @@ typedef struct _mvdapl_ca_t
 \r
 typedef struct _mvdapl_root\r
 {\r
-    ib_al_handle_t               h_al;\r
+    ib_al_handle_t        h_al;\r
     intn_t                guid_count;\r
     mvdapl_ca_t           *mvdapl_ca_tbl;\r
 \r
index 8fecdd2..531a0e5 100644 (file)
@@ -540,7 +540,7 @@ dapls_modify_qp_state_to_rtr (
     qp_mod.req_state                        = IB_QPS_RTR;\r
     qp_mod.state.rtr.rq_psn                 = DAPL_IBAL_START_PSN;\r
     qp_mod.state.rtr.dest_qp                = dest_qp;\r
-    qp_mod.state.rtr.resp_res               = 7;\r
+    qp_mod.state.rtr.resp_res               = 4; // in-flight RDMAs\r
     qp_mod.state.rtr.rnr_nak_timeout        = IB_RNR_NAK_TIMEOUT;\r
     qp_mod.state.rtr.primary_av.sl          = 0;\r
     qp_mod.state.rtr.primary_av.dlid        = dest_lid;\r
index ea4459e..af3412d 100644 (file)
@@ -382,8 +382,7 @@ dapli_alloc_port(
 }\r
 \r
 static void\r
-dapli_add_active_port(\r
-    IN dapl_ibal_ca_t        *ca)\r
+dapli_add_active_port( IN dapl_ibal_ca_t    *ca)\r
 {\r
     dapl_ibal_port_t     *p_port;\r
     ib_port_attr_t       *p_port_attr;\r
@@ -421,8 +420,8 @@ dapli_add_active_port(
             }\r
             else\r
             {\r
-                dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> %s: Could not allocate dapl_ibal_port_t\n",\r
-                       "DiAAP");\r
+                dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> %s: Could not allocate "\r
+                               "dapl_ibal_port_t\n", "DiAAP");\r
             }\r
         }\r
                dapl_dbg_log( DAPL_DBG_TYPE_UTIL, "--> DiAAP: Port %d logical link is %s lid = %#x\n",\r
@@ -483,16 +482,18 @@ dapli_alloc_ca(
         status = ib_query_ca (p_ca->h_ca, NULL, &attr_size);\r
         if (status != IB_INSUFFICIENT_MEMORY)\r
         {\r
-            dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> DiAC: ib_query_ca returned failed status = %d\n", \r
-                    status);\r
+            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "--> DiAC: ib_query_ca returned failed status = %d\n", \r
+                       status);\r
             goto close_and_free_ca;\r
         }\r
 \r
         p_ca->p_ca_attr = dapl_os_alloc ((int)attr_size);\r
         if (p_ca->p_ca_attr == NULL)\r
         {\r
-            dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> %s: dapli_alloc_ca failed to alloc memory\n",\r
-                   "DiAC");\r
+            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                       "--> %s: dapli_alloc_ca failed to alloc memory\n",\r
+                       "DiAC");\r
             goto close_and_free_ca;\r
         }\r
 \r
@@ -502,7 +503,9 @@ dapli_alloc_ca(
                           &attr_size);\r
         if (status != IB_SUCCESS)\r
         {\r
-            dapl_dbg_log ( DAPL_DBG_TYPE_ERR, "--> ib_query_ca returned failed status = %d\n", status);\r
+            dapl_dbg_log ( DAPL_DBG_TYPE_ERR,\r
+                               "--> ib_query_ca returned failed status = %d\n",\r
+                               status);\r
             dapl_os_free (p_ca->p_ca_attr, (int)attr_size);\r
             goto close_and_free_ca;\r
         }\r
@@ -2092,9 +2095,7 @@ dapls_ib_completion_notify (
                return DAT_INVALID_HANDLE;\r
        }\r
     solic_notify = (type == IB_NOTIFY_ON_SOLIC_COMP) ? DAT_TRUE : DAT_FALSE; \r
-    ib_status = ib_rearm_cq ( \r
-                         cq_handle,\r
-                         solic_notify );\r
+    ib_status = ib_rearm_cq ( cq_handle, solic_notify );\r
 \r
     return dapl_ib_status_convert (ib_status);\r
 }\r
index 7c2ba62..c480924 100644 (file)
@@ -143,7 +143,7 @@ typedef struct _dapl_ibal_refs
 \r
 typedef struct _dapl_ibal_root\r
 {\r
-    ib_al_handle_t        h_al;         // handle to Access Layer\r
+    ib_al_handle_t        h_al;        // handle to Access Layer\r
     cl_spinlock_t         ca_lock;     // CA list lock\r
     cl_qlist_t            ca_head;     // list head of CAs\r
     boolean_t             shutdown;    // when true, driver is shutting down\r
@@ -155,7 +155,7 @@ typedef struct _dapl_ibal_root
 typedef struct _dapl_ibal_ca\r
 {\r
     cl_list_item_t    next;        // peer CA list\r
-    ib_ca_handle_t    h_ca;         // handle to open CA\r
+    ib_ca_handle_t    h_ca;        // handle to open CA\r
     ib_ca_attr_t      *p_ca_attr;  // CA attributes\r
     uint32_t          ca_attr_size;// size of ca attribute\r
     dapl_ibal_refs_t  refs;        // reference counting\r
@@ -165,6 +165,7 @@ typedef struct _dapl_ibal_ca
     cl_qlist_t        evd_cb_head; // EVD async error cb list head for this CA\r
     cl_dev_handle_t   mlnx_device;\r
     DAT_PVOID         *ia_ptr;     // hook for CA async callbacks\r
+\r
 }    dapl_ibal_ca_t;\r
 \r
 \r
index eb9f080..6c37793 100644 (file)
@@ -328,7 +328,7 @@ struct dapl_evd
     DAT_BOOLEAN                evd_producer_locking_needed;\r
 \r
     /* Every EVD has a CQ unless it is a SOFTWARE_EVENT only EVD */\r
-    ib_cq_handle_t     ib_cq_handle; \r
+    ib_cq_handle_t     ib_cq_handle;\r
 \r
     /* Mellanox Specific completion handle for registration/de-registration */\r
     ib_comp_handle_t    ib_comp_handle;\r
@@ -400,7 +400,7 @@ struct dapl_ep
     DAT_EP_PARAM               param;\r
 \r
     /* The RC Queue Pair (IBM OS API) */\r
-    ib_qp_handle_t             qp_handle; \r
+    ib_qp_handle_t             qp_handle;\r
     unsigned int               qpn;    /* qp number */\r
     ib_qp_state_t              qp_state;\r
 \r
@@ -447,7 +447,7 @@ struct dapl_ep
 struct dapl_pz\r
 {\r
     DAPL_HEADER                header;\r
-    ib_pd_handle_t     pd_handle; \r
+    ib_pd_handle_t     pd_handle;\r
     DAPL_ATOMIC                pz_ref_count;\r
 };\r
 \r
@@ -456,7 +456,7 @@ struct dapl_lmr
 {\r
     DAPL_HEADER                header;\r
     DAT_LMR_PARAM      param;\r
-    ib_mr_handle_t  mr_handle; \r
+    ib_mr_handle_t     mr_handle;\r
     DAPL_ATOMIC                lmr_ref_count;\r
     ib_shmid_t         ib_shmid;\r
 };\r
@@ -469,7 +469,7 @@ struct dapl_rmr
     DAPL_EP             *ep;\r
     DAPL_PZ             *pz;\r
     DAPL_LMR            *lmr;\r
-    ib_mw_handle_t     mw_handle; \r
+    ib_mw_handle_t     mw_handle;\r
 };\r
 \r
 /* SP types, indicating the state and queue */\r
index abb54b4..de67aa9 100644 (file)
@@ -59,10 +59,11 @@ typedef enum
     DAPL_DBG_TYPE_EP           = 0x0010,\r
     DAPL_DBG_TYPE_UTIL         = 0x0020,\r
     DAPL_DBG_TYPE_CALLBACK     = 0x0040,\r
-    DAPL_DBG_TYPE_DTO_COMP_ERR = 0x0080,\r
+    DAPL_DBG_TYPE_DTO_COMP_ERR  = 0x0080,\r
     DAPL_DBG_TYPE_API          = 0x0100,\r
     DAPL_DBG_TYPE_RTN          = 0x0200,\r
-    DAPL_DBG_TYPE_EXCEPTION    = 0x0400\r
+    DAPL_DBG_TYPE_EXCEPTION    = 0x0400,\r
+    DAPL_DBG_TYPE_EVENT_DQ  = 0x0800\r
 } DAPL_DBG_TYPE;\r
 \r
 typedef enum\r
@@ -72,18 +73,24 @@ typedef enum
 } DAPL_DBG_DEST;\r
 \r
 \r
-#if defined(DAPL_DBG)\r
-\r
 extern DAPL_DBG_TYPE   g_dapl_dbg_type;\r
 extern DAPL_DBG_DEST   g_dapl_dbg_dest;\r
 \r
+#if defined(DAPL_DBG)\r
+\r
 #define dapl_dbg_log g_dapl_dbg_type==0 ? (void) 1 : dapl_internal_dbg_log\r
 extern void dapl_internal_dbg_log ( DAPL_DBG_TYPE type,  const char *fmt,  ...);\r
 \r
-#else  /* !DAPL_DBG */\r
+#else /* !DAPL_DBG */\r
+\r
 #define dapl_dbg_log\r
+\r
 #endif /* !DAPL_DBG */\r
 \r
+#define dapl_log g_dapl_dbg_type==0 ? (void) 1 : dapl_internal_log\r
+extern void dapl_internal_log ( DAPL_DBG_TYPE type,  const char *fmt,  ...);\r
+\r
+\r
 /*\r
  * Counters\r
  */\r
index 298d51d..c03cda7 100644 (file)
@@ -855,7 +855,7 @@ struct dapl_ep
     DAT_EP_PARAM               param;\r
 \r
     /* The RC Queue Pair (IBM OS API) */\r
-    TO_LONG_PTR(ib_qp_handle_t,        qp_handle);\r
+    ib_qp_handle_t             qp_handle;\r
     int                                qpn;    /* qp number */\r
     Ib_qp_state                        qp_state;\r
 \r
index a252627..4f0ca14 100644 (file)
@@ -102,8 +102,8 @@ verb is implemented in the IBM OS Access API as:
 ib_int32_t \r
 ib_mr_shared_register_us( \r
         ib_hca_handle_t         hca_handle,\r
-        ib_mr_handle_t FUNC_PTR64         *mr_handle, /* IN-OUT: could be changed */\r
-        ib_pd_handle_t FUNC_PTR64          pd_handle, /* IN */\r
+        ib_mr_handle_t          *mr_handle, /* IN-OUT: could be changed */\r
+        ib_pd_handle_t          pd_handle, /* IN */\r
         ib_uint32_t             access_control, /* IN */\r
         ib_uint32_t             *l_key, /* OUT */\r
         ib_uint32_t             *r_key, /* OUT: if remote access needed */\r
@@ -180,7 +180,7 @@ dapls_mrdb_record_insert (
 DAT_RETURN \r
 dapls_mrdb_record_update (\r
        IN  DAPL_LMR_COOKIE     cookie, \r
-        IN  ib_mr_handle_t FUNC_PTR64      mr_handle );\r
+    IN  ib_mr_handle_t      mr_handle );\r
 \r
  If there is a record for the specified cookie, the MR handle field is\r
  set to the specified mr_handle value and the initialized field is set\r
@@ -189,7 +189,7 @@ dapls_mrdb_record_update (
 DAT_RETURN\r
 dapls_mrdb_record_query (\r
        IN  DAPL_LMR_COOKIE     cookie,\r
-        OUT ib_mr_handle_t FUNC_PTR64      *mr_handle );\r
+        OUT ib_mr_handle_t      *mr_handle );\r
 \r
  If there is a record for the specified cookie and the initialized\r
  field is true, the MR handle field is returned and the reference\r