[WSD] Changed all debug macros to use IBSP_XXX instead of CL_XXX - it makes
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 27 Sep 2005 00:20:06 +0000 (00:20 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 27 Sep 2005 00:20:06 +0000 (00:20 +0000)
the code much easier to read.  Re-applied changes to ibspdll.rc resource file
lost in previous checkin.

Signed-off-by: Fab Tillier (ftillier@silverstorm.com)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@86 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/wsd/user/extensions.c
ulp/wsd/user/ib_cm.c
ulp/wsd/user/ibsp_duplicate.c
ulp/wsd/user/ibsp_iblow.c
ulp/wsd/user/ibsp_ip.c
ulp/wsd/user/ibsp_mem.c
ulp/wsd/user/ibsp_pnp.c
ulp/wsd/user/ibspdll.c
ulp/wsd/user/ibspdll.rc
ulp/wsd/user/misc.c

index 1aac9be..ff8456b 100644 (file)
@@ -48,22 +48,21 @@ IBSPRegisterMemory(
        ib_access_t access_ctrl;\r
        struct memory_node *node;\r
 \r
-       CL_ENTER( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_MEM );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
 \r
        if( lpBuffer == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("invalid buffer %p\n", lpBuffer) );\r
+               IBSP_ERROR_EXIT( ("invalid buffer %p\n", lpBuffer) );\r
                *lpErrno = WSAEFAULT;\r
                return NULL;\r
        }\r
 \r
        if( dwBufferLength > socket_info->socket_options.max_msg_size )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
-                       ("invalid buffer length %d\n", dwBufferLength) );\r
+               IBSP_ERROR_EXIT( ("invalid buffer length %d\n", dwBufferLength) );\r
                *lpErrno = WSAEFAULT;\r
                return NULL;\r
        }\r
@@ -83,7 +82,7 @@ IBSPRegisterMemory(
                break;\r
 \r
        default:\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("invalid flags %x\n", dwFlags) );\r
+               IBSP_ERROR_EXIT( ("invalid flags %x\n", dwFlags) );\r
                *lpErrno = WSAEINVAL;\r
                return NULL;\r
        }\r
@@ -98,17 +97,17 @@ IBSPRegisterMemory(
 \r
        if( node == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("ib_register_memory failed (pd=%p)\n", socket_info->hca_pd) );\r
                *lpErrno = WSAENOBUFS;\r
        }\r
        else\r
        {\r
-               CL_TRACE_EXIT( IBSP_DBG_MEM, gdbg_lvl, ("returning node %p\n", node) );\r
+               IBSP_TRACE_EXIT( IBSP_DBG_MEM, ("returning node %p\n", node) );\r
                *lpErrno = 0;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_MEM );\r
 \r
        return (HANDLE) node;\r
 }\r
@@ -172,7 +171,7 @@ IBSPRegisterRdmaMemory(
        ib_access_t access_ctrl;\r
        struct ibsp_hca *hca;\r
 \r
-       CL_ENTER( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_MEM );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
@@ -180,7 +179,7 @@ IBSPRegisterRdmaMemory(
        if( *lpdwDescriptorLength < sizeof(struct rdma_memory_desc) )\r
        {\r
                /* This is the probe from the switch to learn the length of the descriptor. */\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("invalid descriptor length %d (usually not an error)\n",\r
                        *lpdwDescriptorLength) );\r
                *lpdwDescriptorLength = sizeof(struct rdma_memory_desc);\r
@@ -190,15 +189,14 @@ IBSPRegisterRdmaMemory(
 \r
        if( lpBuffer == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("invalid buffer %p\n", lpBuffer) );\r
+               IBSP_ERROR_EXIT( ("invalid buffer %p\n", lpBuffer) );\r
                *lpErrno = WSAEFAULT;\r
                return SOCKET_ERROR;\r
        }\r
 \r
        if( dwBufferLength > socket_info->socket_options.max_msg_size )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
-                       ("invalid buffer length %d\n", dwBufferLength) );\r
+               IBSP_ERROR_EXIT( ("invalid buffer length %d\n", dwBufferLength) );\r
                *lpErrno = WSAEFAULT;\r
                return SOCKET_ERROR;\r
        }\r
@@ -220,7 +218,7 @@ IBSPRegisterRdmaMemory(
                break;\r
 \r
        default:\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("invalid flags %x\n", dwFlags) );\r
+               IBSP_ERROR_EXIT( ("invalid flags %x\n", dwFlags) );\r
                *lpErrno = WSAEINVAL;\r
                return SOCKET_ERROR;\r
        }\r
@@ -232,8 +230,7 @@ IBSPRegisterRdmaMemory(
 \r
        if( node == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
-                       ("ib_register_memory failed %d\n", *lpErrno) );\r
+               IBSP_ERROR_EXIT( ("ib_register_memory failed %d\n", *lpErrno) );\r
                *lpErrno = WSAENOBUFS;\r
                return SOCKET_ERROR;\r
        }\r
@@ -251,7 +248,7 @@ IBSPRegisterRdmaMemory(
                         __FUNCTION__, lpBuffer, (unsigned char *)lpBuffer + dwBufferLength,\r
                         dwBufferLength, node));\r
 \r
-       CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_MEM );\r
 \r
        return 0;\r
 }\r
