[Openib-windows] Adding some debug printing to ipoib

Tzachi Dar tzachid at mellanox.co.il
Tue May 16 05:05:00 PDT 2006


Hi Fab,
 
Anything new with this checkin?
 
Thanks
Tzachi



________________________________

	From: openib-windows-bounces at openib.org
[mailto:openib-windows-bounces at openib.org] On Behalf Of Tzachi Dar
	Sent: Thursday, May 04, 2006 6:37 PM
	To: Fab Tillier; openib-windows at openib.org
	Subject: [Openib-windows] Adding some debug printing to ipoib
	
	
	Hi Fab,
	 
	Attached is a small patch that allows debug printing of PNP
events to be printed with the name of the event.
	 
	Thanks
	Tzachi
	 
	 
	Index: inc/iba/ib_al.h
	
===================================================================
	--- inc/iba/ib_al.h (revision 333)
	+++ inc/iba/ib_al.h (working copy)
	@@ -8104,6 +8104,34 @@
	 
	 #define IB_PNP_REG_COMPLETE    IB_PNP_FLAG_REG_COMPLETE
	 
	+AL_INLINE char * get_pnp_event_name(int event)
	+{
	+ switch( event )
	+ {
	+ case IB_PNP_CA_ADD     : return "IB_PNP_CA_ADD";
	+ case IB_PNP_CA_REMOVE    : return "IB_PNP_CA_REMOVE";
	+ case IB_PNP_PORT_ADD    : return "IB_PNP_PORT_ADD";
	+ case IB_PNP_PORT_REMOVE    : return "IB_PNP_PORT_REMOVE";
	+ case IB_PNP_PORT_INIT    : return "IB_PNP_PORT_INIT";
	+ case IB_PNP_PORT_ARMED    : return "IB_PNP_PORT_ARMED";
	+ case IB_PNP_PORT_ACTIVE    : return "IB_PNP_PORT_ACTIVE";
	+ case IB_PNP_PORT_DOWN    : return "IB_PNP_PORT_DOWN";
	+ case IB_PNP_PKEY_CHANGE    : return "IB_PNP_PKEY_CHANGE";
	+ case IB_PNP_SM_CHANGE    : return "IB_PNP_SM_CHANGE";
	+ case IB_PNP_GID_CHANGE    : return "IB_PNP_GID_CHANGE";
	+ case IB_PNP_LID_CHANGE    : return "IB_PNP_LID_CHANGE";
	+ case IB_PNP_SUBNET_TIMEOUT_CHANGE : return
"IB_PNP_SUBNET_TIMEOUT_CHANGE";
	+ case IB_PNP_IOU_ADD     : return "IB_PNP_IOU_ADD";
	+ case IB_PNP_IOU_REMOVE    : return "IB_PNP_IOU_REMOVE";
	+ case IB_PNP_IOC_ADD     : return "IB_PNP_IOC_ADD";
	+ case IB_PNP_IOC_REMOVE    : return "IB_PNP_IOC_REMOVE";
	+ case IB_PNP_IOC_PATH_ADD   : return "IB_PNP_IOC_PATH_ADD";
	+ case IB_PNP_IOC_PATH_REMOVE   : return
"IB_PNP_IOC_PATH_REMOVE";
	+ case IB_PNP_REG_COMPLETE   : return "IB_PNP_REG_COMPLETE";
	+ }
	+ return "Unknown";
	+}
	+
	 typedef uint32_t ib_pnp_event_t;
	 /*
	 * VALUES
	Index: ulp/ipoib/kernel/ipoib_adapter.c
	
===================================================================
	--- ulp/ipoib/kernel/ipoib_adapter.c (revision 333)
	+++ ulp/ipoib/kernel/ipoib_adapter.c (working copy)
	@@ -506,7 +506,7 @@
	  }
	 
	  IPOIB_TRACE( IPOIB_DBG_INFO,
	-  ("p_pnp_rec->pnp_event = 0x%x\n",p_pnp_rec->pnp_event));
	+  ("p_pnp_rec->pnp_event = 0x%x (%s)\n",p_pnp_rec->pnp_event,
get_pnp_event_name(p_pnp_rec->pnp_event)));
	 
	  p_port_rec = (ib_pnp_port_rec_t*)p_pnp_rec;
	 
	@@ -634,8 +634,8 @@
	 
	  default:
	   IPOIB_TRACE( IPOIB_DBG_INFO,
	-   ("IPOIB: Received unhandled PnP event 0x%x\n",
	-   p_pnp_rec->pnp_event) );
	+   ("IPOIB: Received unhandled PnP event 0x%x (%s)\n",
	+   p_pnp_rec->pnp_event,
get_pnp_event_name(p_pnp_rec->pnp_event)) );
	   /* Fall through. */
	  case IB_PNP_PKEY_CHANGE:
	  case IB_PNP_SM_CHANGE:
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060516/83b45e60/attachment.html>


More information about the ofw mailing list