[Openib-windows] WSD - building with IBSP_LOGGING enabled

Tzachi Dar tzachid at mellanox.co.il
Thu Jun 22 00:07:58 PDT 2006


Committed in rev 389.
 
Thanks
Tzachi


________________________________

	From: Tzachi Dar 
	Sent: Thursday, June 15, 2006 3:28 PM
	To: Fab Tillier; openib-windows at openib.org
	Subject: WSD - building with IBSP_LOGGING enabled
	
	
	Hi Fab,
	 
	While debugging failures on WSD I have found that when building
with IBSP_LOGGING enabled, the build fails.
	 
	The following small patch fixes this problem.
	(Please note, the patch looks longer than it is as it just moves
one function from a .h file to .c file)
	 
	Thanks
	Tzachi
	 
	+#ifndef IBSPDEBUG_H
	+#define IBSPDEBUG_H
	+
	 #include "ibspdll.h"
	 #include <complib/cl_atomic.h>
	 
	@@ -169,3 +172,4 @@
	      DataLogger     *pLoger );
	 
	 #endif /* IBSP_LOGGING */
	+#endif /* IBSPDEBUG_H */
	Index: ibspdll.c
	
===================================================================
	--- ibspdll.c (revision 385)
	+++ ibspdll.c (working copy)
	@@ -2264,4 +2264,39 @@
	  return 0;
	 }
	 
	+inline void
	+ibsp_css(
	+     char      *calling_func,
	+     int       line,
	+     struct ibsp_socket_info  *s,
	+     enum ibsp_socket_state  new_state )
	+{
	+ enum ibsp_socket_state old_state;
	 
	+ UNUSED_PARAM( calling_func );
	+ UNUSED_PARAM( line );
	+
	+ old_state = s->socket_state;
	+
	+ if( old_state == new_state )
	+ {
	+  /* Nothing to change */
	+  return;
	+ }
	+
	+ /* IBSP_CLOSED is a dead end state */
	+ if( old_state == IBSP_CLOSED )
	+ {
	+  fzprint(("%s():0x%x:0x%x: socket=0x%p cannot change from %s
to %s, called by %s():%d\n", __FUNCTION__, GetCurrentProcessId(),
GetCurrentThreadId(), s, IBSP_SOCKET_STATE_STR(old_state),
IBSP_SOCKET_STATE_STR(new_state), calling_func, line));
	+  return;
	+ }
	+
	+ fzprint(("%s():0x%x:0x%x: socket=0x%p %s to %s, called by
%s():%d\n", __FUNCTION__,
	+    GetCurrentProcessId(),
	+    GetCurrentThreadId(), s,
	+    IBSP_SOCKET_STATE_STR(old_state),
	+    IBSP_SOCKET_STATE_STR(new_state), calling_func, line));
	+
	+ s->socket_state = new_state;
	+}
	+
	Index: ibspstruct.h
	
===================================================================
	--- ibspstruct.h (revision 385)
	+++ ibspstruct.h (working copy)
	@@ -334,37 +334,8 @@
	      char      *calling_func,
	      int       line,
	      struct ibsp_socket_info  *s,
	-     enum ibsp_socket_state  new_state )
	-{
	- enum ibsp_socket_state old_state;
	+     enum ibsp_socket_state  new_state );
	 
	- UNUSED_PARAM( calling_func );
	- UNUSED_PARAM( line );
	-
	- old_state = s->socket_state;
	-
	- if( old_state == new_state )
	- {
	-  /* Nothing to change */
	-  return;
	- }
	-
	- /* IBSP_CLOSED is a dead end state */
	- if( old_state == IBSP_CLOSED )
	- {
	-  fzprint(("%s():0x%x:0x%x: socket=0x%p cannot change from %s
to %s, called by %s():%d\n", __FUNCTION__, GetCurrentProcessId(),
GetCurrentThreadId(), s, IBSP_SOCKET_STATE_STR(old_state),
IBSP_SOCKET_STATE_STR(new_state), calling_func, line));
	-  return;
	- }
	-
	- fzprint(("%s():0x%x:0x%x: socket=0x%p %s to %s, called by
%s():%d\n", __FUNCTION__,
	-    GetCurrentProcessId(),
	-    GetCurrentThreadId(), s,
	-    IBSP_SOCKET_STATE_STR(old_state),
	-    IBSP_SOCKET_STATE_STR(new_state), calling_func, line));
	-
	- s->socket_state = new_state;
	-}
	-
	 #define IBSP_CHANGE_SOCKET_STATE(socket_info, new_state) \
	  ibsp_css(__FUNCTION__, __LINE__, socket_info, new_state)
	 
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060622/0dfe9447/attachment.html>


More information about the ofw mailing list