@@ -343,7 +340,8 @@ do_rdma_op(
        if( socket_info->socket_state != IBSP_CONNECTED )\r
        {\r
                IBSP_ERROR_EXIT(\r
-                       ("Socket is not in connected socket_state \n") );\r
+                       ("Socket is not in connected socket_state state=%s\n",\r
+                       IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
                *lpErrno = WSAENOTCONN;\r
                return SOCKET_ERROR;\r
        }\r
index d3f6435..82d8057 100644 (file)
@@ -174,7 +174,7 @@ cm_req_callback(
 \r
 #if 0\r
                        cl_spinlock_release( &socket_info->mutex );\r
-                       CL_EXIT_ERROR( IBSP_DBG_CM, gdbg_lvl, ("rejecting\n") );\r
+                       IBSP_ERROR_EXIT( ("rejecting\n") );\r
                        ib_reject( p_cm_req_rec->h_cm_req, IB_REJ_USER_DEFINED );\r
                        ibsp_dup_overlap_abort( socket_info );\r
                        return;\r
@@ -225,7 +225,7 @@ cm_rep_callback(
        ib_cm_rtu_t cm_rtu;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        memset( &cm_rtu, 0, sizeof(cm_rtu) );\r
 \r
@@ -247,7 +247,7 @@ cm_rep_callback(
                if( status != IB_SUCCESS )\r
                {\r
                        /* Note: a REJ has been automatically sent. */\r
-                       CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("ib_cm_rtu failed (0x%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_cm_rtu failed (0x%d)\n", status) );\r
                        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND );\r
                        ibsp_post_select_event( socket_info, FD_CONNECT, WSAETIMEDOUT );\r
                }\r
@@ -263,7 +263,7 @@ cm_rep_callback(
                if( status != IB_SUCCESS )\r
                {\r
                        /* Note: a REJ has been automatically sent. */\r
-                       CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("ib_cm_rtu failed (0x%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_cm_rtu failed (0x%d)\n", status) );\r
                }\r
                else\r
                {\r
@@ -273,7 +273,7 @@ cm_rep_callback(
 \r
        default:\r
                /* The socket might be closing */\r
-               CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("socket %x not in connecting state (%s)\n",\r
+               IBSP_ERROR( ("socket %x not in connecting state (%s)\n",\r
                        socket_info, IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
 \r
                ib_reject( p_cm_rep_rec->h_cm_rep, IB_REJ_USER_DEFINED );\r
@@ -281,7 +281,7 @@ cm_rep_callback(
 \r
        cl_spinlock_release( &socket_info->mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
 \r
 \r
@@ -296,7 +296,7 @@ cm_rtu_callback(
        struct ibsp_socket_info *socket_info =\r
                (struct ibsp_socket_info * __ptr64)p_cm_rtu_rec->qp_context;\r
 \r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        cl_spinlock_acquire( &socket_info->mutex );\r
 \r
@@ -371,7 +371,7 @@ cm_rtu_callback(
                        }\r
                        else\r
                        {\r
-                               CL_ERROR( IBSP_DBG_CM, gdbg_lvl,\r
+                               IBSP_ERROR(\r
                                        ("ib_post_recv returned %s for reposted buffer\n",\r
                                        ib_get_err_str( status )) );\r
 \r
@@ -390,7 +390,7 @@ cm_rtu_callback(
        else\r
        {\r
                /* The Socket might be closing */\r
-               CL_ERROR( IBSP_DBG_CM, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("Got RTU while in socket_state %s - ignoring\n",\r
                        IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
        }\r
@@ -467,11 +467,11 @@ cm_mra_callback(
        IN                              ib_cm_mra_rec_t                         *p_cm_mra_rec )\r
 {\r
        /* TODO */\r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        UNUSED_PARAM( p_cm_mra_rec );\r
 \r
-       CL_EXIT( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
 \r
 \r
@@ -553,9 +553,9 @@ static void AL_API
 cm_drep_callback(\r
        IN                              ib_cm_drep_rec_t                        *p_cm_drep_rec )\r
 {\r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
        UNUSED_PARAM( p_cm_drep_rec );\r
-       CL_EXIT( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
 \r
 \r
@@ -568,15 +568,15 @@ listen_err_callback(
        IN                              ib_listen_err_rec_t                     *p_listen_err_rec )\r
 {\r
        /* TODO */\r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        UNUSED_PARAM( p_listen_err_rec );\r
 \r
-       CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("not implemented") );\r
+       IBSP_ERROR( ("not implemented") );\r
 \r
        CL_ASSERT( 0 );\r
 \r
-       CL_EXIT( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
 \r
 \r
@@ -589,15 +589,15 @@ cm_apr_callback(
        IN                              ib_cm_apr_rec_t                         *p_cm_apr_rec )\r
 {\r
        /* TODO */\r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        UNUSED_PARAM( p_cm_apr_rec );\r
 \r
-       CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("not implemented"));\r
+       IBSP_ERROR( ("not implemented"));\r
 \r
        CL_ASSERT( 0 );\r
 \r
-       CL_EXIT( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
 \r
 \r
@@ -612,15 +612,15 @@ cm_lap_callback(
        IN                              ib_cm_lap_rec_t                         *p_cm_lap_rec )\r
 {\r
        /* TODO */\r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        UNUSED_PARAM( p_cm_lap_rec );\r
 \r
-       CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("not implemented"));\r
+       IBSP_ERROR( ("not implemented"));\r
 \r
        CL_ASSERT( 0 );\r
 \r
-       CL_EXIT( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
 \r
 \r
@@ -633,7 +633,7 @@ ib_listen(
        ib_cm_listen_t param;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_CM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CM );\r
 \r
        memset( &param, 0, sizeof(param) );\r
 \r
@@ -671,14 +671,14 @@ ib_listen(
 \r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_CM, gdbg_lvl, ("ib_cm_listen failed (0x%d)\n", status) );\r
+               IBSP_ERROR_EXIT( ("ib_cm_listen failed (0x%d)\n", status) );\r
                *lpErrno = ibal_to_wsa_error( status );\r
                return SOCKET_ERROR;\r
        }\r
 \r
        STAT_INC( listen_num );\r
 \r
-       CL_TRACE_EXIT( IBSP_DBG_CM, gdbg_lvl,\r
+       IBSP_TRACE_EXIT( IBSP_DBG_CM,\r
                ("started listening for port %d\n",\r
                CL_HTON16( socket_info->local_addr.sin_port )) );\r
 \r
@@ -724,7 +724,7 @@ ib_listen_cancel(
        status = ib_cm_cancel( socket_info->listen.handle, ib_sync_destroy );\r
        if( status )\r
        {\r
-               CL_ERROR( IBSP_DBG_CM, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("ib_cm_cancel returned %s\n", ib_get_err_str( status )) );\r
        }\r
        else\r
@@ -758,9 +758,9 @@ ib_connect(
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), socket_info));\r
 \r
-       CL_TRACE( IBSP_DBG_CM, gdbg_lvl, ("From:\n") );\r
+       IBSP_TRACE( IBSP_DBG_CM, ("From:\n") );\r
        DebugPrintSockAddr( IBSP_DBG_CM, gdbg_lvl, &socket_info->local_addr );\r
-       CL_TRACE( IBSP_DBG_CM, gdbg_lvl, ("To:\n") );\r
+       IBSP_TRACE( IBSP_DBG_CM, ("To:\n") );\r
        DebugPrintSockAddr( IBSP_DBG_CM, gdbg_lvl, &socket_info->peer_addr );\r
 \r
        /* Insert into the connection map. */\r
@@ -783,10 +783,10 @@ ib_connect(
        params.listen_req_param.dwProcessId = socket_info->duplicate.dwProcessId;\r
        params.listen_req_param.identifier = socket_info->duplicate.identifier;\r
 \r
-       CL_TRACE( IBSP_DBG_CM, gdbg_lvl,\r
+       IBSP_TRACE( IBSP_DBG_CM,\r
                ("ib_connect listen params: %x %x\n", params.listen_req_param.dwProcessId,\r
                params.listen_req_param.identifier) );\r
-       CL_TRACE( IBSP_DBG_CM, gdbg_lvl,\r
+       IBSP_TRACE( IBSP_DBG_CM,\r
                ("connecting to port %d, SID=%016I64x\n", socket_info->peer_addr.sin_port,\r
                cm_req.svc_id) );\r
 \r
index 9497ae7..e7108f5 100644 (file)
@@ -79,7 +79,7 @@ setup_duplicate_socket(
                                                  fname );      // name of map object\r
        if( h == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("CreateFileMapping failed with %d\n", GetLastError()) );\r
                ret = WSAENETDOWN;\r
                goto done;\r
@@ -89,7 +89,7 @@ setup_duplicate_socket(
        if( GetLastError() != ERROR_ALREADY_EXISTS )\r
        {\r
                CloseHandle( h );\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("not mapping for socket duplicate info\n") );\r
+               IBSP_ERROR( ("not mapping for socket duplicate info\n") );\r
                ret = WSAENETDOWN;\r
                goto done;\r
        }\r
@@ -102,7 +102,7 @@ setup_duplicate_socket(
                                                         0 );   // default: map entire file\r
        if( dup_info == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("MapViewOfFile failed with %d\n", GetLastError()) );\r
                ret = WSAENETDOWN;\r
                goto done;\r
@@ -118,7 +118,7 @@ setup_duplicate_socket(
 \r
                if( socket_info->switch_socket == INVALID_SOCKET )\r
                {\r
-                       CL_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("WPUCreateSocketHandle() failed: %d", ret) );\r
                        goto done;\r
                }\r
@@ -143,7 +143,7 @@ setup_duplicate_socket(
        socket_info->port = get_port_from_ip_address( dup_info->local_addr.sin_addr );\r
        if( socket_info->port == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("incoming destination IP address not local (%s)\n",\r
                        inet_ntoa( dup_info->local_addr.sin_addr )) );\r
                ret = WSAENETDOWN;\r
@@ -153,7 +153,7 @@ setup_duplicate_socket(
        ret = ib_create_socket( socket_info );\r
        if( ret )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("ib_create socket failed with %d\n", ret) );\r
                ret = WSAENOBUFS;\r
                goto done;\r
@@ -165,7 +165,7 @@ setup_duplicate_socket(
                                                         &dest_port_guid );\r
        if( ret )\r
        {\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("query_guid_address failed for IP %08x\n",\r
+               IBSP_ERROR( ("query_guid_address failed for IP %08x\n",\r
                        socket_info->peer_addr.sin_addr.s_addr) );\r
                ret = WSAEHOSTUNREACH;\r
                goto done;\r
@@ -175,7 +175,7 @@ setup_duplicate_socket(
        ret = query_pr( socket_info->port, dest_port_guid, &path_rec );\r
        if( ret )\r
        {\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("query_pr failed for IP %08x\n",\r
+               IBSP_ERROR( ("query_pr failed for IP %08x\n",\r
                        socket_info->peer_addr.sin_addr.s_addr) );\r
                ret = WSAEHOSTUNREACH;\r
                goto done;\r
@@ -188,20 +188,20 @@ setup_duplicate_socket(
        ret = ib_connect( socket_info, &path_rec );\r
        if( ret != WSAEWOULDBLOCK )\r
        {\r
-               CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("ib_connect failed (%d)\n", ret) );\r
+               IBSP_ERROR( ("ib_connect failed (%d)\n", ret) );\r
                goto done;\r
        }\r
 \r
        if( WaitForSingleObject( socket_info->h_event, INFINITE ) != WAIT_OBJECT_0 )\r
        {\r
-               CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("WaitForSingleObject failed\n") );\r
+               IBSP_ERROR( ("WaitForSingleObject failed\n") );\r
        }\r
 \r
        cl_spinlock_acquire( &socket_info->mutex );\r
        if( socket_info->socket_state != IBSP_CONNECTED )\r
        {\r
                cl_spinlock_release( &socket_info->mutex );\r
-               CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("Failed to connect\n") );\r
+               IBSP_ERROR( ("Failed to connect\n") );\r
                ret = WSAEHOSTUNREACH;\r
                goto done;\r
        }\r
@@ -219,7 +219,7 @@ done:
                socket_info->h_event = NULL;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CONN );\r
 \r
        return ret;\r
 }\r
@@ -284,7 +284,7 @@ prepare_duplicate_socket(
 \r
                if( socket_info->duplicate.mmap_handle == NULL )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("CreateFileMapping failed with %d\n", GetLastError()) );\r
                        return WSAENETDOWN;\r
                }\r
@@ -307,7 +307,7 @@ prepare_duplicate_socket(
                                                                 0 );   // default: map entire file\r
                if( dup_info == NULL )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("MapViewOfFile failed with %d\n", GetLastError()) );\r
                        CloseHandle( socket_info->duplicate.mmap_handle );\r
                        socket_info->duplicate.mmap_handle = NULL;\r
@@ -317,7 +317,7 @@ prepare_duplicate_socket(
 \r
        if( dup_info == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("failed to get a unique identifier\n") );\r
+               IBSP_ERROR_EXIT( ("failed to get a unique identifier\n") );\r
                CloseHandle( socket_info->duplicate.mmap_handle );\r
                socket_info->duplicate.mmap_handle = NULL;\r
                return WSAENETDOWN;\r
@@ -346,6 +346,6 @@ prepare_duplicate_socket(
        dup_info->dwProcessId = dwProcessId;\r
 \r
        /* And that's it */\r
-       CL_EXIT( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CONN );\r
        return 0;\r
 }\r
index 38103a3..130d45d 100644 (file)
@@ -308,7 +308,7 @@ ib_cq_comp(
        int                                             comp_count;\r
 #endif\r
 \r
-       CL_ENTER( IBSP_DBG_WQ, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_WQ );\r
 \r
        CL_ASSERT( WC_LIST_SIZE >= 1 );\r
 \r
@@ -326,7 +326,7 @@ ib_cq_comp(
 \r
                status = ib_poll_cq( cq_tinfo->cq, &free_wclist, &done_wclist );\r
 \r
-               CL_TRACE( IBSP_DBG_WQ, gdbg_lvl,\r
+               IBSP_TRACE( IBSP_DBG_WQ,\r
                        ("%s():%d:0x%x:0x%x: poll CQ got status %d, free=%p, done=%p\n",\r
                        __FUNCTION__, __LINE__, GetCurrentProcessId(), GetCurrentThreadId(),\r
                        status, free_wclist, done_wclist) );\r
@@ -340,12 +340,12 @@ ib_cq_comp(
                case IB_INVALID_CQ_HANDLE:\r
                        /* This happens when the switch closes the socket while the \r
                         * execution thread was calling lpWPUCompleteOverlappedRequest. */\r
-                       CL_ERROR( IBSP_DBG_WQ, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("ib_poll_cq returned IB_INVLALID_CQ_HANDLE\n") );\r
                        goto done;\r
 \r
                default:\r
-                       CL_ERROR( IBSP_DBG_WQ, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("ib_poll_cq failed returned %s\n", ib_get_err_str( status )) );\r
                        break;\r
                }\r
@@ -401,7 +401,7 @@ ib_cq_comp(
        status = ib_rearm_cq( cq_tinfo->cq, FALSE );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_WQ, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("ib_rearm_cq returned %s)\n", ib_get_err_str( status )) );\r
        }\r
 \r
@@ -414,7 +414,7 @@ done:
                         GetCurrentThreadId(), g_ibsp.overlap_h0_count, g_ibsp.overlap_h1_count));\r
 #endif\r
 \r
-       CL_EXIT( IBSP_DBG_WQ, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_WQ );\r
 }\r
 \r
 \r
@@ -426,7 +426,7 @@ ib_cq_thread(
        struct cq_thread_info *cq_tinfo = (struct cq_thread_info *)lpParameter;\r
        cl_status_t cl_status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
 \r
        fzprint(("%s():%d:0x%x:0x%x: cq_tinfo=0x%p\n", __FUNCTION__,\r
@@ -437,7 +437,7 @@ ib_cq_thread(
                cl_status = cl_waitobj_wait_on( cq_tinfo->cq_waitobj, EVENT_NO_TIMEOUT, TRUE );\r
                if( cl_status != CL_SUCCESS )\r
                {\r
-                       CL_ERROR( IBSP_DBG_EP, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("cl_waitobj_wait_on() (%d)\n", cl_status) );\r
                }\r
 \r
@@ -461,12 +461,12 @@ ib_cq_thread(
        cl_status = cl_waitobj_destroy( cq_tinfo->cq_waitobj );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("cl_waitobj_destroy() (%d)\n", cl_status) );\r
+               IBSP_ERROR( ("cl_waitobj_destroy() (%d)\n", cl_status) );\r
        }\r
        HeapFree( g_ibsp.heap, 0, cq_tinfo );\r
 \r
        /* No special exit code, even on errors. */\r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        ExitThread( 0 );\r
 }\r
 \r
@@ -481,13 +481,13 @@ ib_alloc_cq_tinfo(
        cl_status_t cl_status;\r
        int error;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        cq_tinfo = HeapAlloc( g_ibsp.heap, HEAP_ZERO_MEMORY, sizeof(struct cq_thread_info) );\r
 \r
        if( cq_tinfo == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("HeapAlloc() Failed.\n") );\r
+               IBSP_ERROR( ("HeapAlloc() Failed.\n") );\r
                error = TRUE;\r
                goto done;\r
        }\r
@@ -496,7 +496,7 @@ ib_alloc_cq_tinfo(
        if( cl_status != CL_SUCCESS )\r
        {\r
                cq_tinfo->cq_waitobj = NULL;\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("cl_waitobj_create() (%d)\n", cl_status) );\r
+               IBSP_ERROR( ("cl_waitobj_create() (%d)\n", cl_status) );\r
                error = TRUE;\r
                goto done;\r
        }\r
@@ -509,7 +509,7 @@ ib_alloc_cq_tinfo(
 \r
        if( cq_tinfo->ib_cq_thread == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("CreateThread failed.") );\r
+               IBSP_ERROR( ("CreateThread failed.") );\r
                error = TRUE;\r
                goto done;\r
        }\r
@@ -527,7 +527,7 @@ ib_alloc_cq_tinfo(
                &cq_tinfo->cq );\r
        if( status )\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_create_cq failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_create_cq failed (%d)\n", status) );\r
                error = TRUE;\r
                goto done;\r
        }\r
@@ -537,7 +537,7 @@ ib_alloc_cq_tinfo(
        status = ib_rearm_cq( cq_tinfo->cq, FALSE );\r
        if( status )\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_rearm_cq failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_rearm_cq failed (%d)\n", status) );\r
                error = TRUE;\r
                goto done;\r
        }\r
@@ -558,7 +558,7 @@ done:
                cq_tinfo = NULL;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 \r
        return (cq_tinfo);\r
 }\r
@@ -574,7 +574,7 @@ ib_destroy_cq_tinfo(
        ib_api_status_t status;\r
        HANDLE h_cq_thread;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        if( cq_tinfo == NULL )\r
        {\r
@@ -588,14 +588,14 @@ ib_destroy_cq_tinfo(
 \r
                while( ib_poll_cq( cq_tinfo->cq, &free_wclist, &done_wclist ) == IB_SUCCESS )\r
                {\r
-                       CL_TRACE( IBSP_DBG_WQ, gdbg_lvl, ("%s():%d:0x%x:0x%x: free=%p, done=%p\n",\r
+                       IBSP_TRACE( IBSP_DBG_WQ, ("%s():%d:0x%x:0x%x: free=%p, done=%p\n",\r
                                __FUNCTION__,\r
                                __LINE__, GetCurrentProcessId(),\r
                                GetCurrentThreadId(),\r
                                free_wclist, done_wclist) );\r
                }\r
 \r
-               CL_TRACE( IBSP_DBG_WQ, gdbg_lvl, ("%s():%d:0x%x:0x%x: ib_destroy_cq() start..\n",\r
+               IBSP_TRACE( IBSP_DBG_WQ, ("%s():%d:0x%x:0x%x: ib_destroy_cq() start..\n",\r
                        __FUNCTION__,\r
                        __LINE__, GetCurrentProcessId(),\r
                        GetCurrentThreadId()) );\r
@@ -606,11 +606,11 @@ ib_destroy_cq_tinfo(
                status = ib_destroy_cq( cq_tinfo->cq, ib_sync_destroy );\r
                if( status )\r
                {\r
-                       CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_destroy_cq failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_destroy_cq failed (%d)\n", status) );\r
                }\r
                else\r
                {\r
-                       CL_TRACE( IBSP_DBG_WQ, gdbg_lvl,\r
+                       IBSP_TRACE( IBSP_DBG_WQ,\r
                                ("%s():%d:0x%x:0x%x: ib_destroy_cq() finished.\n", __FUNCTION__,\r
                                __LINE__, GetCurrentProcessId(), GetCurrentThreadId()) );\r
 \r
@@ -641,7 +641,7 @@ ib_destroy_cq_tinfo(
                                         cq_tinfo->ib_cq_thread_id ));\r
                        if( WaitForSingleObject( h_cq_thread, INFINITE ) != WAIT_OBJECT_0 )\r
                        {\r
-                               CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("WaitForSingleObject failed\n") );\r
+                               IBSP_ERROR( ("WaitForSingleObject failed\n") );\r
                        }\r
                        else\r
                        {\r
@@ -668,7 +668,7 @@ ib_destroy_cq_tinfo(
                HeapFree( g_ibsp.heap, 0, cq_tinfo );\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -679,7 +679,7 @@ ib_acquire_cq_tinfo(
        struct cq_thread_info *cq_tinfo = NULL;\r
        uint32_t current_cqe_size;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        /* \r
         * TODO: If future implementations require more than 1 cq_tinfo per HCA, then\r
@@ -690,7 +690,7 @@ ib_acquire_cq_tinfo(
                cq_tinfo = ib_alloc_cq_tinfo( hca );\r
                if( cq_tinfo == NULL )\r
                {\r
-                       CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("ib_alloc_cq_tinfo() failed\n") );\r
+                       IBSP_ERROR( ("ib_alloc_cq_tinfo() failed\n") );\r
                        return (NULL);\r
                }\r
        }\r
@@ -716,7 +716,7 @@ ib_acquire_cq_tinfo(
                         * more than one cq per HCA in the future.\r
                         */\r
                        cl_atomic_dec( &cq_tinfo->qp_count );\r
-                       CL_EXIT_ERROR( IBSP_DBG_EP, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("ib_modify_cq() failed. (%d)\n", status) );\r
                        return (NULL);\r
                }\r
@@ -731,7 +731,7 @@ ib_acquire_cq_tinfo(
                }\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 \r
        return (cq_tinfo);\r
 }\r
@@ -740,13 +740,13 @@ void
 ib_release_cq_tinfo(\r
                                        struct cq_thread_info           *cq_tinfo )\r
 {\r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        cl_atomic_dec( &cq_tinfo->qp_count );\r
 \r
        /* TODO: downsize the cq  */\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -756,7 +756,7 @@ ib_release(void)
 {\r
        cl_fmap_item_t                  *p_item;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        if( g_ibsp.al_handle )\r
        {\r
@@ -788,11 +788,11 @@ ib_release(void)
                                 status));\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_close_al failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_close_al failed (%d)\n", status) );\r
                }\r
                else\r
                {\r
-                       CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("ib_close_al success\n") );\r
+                       IBSP_TRACE( IBSP_DBG_HW, ("ib_close_al success\n") );\r
                        STAT_DEC( al_num );\r
                }\r
                g_ibsp.al_handle = NULL;\r
@@ -808,7 +808,7 @@ ib_release(void)
                        PARENT_STRUCT(p_item, struct ibsp_ip_addr, item) );\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -819,7 +819,7 @@ ibsp_initialize(void)
        ib_api_status_t status;\r
        int ret;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        CL_ASSERT( g_ibsp.al_handle == NULL );\r
        CL_ASSERT( cl_qlist_count( &g_ibsp.hca_list ) == 0 );\r
@@ -827,11 +827,11 @@ ibsp_initialize(void)
        /* Open the IB library */\r
        status = ib_open_al( &g_ibsp.al_handle );\r
 \r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("open is %d %p\n", status, g_ibsp.al_handle) );\r
+       IBSP_TRACE( IBSP_DBG_HW, ("open is %d %p\n", status, g_ibsp.al_handle) );\r
 \r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_open_al failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_open_al failed (%d)\n", status) );\r
                ret = WSAEPROVIDERFAILEDINIT;\r
                goto done;\r
        }\r
@@ -842,7 +842,7 @@ ibsp_initialize(void)
        status = register_pnp();\r
        if( status )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("register_pnp failed (%d)\n", status) );\r
+               IBSP_ERROR( ("register_pnp failed (%d)\n", status) );\r
                ret = WSAEPROVIDERFAILEDINIT;\r
                goto done;\r
        }\r
@@ -860,7 +860,7 @@ done:
                ib_release();\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 \r
        return ret;\r
 }\r
@@ -873,18 +873,18 @@ ib_destroy_socket(
 {\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_EP );\r
 \r
        if( socket_info->qp )\r
        {\r
                status = ib_destroy_qp( socket_info->qp, ib_sync_destroy );\r
                if( status )\r
                {\r
-                       CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_destroy_qp failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_destroy_qp failed (%d)\n", status) );\r
                }\r
                else\r
                {\r
-                       CL_TRACE( IBSP_DBG_WQ, gdbg_lvl,\r
+                       IBSP_TRACE( IBSP_DBG_WQ,\r
                                ("%s():%d:0x%x:0x%x: ib_destroy_qp() finished\n", __FUNCTION__,\r
                                __LINE__, GetCurrentProcessId(), GetCurrentThreadId()) );\r
 \r
@@ -896,7 +896,7 @@ ib_destroy_socket(
                }\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_EP );\r
 }\r
 \r
 \r
@@ -914,7 +914,7 @@ ib_create_socket(
        struct ibsp_hca                 *hca;\r
        ib_qp_attr_t                    qp_attr;\r
 \r
-       CL_ENTER( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_EP );\r
 \r
        CL_ASSERT( socket_info != NULL );\r
        CL_ASSERT( socket_info->port != NULL );\r
@@ -927,7 +927,7 @@ ib_create_socket(
        cq_tinfo = ib_acquire_cq_tinfo( hca );\r
        if( cq_tinfo == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_acquire_cq_tinfo failed\n") );\r
+               IBSP_ERROR( ("ib_acquire_cq_tinfo failed\n") );\r
                ret = WSAEPROVIDERFAILEDINIT;\r
                goto done;\r
        }\r
@@ -948,7 +948,7 @@ ib_create_socket(
                &socket_info->qp );\r
        if( status )\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_create_qp failed (%d)\n", status));\r
+               IBSP_ERROR( ("ib_create_qp failed (%d)\n", status));\r
                ret = WSAEPROVIDERFAILEDINIT;\r
                goto done;\r
        }\r
@@ -960,7 +960,7 @@ ib_create_socket(
        }\r
        else\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("ib_query_qp returned %s\n", ib_get_err_str( status )) );\r
                socket_info->max_inline = 0;\r
        }\r
@@ -975,7 +975,7 @@ ib_create_socket(
                ib_destroy_socket( socket_info );\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_EP );\r
 \r
        return ret;\r
 }\r
@@ -985,11 +985,11 @@ void
 wait_cq_drain(\r
        IN      OUT                     struct ibsp_socket_info         *socket_info )\r
 {\r
-       CL_ENTER( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_EP );\r
 \r
        if( socket_info->cq_tinfo == NULL )\r
        {\r
-               CL_EXIT( IBSP_DBG_EP, gdbg_lvl );\r
+               IBSP_EXIT( IBSP_DBG_EP );\r
                return;\r
        }\r
 \r
@@ -1003,7 +1003,7 @@ wait_cq_drain(
                Sleep(100);\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_EP );\r
 }\r
 \r
 \r
@@ -1016,7 +1016,7 @@ ibsp_dup_overlap_abort(
        int ret;\r
        uint8_t                         idx;\r
 \r
-       CL_ENTER( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_EP );\r
        CL_ASSERT( !socket_info->send_cnt && !socket_info->recv_cnt );\r
 \r
        /* Browse the list of all posted overlapped structures\r
@@ -1088,7 +1088,7 @@ ibsp_dup_overlap_abort(
                cl_atomic_dec( &socket_info->dup_cnt );\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_EP );\r
 }\r
 \r
 \r
@@ -1099,7 +1099,7 @@ shutdown_and_destroy_socket_info(
 {\r
        enum ibsp_socket_state  old_state;\r
 \r
-       CL_ENTER( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_EP );\r
 \r
        cl_spinlock_acquire( &socket_info->mutex );\r
        old_state = socket_info->socket_state;\r
@@ -1167,7 +1167,7 @@ shutdown_and_destroy_socket_info(
        /* Release the initial reference and clean up. */\r
        deref_socket_info( socket_info );\r
 \r
-       CL_EXIT( IBSP_DBG_EP, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_EP );\r
 }\r
 \r
 \r
index 27f547f..0ad6960 100644 (file)
@@ -80,15 +80,15 @@ query_ip_address_callback(
                (struct ip_query_context * __ptr64)p_query_rec->query_context;\r
        cl_fmap_item_t                          *p_item;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
+       IBSP_TRACE( IBSP_DBG_HW,\r
                ("status is %s\n", ib_get_err_str( p_query_rec->status )) );\r
 \r
        if( p_query_rec->status == IB_SUCCESS )\r
        {\r
                unsigned int i;\r
 \r
-               CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("got %d records\n", p_query_rec->result_cnt) );\r
+               IBSP_TRACE( IBSP_DBG_HW, ("got %d records\n", p_query_rec->result_cnt) );\r
 \r
                for( i = 0; i < p_query_rec->result_cnt; i++ )\r
                {\r
@@ -100,7 +100,7 @@ query_ip_address_callback(
                                HeapAlloc( g_ibsp.heap, HEAP_ZERO_MEMORY, sizeof(struct ibsp_ip_addr) );\r
                        if( !ip_addr )\r
                        {\r
-                               CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl, ("no memory\n") );\r
+                               IBSP_ERROR_EXIT( ("no memory\n") );\r
                                break;\r
                        }\r
 \r
@@ -114,26 +114,26 @@ query_ip_address_callback(
                        if( p_item != &ip_addr->item )\r
                        {\r
                                /* Duplicate!  Should never happen. */\r
-                               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+                               IBSP_ERROR(\r
                                        ("Got duplicate addr %s\n", inet_ntoa( ip_addr->ip_addr )) );\r
                                HeapFree( g_ibsp.heap, 0, ip_addr );\r
                                continue;\r
                        }\r
 \r
-                       CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
+                       IBSP_TRACE( IBSP_DBG_HW,\r
                                ("  Got addr %s\n", inet_ntoa( ip_addr->ip_addr )) );\r
                }\r
        }\r
        else if( p_query_rec->p_result_mad )\r
        {\r
-               CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("SA status is %x\n",\r
+               IBSP_TRACE( IBSP_DBG_HW, ("SA status is %x\n",\r
                        p_query_rec->p_result_mad->p_mad_buf->status) );\r
        }\r
 \r
        if( p_query_rec->p_result_mad )\r
                ib_put_mad( p_query_rec->p_result_mad );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -150,7 +150,7 @@ query_ip_address(
        ib_query_req_t query_req;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        /* The list must be initialized and empty */\r
        CL_ASSERT( !cl_fmap_count( p_ip_map ) );\r
@@ -189,14 +189,14 @@ query_ip_address(
 \r
        if( status != IB_SUCCESS && status != IB_INVALID_GUID )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_query failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_query failed (%d)\n", status) );\r
                CL_ASSERT( !cl_fmap_count( p_ip_map ) );\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("Failed to build list of IP addr for port %016I64x\n",\r
                        CL_HTON64( p_port->guid )) );\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl, ("query_ip_address failed\n") );\r
+               IBSP_ERROR_EXIT( ("query_ip_address failed\n") );\r
                return 1;\r
        }\r
 \r
@@ -204,7 +204,7 @@ query_ip_address(
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), status));\r
 \r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        return 0;\r
 }\r
 \r
@@ -227,7 +227,7 @@ update_ip_addresses(
        ret = query_ip_address( port, &dup_ip );\r
        if( ret )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("query_ip_address failed (%d)\n", ret) );\r
                return 1;\r
        }\r
@@ -289,7 +289,7 @@ update_all_ip_addrs(void)
        struct ibsp_hca         *p_hca;\r
        struct ibsp_port        *p_port;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        cl_spinlock_acquire( &g_ibsp.hca_mutex );\r
        for( p_hca_item = cl_qlist_head( &g_ibsp.hca_list );\r
@@ -310,7 +310,7 @@ update_all_ip_addrs(void)
        }\r
        cl_spinlock_release( &g_ibsp.hca_mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 /*--------------------------------------------------------------------------*/\r
@@ -333,8 +333,8 @@ query_guid_callback(
                (struct query_guid_context * __ptr64)p_query_rec->query_context;\r
        ib_service_record_t *service_record;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
+       IBSP_TRACE( IBSP_DBG_HW,\r
                ("status is %d, count is %d\n", p_query_rec->status,\r
                p_query_rec->result_cnt) );\r
 \r
@@ -356,7 +356,7 @@ query_guid_callback(
        if( p_query_rec->p_result_mad )\r
                ib_put_mad( p_query_rec->p_result_mad );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -374,7 +374,7 @@ query_guid_address(
        ib_query_req_t query_req;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        query_req.query_type = IB_QUERY_USER_DEFINED;\r
        query_req.p_query_input = &user_query;\r
@@ -412,13 +412,13 @@ query_guid_address(
 \r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_query failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_query failed (%d)\n", status) );\r
                goto error;\r
        }\r
 \r
        if( query_context.status != IB_SUCCESS )\r
        {\r
-               CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_TRACE( IBSP_DBG_HW,\r
                        ("query success, but no GUID for IP address %x (query status %d)\n",\r
                        ip_addr, query_context.status) );\r
                goto error;\r
@@ -426,11 +426,11 @@ query_guid_address(
 \r
        *port_guid = query_context.guid;\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        return 0;\r
 \r
 error:\r
-       CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl, ("query_ip_address failed\n") );\r
+       IBSP_ERROR_EXIT( ("query_ip_address failed\n") );\r
        return 1;\r
 }\r
 \r
@@ -454,8 +454,8 @@ query_pr_callback(
                (struct query_pr_context * __ptr64)p_query_rec->query_context;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("status is %d\n", p_query_rec->status) );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
+       IBSP_TRACE( IBSP_DBG_HW, ("status is %d\n", p_query_rec->status) );\r
 \r
        if( p_query_rec->status == IB_SUCCESS && p_query_rec->result_cnt )\r
        {\r
@@ -478,7 +478,7 @@ query_pr_callback(
        if( p_query_rec->p_result_mad )\r
                status = ib_put_mad( p_query_rec->p_result_mad );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -495,7 +495,7 @@ query_pr(
        ib_query_req_t query_req;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        query_req.query_type = IB_QUERY_PATH_REC_BY_GIDS;\r
        query_req.p_query_input = &user_query;\r
@@ -514,7 +514,7 @@ query_pr(
        fzprint(("%s():%d:0x%x:0x%x: Calling ib_query()..\n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId()));\r
 \r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
+       IBSP_TRACE( IBSP_DBG_HW,\r
                ("Query for path from %I64x to %I64x\n",\r
                port->guid, dest_port_guid) );\r
 \r
@@ -522,7 +522,7 @@ query_pr(
 \r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_query failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_query failed (%d)\n", status) );\r
                goto error;\r
        }\r
 \r
@@ -531,7 +531,7 @@ query_pr(
 \r
        if( query_context.status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("query failed (%d)\n", query_context.status) );\r
+               IBSP_ERROR( ("query failed (%d)\n", query_context.status) );\r
                goto error;\r
        }\r
 \r
@@ -543,11 +543,11 @@ query_pr(
                path_rec->mtu |= IB_MTU_1024;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        return 0;\r
 \r
 error:\r
-       CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl, ("query_ip_address failed\n") );\r
+       IBSP_ERROR_EXIT( ("query_ip_address failed\n") );\r
        return 1;\r
 }\r
 \r
@@ -569,7 +569,7 @@ build_ip_list(
        struct sockaddr_in      *addr;\r
        int                                     i;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        cl_spinlock_acquire( &g_ibsp.hca_mutex );\r
        for( p_hca_item = cl_qlist_head( &g_ibsp.hca_list );\r
@@ -594,7 +594,7 @@ build_ip_list(
 \r
        num_ip = cl_fmap_count( &g_ibsp.ip_map );\r
 \r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("     num ip = %d\n", num_ip) );\r
+       IBSP_TRACE( IBSP_DBG_HW, ("     num ip = %d\n", num_ip) );\r
 \r
        /* Note: the required size computed is a few bytes larger than necessary, \r
         * but that keeps the code clean. */\r
@@ -621,7 +621,7 @@ build_ip_list(
                cl_spinlock_release( &g_ibsp.ip_mutex );\r
                *ip_list_size = (DWORD) size_req;\r
                *lpErrno = WSAEFAULT;\r
-               CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("returning efault, size %d (usually not an error)", size_req) );\r
                return SOCKET_ERROR;\r
        }\r
@@ -653,7 +653,7 @@ build_ip_list(
 \r
        cl_spinlock_release( &g_ibsp.ip_mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 \r
        lpErrno = 0;\r
        return 0;\r
@@ -669,7 +669,7 @@ get_port_from_ip_address(
        struct ibsp_ip_addr             ip;\r
        struct ibsp_port                *p_port = NULL;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        ip.ip_addr = sin_addr;\r
        ip.p_port = NULL;\r
@@ -680,10 +680,10 @@ get_port_from_ip_address(
        if( p_item != cl_fmap_end( &g_ibsp.ip_map ) )\r
                p_port = PARENT_STRUCT(p_item, struct ibsp_ip_addr, item)->p_port;\r
        else\r
-               CL_TRACE(IBSP_DBG_HW, gdbg_lvl, ("not found\n") );\r
+               IBSP_TRACE( IBSP_DBG_HW, ("not found\n") );\r
 \r
        cl_spinlock_release( &g_ibsp.ip_mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        return p_port;\r
 }\r
index 8638862..6ed5122 100644 (file)
@@ -78,7 +78,7 @@ lookup_partial_mr(
 {\r
        struct memory_node *node;\r
 \r
-       CL_ENTER( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_MEM );\r
 \r
        cl_spinlock_acquire( &mem_list->mutex );\r
 \r
@@ -87,9 +87,9 @@ lookup_partial_mr(
        cl_spinlock_release( &mem_list->mutex );\r
 \r
        if( node )\r
-               CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+               IBSP_EXIT( IBSP_DBG_MEM );\r
        else\r
-               CL_TRACE_EXIT( IBSP_DBG_MEM, gdbg_lvl, ("mr not found\n") );\r
+               IBSP_TRACE_EXIT( IBSP_DBG_MEM, ("mr not found\n") );\r
 \r
        return node;\r
 }\r
@@ -110,7 +110,7 @@ ib_register_memory(
        struct memory_node *node;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_MEM );\r
 \r
        CL_ASSERT( start != NULL );\r
        CL_ASSERT( len != 0 );\r
@@ -126,7 +126,7 @@ ib_register_memory(
        {\r
                node->refcount++;\r
                cl_spinlock_release( &mem_list->mutex );\r
-               CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+               IBSP_EXIT( IBSP_DBG_MEM );\r
                return node;\r
        }\r
 \r
@@ -137,8 +137,9 @@ ib_register_memory(
 \r
        if( node == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
-                       ("AllocateOverlappedBuf:HeapAlloc() failed: %d\n", GetLastError()) );\r
+               IBSP_ERROR_EXIT(\r
+                       ("AllocateOverlappedBuf:HeapAlloc() failed: %d\n",\r
+                       GetLastError()) );\r
                *lpErrno = WSAENOBUFS;\r
                return NULL;\r
        }\r
@@ -150,7 +151,7 @@ ib_register_memory(
        node->type.length = len;\r
        node->type.access_ctrl = access_ctrl;\r
 \r
-       CL_TRACE( IBSP_DBG_MEM, gdbg_lvl, ("pinning memory node %p\n", node) );\r
+       IBSP_TRACE( IBSP_DBG_MEM, ("pinning memory node %p\n", node) );\r
        status = ib_reg_mem( pd, &node->type, &node->lkey, &node->rkey, &node->mr_handle );\r
 \r
        if( status )\r
@@ -160,11 +161,11 @@ ib_register_memory(
 #endif\r
                if( HeapFree( g_ibsp.heap, 0, node ) == FALSE )\r
                {\r
-                       CL_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("BAD: HeapFree failed (%d)\n", GetLastError()) );\r
                }\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("ib_reg_mem failed (%d)\n", status) );\r
+               IBSP_ERROR_EXIT( ("ib_reg_mem failed (%d)\n", status) );\r
 \r
                *lpErrno = WSAEFAULT;\r
                return NULL;\r
@@ -177,7 +178,7 @@ ib_register_memory(
        cl_qlist_insert_head( &mem_list->list, &node->item );\r
        cl_spinlock_release( &mem_list->mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_MEM );\r
 \r
        *lpErrno = 0;\r
        return node;\r
@@ -195,14 +196,14 @@ ib_deregister_memory(
        ib_api_status_t status;\r
 #endif\r
 \r
-       CL_ENTER( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_MEM );\r
 \r
        cl_spinlock_acquire( &mem_list->mutex );\r
 \r
        if( node->refcount <= 0 )\r
        {\r
                cl_spinlock_release( &mem_list->mutex );\r
-               CL_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("ib_deregister_memory: bad refcount %d)\n", node->refcount) );\r
                *lpErrno = WSAEINVAL;\r
                return SOCKET_ERROR;\r
@@ -215,7 +216,7 @@ ib_deregister_memory(
                status = ib_dereg_mr( node->mr_handle );\r
                if( status )\r
                {\r
-                       CL_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("ib_dereg_mr failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_dereg_mr failed (%d)\n", status) );\r
                }\r
                else\r
                {\r
@@ -227,7 +228,7 @@ ib_deregister_memory(
 #endif\r
                if( HeapFree( g_ibsp.heap, 0, node ) == FALSE )\r
                {\r
-                       CL_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("BAD: HeapFree failed (%d)\n", GetLastError()) );\r
                }\r
        }\r
@@ -238,7 +239,7 @@ ib_deregister_memory(
 \r
        cl_spinlock_release( &mem_list->mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_MEM );\r
 \r
        *lpErrno = 0;\r
        return 0;\r
@@ -254,7 +255,7 @@ ib_deregister_all_mr(
 {\r
        cl_list_item_t *item;\r
 \r
-       CL_ENTER( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_MEM );\r
 \r
        cl_spinlock_acquire( &mem_list->mutex );\r
 \r
@@ -263,11 +264,11 @@ ib_deregister_all_mr(
                struct memory_node *node = PARENT_STRUCT(item, struct memory_node, item);\r
                ib_api_status_t status;\r
 \r
-               CL_TRACE( IBSP_DBG_MEM, gdbg_lvl, ("unpinning ,memory node node %p\n", node) );\r
+               IBSP_TRACE( IBSP_DBG_MEM, ("unpinning ,memory node node %p\n", node) );\r
                status = ib_dereg_mr( node->mr_handle );\r
                if( status )\r
                {\r
-                       CL_ERROR( IBSP_DBG_MEM, gdbg_lvl, ("ib_dereg_mem failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_dereg_mem failed (%d)\n", status) );\r
                }\r
                else\r
                {\r
@@ -280,12 +281,12 @@ ib_deregister_all_mr(
 \r
                if( HeapFree( g_ibsp.heap, 0, node ) == FALSE )\r
                {\r
-                       CL_ERROR( IBSP_DBG_MEM, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("BAD: HeapFree failed (%d)\n", GetLastError()) );\r
                }\r
        }\r
 \r
        cl_spinlock_release( &mem_list->mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_MEM, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_MEM );\r
 }\r
index f880b01..77f4074 100644 (file)
@@ -74,12 +74,12 @@ pnp_ca_add(
        struct ibsp_hca *hca;\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        hca = HeapAlloc( g_ibsp.heap, HEAP_ZERO_MEMORY, sizeof(struct ibsp_hca) );\r
        if( hca == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("can't get enough memory (%d)\n", sizeof(struct ibsp_hca)) );\r
                status = IB_INSUFFICIENT_MEMORY;\r
                goto pnp_ca_add_err1;\r
@@ -93,14 +93,14 @@ pnp_ca_add(
        cl_spinlock_init( &hca->rdma_mem_list.mutex );\r
 \r
        /* HCA handle */\r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
+       IBSP_TRACE( IBSP_DBG_HW,\r
                         ("handle is %p %016I64x\n", g_ibsp.al_handle, hca->guid) );\r
        status =\r
                ib_open_ca( g_ibsp.al_handle, hca->guid, NULL, hca, &hca->hca_handle );\r
 \r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_open_ca failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_open_ca failed (%d)\n", status) );\r
                goto pnp_ca_add_err2;\r
        }\r
 \r
@@ -112,7 +112,7 @@ pnp_ca_add(
        {\r
                STAT_INC( pd_num );\r
 \r
-               CL_TRACE( IBSP_DBG_EP, gdbg_lvl, ("allocated PD %p for HCA\n", hca->pd) );\r
+               IBSP_TRACE( IBSP_DBG_EP, ("allocated PD %p for HCA\n", hca->pd) );\r
 \r
                /* Success */\r
                cl_spinlock_acquire( &g_ibsp.hca_mutex );\r
@@ -123,7 +123,7 @@ pnp_ca_add(
        }\r
        else\r
        {\r
-               CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_alloc_pd failed (%d)\n", status) );\r
+               IBSP_ERROR( ("ib_alloc_pd failed (%d)\n", status) );\r
                if( ib_close_ca( hca->hca_handle, NULL ) == IB_SUCCESS )\r
                        STAT_DEC( ca_num );\r
 \r
@@ -133,7 +133,7 @@ pnp_ca_add_err2:
        }\r
 pnp_ca_add_err1:\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        return status;\r
 }\r
 \r
@@ -146,7 +146,7 @@ pnp_ca_remove(
        ib_api_status_t status;\r
        cl_list_item_t  *p_item;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        /*\r
         * Remove all the ports\r
@@ -171,7 +171,7 @@ pnp_ca_remove(
                 */\r
                status = ib_dealloc_pd( hca->pd, NULL );\r
                if( status )\r
-                       CL_ERROR( IBSP_DBG_EP, gdbg_lvl, ("ib_dealloc_pd failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_dealloc_pd failed (%d)\n", status) );\r
                else\r
                        STAT_DEC( pd_num );\r
 \r
@@ -182,7 +182,7 @@ pnp_ca_remove(
        {\r
                status = ib_close_ca( hca->hca_handle, ib_sync_destroy );\r
                if( status != IB_SUCCESS )\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_close_ca failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_close_ca failed (%d)\n", status) );\r
 \r
                hca->hca_handle = NULL;\r
        }\r
@@ -197,7 +197,7 @@ pnp_ca_remove(
 \r
        HeapFree( g_ibsp.heap, 0, hca );\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -209,24 +209,24 @@ pnp_port_add(
        struct ibsp_hca *hca;\r
        struct ibsp_port *port;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        hca = lookup_hca( p_port_rec->p_ca_attr->ca_guid );\r
        if( !hca )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("Failed to lookup HCA (%016I64x) for new port (%016I64x)\n",\r
                        p_port_rec->p_ca_attr->ca_guid, p_port_rec->p_port_attr->port_guid) );\r
-               CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+               IBSP_EXIT( IBSP_DBG_HW );\r
                return IB_INVALID_GUID;\r
        }\r
 \r
        port = HeapAlloc( g_ibsp.heap, HEAP_ZERO_MEMORY, sizeof(struct ibsp_port) );\r
        if( port == NULL )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                                 ("HeapAlloc failed (%d)\n", sizeof(struct ibsp_port)) );\r
-               CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+               IBSP_EXIT( IBSP_DBG_HW );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -239,7 +239,7 @@ pnp_port_add(
        cl_spinlock_release( &hca->port_lock );\r
        p_port_rec->pnp_rec.context = port;\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -249,7 +249,7 @@ static void
 pnp_port_remove(\r
        IN                              struct ibsp_port* const         port )\r
 {\r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        if( !port )\r
                goto done;\r
@@ -264,7 +264,7 @@ pnp_port_remove(
        HeapFree( g_ibsp.heap, 0, port );\r
 \r
 done:\r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
 \r
 \r
@@ -275,8 +275,8 @@ pnp_callback(
        ib_api_status_t                 status = IB_SUCCESS;\r
        ib_pnp_port_rec_t*              p_port_rec = (ib_pnp_port_rec_t*)pnp_rec;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
-       CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("event is %x\n", pnp_rec->pnp_event) );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
+       IBSP_TRACE( IBSP_DBG_HW, ("event is %x\n", pnp_rec->pnp_event) );\r
 \r
        switch( pnp_rec->pnp_event )\r
        {\r
@@ -310,7 +310,7 @@ pnp_callback(
        case IB_PNP_GID_CHANGE:\r
        case IB_PNP_LID_CHANGE:\r
        case IB_PNP_SUBNET_TIMEOUT_CHANGE:\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("pnp_callback: unsupported event %x\n", pnp_rec->pnp_event) );\r
                break;\r
 \r
@@ -319,12 +319,12 @@ pnp_callback(
                break;\r
 \r
        default:\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("pnp_callback: unsupported event %x\n", pnp_rec->pnp_event) );\r
                break;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 \r
        return IB_SUCCESS;\r
 }\r
@@ -339,7 +339,7 @@ register_pnp(void)
        ib_api_status_t status;\r
        ib_pnp_req_t pnp_req;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        pnp_req.pnp_class = IB_PNP_CA;\r
        pnp_req.pnp_context = NULL;\r
@@ -347,7 +347,7 @@ register_pnp(void)
        status = ib_reg_pnp( g_ibsp.al_handle, &pnp_req, &g_ibsp.pnp_handle_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("register_pnp: ib_reg_pnp for PORT failed (%d)\n", status) );\r
                goto done;\r
        }\r
@@ -358,7 +358,7 @@ register_pnp(void)
        status = ib_reg_pnp( g_ibsp.al_handle, &pnp_req, &g_ibsp.pnp_handle_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+               IBSP_ERROR(\r
                        ("register_pnp: ib_reg_pnp for PORT failed (%d)\n", status) );\r
                goto done;\r
        }\r
@@ -371,7 +371,7 @@ done:
                unregister_pnp();\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 \r
        return status;\r
 }\r
@@ -383,14 +383,14 @@ unregister_pnp(void)
 {\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_HW );\r
 \r
        if( g_ibsp.pnp_handle_port )\r
        {\r
                status = ib_dereg_pnp( g_ibsp.pnp_handle_port, ib_sync_destroy );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("unregister_pnp: ib_dereg_pnp for PORT failed (%d)\n", status) );\r
                }\r
 \r
@@ -402,12 +402,12 @@ unregister_pnp(void)
                status = ib_dereg_pnp( g_ibsp.pnp_handle_ca, ib_sync_destroy );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                ("unregister_pnp: ib_dereg_pnp for PORT failed (%d)\n", status) );\r
                }\r
 \r
                g_ibsp.pnp_handle_ca = NULL;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_HW );\r
 }\r
index 8d65528..57efd2f 100644 (file)
@@ -64,7 +64,7 @@ _DllMain(
        TCHAR   env_var[16];\r
        DWORD   i;\r
 \r
-       CL_ENTER( IBSP_DBG_DLL, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_DLL );\r
 \r
        UNUSED_PARAM( hinstDll );\r
        UNUSED_PARAM( lpvReserved );\r
@@ -80,7 +80,7 @@ _DllMain(
                char buf[64];\r
                if( GetEnvironmentVariable( "IBSPLOAD", buf, sizeof(buf) ) == 0 )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_DLL, gdbg_lvl, ("IBSPLOAD not defined:\n") );\r
+                       IBSP_ERROR_EXIT( ("IBSPLOAD not defined:\n") );\r
 \r
                        return FALSE;\r
                }\r
@@ -90,7 +90,7 @@ _DllMain(
        switch( dwReason )\r
        {\r
        case DLL_PROCESS_ATTACH:\r
-               CL_TRACE( IBSP_DBG_DLL, gdbg_lvl, ("DllMain: DLL_PROCESS_ATTACH\n") );\r
+               IBSP_TRACE( IBSP_DBG_DLL, ("DllMain: DLL_PROCESS_ATTACH\n") );\r
 \r
 #ifdef _DEBUG_\r
                i = GetEnvironmentVariable( "IBWSD_DBG", env_var, 16 );\r
@@ -115,15 +115,15 @@ _DllMain(
                break;\r
 \r
        case DLL_THREAD_ATTACH:\r
-               CL_TRACE( IBSP_DBG_DLL, gdbg_lvl, ("DllMain: DLL_THREAD_ATTACH\n") );\r
+               IBSP_TRACE( IBSP_DBG_DLL, ("DllMain: DLL_THREAD_ATTACH\n") );\r
                break;\r
 \r
        case DLL_THREAD_DETACH:\r
-               CL_TRACE( IBSP_DBG_DLL, gdbg_lvl, ("DllMain: DLL_THREAD_DETACH\n") );\r
+               IBSP_TRACE( IBSP_DBG_DLL, ("DllMain: DLL_THREAD_DETACH\n") );\r
                break;\r
 \r
        case DLL_PROCESS_DETACH:\r
-               CL_TRACE( IBSP_DBG_DLL, gdbg_lvl, ("DllMain: DLL_PROCESS_DETACH\n") );\r
+               IBSP_TRACE( IBSP_DBG_DLL, ("DllMain: DLL_PROCESS_DETACH\n") );\r
 \r
 #ifdef _DEBUG_\r
                {\r
@@ -141,36 +141,36 @@ _DllMain(
 \r
                        cl_spinlock_release( &g_ibsp.socket_info_mutex );\r
 \r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl, ("Statistics:\n") );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR( ("Statistics:\n") );\r
+                       IBSP_ERROR(\r
                                         ("  overlap_h0_count = %d\n", g_ibsp.overlap_h0_count) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  max_comp_count = %d\n", g_ibsp.max_comp_count) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  overlap_h1_count = %d\n", g_ibsp.overlap_h1_count) );\r
 \r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl, ("  send_count = %d\n", g_ibsp.send_count) );\r
+                       IBSP_ERROR( ("  send_count = %d\n", g_ibsp.send_count) );\r
 \r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of QPs left = %d\n", g_ibsp.qp_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of CQs left = %d\n", g_ibsp.cq_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of PDs left = %d\n", g_ibsp.pd_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of ALs left = %d\n", g_ibsp.al_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of MRs left = %d\n", g_ibsp.mr_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of listens left = %d\n", g_ibsp.listen_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of PNPs left = %d\n", g_ibsp.pnp_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of threads left = %d\n", g_ibsp.thread_num) );\r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  number of WPU sockets left = %d\n", g_ibsp.wpusocket_num) );\r
 \r
-                       CL_ERROR( IBSP_DBG_DLL, gdbg_lvl,\r
+                       IBSP_ERROR(\r
                                         ("  CloseSocket_count = %d\n", g_ibsp.CloseSocket_count) );\r
 \r
                }\r
@@ -179,7 +179,7 @@ _DllMain(
                break;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_DLL, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_DLL );\r
 \r
        return TRUE;\r
 }\r
@@ -286,7 +286,7 @@ IBSPAccept(
                return INVALID_SOCKET;\r
        }\r
 \r
-       CL_TRACE( IBSP_DBG_CONN, gdbg_lvl,\r
+       IBSP_TRACE( IBSP_DBG_CONN,\r
                ("IBSPAccept: Found pending connection on this socket\n") );\r
 \r
        incoming = PARENT_STRUCT(cl_qlist_head( &socket_info->listen.list ),\r
@@ -324,7 +324,7 @@ reject:
                ib_reject( incoming->cm_req_received.h_cm_req, IB_REJ_INSUF_QP );\r
 \r
                HeapFree( g_ibsp.heap, 0, incoming );\r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("bad incoming parameter\n") );\r
+               IBSP_ERROR_EXIT( ("bad incoming parameter\n") );\r
                *lpErrno = WSAECONNREFUSED;\r
                return INVALID_SOCKET;\r
        }\r
@@ -400,7 +400,7 @@ reject:
        {\r
                cl_spinlock_release( &socket_info->mutex );\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("create_socket_info return NULL\n") );\r
+               IBSP_ERROR_EXIT( ("create_socket_info return NULL\n") );\r
                *lpErrno = WSAENOBUFS;\r
                return INVALID_SOCKET;\r
        }\r
@@ -412,7 +412,7 @@ reject:
        {\r
                cl_spinlock_release( &socket_info->mutex );\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("WPUCreateSocketHandle() failed: %d", *lpErrno) );\r
                free_socket_info( new_socket_info );\r
                return INVALID_SOCKET;\r
@@ -431,7 +431,7 @@ reject:
        {\r
                cl_spinlock_release( &socket_info->mutex );\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("ib_create socket failed with %d\n", ret) );\r
                *lpErrno = WSAENOBUFS;\r
                return INVALID_SOCKET;\r
@@ -454,7 +454,7 @@ reject:
        memcpy( addr, &incoming->params.source, sizeof(struct sockaddr_in) );\r
        *addrlen = sizeof(struct sockaddr_in);\r
 \r
-       CL_TRACE( IBSP_DBG_CONN, gdbg_lvl, ("The socket address of connecting entity is\n") );\r
+       IBSP_TRACE( IBSP_DBG_CONN, ("The socket address of connecting entity is\n") );\r
        DebugPrintSockAddr( IBSP_DBG_CONN, gdbg_lvl, &incoming->params.source );\r
 \r
        new_socket_info->peer_addr = incoming->params.source;\r
@@ -498,7 +498,7 @@ reject:
                HeapFree( g_ibsp.heap, 0, incoming );\r
                *lpErrno = ret;\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("ib_accept failed (%d)\n", ret) );\r
+               IBSP_ERROR_EXIT( ("ib_accept failed (%d)\n", ret) );\r
 \r
                return INVALID_SOCKET;\r
        }\r
@@ -564,7 +564,7 @@ reject:
                        CloseHandle( new_socket_info->h_event );\r
                        new_socket_info->h_event = NULL;\r
 \r
-                       CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("wait for ib_accept failed\n") );\r
+                       IBSP_ERROR_EXIT( ("wait for ib_accept failed\n") );\r
 \r
                        *lpErrno = WSAEACCES;\r
                        return INVALID_SOCKET;\r
@@ -593,12 +593,12 @@ IBSPBind(
        struct ibsp_port *port;\r
        int ret;\r
 \r
-       CL_ENTER( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CONN );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
 \r
-       CL_TRACE( IBSP_DBG_CONN, gdbg_lvl, ("Address to bind to:\n") );\r
+       IBSP_TRACE( IBSP_DBG_CONN, ("Address to bind to:\n") );\r
        DebugPrintSockAddr( IBSP_DBG_CONN, gdbg_lvl, addr );\r
 \r
        fzprint(("binding to IP %s\n", inet_ntoa( addr->sin_addr )));\r
@@ -675,12 +675,12 @@ IBSPBind(
 \r
        cl_spinlock_release( &socket_info->mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CONN );\r
        return 0;\r
 \r
 error:\r
        CL_ASSERT( *lpErrno != 0 );\r
-       CL_TRACE_EXIT( IBSP_DBG_CONN, gdbg_lvl, ("failed with error %d\n", *lpErrno) );\r
+       IBSP_TRACE_EXIT( IBSP_DBG_CONN, ("failed with error %d\n", *lpErrno) );\r
        return SOCKET_ERROR;\r
 }\r
 \r
@@ -700,14 +700,14 @@ IBSPCloseSocket(
 {\r
        struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s;\r
 \r
-       CL_ENTER( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CONN );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
 \r
        if( s == INVALID_SOCKET )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_WQ, gdbg_lvl, ("invalid socket handle %x\n", s) );\r
+               IBSP_ERROR_EXIT( ("invalid socket handle %x\n", s) );\r
                *lpErrno = WSAENOTSOCK;\r
                return SOCKET_ERROR;\r
        }\r
@@ -722,7 +722,7 @@ IBSPCloseSocket(
        shutdown_and_destroy_socket_info( socket_info );\r
 \r
 \r
-       CL_EXIT( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CONN );\r
 \r
        *lpErrno = 0;\r
        return 0;\r
@@ -762,7 +762,7 @@ IBSPConnect(
                         __LINE__, GetCurrentProcessId(),\r
                         GetCurrentThreadId(), s, IBSP_SOCKET_STATE_STR( socket_info->socket_state )));\r
 \r
-       CL_TRACE( IBSP_DBG_CONN, gdbg_lvl,\r
+       IBSP_TRACE( IBSP_DBG_CONN,\r
                ("lpCallerData=%p, lpCalleeData=%p\n", lpCallerData, lpCalleeData) );\r
 \r
        /* Sanity checks */\r
@@ -806,12 +806,13 @@ IBSPConnect(
        if( ret )\r
        {\r
                IBSP_ERROR_EXIT(\r
-                       ("query_guid_address failed for IP %08x\n", addr->sin_addr.s_addr) );\r
+                       ("query_guid_address failed for IP %08x\n",\r
+                       addr->sin_addr.s_addr) );\r
                *lpErrno = WSAEADDRNOTAVAIL;\r
                return SOCKET_ERROR;\r
        }\r
 \r
-       CL_TRACE( IBSP_DBG_CONN, gdbg_lvl, ("got GUID %I64x for IP %s\n",\r
+       IBSP_TRACE( IBSP_DBG_CONN, ("got GUID %I64x for IP %s\n",\r
                CL_NTOH64( dest_port_guid ), inet_ntoa( addr->sin_addr )) );\r
 \r
        if( dest_port_guid == socket_info->port->guid )\r
@@ -900,7 +901,7 @@ IBSPDuplicateSocket(
        struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s;\r
        int ret;\r
 \r
-       CL_ENTER( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CONN );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p state=%s\n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(),\r
@@ -910,7 +911,7 @@ IBSPDuplicateSocket(
        if( socket_info->socket_state != IBSP_CONNECTED )\r
        {\r
                cl_spinlock_release( &socket_info->mutex );\r
-               CL_TRACE_EXIT( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_TRACE_EXIT( IBSP_DBG_CONN,\r
                        ("Socket state not IBSP_CONNECTED, state=%s.\n",\r
                        IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
                *lpErrno = WSAENOTCONN;\r
@@ -921,14 +922,14 @@ IBSPDuplicateSocket(
        cl_spinlock_release( &socket_info->mutex );\r
        if( ret )\r
        {\r
-               CL_TRACE_EXIT( IBSP_DBG_CONN, gdbg_lvl,\r
+               IBSP_TRACE_EXIT( IBSP_DBG_CONN,\r
                        ("prepare_duplicate_socket failed with %d\n", ret) );\r
                *lpErrno = ret;\r
                return SOCKET_ERROR;\r
        }\r
        else\r
        {\r
-               CL_EXIT( IBSP_DBG_CONN, gdbg_lvl );\r
+               IBSP_EXIT( IBSP_DBG_CONN );\r
                lpProtocolInfo->dwProviderReserved = socket_info->duplicate.identifier;\r
                *lpErrno = 0;\r
                return 0;\r
@@ -1141,21 +1142,21 @@ IBSPGetSockOpt(
 {\r
        struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s;\r
 \r
-       CL_ENTER( IBSP_DBG_OPT, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_OPT );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p\n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
 \r
        if( level != SOL_SOCKET )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl, ("invalid level %d", level) );\r
+               IBSP_ERROR_EXIT( ("invalid level %d", level) );\r
                *lpErrno = WSAENOPROTOOPT;\r
                return SOCKET_ERROR;\r
        }\r
 \r
        if( optval == NULL || optlen == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                                          ("invalid optval=%p or optlen=%p", optval, optlen) );\r
                *lpErrno = WSAEFAULT;\r
                return SOCKET_ERROR;\r
@@ -1164,10 +1165,10 @@ IBSPGetSockOpt(
        switch( optname )\r
        {\r
        case SO_DEBUG:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_DEBUG\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_DEBUG\n") );\r
                if( *optlen < sizeof(BOOL) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", *optlen) );\r
                        *optlen = sizeof(BOOL);\r
                        *lpErrno = WSAEFAULT;\r
@@ -1179,10 +1180,10 @@ IBSPGetSockOpt(
                break;\r
 \r
        case SO_GROUP_ID:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_GROUP_ID\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_GROUP_ID\n") );\r
                if( *optlen < sizeof(GROUP) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", *optlen) );\r
                        *optlen = sizeof(GROUP);\r
                        *lpErrno = WSAEFAULT;\r
@@ -1194,11 +1195,11 @@ IBSPGetSockOpt(
                break;\r
 \r
        case SO_GROUP_PRIORITY:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_GROUP_PRIORITY\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_GROUP_PRIORITY\n") );\r
 \r
                if( *optlen < sizeof(int) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", *optlen) );\r
                        *optlen = sizeof(int);\r
                        *lpErrno = WSAEFAULT;\r
@@ -1210,11 +1211,11 @@ IBSPGetSockOpt(
                break;\r
 \r
        case SO_MAX_MSG_SIZE:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_MAX_MSG_SIZE\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_MAX_MSG_SIZE\n") );\r
 \r
                if( *optlen < sizeof(unsigned int) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", *optlen) );\r
                        *optlen = sizeof(unsigned int);\r
                        *lpErrno = WSAEFAULT;\r
@@ -1226,11 +1227,11 @@ IBSPGetSockOpt(
                break;\r
 \r
        case SO_MAX_RDMA_SIZE:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_MAX_RDMA_SIZE\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_MAX_RDMA_SIZE\n") );\r
 \r
                if( *optlen < sizeof(unsigned int) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", *optlen) );\r
                        *optlen = sizeof(unsigned int);\r
                        *lpErrno = WSAEFAULT;\r
@@ -1242,11 +1243,11 @@ IBSPGetSockOpt(
                break;\r
 \r
        case SO_RDMA_THRESHOLD_SIZE:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_RDMA_THRESHOLD_SIZE\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_RDMA_THRESHOLD_SIZE\n") );\r
 \r
                if( *optlen < sizeof(unsigned int) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", *optlen) );\r
                        *optlen = sizeof(unsigned int);\r
                        *lpErrno = WSAEFAULT;\r
@@ -1261,13 +1262,13 @@ IBSPGetSockOpt(
        default:\r
                *lpErrno = WSAENOPROTOOPT;\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl, ("unknown option 0x%x\n", optname) );\r
+               IBSP_ERROR_EXIT( ("unknown option 0x%x\n", optname) );\r
 \r
                return SOCKET_ERROR;\r
                break;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_OPT, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_OPT );\r
        return 0;\r
 }\r
 \r
@@ -1285,7 +1286,7 @@ IBSPGetQOSByName(
                                        LPQOS                                           lpQOS,\r
                                        LPINT                                           lpErrno )\r
 {\r
-       CL_ENTER( IBSP_DBG_OPT, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_OPT );\r
 \r
        UNUSED_PARAM( s );\r
        UNUSED_PARAM( lpQOSName );\r
@@ -1296,7 +1297,7 @@ IBSPGetQOSByName(
 \r
        *lpErrno = WSAEOPNOTSUPP;\r
 \r
-       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl, ("not supported\n") );\r
+       IBSP_ERROR_EXIT( ("not supported\n") );\r
 \r
        return FALSE;\r
 }\r
@@ -1420,7 +1421,7 @@ IBSPIoctl(
        case SIO_SET_GROUP_QOS:\r
                /* We don't support that. dwServiceFlags1 in installSP \r
                 * wasn't set. */\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("unsupported dwIoControlCode %d\n", dwIoControlCode) );\r
                *lpErrno = WSAENOPROTOOPT;\r
                return SOCKET_ERROR;\r
@@ -1434,13 +1435,13 @@ IBSPIoctl(
                        ret = build_ip_list( (LPSOCKET_ADDRESS_LIST)lpvOutBuffer,\r
                                                                lpcbBytesReturned, lpErrno );\r
 \r
-                       CL_EXIT( IBSP_DBG_OPT, gdbg_lvl );\r
+                       IBSP_EXIT( IBSP_DBG_OPT );\r
                        return ret;\r
                }\r
                break;\r
 \r
        default:\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("invalid dwIoControlCode %d\n", dwIoControlCode) );\r
 \r
                *lpErrno = WSAENOPROTOOPT;\r
@@ -1467,14 +1468,14 @@ IBSPListen(
        struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s;\r
        int ret;\r
 \r
-       CL_ENTER( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_CONN );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p\n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
 \r
        cl_spinlock_acquire( &socket_info->mutex );\r
 \r
-       CL_TRACE( IBSP_DBG_CONN, gdbg_lvl, ("socket_state is %s\n",\r
+       IBSP_TRACE( IBSP_DBG_CONN, ("socket_state is %s\n",\r
                IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
 \r
        /* Verify the state of the socket */\r
@@ -1493,7 +1494,7 @@ IBSPListen(
                if( ret )\r
                {\r
                        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND );\r
-                       CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("ib_listen failed with %d\n", ret) );\r
+                       IBSP_ERROR_EXIT( ("ib_listen failed with %d\n", ret) );\r
                }\r
                else\r
                {\r
@@ -1518,7 +1519,7 @@ IBSPListen(
 \r
        cl_spinlock_release( &socket_info->mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_CONN, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_CONN );\r
 \r
        if( *lpErrno )\r
                return SOCKET_ERROR;\r
@@ -1999,21 +2000,21 @@ IBSPSetSockOpt(
 {\r
        struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s;\r
 \r
-       CL_ENTER( IBSP_DBG_OPT, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_OPT );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: socket=0x%p\n", __FUNCTION__,\r
                         __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s));\r
 \r
        if( level != SOL_SOCKET )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl, ("invalid level %d", level) );\r
+               IBSP_ERROR_EXIT( ("invalid level %d", level) );\r
                *lpErrno = WSAENOPROTOOPT;\r
                return SOCKET_ERROR;\r
        }\r
 \r
        if( optval == NULL )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl, ("invalid optval=%p", optval) );\r
+               IBSP_ERROR_EXIT( ("invalid optval=%p", optval) );\r
                *lpErrno = WSAEFAULT;\r
                return SOCKET_ERROR;\r
        }\r
@@ -2021,10 +2022,10 @@ IBSPSetSockOpt(
        switch( optname )\r
        {\r
        case SO_DEBUG:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_DEBUG\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_DEBUG\n") );\r
                if( optlen != sizeof(BOOL) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", optlen) );\r
                        *lpErrno = WSAEFAULT;\r
                        return SOCKET_ERROR;\r
@@ -2033,10 +2034,10 @@ IBSPSetSockOpt(
                break;\r
 \r
        case SO_GROUP_PRIORITY:\r
-               CL_TRACE( IBSP_DBG_OPT, gdbg_lvl, ("Option name SO_GROUP_PRIORITY\n") );\r
+               IBSP_TRACE( IBSP_DBG_OPT, ("Option name SO_GROUP_PRIORITY\n") );\r
                if( optlen != sizeof(int) )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("option len is invalid (0x%x)\n", optlen) );\r
                        *lpErrno = WSAEFAULT;\r
                        return SOCKET_ERROR;\r
@@ -2045,13 +2046,13 @@ IBSPSetSockOpt(
                break;\r
 \r
        default:\r
-               CL_EXIT_ERROR( IBSP_DBG_OPT, gdbg_lvl, ("invalid option %x\n", optname) );\r
+               IBSP_ERROR_EXIT( ("invalid option %x\n", optname) );\r
                *lpErrno = WSAENOPROTOOPT;\r
                return SOCKET_ERROR;\r
                break;\r
        }\r
 \r
-       CL_EXIT( IBSP_DBG_OPT, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_OPT );\r
 \r
        return 0;\r
 }\r
@@ -2215,7 +2216,7 @@ IBSPCleanup(
 {\r
        int ret = 0;\r
 \r
-       CL_ENTER( IBSP_DBG_INIT, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_INIT );\r
 \r
        cl_spinlock_acquire( &g_ibsp.mutex );\r
 \r
@@ -2225,7 +2226,7 @@ IBSPCleanup(
 \r
                *lpErrno = WSANOTINITIALISED;\r
 \r
-               CL_EXIT_ERROR( IBSP_DBG_INIT, gdbg_lvl, ("returning WSAENOTINITIALISED\n") );\r
+               IBSP_ERROR_EXIT( ("returning WSAENOTINITIALISED\n") );\r
 \r
                return SOCKET_ERROR;\r
        }\r
@@ -2233,17 +2234,17 @@ IBSPCleanup(
        /* Decrement the entry count */\r
        g_ibsp.entry_count--;\r
 \r
-       CL_TRACE( IBSP_DBG_INIT, gdbg_lvl, ("WSPCleanup: %d\n", g_ibsp.entry_count) );\r
+       IBSP_TRACE( IBSP_DBG_INIT, ("WSPCleanup: %d\n", g_ibsp.entry_count) );\r
 \r
        if( g_ibsp.entry_count == 0 )\r
        {\r
-               CL_TRACE( IBSP_DBG_INIT, gdbg_lvl, ("entry_count is 0 => cleaning up\n") );\r
+               IBSP_TRACE( IBSP_DBG_INIT, ("entry_count is 0 => cleaning up\n") );\r
                ib_release();\r
        }\r
 \r
        cl_spinlock_release( &g_ibsp.mutex );\r
 \r
-       CL_EXIT( IBSP_DBG_INIT, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_INIT );\r
 \r
        return ret;\r
 }\r
@@ -2267,19 +2268,19 @@ WSPStartupEx(
        static WSPPROC_TABLE gProcTable;\r
        static WSPDATA gWSPData;\r
 \r
-       CL_ENTER( IBSP_DBG_INIT, gdbg_lvl );\r
+       IBSP_ENTER( IBSP_DBG_INIT );\r
 \r
        /* Make sure that the version requested is >= 2.2. The low byte is the \r
           major version and the high byte is the minor version. */\r
        if( (LOBYTE(wVersion) < 2) || ((LOBYTE(wVersion) == 2) && (HIBYTE(wVersion) < 2)) )\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_INIT, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("Invalid winsock version requested %x\n", wVersion) );\r
 \r
                return WSAVERNOTSUPPORTED;\r
        }\r
 \r
-       CL_TRACE( IBSP_DBG_INIT, gdbg_lvl, ("entry_count=%d)\n", g_ibsp.entry_count) );\r
+       IBSP_TRACE( IBSP_DBG_INIT, ("entry_count=%d)\n", g_ibsp.entry_count) );\r
 \r
        cl_spinlock_acquire( &g_ibsp.mutex );\r
 \r
@@ -2329,7 +2330,7 @@ WSPStartupEx(
                ret = ibsp_initialize();\r
                if( ret )\r
                {\r
-                       CL_EXIT_ERROR( IBSP_DBG_INIT, gdbg_lvl,\r
+                       IBSP_ERROR_EXIT(\r
                                ("ibsp_initialize failed (%d)\n", ret) );\r
                        return ret;\r
                }\r
@@ -2345,7 +2346,7 @@ WSPStartupEx(
        /* store the upcall function table */\r
        g_ibsp.up_call_table = *UpCallTable;\r
 \r
-       CL_EXIT( IBSP_DBG_INIT, gdbg_lvl );\r
+       IBSP_EXIT( IBSP_DBG_INIT );\r
 \r
        return 0;\r
 }\r
index 417606f..a752aae 100644 (file)
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
  * SOFTWARE.\r
  *\r
- * $Id: ibspdll.rc 1.3 05/05/23 16:03:31-07:00 ftillier@orbuild.infiniconsys.com $\r
+ * $Id$\r
  */\r
 \r
 #include <ics_ver.h>\r
 \r
 #define VER_FILETYPE                           VFT_DLL\r
 #define VER_FILESUBTYPE                                VFT2_UNKNOWN\r
-#define VER_FILEDESCRIPTION_STR     "SilverStorm Winsock Direct for InfiniBand"\r
-#define VER_INTERNALNAME_STR        "ibwsd.dll"\r
-#define VER_ORIGINALFILENAME_STR    "ibwsd.dll"\r
+\r
+#ifdef _DEBUG_\r
+#define VER_FILEDESCRIPTION_STR                "Winsock Direct for InfiniBand (Debug)"\r
+#else\r
+#define VER_FILEDESCRIPTION_STR                "Winsock Direct for InfiniBand"\r
+#endif\r
+\r
+#define VER_INTERNALNAME_STR           "ibwsd.dll"\r
+#define VER_ORIGINALFILENAME_STR       "ibwsd.dll"\r
 \r
 #include <common.ver>\r
index 0430a9f..5c7da13 100644 (file)
@@ -88,7 +88,7 @@ init_globals( void )
        g_ibsp.heap = HeapCreate( 0, 128000, 0 );\r
        if( g_ibsp.heap == NULL)\r
        {\r
-               CL_EXIT_ERROR( IBSP_DBG_INIT, gdbg_lvl,\r
+               IBSP_ERROR_EXIT(\r
                        ("HeapCreate() failed: %d\n", GetLastError()) );\r
                return 1;\r
        }\r