[Openib-windows] [PATCH] use of event log for link up/down msg

Yossi Leybovich sleybo at mellanox.co.il
Sun Dec 11 08:23:04 PST 2005


Fab
 
I create patch that enable to log port up\down events to the log viewer.
I add msg file to the repository.
In the near future I will send patch that will add more massages to the
log viewer(I will also use the NDIS_ERROR_CODE  defines from ndis.h)

Pls review
10x
Yossi 
 
Index: ulp/ipoib/kernel/ipoib.rc
===================================================================
--- ulp/ipoib/kernel/ipoib.rc (revision 814)
+++ ulp/ipoib/kernel/ipoib.rc (working copy)
@@ -45,3 +45,4 @@
 #define VER_ORIGINALFILENAME_STR "ipoib.sys"
 
 #include <common.ver>
+#include "ipoib_log.rc"
Index: ulp/ipoib/kernel/ipoib_adapter.c
===================================================================
--- ulp/ipoib/kernel/ipoib_adapter.c (revision 814)
+++ ulp/ipoib/kernel/ipoib_adapter.c (working copy)
@@ -880,6 +949,11 @@
 
   /* Now that we're in the broadcast group, notify that we have a link.
*/
   IPOIB_TRACE( IPOIB_DBG_INFO, ("Link UP!\n") );
+   NdisWriteErrorLogEntry(
+     p_adapter->h_adapter,
+     EVENT_IPOIB_PORT_UP,
+     0);
+ 
   NdisMIndicateStatus( p_adapter->h_adapter, NDIS_STATUS_MEDIA_CONNECT,
    NULL, 0 );
   NdisMIndicateStatusComplete( p_adapter->h_adapter );
 
Index: ulp/ipoib/kernel/ipoib_driver.c
===================================================================
--- ulp/ipoib/kernel/ipoib_driver.c (revision 814)
+++ ulp/ipoib/kernel/ipoib_driver.c (working copy)
@@ -634,11 +634,24 @@
  ib_status = ipoib_start_adapter( p_adapter );
  if( ib_status != IB_SUCCESS )
  {
+  NdisWriteErrorLogEntry(
+   h_adapter,
+   NDIS_ERROR_CODE_HARDWARE_FAILURE,
+   0);
   ipoib_destroy_adapter( p_adapter );
   IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,
    ("ipoib_start_adapter returned status %d.\n", ib_status ) );
   return NDIS_STATUS_FAILURE;
  }
+ else
+ {
+  NdisWriteErrorLogEntry(
+   h_adapter,
+   EVENT_IPOIB_INIT_SUCCESS,
+   0);
+  
+ }
+ 
 
  ipoib_ref_ibat();
 
Index: ulp/ipoib/kernel/ipoib_driver.h
===================================================================
--- ulp/ipoib/kernel/ipoib_driver.h (revision 814)
+++ ulp/ipoib/kernel/ipoib_driver.h (working copy)
@@ -33,7 +33,7 @@
 #ifndef _IPOIB_DRIVER_H_
 #define _IPOIB_DRIVER_H_
 
-
+#include "ipoib_log.h"
 #include "ipoib_adapter.h"
 #include <complib/cl_spinlock.h>
 #include <complib/cl_qlist.h>
Index: ulp/ipoib/kernel/ipoib_log.mc
===================================================================
--- ulp/ipoib/kernel/ipoib_log.mc (revision 0)
+++ ulp/ipoib/kernel/ipoib_log.mc (revision 0)
@@ -0,0 +1,67 @@
+;/*++
+;======================================================================
==============
+;Copyright (c) 2001 Mellanox Technologies
+;
+;Module Name:
+;
+;    ipoiblog.mc
+;
+;Abstract:
+;
+;    IPoIB Driver event log messages
+;
+;Authors:
+;
+;    Yossi Leybovich
+;
+;Environment:
+;
+;   Kernel Mode .
+;
+;======================================================================
===============
+;--*/
+;
+MessageIdTypedef = NDIS_ERROR_CODE
+
+SeverityNames = (
+ Success    = 0x0:STATUS_SEVERITY_SUCCESS
+ Informational = 0x1:STATUS_SEVERITY_INFORMATIONAL
+ Warning    = 0x2:STATUS_SEVERITY_WARNING
+ Error    = 0x3:STATUS_SEVERITY_ERROR
+ )
+
+FacilityNames = (
+ System  = 0x0
+ RpcRuntime = 0x2:FACILITY_RPC_RUNTIME
+ RpcStubs = 0x3:FACILITY_RPC_STUBS
+ Io   = 0x4:FACILITY_IO_ERROR_CODE
+ IPoIB   = 0x7:FACILITY_IPOIB_ERROR_CODE
+ )
+
+
+MessageId=0x0001
+Facility=IPoIB
+Severity=Warning
+SymbolicName=EVENT_IPOIB_PORT_DOWN
+Language=English
+%2: Network controller link is down.
+.
+
+
+MessageId=+1
+Facility=IPoIB
+Severity=Informational
+SymbolicName=EVENT_IPOIB_PORT_UP
+Language=English
+%2: Network controller link is up.
+.
+
+MessageId=+1
+Facility=IPoIB
+Severity=Informational
+SymbolicName=EVENT_IPOIB_INIT_SUCCESS
+Language=English
+%2: Driver Initialized succesfully.
+.
+
+
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c (revision 814)
+++ ulp/ipoib/kernel/ipoib_port.c (working copy)
@@ -4724,7 +4724,10 @@
  /* Mark our state.  This causes all callbacks to abort. */
  cl_obj_lock( &p_port->obj );
  p_port->state = IB_QPS_ERROR;
-
+  NdisWriteErrorLogEntry(
+   p_port->p_adapter->h_adapter,
+   EVENT_IPOIB_PORT_DOWN,
+   0);
  if( p_port->ib_mgr.h_query )
  {
   p_port->p_adapter->p_ifc->cancel_query( p_port->p_adapter->h_al,
p_port->ib_mgr.h_query );
Index: ulp/ipoib/kernel/netipoib.inf
===================================================================
--- ulp/ipoib/kernel/netipoib.inf (revision 814)
+++ ulp/ipoib/kernel/netipoib.inf (working copy)
@@ -141,7 +141,7 @@
 AddReg = IpoibAddEventLogReg
 
 [IpoibAddEventLogReg]
-HKR, , EventMessageFile, 0x00020000,
"%%SystemRoot%%\System32\netevent.dll"
+HKR, , EventMessageFile, 0x00020000,
"%%SystemRoot%%\System32\netevent.dll";"%%SystemRoot%%\System32\drivers\
ipoib.sys"
 HKR, , TypesSupported,   0x00010001, 7
 
 
Index: ulp/ipoib/kernel/SOURCES
===================================================================
--- ulp/ipoib/kernel/SOURCES (revision 814)
+++ ulp/ipoib/kernel/SOURCES (working copy)
@@ -2,7 +2,8 @@
 TARGETPATH=..\..\..\bin\kernel\obj$(BUILD_ALT_DIR)
 TARGETTYPE=DRIVER
 
-SOURCES= ipoib.rc \
+SOURCES=  ipoib_log.mc \
+  ipoib.rc \
   ipoib_driver.c \
   ipoib_adapter.c \
   ipoib_endpoint.c \

-------------- next part --------------
A non-text attachment was scrubbed...
Name: eventlog.patch
Type: application/octet-stream
Size: 5212 bytes
Desc: eventlog.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051211/49dc2b5b/attachment.obj>


More information about the ofw mailing list