opensm: Only log SM PORT "state" when it changes
PATCH 1/1 opensm: Only log SM PORT "state" when it changes
rather than every sweep time
so don't spam syslog and opensm.log when port stays down
---
include/opensm/osm_subnet.h +5 -0
@@ -548,6 +548,7 @@ typedef struct osm_subn {ib_net16_t master_sm_base_lid;ib_net16_t sm_base_lid;ib_net64_t sm_port_guid; +uint8_t last_sm_port_state;uint8_t sm_state;osm_subn_opt_t opt;struct osm_qos_policy *p_qos_policy;
@@ -607,6 +608,10 @@ typedef struct osm_subn {* sm_port_guid * This SM's own port GUID. * +* last_sm_port_state +* Last state of this SM's port. +* 0 is down and 1 is up. +* * sm_state * The high-level state of the SM. This value is made available * in the SMInfo attribute.
opensm/osm_state_mgr.c +13 -2
@@ -1198,8 +1198,12 @@ repeat_discovery:return ;if (state_mgr_is_sm_port_down (sm) == TRUE) { -osm_log (sm->p_log,OSM_LOG_SYS ,"SM port is down\n" ); -OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"SM PORT DOWN" ); +if (sm->p_subn->last_sm_port_state) { + sm->p_subn->last_sm_port_state =0 ; +osm_log (sm->p_log,OSM_LOG_SYS ,"SM port is down\n" ); +OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE , +"SM PORT DOWN" ); + }/* Run the drop manager - we want to clear all records */ osm_drop_mgr_process (sm);
@@ -1210,6 +1214,13 @@ repeat_discovery:osm_opensm_report_event (sm->p_subn->p_osm,OSM_EVENT_ID_STATE_CHANGE ,NULL );return ; + }else { +if (!sm->p_subn->last_sm_port_state) { + sm->p_subn->last_sm_port_state =1 ; +osm_log (sm->p_log,OSM_LOG_SYS ,"SM port is up\n" ); +OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE , +"SM PORT UP" ); + } } status =state_mgr_sweep_hop_1 (sm);
opensm/osm_subnet.c +1 -0
@@ -563,6 +563,7 @@ ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn, IN osm_opensm_t * p_osm,/* we assume master by default - so we only need to set it true if STANDBY */ p_subn->coming_out_of_standby = FALSE; p_subn->sweeping_enabled = TRUE; + p_subn->last_sm_port_state =1 ;return IB_SUCCESS ; }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 4E85E347.3030005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Very fast service, thanks Hal!
I'll try this out today but I'm sure it's exactly what we would want.
- R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Hal,
Quoted 6 lines · Hal Rosenstock
rather than every sweep time
so don't spam syslog and opensm.log when port stays down---
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html