opensm/osmeventplugin: added new events to monitor SM
PATCH v6 1/1 opensm/osmeventplugin: added new events to monitor SM
Adding new events that allow event plug-in to see when SM starts/finishes heavy sweep and routing configuration, when it updates dump files, when it is no longer master, when SM port is down, and when SA DB is actually dumped at the end of light sweep:
OSM_EVENT_ID_HEAVY_SWEEP_START
OSM_EVENT_ID_HEAVY_SWEEP_DONE
OSM_EVENT_ID_UCAST_ROUTING_DONE
OSM_EVENT_ID_STATE_CHANGE
OSM_EVENT_ID_SA_DB_DUMPED
---
Changes since v5:
- Added OSM_EVENT_ID_HEAVY_SWEEP_START event.
Changes since v4:
- OSM_EVENT_ID_SA_DB_DUMPED was still reported during heavy sweep - removed.
Changes since v3:
- OSM_EVENT_ID_ENTERING_STANDBY and OSM_EVENT_ID_SM_PORT_DOWN replaced by OSM_EVENT_STATE_CHANGE
- OSM_EVENT_ID_SA_DB_DUMPED is not reported during heavy sweep, but only if SA DB was actually dumped at the end of light sweep
- fixed bug with OSM_EVENT_ID_MAX
--- opensm/include/opensm/osm_event_plugin.h | 5 +++++ opensm/opensm/osm_state_mgr.c | 20 ++++++++++++++++++-- opensm/osmeventplugin/src/osmeventplugin.c | 15 +++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-)
opensm/include/opensm/osm_event_plugin.h +5 -0
@@ -72,6 +72,11 @@ typedef enum {OSM_EVENT_ID_PORT_SELECT ,OSM_EVENT_ID_TRAP ,OSM_EVENT_ID_SUBNET_UP , +OSM_EVENT_ID_HEAVY_SWEEP_START , +OSM_EVENT_ID_HEAVY_SWEEP_DONE , +OSM_EVENT_ID_UCAST_ROUTING_DONE , +OSM_EVENT_ID_STATE_CHANGE , +OSM_EVENT_ID_SA_DB_DUMPED ,OSM_EVENT_ID_MAX } osm_epi_event_id_t;
opensm/opensm/osm_state_mgr.c +18 -2
@@ -1107,8 +1107,10 @@ static void do_sweep(osm_sm_t * sm)if (wait_for_pending_transactions (&sm->p_subn->p_osm->stats))return ;if (!sm->p_subn->force_heavy_sweep) { -if (sm->p_subn->opt.sa_db_dump) -osm_sa_db_file_dump (sm->p_subn->p_osm); +if (sm->p_subn->opt.sa_db_dump && + !osm_sa_db_file_dump (sm->p_subn->p_osm)) +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_SA_DB_DUMPED ,NULL );OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"LIGHT SWEEP COMPLETE" );return ;
@@ -1151,10 +1153,15 @@ static void do_sweep(osm_sm_t * sm)if (!sm->p_subn->subnet_initialization_error) {OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"REROUTE COMPLETE" ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_UCAST_ROUTING_DONE ,NULL );return ; } } +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_HEAVY_SWEEP_START ,NULL ); +/* go to heavy sweep */ repeat_discovery:
@@ -1185,6 +1192,8 @@ repeat_discovery:/* Move to DISCOVERING state */ osm_sm_state_mgr_process (sm,OSM_SM_SIGNAL_DISCOVER ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_STATE_CHANGE ,NULL );return ; }
@@ -1205,6 +1214,8 @@ repeat_discovery: "ENTERING STANDBY STATE");/* notify master SM about us */ osm_send_trap144 (sm,0 ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_STATE_CHANGE ,NULL );return ; }
@@ -1212,6 +1223,9 @@ repeat_discovery:if (sm->p_subn->force_heavy_sweep) goto repeat_discovery; +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_HEAVY_SWEEP_DONE ,NULL ); +OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"HEAVY SWEEP COMPLETE" );/* If we are MASTER - get the highest remote_sm, and
@@ -1314,6 +1328,8 @@ repeat_discovery:OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"SWITCHES CONFIGURED FOR UNICAST" ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_UCAST_ROUTING_DONE ,NULL );if (!sm->p_subn->opt.disable_multicast) {osm_mcast_mgr_process (sm);
opensm/osmeventplugin/src/osmeventplugin.c +15 -0
@@ -176,6 +176,21 @@ static void report(void *_log, osm_epi_event_id_t event_id, void *event_data)case OSM_EVENT_ID_SUBNET_UP :fprintf (log->log_file,"Subnet up reported\n" );break ; +case OSM_EVENT_ID_HEAVY_SWEEP_START : +fprintf (log->log_file,"Heavy sweep started\n" ); +break ; +case OSM_EVENT_ID_HEAVY_SWEEP_DONE : +fprintf (log->log_file,"Heavy sweep completed\n" ); +break ; +case OSM_EVENT_ID_UCAST_ROUTING_DONE : +fprintf (log->log_file,"Unicast routing completed\n" ); +break ; +case OSM_EVENT_ID_STATE_CHANGE : +fprintf (log->log_file,"SM state changed\n" ); +break ; +case OSM_EVENT_ID_SA_DB_DUMPED : +fprintf (log->log_file,"SA DB dump file updated\n" ); +break ;case OSM_EVENT_ID_MAX :default : osm_log(log->osmlog, OSM_LOG_ERROR,
Signature · 6 lines
1.5.1.4 -- 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 Yevgeny,
Quoted 6 lines · Yevgeny Kliteynik
Adding new events that allow event plug-in to see when SM starts/finishes heavy sweep and routing configuration, when it updates dump files, when it is no longer master, when SM port is down, and when SA DB is actually dumped at the end of light sweep:
Quoted 7 lines
OSM_EVENT_ID_HEAVY_SWEEP_START
OSM_EVENT_ID_HEAVY_SWEEP_DONE
OSM_EVENT_ID_UCAST_ROUTING_DONE
OSM_EVENT_ID_STATE_CHANGE
OSM_EVENT_ID_SA_DB_DUMPEDSigned-off-by Yevgeny Kliteynik <[email protected]>
I'm applying this, Thanks.
However I would strongly suggest few improvements - see below.
Quoted 29 lines
---
Changes since v5:
- AddedOSM_EVENT_ID_HEAVY_SWEEP_STARTevent.Changes since v4:
-OSM_EVENT_ID_SA_DB_DUMPEDwas still reported during heavy sweep - removed.Changes since v3:
-OSM_EVENT_ID_ENTERING_STANDBYandOSM_EVENT_ID_SM_PORT_DOWNreplaced byOSM_EVENT_STATE_CHANGE
-OSM_EVENT_ID_SA_DB_DUMPEDis not reported during heavy sweep, but only if SA DB was actually dumped at the end of light sweep
- fixed bug withOSM_EVENT_ID_MAXSigned-off-by Yevgeny Kliteynik <[email protected]>--- opensm/include/opensm/osm_event_plugin.h | 5 +++++ opensm/opensm/osm_state_mgr.c | 20 ++++++++++++++++++-- opensm/osmeventplugin/src/osmeventplugin.c | 15 +++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-)opensm/include/opensm/osm_event_plugin.h +0
-0
opensm/include/opensm/osm_event_plugin.h typedef enum { · line 76
Quoted 5 lines
opensm/include/opensm/osm_event_plugin.h +2
-0@@ -72,6 +72,11 @@ typedef enum {OSM_EVENT_ID_PORT_SELECT ,OSM_EVENT_ID_TRAP ,OSM_EVENT_ID_SUBNET_UP , +OSM_EVENT_ID_HEAVY_SWEEP_START , + OSM_EVENT_ID_HEAVY_SWEEP_DONE,
I see that this one is used to indicate a discovery sweep phase completion. Would it be better to rename this as OSM_EVENT_ID_DISCOVERY_DONE?
Quoted 40 lines
opensm/include/opensm/osm_event_plugin.h +3
-0+OSM_EVENT_ID_UCAST_ROUTING_DONE , +OSM_EVENT_ID_STATE_CHANGE , +OSM_EVENT_ID_SA_DB_DUMPED , OSM_EVENT_ID_MAX } osm_epi_event_id_t;opensm/opensm/osm_state_mgr.c +9
-2@@ -1107,8 +1107,10 @@ static void do_sweep(osm_sm_t * sm)if (wait_for_pending_transactions (&sm->p_subn->p_osm->stats))return ;if (!sm->p_subn->force_heavy_sweep) { -if (sm->p_subn->opt.sa_db_dump) -osm_sa_db_file_dump (sm->p_subn->p_osm); +if (sm->p_subn->opt.sa_db_dump && + !osm_sa_db_file_dump (sm->p_subn->p_osm)) +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_SA_DB_DUMPED ,NULL );OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"LIGHT SWEEP COMPLETE" );return ;@@ -1151,10 +1153,15 @@ static void do_sweep(osm_sm_t * sm)if (!sm->p_subn->subnet_initialization_error) {OSM_LOG_MSG_BOX (sm->p_log,OSM_LOG_VERBOSE ,"REROUTE COMPLETE" ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_UCAST_ROUTING_DONE ,NULL );return ; } } +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_HEAVY_SWEEP_START ,NULL ); +/* go to heavy sweep */ repeat_discovery:
opensm/opensm/osm_state_mgr.c repeat_discovery: · line 1196
Quoted 5 lines
opensm/opensm/osm_state_mgr.c +2
-0@@ -1185,6 +1192,8 @@ repeat_discovery:/* Move to DISCOVERING state */ osm_sm_state_mgr_process (sm,OSM_SM_SIGNAL_DISCOVER ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_STATE_CHANGE ,NULL );
I think, that if we are introducing "SM state change" event then this should report any state change and not only "going to stand-by". I would prefer to see this report call inside osm_sm_state_mgr_process().
opensm/opensm/osm_state_mgr.c repeat_discovery: · line 1218
Quoted 9 lines
opensm/opensm/osm_state_mgr.c +2
-0return ; }@@ -1205,6 +1214,8 @@ repeat_discovery: "ENTERING STANDBY STATE");/* notify master SM about us */ osm_send_trap144 (sm,0 ); +osm_opensm_report_event (sm->p_subn->p_osm, +OSM_EVENT_ID_STATE_CHANGE ,NULL );
Ditto.
Sasha
--
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