[WSD] Rename some structures to make the code more readable.
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 May 2007 08:54:54 +0000 (08:54 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 May 2007 08:54:54 +0000 (08:54 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@650 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/ibspdll.c
ulp/wsd/user/ibspstruct.h
ulp/wsd/user/sockinfo.c

index f22c1b8..2839ce8 100644 (file)
@@ -174,7 +174,7 @@ IBSPRegisterRdmaMemory(
        IN      OUT                     LPDWORD                                         lpdwDescriptorLength,\r
                OUT                     LPINT                                           lpErrno )\r
 {\r
-       struct memory_node *node;\r
+       struct memory_node *node2;\r
        struct rdma_memory_desc *desc;\r
        struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s;\r
        ib_access_t access_ctrl;\r
@@ -232,10 +232,10 @@ IBSPRegisterRdmaMemory(
        hca = socket_info->port->hca;\r
 \r
        /** TODO: Fix locking so we dont' dereference node outside of mutex. */\r
-       node = ibsp_reg_mem( socket_info, hca->pd,\r
+       node2 = ibsp_reg_mem( socket_info, hca->pd,\r
                lpBuffer, dwBufferLength, access_ctrl, lpErrno );\r
 \r
-       if( !node )\r
+       if( !node2 )\r
        {\r
                IBSP_ERROR_EXIT( ("ibsp_reg_mem failed %d\n", *lpErrno) );\r
                *lpErrno = WSAENOBUFS;\r
@@ -245,16 +245,16 @@ IBSPRegisterRdmaMemory(
        desc = lpRdmaBufferDescriptor;\r
 \r
        desc->iova = (uint64_t) (uintptr_t) lpBuffer;\r
-       desc->lkey = node->p_reg->lkey;\r
-       desc->rkey = node->p_reg->rkey;\r
-       desc->node = node;\r
+       desc->lkey = node2->p_reg->lkey;\r
+       desc->rkey = node2->p_reg->rkey;\r
+       desc->node1 = node2;\r
 \r
        *lpErrno = 0;\r
 \r
        IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_MEM,\r
                ("Socket %Ix registered RDMA MEM at %p, len %d, for access %d, "\r
                "returning handle %p, rkey %08x\n",\r
-               s, lpBuffer, dwBufferLength, dwFlags, node, desc->rkey));\r
+               s, lpBuffer, dwBufferLength, dwFlags, node2, desc->rkey));\r
 \r
 \r
        IBSP_EXIT( IBSP_DBG_MEM );\r
@@ -302,7 +302,7 @@ IBSPDeregisterRdmaMemory(
 \r
        desc = lpRdmaBufferDescriptor;\r
 \r
-       ret = ibsp_dereg_mem( socket_info, desc->node, lpErrno );\r
+       ret = ibsp_dereg_mem( socket_info, desc->node1, lpErrno );\r
 \r
        fzprint(("%s():%d:0x%x:0x%x: Unregistering RDMA MEM %p\n",\r
                         __FUNCTION__, __LINE__, GetCurrentProcessId(),\r
@@ -340,7 +340,7 @@ do_rdma_op(
 \r
        CL_ASSERT( wr_type == WR_RDMA_WRITE || wr_type == WR_RDMA_READ );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        switch( socket_info->socket_state )\r
        {\r
        case IBSP_CONNECTED:\r
@@ -348,13 +348,13 @@ do_rdma_op(
                break;\r
 \r
        default:\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("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
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        if( socket_info->qp_error )\r
        {\r
index 2c77be9..118234a 100644 (file)
@@ -121,7 +121,7 @@ cm_req_callback(
        CL_ASSERT( socket_info );\r
        CL_ASSERT( p_cm_req_rec->p_req_pdata );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        switch( socket_info->socket_state )\r
        {\r
@@ -164,15 +164,15 @@ cm_req_callback(
                        /* Non-blocking cancel since we're in CM callback context */\r
                        ib_cm_cancel( socket_info->listen.handle, NULL );\r
                        socket_info->listen.handle = NULL;\r
-                       cl_spinlock_release( &socket_info->mutex );\r
+                       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
                        wait_cq_drain( socket_info );\r
 \r
-                       cl_spinlock_acquire( &socket_info->mutex );\r
+                       cl_spinlock_acquire( &socket_info->mutex1 );\r
                        ret = ib_accept( socket_info, p_cm_req_rec );\r
                        if( ret )\r
                        {\r
-                               cl_spinlock_release( &socket_info->mutex );\r
+                               cl_spinlock_release( &socket_info->mutex1 );\r
                                IBSP_ERROR( (\r
                                        "ib_accept for duplicate socket returned %d, rejecting\n",\r
                                        ret) );\r
@@ -193,7 +193,7 @@ cm_req_callback(
                break;\r
        }\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
@@ -225,7 +225,7 @@ cm_rep_callback(
        cm_rtu.pfn_cm_apr_cb = cm_apr_callback;\r
        cm_rtu.pfn_cm_dreq_cb = cm_dreq_callback;\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        switch( socket_info->socket_state )\r
        {\r
@@ -276,7 +276,7 @@ cm_rep_callback(
                ib_reject( p_cm_rep_rec->h_cm_rep, IB_REJ_USER_DEFINED );\r
        }\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
@@ -295,7 +295,7 @@ cm_rtu_callback(
 \r
        IBSP_ENTER( IBSP_DBG_CM );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        if( socket_info->socket_state == IBSP_DUPLICATING_REMOTE )\r
        {\r
@@ -386,7 +386,7 @@ cm_rtu_callback(
                        IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
        }\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
@@ -428,7 +428,7 @@ cm_rej_callback(
        IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CM, ("socket %p connect reject, reason=%d\n",\r
                socket_info, cl_ntoh16(p_cm_rej_rec->rej_status)) );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        switch( socket_info->socket_state )\r
        {\r
@@ -469,7 +469,7 @@ cm_rej_callback(
                break;\r
        }\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
@@ -513,7 +513,7 @@ cm_dreq_callback(
 \r
        reason = (struct disconnect_reason * __ptr64)p_cm_dreq_rec->p_dreq_pdata;\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        if( socket_info->socket_state == IBSP_CONNECTED )\r
        {\r
@@ -561,7 +561,7 @@ cm_dreq_callback(
                if( status != IB_SUCCESS )\r
                        IBSP_ERROR( ("ib_cm_drep returned %s\n", ib_get_err_str( status )) );\r
        }\r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        IBSP_EXIT( IBSP_DBG_CM );\r
 }\r
@@ -753,9 +753,9 @@ ib_listen_cancel(
 \r
        /* We can empty the queue now. Since we are closing, \r
         * no new entry will be added. */\r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        ib_listen_backlog( socket_info, 0 );\r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        socket_info->listen.handle = NULL;\r
 \r
index bc8a148..8cac6ba 100644 (file)
@@ -149,10 +149,10 @@ setup_duplicate_socket(
        if( WaitForSingleObject( socket_info->h_event, INFINITE ) != WAIT_OBJECT_0 )\r
                IBSP_ERROR( ("WaitForSingleObject failed\n") );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        if( socket_info->socket_state != IBSP_CONNECTED )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR( ("Failed to connect\n") );\r
                ret = WSAENETDOWN;\r
 err2:\r
@@ -166,7 +166,7 @@ err2:
        else\r
        {\r
                ret = 0;\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
        }\r
 \r
 err1:\r
@@ -212,10 +212,10 @@ IBSPDuplicateSocket(
                ("Duplicating socket=0x%p to dwProcessId=0x%x \n",\r
                socket_info, dwProcessId) );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        if( socket_info->socket_state != IBSP_CONNECTED )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_PRINT_EXIT(TRACE_LEVEL_INFORMATION, IBSP_DBG_DUP,\r
                        ("Socket state not IBSP_CONNECTED, state=%s.\n",\r
                        IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
@@ -231,7 +231,7 @@ IBSPDuplicateSocket(
                PAGE_READWRITE, 0, sizeof(struct ibsp_duplicate_info), fname );\r
        if( !h_dup_info )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("CreateFileMapping for %s failed with %d\n",\r
                        fname, GetLastError()) );\r
                *lpErrno = WSAENETDOWN;\r
@@ -242,7 +242,7 @@ IBSPDuplicateSocket(
        dup_info = MapViewOfFile( h_dup_info, FILE_MAP_WRITE, 0, 0, 0 );\r
        if( !dup_info )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("MapViewOfFile failed with %d\n", GetLastError()) );\r
                CloseHandle( h_dup_info );\r
                *lpErrno = WSAENETDOWN;\r
@@ -266,7 +266,7 @@ IBSPDuplicateSocket(
        h_target_process = OpenProcess( PROCESS_DUP_HANDLE, FALSE, dwProcessId );\r
        if( !h_target_process )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("OpenProcess failed with %d\n", GetLastError()) );\r
                CloseHandle( h_dup_info );\r
                *lpErrno = WSAENETDOWN;\r
@@ -277,7 +277,7 @@ IBSPDuplicateSocket(
                h_target_process, &h_target_dup_info, 0, TRUE,\r
                DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS ) )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("DuplicateHandle failed with %d\n", GetLastError()) );\r
                CloseHandle( h_target_process );\r
                *lpErrno = WSAENETDOWN;\r
@@ -307,13 +307,13 @@ IBSPDuplicateSocket(
        /* We changed the state - remove from connection map. */\r
        ibsp_conn_remove( socket_info );\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        wait_cq_drain( socket_info );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        ib_destroy_socket( socket_info );\r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        /* And that's it */\r
        IBSP_EXIT( IBSP_DBG_DUP );\r
index ab33d36..9e7d380 100644 (file)
@@ -105,7 +105,7 @@ complete_wq(
                switch ( wc->wc_type ) \r
                {\r
                case IB_WC_RECV:\r
-               CL_ASSERT(wc->length != 0);\r
+                       CL_ASSERT(wc->length != 0);\r
                        lpOverlapped->InternalHigh = wc->length;\r
 #ifdef IBSP_LOGGING\r
                        cl_spinlock_acquire( &socket_info->recv_lock );\r
@@ -125,6 +125,7 @@ complete_wq(
                        break;\r
 \r
                case IB_WC_RDMA_READ:\r
+                       CL_ASSERT(wc->length != 0);\r
                        lpOverlapped->InternalHigh = wc->length;\r
 #ifdef PERFMON_ENABLED\r
                        InterlockedIncrement64( &g_pm_stat.pdata[COMP_RECV] );\r
@@ -154,7 +155,7 @@ complete_wq(
                break;\r
 \r
        case IB_WCS_WR_FLUSHED_ERR:\r
-               cl_spinlock_acquire( &socket_info->mutex );\r
+               cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
                if( socket_info->socket_state == IBSP_DUPLICATING_REMOTE &&\r
                        wc->wc_type == IB_WC_RECV )\r
@@ -184,7 +185,7 @@ complete_wq(
 \r
                        cl_spinlock_release( &socket_info->recv_lock );\r
 \r
-                       cl_spinlock_release( &socket_info->mutex );\r
+                       cl_spinlock_release( &socket_info->mutex1 );\r
                        p_io_info->p_ov = NULL;\r
                        IBSP_EXIT( IBSP_DBG_IO );\r
                        return;\r
@@ -196,7 +197,7 @@ complete_wq(
                else\r
                        wr->lpOverlapped->OffsetHigh = WSA_OPERATION_ABORTED;\r
 \r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
 \r
                /* Override the length, as per the WSD specs. */\r
                wr->lpOverlapped->InternalHigh = 0;\r
@@ -345,7 +346,7 @@ complete_wq(
 #endif\r
 \r
                p_io_info->p_ov = lpOverlapped;\r
-               cl_atomic_inc( &socket_info->ref_cnt );\r
+               cl_atomic_inc( &socket_info->ref_cnt1 );\r
        }\r
 \r
        if( wc->wc_type == IB_WC_RECV )\r
@@ -967,7 +968,7 @@ ib_destroy_socket(
 \r
        if( socket_info->qp )\r
        {\r
-               cl_atomic_inc( &socket_info->ref_cnt );\r
+               cl_atomic_inc( &socket_info->ref_cnt1 );\r
                status = ib_destroy_qp( socket_info->qp, deref_socket_info );\r
                if( status != IB_SUCCESS )\r
                {\r
@@ -1171,10 +1172,10 @@ shutdown_and_destroy_socket_info(
 \r
        IBSP_ENTER( IBSP_DBG_EP );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        old_state = socket_info->socket_state;\r
        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_CLOSED );\r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        if( socket_info->listen.handle )\r
        {\r
index b377bb1..6fb1e2c 100644 (file)
@@ -578,7 +578,7 @@ build_ip_list(
                *ip_list_size = (DWORD) size_req;\r
                *lpErrno = WSAEFAULT;\r
                IBSP_ERROR_EXIT( (\r
-                       "returning efault, size %Id (usually not an error)", size_req) );\r
+                       "returning default, size %Id (usually not an error)\n", size_req) );\r
                return SOCKET_ERROR;\r
        }\r
 \r
index a8a695e..5cca974 100644 (file)
@@ -216,6 +216,8 @@ static inline int __ibsp_dereg_mem_mr(
 \r
        cl_qlist_remove_item( &node->s->mr_list, &node->socket_item );\r
 \r
+\r
+       memset(node,0x45,sizeof node);\r
        HeapFree( g_ibsp.heap, 0, node );\r
 \r
        IBSP_EXIT( IBSP_DBG_MEM );\r
index e29b0cc..ae42764 100644 (file)
@@ -406,7 +406,7 @@ accept_socket(
                &new_socket_info->local_addr, &new_socket_info->peer_addr );\r
 #endif\r
 \r
-       cl_spinlock_acquire( &new_socket_info->mutex );\r
+       cl_spinlock_acquire( &new_socket_info->mutex1 );\r
        /* Update the state of the socket context */\r
        IBSP_CHANGE_SOCKET_STATE( new_socket_info, IBSP_CONNECTED );\r
 \r
@@ -414,7 +414,7 @@ accept_socket(
        if( *lpErrno )\r
        {\r
                IBSP_CHANGE_SOCKET_STATE( new_socket_info, IBSP_CREATE );\r
-               cl_spinlock_release( &new_socket_info->mutex );\r
+               cl_spinlock_release( &new_socket_info->mutex1 );\r
 \r
                if( *lpErrno == WSAEADDRINUSE )\r
                {\r
@@ -437,7 +437,7 @@ accept_socket(
                &g_ibsp.socket_info_list, &new_socket_info->item );\r
        cl_spinlock_release( &g_ibsp.socket_info_mutex );\r
 \r
-       cl_spinlock_release( &new_socket_info->mutex );\r
+       cl_spinlock_release( &new_socket_info->mutex1 );\r
 \r
        IBSP_PRINT_EXIT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CONN,\r
                ("returns new socket (0x%p)\n", new_socket_info) );\r
@@ -489,12 +489,12 @@ IBSPAccept(
         * there is one, create a socket, and then query the switch about\r
         * the pending connection */\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        /* Verify the state of the socket */\r
        if( socket_info->socket_state != IBSP_LISTEN )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("Socket is not in right socket_state (%s)\n",\r
                        IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
                *lpErrno = WSAEINVAL;\r
@@ -503,7 +503,7 @@ IBSPAccept(
 \r
        if( cl_qlist_count( &socket_info->listen.list ) == 0 )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
 \r
                IBSP_ERROR_EXIT( ("No pending connection found for this socket\n") );\r
                *lpErrno = WSAEWOULDBLOCK;\r
@@ -519,7 +519,7 @@ IBSPAccept(
        /* Signal the event again if there are more connection requests. */\r
        if( cl_qlist_count( &socket_info->listen.list ) )\r
                ibsp_post_select_event( socket_info, FD_ACCEPT, 0 );\r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        port = socket_info->port;\r
 \r
@@ -603,9 +603,9 @@ reject:
                ib_cm_mra( incoming->cm_req_received.h_cm_req, &mra );\r
 \r
                /* Put the item back at the head of the list. */\r
-               cl_spinlock_acquire( &socket_info->mutex );\r
+               cl_spinlock_acquire( &socket_info->mutex1 );\r
                cl_qlist_insert_head( &socket_info->listen.list, &incoming->item );\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
 \r
                IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CONN,\r
                        ("Conditional routine returned CF_DEFER\n") );\r
@@ -697,12 +697,12 @@ IBSPBind(
 \r
        /* We are going to take this mutex for some time, \r
         * but at this stage, it shouldn't impact anything. */\r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        /* Verify the state of the socket */\r
        if( socket_info->socket_state != IBSP_CREATE )\r
        {\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR( (\r
                        "Invalid socket state (%s)\n",\r
                        IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
@@ -718,7 +718,7 @@ IBSPBind(
                if( ret )\r
                {\r
                        socket_info->port = NULL;\r
-                       cl_spinlock_release( &socket_info->mutex );\r
+                       cl_spinlock_release( &socket_info->mutex1 );\r
                        IBSP_ERROR( ("ib_create socket failed with %d\n", ret) );\r
                        *lpErrno = WSAENOBUFS;\r
                        goto error;\r
@@ -730,7 +730,7 @@ IBSPBind(
 \r
        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND );\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        IBSP_EXIT( IBSP_DBG_CONN );\r
        return 0;\r
@@ -882,7 +882,7 @@ IBSPConnect(
                return SOCKET_ERROR;\r
        }\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        /* Verify the state of the socket */\r
        switch( socket_info->socket_state )\r
@@ -933,7 +933,7 @@ IBSPConnect(
        }\r
 \r
 done:\r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
        IBSP_EXIT( IBSP_DBG_CONN );\r
        return SOCKET_ERROR;\r
 }\r
@@ -1125,6 +1125,8 @@ IBSPGetOverlappedResult(
                         __FUNCTION__, __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s,\r
                         lpOverlapped, *lpErrno, rc));\r
 \r
+       if (rc == TRUE) CL_ASSERT(*lpcbTransfer > 0);\r
+\r
        IBSP_EXIT( IBSP_DBG_IO );\r
        return rc;\r
 }\r
@@ -1469,7 +1471,7 @@ IBSPListen(
        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
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
 \r
        IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CONN, ("socket_state is %s\n",\r
                IBSP_SOCKET_STATE_STR( socket_info->socket_state )) );\r
@@ -1508,7 +1510,7 @@ IBSPListen(
                break;\r
        }\r
 \r
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        *lpErrno = ret;\r
 \r
@@ -1568,7 +1570,7 @@ IBSPRecv(
                return SOCKET_ERROR;\r
        }\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        switch( socket_info->socket_state )\r
        {\r
        case IBSP_CONNECTED:\r
@@ -1576,13 +1578,13 @@ IBSPRecv(
                break;\r
 \r
        default:\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("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
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        if( socket_info->qp_error != 0 )\r
        {\r
@@ -1784,7 +1786,7 @@ IBSPSend(
        CL_ASSERT( lpCompletionRoutine == NULL );\r
        CL_ASSERT( lpOverlapped != NULL );\r
 \r
-       cl_spinlock_acquire( &socket_info->mutex );\r
+       cl_spinlock_acquire( &socket_info->mutex1 );\r
        switch( socket_info->socket_state )\r
        {\r
        case IBSP_CONNECTED:\r
@@ -1792,13 +1794,13 @@ IBSPSend(
                break;\r
 \r
        default:\r
-               cl_spinlock_release( &socket_info->mutex );\r
+               cl_spinlock_release( &socket_info->mutex1 );\r
                IBSP_ERROR_EXIT( ("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
-       cl_spinlock_release( &socket_info->mutex );\r
+       cl_spinlock_release( &socket_info->mutex1 );\r
 \r
        if( socket_info->qp_error )\r
        {\r
index 5d7ae89..867267d 100644 (file)
@@ -195,7 +195,7 @@ struct rdma_memory_desc
        uint64_t iova;\r
        uint32_t lkey;\r
        uint32_t rkey;\r
-       struct memory_node *node      /* valid only on registering node */\r
+       struct memory_node *node1;      /* valid only on registering node */\r
 };\r
 \r
 struct cq_thread_info\r
@@ -224,7 +224,7 @@ struct ibsp_socket_info
 {\r
        cl_list_item_t item;            /* Link to next SOCKET_INFO in the global list */\r
        cl_rbmap_item_t conn_item;\r
-       cl_spinlock_t mutex           /* protect this structure */\r
+       cl_spinlock_t mutex1;           /* protect this structure */\r
 \r
        /* Switch socket handle created by WPUCreateSocketHandle. */\r
        SOCKET switch_socket;\r
@@ -295,7 +295,7 @@ struct ibsp_socket_info
         * Used to stall destruction of switch socket until all completion\r
         * upcalls have unwound.\r
         */\r
-       atomic32_t              ref_cnt;\r
+       atomic32_t              ref_cnt1;\r
 \r
 #ifdef _DEBUG_\r
        atomic32_t              send_comp;\r
index 1109b01..e471851 100644 (file)
@@ -66,13 +66,13 @@ create_socket_info(
                return NULL;\r
        }\r
 \r
-       cl_spinlock_construct( &socket_info->mutex );\r
+       cl_spinlock_construct( &socket_info->mutex1 );\r
        cl_spinlock_construct( &socket_info->send_lock );\r
        cl_spinlock_construct( &socket_info->recv_lock );\r
        cl_qlist_init( &socket_info->mr_list );\r
        cl_qlist_init( &socket_info->listen.list );\r
 \r
-       if( cl_spinlock_init( &socket_info->mutex ) != CL_SUCCESS )\r
+       if( cl_spinlock_init( &socket_info->mutex1 ) != CL_SUCCESS )\r
                goto err;\r
 \r
        if( cl_spinlock_init( &socket_info->send_lock ) != CL_SUCCESS )\r
@@ -106,7 +106,7 @@ err:
         * Preset to 1, IBSPCloseSocket will decrement it, and switch socket\r
         * will be freed once it goes to zero.\r
         */\r
-       socket_info->ref_cnt = 1;\r
+       socket_info->ref_cnt1 = 1;\r
 \r
        IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_SI, ("socket_info (%p), switch socket (%p)\n",\r
                socket_info, (void*)socket_info->switch_socket) );\r
@@ -145,7 +145,7 @@ free_socket_info(
        CL_ASSERT( !p_socket->qp );\r
        CL_ASSERT( !p_socket->conn_item.p_map );\r
 \r
-       cl_spinlock_destroy( &p_socket->mutex );\r
+       cl_spinlock_destroy( &p_socket->mutex1 );\r
 \r
        cl_spinlock_destroy( &p_socket->send_lock );\r
        cl_spinlock_destroy( &p_socket->recv_lock );\r
@@ -167,7 +167,7 @@ deref_socket_info(
 {\r
        IBSP_ENTER( IBSP_DBG_SI );\r
 \r
-       if( !cl_atomic_dec( &p_socket->ref_cnt ) )\r
+       if( !cl_atomic_dec( &p_socket->ref_cnt1 ) )\r
        {\r
                free_socket_info( p_socket );\r
                IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_SI, ("Freed socket_info (%p)\n", p_socket) );\r