From: ftillier Date: Mon, 19 Dec 2005 19:30:43 +0000 (+0000) Subject: [IPoIB] Add support for event logging X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=7151cbbc9b8ec3e59fb518dbd507d2c2027c5152;p=~shefty%2Frdma-win.git [IPoIB] Add support for event logging Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il) git-svn-id: svn://openib.tc.cornell.edu/gen1@212 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/ipoib/kernel/SOURCES b/trunk/ulp/ipoib/kernel/SOURCES index dda21429..75f58a53 100644 --- a/trunk/ulp/ipoib/kernel/SOURCES +++ b/trunk/ulp/ipoib/kernel/SOURCES @@ -2,7 +2,8 @@ TARGETNAME=ipoib 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 \ diff --git a/trunk/ulp/ipoib/kernel/ipoib.rc b/trunk/ulp/ipoib/kernel/ipoib.rc index 9d04836f..525372fd 100644 --- a/trunk/ulp/ipoib/kernel/ipoib.rc +++ b/trunk/ulp/ipoib/kernel/ipoib.rc @@ -45,3 +45,4 @@ #define VER_ORIGINALFILENAME_STR "ipoib.sys" #include +#include "ipoib_log.rc" diff --git a/trunk/ulp/ipoib/kernel/ipoib_adapter.c b/trunk/ulp/ipoib/kernel/ipoib_adapter.c index ca07bccf..47a4ad3e 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_adapter.c +++ b/trunk/ulp/ipoib/kernel/ipoib_adapter.c @@ -806,35 +806,65 @@ __ipoib_pnp_dereg( void ipoib_set_rate( IN ipoib_adapter_t* const p_adapter, - IN const uint8_t link_width ) + IN const uint8_t link_width, + IN const uint8_t link_speed ) { IPOIB_ENTER( IPOIB_DBG_INIT ); cl_obj_lock( &p_adapter->obj ); /* Set the link speed based on the IB link speed (1x vs 4x, etc). */ + switch( link_speed ) + { + case IB_LINK_SPEED_ACTIVE_2_5: + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link speed is 2.5Gs\n") ); + p_adapter->rate = IB_LINK_SPEED_ACTIVE_2_5; + break; + + case IB_LINK_SPEED_ACTIVE_5: + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link speed is 5G\n") ); + p_adapter->rate = IB_LINK_SPEED_ACTIVE_5; + break; + + case IB_LINK_SPEED_ACTIVE_10: + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link speed is 10G\n") ); + p_adapter->rate = IB_LINK_SPEED_ACTIVE_10; + break; + + default: + IPOIB_TRACE( IPOIB_DBG_ERROR, + ("Invalid link speed %d.\n", link_speed) ); + p_adapter->rate = 0; + } + switch( link_width ) { case IB_LINK_WIDTH_ACTIVE_1X: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Link speed is 2.5Gbps\n") ); - p_adapter->rate = ONE_X_IN_100BPS; + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link width is 1X\n") ); + p_adapter->rate *= ONE_X_IN_100BPS; break; case IB_LINK_WIDTH_ACTIVE_4X: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Link speed is 10Gbps\n") ); - p_adapter->rate = FOUR_X_IN_100BPS; + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link width is 4X\n") ); + p_adapter->rate *= FOUR_X_IN_100BPS; break; case IB_LINK_WIDTH_ACTIVE_12X: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Link speed is 30Gbps\n") ); - p_adapter->rate = TWELVE_X_IN_100BPS; + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link width is 12X\n") ); + p_adapter->rate *= TWELVE_X_IN_100BPS; break; default: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Invalid rate.\n") ); + IPOIB_TRACE( IPOIB_DBG_ERROR, + ("Invalid link rate (%d).\n", link_width) ); p_adapter->rate = 0; } cl_obj_unlock( &p_adapter->obj ); - IPOIB_EXIT( IPOIB_DBG_INIT ); } @@ -875,14 +905,22 @@ ipoib_set_active( /* Join all programmed multicast groups. */ for( i = 0; i < p_adapter->mcast_array_size; i++ ) { - ipoib_port_join_mcast( p_adapter->p_port, p_adapter->mcast_array[i] ); + ipoib_port_join_mcast( + p_adapter->p_port, p_adapter->mcast_array[i] ); } /* Register all existing addresses. */ ipoib_reg_addrs( p_adapter ); - /* Now that we're in the broadcast group, notify that we have a link. */ + /* + * 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 + (p_adapter->rate/ONE_X_IN_100BPS), + 1, p_adapter->rate ); + NdisMIndicateStatus( p_adapter->h_adapter, NDIS_STATUS_MEDIA_CONNECT, NULL, 0 ); NdisMIndicateStatusComplete( p_adapter->h_adapter ); diff --git a/trunk/ulp/ipoib/kernel/ipoib_adapter.h b/trunk/ulp/ipoib/kernel/ipoib_adapter.h index 8e63fe34..3a1849a1 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_adapter.h +++ b/trunk/ulp/ipoib/kernel/ipoib_adapter.h @@ -383,7 +383,8 @@ ipoib_inc_send_stat( void ipoib_set_rate( IN ipoib_adapter_t* const p_adapter, - IN const uint8_t rate ); + IN const uint8_t link_width, + IN const uint8_t link_speed ); void diff --git a/trunk/ulp/ipoib/kernel/ipoib_driver.c b/trunk/ulp/ipoib/kernel/ipoib_driver.c index 2cf63678..e87dc71b 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_driver.c +++ b/trunk/ulp/ipoib/kernel/ipoib_driver.c @@ -634,6 +634,8 @@ ipoib_initialize( 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 ) ); diff --git a/trunk/ulp/ipoib/kernel/ipoib_driver.h b/trunk/ulp/ipoib/kernel/ipoib_driver.h index 0d42d597..a3bb2cf3 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_driver.h +++ b/trunk/ulp/ipoib/kernel/ipoib_driver.h @@ -34,6 +34,7 @@ #define _IPOIB_DRIVER_H_ +#include "ipoib_log.h" #include "ipoib_adapter.h" #include #include diff --git a/trunk/ulp/ipoib/kernel/ipoib_log.mc b/trunk/ulp/ipoib/kernel/ipoib_log.mc new file mode 100644 index 00000000..7f7c8a81 --- /dev/null +++ b/trunk/ulp/ipoib/kernel/ipoib_log.mc @@ -0,0 +1,130 @@ +;/*++ +;============================================================================= +;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=0x0002 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP +Language=English +%2: Network controller link is up. +. + + +MessageId=0x0003 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP1 +Language=English +%2: Network controller link is up at 2.5Gbps. +. + +MessageId=0x0004 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP2 +Language=English +%2: Network controller link is up at 5Gbps. +. + +MessageId=0x0006 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP3 +Language=English +%2: Network controller link is up at 10Gbps. +. + +MessageId=0x000a +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP4 +Language=English +%2: Network controller link is up at 20Gps. +. + +MessageId=0x000e +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP5 +Language=English +%2: Network controller link is up at 30Gps. +. + +MessageId=0x0012 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP6 +Language=English +%2: Network controller link is up at 40Gps. +. + +MessageId=0x001a +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP7 +Language=English +%2: Network controller link is up at 60Gps. +. + +MessageId=0x0032 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_PORT_UP8 +Language=English +%2: Network controller link is up at 120Gps. +. + +MessageId=0x0040 +Facility=IPoIB +Severity=Informational +SymbolicName=EVENT_IPOIB_INIT_SUCCESS +Language=English +%2: Driver Initialized succesfully. +. + diff --git a/trunk/ulp/ipoib/kernel/ipoib_port.c b/trunk/ulp/ipoib/kernel/ipoib_port.c index 62abceac..756cc9a1 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_port.c +++ b/trunk/ulp/ipoib/kernel/ipoib_port.c @@ -4435,8 +4435,11 @@ __port_info_cb( IPOIB_TRACE( IPOIB_DBG_INFO, ("Received port info: link width = %d.\n", p_port_rec->port_info.link_width_active) ); + ipoib_set_rate( p_port->p_adapter, - p_port_rec->port_info.link_width_active ); + p_port_rec->port_info.link_width_active, + ib_port_info_get_link_speed_active( &p_port_rec->port_info ) ); + __port_get_mcast( p_port ); } else @@ -4725,6 +4728,9 @@ ipoib_port_down( 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 ); diff --git a/trunk/ulp/ipoib/kernel/netipoib.inf b/trunk/ulp/ipoib/kernel/netipoib.inf index 1d15fd1d..b0053e82 100644 --- a/trunk/ulp/ipoib/kernel/netipoib.inf +++ b/trunk/ulp/ipoib/kernel/netipoib.inf @@ -141,7 +141,7 @@ HKR,"Parameters","DebugFlags",%REG_DWORD_NO_CLOBBER%,0x80000000 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