From 631f7f8952faacf58354610c344f34078df457fe Mon Sep 17 00:00:00 2001 From: ftillier Date: Thu, 7 Jul 2005 23:16:53 +0000 Subject: [PATCH] Changed event notification to use interlocked operations. Fixed improper lock usage when changing socket state. Cleaned up debug output. git-svn-id: svn://openib.tc.cornell.edu/gen1@30 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- branches/fab_cm_branch/ulp/wsd/user/ib_cm.c | 49 ++--- branches/fab_cm_branch/ulp/wsd/user/ibspdll.c | 194 ++++++++---------- branches/fab_cm_branch/ulp/wsd/user/ibspdll.h | 3 +- .../fab_cm_branch/ulp/wsd/user/ibspproto.h | 6 + .../fab_cm_branch/ulp/wsd/user/ibspstruct.h | 2 - .../fab_cm_branch/ulp/wsd/user/sockinfo.c | 2 - 6 files changed, 124 insertions(+), 132 deletions(-) diff --git a/branches/fab_cm_branch/ulp/wsd/user/ib_cm.c b/branches/fab_cm_branch/ulp/wsd/user/ib_cm.c index 4a1e86f3..aa4fe7aa 100644 --- a/branches/fab_cm_branch/ulp/wsd/user/ib_cm.c +++ b/branches/fab_cm_branch/ulp/wsd/user/ib_cm.c @@ -51,36 +51,30 @@ get_service_id_for_port( /* Signals a select event to the switch. */ -static void -post_select_event( +void +ibsp_post_select_event( struct ibsp_socket_info *socket_info, int event, int error ) { - CL_ENTER( IBSP_DBG_NEV, gdbg_lvl ); + HANDLE h_event; - if( (socket_info->event_mask & event) == 0 ) - { - /* This event is not requested. Since we capture only two important - * event, this case should never occur. */ - CL_EXIT_ERROR( IBSP_DBG_NEV, gdbg_lvl, - ("Hummm, tried to post an umasked event. (%x, %x)\n", - socket_info->event_mask, event) ); - return; - } + IBSP_ENTER( IBSP_DBG_NEV ); - cl_spinlock_acquire( &socket_info->event_mutex ); - - socket_info->network_events |= event; + CL_ASSERT( socket_info ); + CL_ASSERT( event ); switch( event ) { case FD_CONNECT: + IBSP_TRACE1( IBSP_DBG_NEV, + ("socket %p FD_CONNECT\n", socket_info) ); socket_info->errno_connect = error; break; case FD_ACCEPT: - socket_info->errno_accept = error; + IBSP_TRACE1( IBSP_DBG_NEV, + ("socket %p FD_ACCEPT\n", socket_info) ); break; default: @@ -88,11 +82,20 @@ post_select_event( break; } - cl_spinlock_release( &socket_info->event_mutex ); + _InterlockedOr( &socket_info->network_events, event ); - SetEvent( socket_info->event_select ); + h_event = InterlockedCompareExchangePointer( + &socket_info->event_select, NULL, NULL ); + /* Check for event notification request and signal as needed. */ + if( (socket_info->event_mask & event) && h_event ) + { + IBSP_TRACE2( IBSP_DBG_NEV, + ("Signaling eventHandle %p at time %I64d.\n", + h_event, cl_get_time_stamp() ) ); + SetEvent( h_event ); + } - CL_EXIT( IBSP_DBG_NEV, gdbg_lvl ); + IBSP_EXIT( IBSP_DBG_NEV ); } @@ -165,7 +168,7 @@ cm_req_callback( mra.svc_timeout = 0x1F; ib_cm_mra( p_cm_req_rec->h_cm_req, &mra ); - post_select_event( socket_info, FD_ACCEPT, 0 ); + ibsp_post_select_event( socket_info, FD_ACCEPT, 0 ); break; case IBSP_DUPLICATING_REMOTE: @@ -271,12 +274,12 @@ cm_rep_callback( /* Note: a REJ has been automatically sent. */ CL_ERROR( IBSP_DBG_CM, gdbg_lvl, ("ib_cm_rtu failed (0x%d)\n", status) ); IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND ); - post_select_event( socket_info, FD_CONNECT, WSAENOBUFS ); + ibsp_post_select_event( socket_info, FD_CONNECT, WSAENOBUFS ); } else { IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_CONNECTED ); - post_select_event( socket_info, FD_CONNECT, 0 ); + ibsp_post_select_event( socket_info, FD_CONNECT, 0 ); } } else if( socket_info->socket_state == IBSP_DUPLICATING_NEW ) @@ -450,7 +453,7 @@ cm_rej_callback( { case IBSP_CONNECT: IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND ); - post_select_event( socket_info, FD_CONNECT, WSAECONNREFUSED ); + ibsp_post_select_event( socket_info, FD_CONNECT, WSAECONNREFUSED ); break; case IBSP_ACCEPT: diff --git a/branches/fab_cm_branch/ulp/wsd/user/ibspdll.c b/branches/fab_cm_branch/ulp/wsd/user/ibspdll.c index 903e45a4..7890e995 100644 --- a/branches/fab_cm_branch/ulp/wsd/user/ibspdll.c +++ b/branches/fab_cm_branch/ulp/wsd/user/ibspdll.c @@ -245,9 +245,8 @@ IBSPAccept( WSABUF callee_id; struct listen_incoming *incoming; struct ibsp_port *port; - BOOLEAN reject; - CL_ENTER( IBSP_DBG_CONN, gdbg_lvl ); + IBSP_ENTER( IBSP_DBG_CONN ); fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__, __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s)); @@ -256,8 +255,8 @@ IBSPAccept( if( *addrlen < sizeof(struct sockaddr_in) ) { - CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, - ("invalid addrlen (%d, %d)\n", *addrlen, sizeof(struct sockaddr_in)) ); + IBSP_ERROR_EXIT( ("invalid addrlen (%d, %d)\n", + *addrlen, sizeof(struct sockaddr_in)) ); *lpErrno = WSAEFAULT; return INVALID_SOCKET; } @@ -272,8 +271,7 @@ IBSPAccept( if( socket_info->socket_state != IBSP_LISTEN ) { cl_spinlock_release( &socket_info->mutex ); - CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, - ("Socket is not in right socket_state (%s)\n", + IBSP_ERROR_EXIT( ("Socket is not in right socket_state (%s)\n", IBSP_SOCKET_STATE_STR( socket_info->socket_state )) ); *lpErrno = WSAEINVAL; return INVALID_SOCKET; @@ -283,8 +281,7 @@ IBSPAccept( { cl_spinlock_release( &socket_info->mutex ); - CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, - ("No pending connection found for this socket\n") ); + IBSP_ERROR_EXIT( ("No pending connection found for this socket\n") ); *lpErrno = WSAEWOULDBLOCK; return INVALID_SOCKET; } @@ -296,17 +293,15 @@ IBSPAccept( struct listen_incoming, item); port = socket_info->port; - reject = FALSE; - /* Find the destination IP address */ if( port == NULL ) { /* The socket was bound to INADDR_ANY. We must find the correct port - * for the new socket. */ + * for the new socket. */ port = get_port_from_ip_address( incoming->params.dest.sin_addr ); if( port == NULL ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + IBSP_ERROR( ("incoming destination IP address not local (%s)\n", inet_ntoa( incoming->params.dest.sin_addr )) ); goto reject; @@ -316,15 +311,11 @@ IBSPAccept( /* Cross-check with the path info to make sure we are conectiong correctly */ if( port->guid != ib_gid_get_guid( &incoming->cm_req_received.primary_path.sgid ) ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + IBSP_ERROR( ("GUIDs of port for destination IP address and primary path do not match (%016I64x, %016I64x)\n", port->guid, ib_gid_get_guid( &incoming->cm_req_received.primary_path.sgid )) ); - goto reject; - } - if( reject ) - { reject: /* The request is invalid. Remove it from the list and reject it. */ cl_qlist_remove_item( &socket_info->info.listen.list, &incoming->item ); @@ -350,26 +341,18 @@ reject: callee_id.buf = (char *)&incoming->params.dest; callee_id.len = sizeof(incoming->params.dest); -#ifdef _DEBUG_ - { - char buf[100]; - char *p = buf; - p += sprintf( p, "got incoming connection from %s/%d-%d to", - inet_ntoa( incoming->params.source.sin_addr ), - cl_ntoh16( incoming->params.source.sin_port ), - incoming->params.source.sin_family ); - p += sprintf( p, " %s/%d-%d", - inet_ntoa( incoming->params.dest.sin_addr ), - cl_ntoh16( incoming->params.dest.sin_port ), - incoming->params.dest.sin_family ); - - CL_TRACE( IBSP_DBG_CONN, gdbg_lvl, (buf) ); - } -#endif + IBSP_TRACE( IBSP_DBG_CONN, + ("Got incoming conn from %s/%d-%d to %s/%d-%d\n", + inet_ntoa( incoming->params.source.sin_addr ), + cl_ntoh16( incoming->params.source.sin_port ), + incoming->params.source.sin_family, + inet_ntoa( incoming->params.dest.sin_addr ), + cl_ntoh16( incoming->params.dest.sin_port ), + incoming->params.dest.sin_family) ); /* Call the conditional function */ - ret = lpfnCondition( &caller_id, NULL, - NULL, NULL, &callee_id, NULL, NULL, dwCallbackData ); + ret = lpfnCondition( &caller_id, NULL, NULL, NULL, + &callee_id, NULL, NULL, dwCallbackData ); switch( ret ) { @@ -377,23 +360,25 @@ reject: cl_qlist_remove_item( &socket_info->info.listen.list, &incoming->item ); cl_spinlock_release( &socket_info->mutex ); - ib_reject( incoming->cm_req_received.h_cm_req, IB_REJ_INSUF_QP ); + IBSP_TRACE1( IBSP_DBG_CONN, + ("Conditional routine returned CF_REJECT\n") ); + + ib_reject( incoming->cm_req_received.h_cm_req, IB_REJ_USER_DEFINED ); HeapFree( g_ibsp.heap, 0, incoming ); - CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, - ("Conditional routine rejected connection\n") ); *lpErrno = WSAECONNREFUSED; + IBSP_EXIT( IBSP_DBG_CONN ); return INVALID_SOCKET; - break; case CF_DEFER: cl_spinlock_release( &socket_info->mutex ); - CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("Conditional routine returned defer\n") ); + IBSP_TRACE1( IBSP_DBG_CONN, + ("Conditional routine returned CF_DEFER\n") ); /* TODO: Send MRA */ *lpErrno = WSATRY_AGAIN; + IBSP_EXIT( IBSP_DBG_CONN ); return INVALID_SOCKET; - break; case CF_ACCEPT: break; @@ -401,10 +386,11 @@ reject: default: /* Should never happen */ cl_spinlock_release( &socket_info->mutex ); - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, - ("lpfnCondition returned undocumented code (%d)\n", ret) ); + IBSP_ERROR( + ("Conditional routine returned undocumented code (%d)\n", ret) ); CL_ASSERT( 0 ); *lpErrno = WSAECONNREFUSED; + IBSP_EXIT( IBSP_DBG_CONN ); return INVALID_SOCKET; } @@ -455,12 +441,12 @@ reject: new_socket_info->local_addr = incoming->params.dest; cl_qlist_remove_item( &socket_info->info.listen.list, &incoming->item ); + /* Signal the event again if there are more connection requests. */ + if( cl_qlist_count( &socket_info->info.listen.list ) ) + ibsp_post_select_event( socket_info, FD_ACCEPT, 0 ); cl_spinlock_release( &socket_info->mutex ); - /* Update the state of the socket context */ - IBSP_CHANGE_SOCKET_STATE( new_socket_info, IBSP_ACCEPT ); - /* Copy the socket context info from parent socket context */ new_socket_info->socket_options = socket_info->socket_options; @@ -476,20 +462,25 @@ reject: new_socket_info->info.accept.event = CreateEvent( NULL, FALSE, FALSE, NULL ); + cl_spinlock_acquire( &new_socket_info->mutex ); + /* Update the state of the socket context */ + IBSP_CHANGE_SOCKET_STATE( new_socket_info, IBSP_ACCEPT ); + ret = ib_accept( new_socket_info, &incoming->cm_req_received, lpErrno ); if( ret ) { + IBSP_CHANGE_SOCKET_STATE( new_socket_info, IBSP_CREATE ); + cl_spinlock_release( &new_socket_info->mutex ); /* Free the socket descriptor */ fzprint(("%s():%d:0x%x:0x%x: socket=0x%p calling lpWPUCloseSocketHandle=0x%p\n", __FUNCTION__, __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), socket_info, socket_info->switch_socket)); if( g_ibsp.up_call_table.lpWPUCloseSocketHandle( - new_socket_info->switch_socket, lpErrno ) == SOCKET_ERROR ) + new_socket_info->switch_socket, &ret ) == SOCKET_ERROR ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, - ("WPUCloseSocketHandle failed: %d\n", *lpErrno) ); + IBSP_ERROR( ("WPUCloseSocketHandle failed: %d\n", ret) ); } else { @@ -506,7 +497,7 @@ reject: ib_reject( incoming->cm_req_received.h_cm_req, IB_REJ_INSUF_QP ); HeapFree( g_ibsp.heap, 0, incoming ); - *lpErrno = WSAEACCES; + *lpErrno = ret; CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("ib_accept failed (%d)\n", ret) ); @@ -514,6 +505,7 @@ reject: } else { + cl_spinlock_release( &new_socket_info->mutex ); HeapFree( g_ibsp.heap, 0, incoming ); if( WaitForSingleObject( new_socket_info->info.accept.event, INFINITE ) == WAIT_OBJECT_0 ) @@ -532,7 +524,7 @@ reject: } else { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + IBSP_ERROR( ("ib_accept failed - socket state is %s\n", IBSP_SOCKET_STATE_STR( new_socket_info->socket_state )) ); @@ -546,7 +538,7 @@ reject: if( g_ibsp.up_call_table.lpWPUCloseSocketHandle( new_socket_info->switch_socket, lpErrno ) == SOCKET_ERROR ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + IBSP_ERROR( ("WPUCloseSocketHandle failed: %d\n", *lpErrno) ); } else @@ -566,7 +558,6 @@ reject: ("returns new SocketID (0x%x)\n", new_socket) ); return (SOCKET) new_socket_info; - } else { @@ -614,7 +605,7 @@ IBSPBind( /* Sanity checks */ if( namelen != sizeof(struct sockaddr_in) ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + IBSP_ERROR( ("invalid namelen (%d instead of %d)\n", namelen, sizeof(struct sockaddr_in)) ); *lpErrno = WSAEFAULT; @@ -623,7 +614,7 @@ IBSPBind( if( addr->sin_family != AF_INET ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("bad family for socket\n") ); + IBSP_ERROR( ("bad family for socket\n") ); *lpErrno = WSAEFAULT; goto error; } @@ -634,7 +625,7 @@ IBSPBind( port = get_port_from_ip_address( addr->sin_addr ); if( port == NULL ) { - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + IBSP_ERROR( ("This IP address does not belong to that host (%08x)\n", addr->sin_addr.S_un.S_addr) ); *lpErrno = WSAEADDRNOTAVAIL; @@ -648,13 +639,13 @@ IBSPBind( /* We are going to take this mutex for some time, * but at this stage, it shouldn't impact anything. */ - cl_spinlock_acquire( &socket_info->event_mutex ); + cl_spinlock_acquire( &socket_info->mutex ); /* Verify the state of the socket */ if( socket_info->socket_state != IBSP_CREATE ) { - cl_spinlock_release( &socket_info->event_mutex ); - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, + cl_spinlock_release( &socket_info->mutex ); + IBSP_ERROR( ("Invalid socket state (%s)\n", IBSP_SOCKET_STATE_STR( socket_info->socket_state )) ); *lpErrno = WSAEINVAL; @@ -669,8 +660,8 @@ IBSPBind( if( ret ) { socket_info->port = NULL; - cl_spinlock_release( &socket_info->event_mutex ); - CL_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("ib_create socket failed with %d\n", ret) ); + cl_spinlock_release( &socket_info->mutex ); + IBSP_ERROR( ("ib_create socket failed with %d\n", ret) ); *lpErrno = WSAENOBUFS; goto error; } @@ -681,7 +672,7 @@ IBSPBind( IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND ); - cl_spinlock_release( &socket_info->event_mutex ); + cl_spinlock_release( &socket_info->mutex ); CL_EXIT( IBSP_DBG_CONN, gdbg_lvl ); return 0; @@ -724,19 +715,18 @@ IBSPCloseSocket( cl_atomic_inc( &g_ibsp.CloseSocket_count ); #endif - cl_spinlock_acquire( &socket_info->event_mutex ); - + cl_spinlock_acquire( &socket_info->mutex ); old_state = socket_info->socket_state; IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_CLOSING ); - cl_spinlock_release( &socket_info->event_mutex ); + cl_spinlock_release( &socket_info->mutex ); shutdown_and_destroy_socket_info( socket_info, old_state ); - cl_spinlock_acquire( &socket_info->event_mutex ); + cl_spinlock_acquire( &socket_info->mutex ); IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_CLOSED ); - cl_spinlock_release( &socket_info->event_mutex ); + cl_spinlock_release( &socket_info->mutex ); /* Take off socket_info_list and put on closed_socket_info_list */ cl_spinlock_acquire( &g_ibsp.socket_info_mutex ); @@ -750,7 +740,6 @@ IBSPCloseSocket( /* Notify ib_cleanup_thread() to free this */ SetEvent( g_ibsp.ib_cleanup_event ); - CL_EXIT( IBSP_DBG_CONN, gdbg_lvl ); *lpErrno = 0; @@ -991,44 +980,33 @@ IBSPEnumNetworkEvents( LPWSANETWORKEVENTS lpNetworkEvents, LPINT lpErrno ) { - struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s; - - CL_ENTER( IBSP_DBG_NEV, gdbg_lvl ); + struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s; - fzprint(("%s():%d:0x%x:0x%x: socket=0x%p \n", __FUNCTION__, - __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s)); + IBSP_ENTER( IBSP_DBG_NEV ); - cl_spinlock_acquire( &socket_info->event_mutex ); + ResetEvent( hEventObject ); - lpNetworkEvents->lNetworkEvents = 0; + lpNetworkEvents->lNetworkEvents = + InterlockedExchange( &socket_info->network_events, 0 ); - if( socket_info->network_events & FD_ACCEPT ) + if( lpNetworkEvents->lNetworkEvents & FD_ACCEPT ) { - CL_TRACE( IBSP_DBG_NEV, gdbg_lvl, ("FD_ACCEPT\n") ); - lpNetworkEvents->lNetworkEvents |= FD_ACCEPT; - lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] = socket_info->errno_accept; + IBSP_TRACE1( IBSP_DBG_NEV, + ("socket %p notify FD_ACCEPT at time %I64d\n", + socket_info, cl_get_time_stamp()) ); + lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] = 0; } - if( socket_info->network_events & FD_CONNECT ) + if( lpNetworkEvents->lNetworkEvents & FD_CONNECT ) { - CL_TRACE( IBSP_DBG_NEV, gdbg_lvl, ("FD_CONNECT\n") ); - lpNetworkEvents->lNetworkEvents |= FD_CONNECT; + IBSP_TRACE1( IBSP_DBG_NEV, + ("socket %p notify FD_CONNECT %d at time %I64d\n", + socket_info, socket_info->errno_connect, cl_get_time_stamp()) ); lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] = socket_info->errno_connect; } - socket_info->network_events = 0; - - ResetEvent( hEventObject ); - - cl_spinlock_release( &socket_info->event_mutex ); - - CL_TRACE_EXIT( IBSP_DBG_NEV, gdbg_lvl, - ("returning %x, accept=%d, connect=%d\n", - lpNetworkEvents->lNetworkEvents, - lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT], - lpNetworkEvents->iErrorCode[FD_CONNECT_BIT]) ); - *lpErrno = 0; + IBSP_EXIT( IBSP_DBG_NEV ); return 0; } @@ -1046,30 +1024,38 @@ IBSPEventSelect( long lNetworkEvents, LPINT lpErrno ) { - struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s; + struct ibsp_socket_info *socket_info = (struct ibsp_socket_info *)s; + long events; - CL_ENTER( IBSP_DBG_NEV, gdbg_lvl ); + IBSP_ENTER( IBSP_DBG_NEV ); - fzprint(("%s():%d:0x%x:0x%x: socket=0x%p\n", __FUNCTION__, - __LINE__, GetCurrentProcessId(), GetCurrentThreadId(), s)); + IBSP_TRACE4( IBSP_DBG_NEV, + ("Socket %p requesting notifiction of %d on event %p.\n", + s, lNetworkEvents, hEventObject) ); if( (lNetworkEvents & ~(FD_ACCEPT | FD_CONNECT)) != 0 ) { - CL_TRACE_EXIT(IBSP_DBG_NEV, gdbg_lvl, + IBSP_TRACE_EXIT(IBSP_DBG_NEV, ("Unknown lNetworkEvents flag given (%x)\n", lNetworkEvents) ); *lpErrno = WSAEINVAL; return SOCKET_ERROR; } - CL_ASSERT( (hEventObject == NULL && socket_info->event_select != NULL) || - (hEventObject != NULL && socket_info->event_select == NULL) ); CL_ASSERT( lpErrno ); - if( hEventObject ) - socket_info->event_select = hEventObject; socket_info->event_mask = lNetworkEvents; + InterlockedExchangePointer( &socket_info->event_select, hEventObject ); + + events = InterlockedCompareExchange( &socket_info->network_events, 0, 0 ); + /* Check for existing events and signal as appropriate. */ + if( (socket_info->event_mask & events) && hEventObject ) + { + IBSP_TRACE2( IBSP_DBG_NEV, + ("Signaling eventHandle %p .\n", socket_info->event_select) ); + SetEvent( hEventObject ); + } - CL_EXIT( IBSP_DBG_NEV, gdbg_lvl ); + IBSP_EXIT( IBSP_DBG_NEV ); return 0; } diff --git a/branches/fab_cm_branch/ulp/wsd/user/ibspdll.h b/branches/fab_cm_branch/ulp/wsd/user/ibspdll.h index 52938cc4..e03a95c9 100644 --- a/branches/fab_cm_branch/ulp/wsd/user/ibspdll.h +++ b/branches/fab_cm_branch/ulp/wsd/user/ibspdll.h @@ -42,7 +42,8 @@ #include #include -#include "iba/ib_al.h" +#include +#include #include "ibspdefines.h" #include "ibspdebug.h" diff --git a/branches/fab_cm_branch/ulp/wsd/user/ibspproto.h b/branches/fab_cm_branch/ulp/wsd/user/ibspproto.h index 8e74c60d..a9b11227 100644 --- a/branches/fab_cm_branch/ulp/wsd/user/ibspproto.h +++ b/branches/fab_cm_branch/ulp/wsd/user/ibspproto.h @@ -258,6 +258,12 @@ void ib_deregister_all_mr( IN struct mr_list *mem_list ); +void +ibsp_post_select_event( + struct ibsp_socket_info *socket_info, + int event, + int error ); + /* ibspdll.c */ extern int init_globals( void ); diff --git a/branches/fab_cm_branch/ulp/wsd/user/ibspstruct.h b/branches/fab_cm_branch/ulp/wsd/user/ibspstruct.h index 2a76baee..e5d79acd 100644 --- a/branches/fab_cm_branch/ulp/wsd/user/ibspstruct.h +++ b/branches/fab_cm_branch/ulp/wsd/user/ibspstruct.h @@ -260,12 +260,10 @@ struct ibsp_socket_info } info; /* Variables associated with IBSPSelectEvent */ - cl_spinlock_t event_mutex; WSAEVENT event_select; /* Handle to Event Object */ long event_mask; /* Events we care about */ long network_events; /* Events that happenned */ int errno_connect; /* errno code (if any) returned by connect */ - int errno_accept; /* errno code (if any) returned by accept */ struct ibsp_socket_options socket_options; /* Socket Options */ diff --git a/branches/fab_cm_branch/ulp/wsd/user/sockinfo.c b/branches/fab_cm_branch/ulp/wsd/user/sockinfo.c index ad144137..d008072c 100644 --- a/branches/fab_cm_branch/ulp/wsd/user/sockinfo.c +++ b/branches/fab_cm_branch/ulp/wsd/user/sockinfo.c @@ -58,7 +58,6 @@ create_socket_info(void) cl_qlist_init( &socket_info->buf_mem_list.list ); cl_spinlock_init( &socket_info->buf_mem_list.mutex ); - cl_spinlock_init( &socket_info->event_mutex ); cl_qlist_init( &socket_info->info.listen.list ); @@ -93,7 +92,6 @@ free_socket_info( IBSP_ENTER( IBSP_DBG_SI ); cl_spinlock_destroy( &socket_info->buf_mem_list.mutex ); - cl_spinlock_destroy( &socket_info->event_mutex ); cl_spinlock_destroy( &socket_info->mutex ); cl_spinlock_destroy( &socket_info->send_lock ); -- 2.41.0