[Openib-windows] Adding some debug printing to ipoib

Tzachi Dar tzachid at mellanox.co.il
Thu May 4 08:36:38 PDT 2006


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/20060504/e98a8d37/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_print.diff
Type: application/octet-stream
Size: 2462 bytes
Desc: ipoib_print.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060504/e98a8d37/attachment.obj>


More information about the ofw mailing list