Skip to contentSkip to conversation

opensm/osmeventplugin: added new events to monitor SM

PATCH Superseded Yevgeny Kliteynik 2 participants 3 messages Jun 10, 2010 – Jun 17, 2010 1 message not in the archive InfiniBand

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 opensm/osmeventplugin: added new events to monitor SM

Hi Sasha,

Adding new events that allow event plug-in to see when SM finishes heavy sweep and routing configuration, when it updates dump files, when it is no longer master, and when SM port is down:

OSM_EVENT_ID_HEAVY_SWEEP_DONE
OSM_EVENT_ID_UCAST_ROUTING_DONE
OSM_EVENT_ID_ENTERING_STANDBY
OSM_EVENT_ID_SM_PORT_DOWN
OSM_EVENT_ID_SA_DB_DUMPED

The last event is reported when SA DB is actually dumped.

---

Changes from V2:
- reduced number of events that are reported
- rebased to latest master

---
 opensm/include/opensm/osm_event_plugin.h   |    7 ++++++-
 opensm/opensm/osm_state_mgr.c              |   16 +++++++++++++++-
 opensm/osmeventplugin/src/osmeventplugin.c |   15 +++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)
opensm/include/opensm/osm_event_plugin.h +6 -1
index 33d1920..a565123 100644
@@ -72,7 +72,12 @@ typedef enum {
 	OSM_EVENT_ID_PORT_SELECT,
 	OSM_EVENT_ID_TRAP,
 	OSM_EVENT_ID_SUBNET_UP,
-	OSM_EVENT_ID_MAX
+	OSM_EVENT_ID_MAX,
+	OSM_EVENT_ID_HEAVY_SWEEP_DONE,
+	OSM_EVENT_ID_UCAST_ROUTING_DONE,
+	OSM_EVENT_ID_ENTERING_STANDBY,
+	OSM_EVENT_ID_SM_PORT_DOWN,
+	OSM_EVENT_ID_SA_DB_DUMPED
 } osm_epi_event_id_t;
 
 typedef struct osm_epi_port_id {
opensm/opensm/osm_state_mgr.c +15 -1
index 81c8f54..3231ae9 100644
@@ -1151,6 +1151,8 @@ 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;
 		}
 	}
@@ -1185,6 +1187,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_SM_PORT_DOWN, NULL);
 		return;
 	}
 
@@ -1205,6 +1209,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_ENTERING_STANDBY, NULL);
 		return;
 	}
 
@@ -1212,6 +1218,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 +1323,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);
@@ -1375,7 +1386,10 @@ repeat_discovery:
 
 		if (osm_log_is_active(sm->p_log, OSM_LOG_VERBOSE) ||
 		    sm->p_subn->opt.sa_db_dump)
-			osm_sa_db_file_dump(sm->p_subn->p_osm);
+			if (!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);
+
 	}
 
 	/*
opensm/osmeventplugin/src/osmeventplugin.c +15 -0
index b4d9ce9..af68a5c 100644
@@ -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_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_ENTERING_STANDBY:
+		fprintf(log->log_file, "Entering stand-by state\n");
+		break;
+	case OSM_EVENT_ID_SM_PORT_DOWN:
+		fprintf(log->log_file, "SM port is down\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 · 7 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

A message that is not in the archive (sent off-list or not yet received): 4C10CF60.8060904-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#2 lore raw
Quoted 9 lines · Yevgeny Kliteynik

Hi Sasha,

Adding new events that allow event plug-in to see when SM finishes heavy sweep and routing configuration, when it updates dump files, when it is no longer master, and when SM port is down:

OSM_EVENT_ID_HEAVY_SWEEP_DONE
OSM_EVENT_ID_UCAST_ROUTING_DONE

What is wrong with using Subnet Up event for those purposes?

Quoted 2 lines

OSM_EVENT_ID_ENTERING_STANDBY
OSM_EVENT_ID_SM_PORT_DOWN

Instead I would suggest to make "state change" event.

Quoted 1 line

OSM_EVENT_ID_SA_DB_DUMPED

Again, "Subnet Up" indicates that all sweep stuff is done (including dump files).

Quoted 21 lines

The last event is reported when SA DB is actually dumped.

---

Changes from V2:
- reduced number of events that are reported
- rebased to latest master

---
 opensm/include/opensm/osm_event_plugin.h   |    7 ++++++-
 opensm/opensm/osm_state_mgr.c              |   16 +++++++++++++++-
 opensm/osmeventplugin/src/osmeventplugin.c |   15 +++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)
opensm/include/opensm/osm_event_plugin.h +0 -0
index 33d1920..a565123 100644

opensm/include/opensm/osm_event_plugin.h typedef enum { · line 75

Quoted 5 lines
opensm/include/opensm/osm_event_plugin.h +1 -1
@@ -72,7 +72,12 @@ typedef enum {
 	OSM_EVENT_ID_PORT_SELECT,
 	OSM_EVENT_ID_TRAP,
 	OSM_EVENT_ID_SUBNET_UP,
-	OSM_EVENT_ID_MAX
+	OSM_EVENT_ID_MAX,

Likely you wanted to move OSM_EVENT_ID_MAX to be last in the list.

Sasha

Quoted 105 lines
opensm/include/opensm/osm_event_plugin.h +5 -0
+	OSM_EVENT_ID_HEAVY_SWEEP_DONE,
+	OSM_EVENT_ID_UCAST_ROUTING_DONE,
+	OSM_EVENT_ID_ENTERING_STANDBY,
+	OSM_EVENT_ID_SM_PORT_DOWN,
+	OSM_EVENT_ID_SA_DB_DUMPED
 } osm_epi_event_id_t;
 
 typedef struct osm_epi_port_id {
opensm/opensm/osm_state_mgr.c +15 -1
index 81c8f54..3231ae9 100644
@@ -1151,6 +1151,8 @@ 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;
 		}
 	}
@@ -1185,6 +1187,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_SM_PORT_DOWN, NULL);
 		return;
 	}
 
@@ -1205,6 +1209,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_ENTERING_STANDBY, NULL);
 		return;
 	}
 
@@ -1212,6 +1218,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 +1323,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);
@@ -1375,7 +1386,10 @@ repeat_discovery:
 
 		if (osm_log_is_active(sm->p_log, OSM_LOG_VERBOSE) ||
 		    sm->p_subn->opt.sa_db_dump)
-			osm_sa_db_file_dump(sm->p_subn->p_osm);
+			if (!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);
+
 	}
 
 	/*
opensm/osmeventplugin/src/osmeventplugin.c +15 -0
index b4d9ce9..af68a5c 100644
@@ -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_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_ENTERING_STANDBY:
+		fprintf(log->log_file, "Entering stand-by state\n");
+		break;
+	case OSM_EVENT_ID_SM_PORT_DOWN:
+		fprintf(log->log_file, "SM port is down\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 · 7 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

--
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

#3 lore raw

Hi Sasha,

Quoted 8 lines · Sasha Khapyorsky
Quoted 7 lines · Yevgeny Kliteynik

Hi Sasha,

Adding new events that allow event plug-in to see when SM finishes heavy sweep and routing configuration, when it updates dump files, when it is no longer master, and when SM port is down:

Quoted 4 lines
Quoted 2 lines

OSM_EVENT_ID_HEAVY_SWEEP_DONE
OSM_EVENT_ID_UCAST_ROUTING_DONE

What is wrong with using Subnet Up event for those purposes?

There is a big difference between SWEEP_DONE and SUBNET_UP events. The former happens before all the managers (drop manager, QoS, unicast and multicast routing, etc), so there is a long period between two events.
Moreover, after SWEEP_DONE there is a lot of information that is later cleared.

As for ROUTING_DONE, if OSM is doing re-route only, then routing might change, and we don't get SUBNET_UP event. Furthermore, when torus2QoS routing will be included in the SM, the re-route will also cause QoS configuration to change.

Quoted 4 lines
Quoted 2 lines

OSM_EVENT_ID_ENTERING_STANDBY
OSM_EVENT_ID_SM_PORT_DOWN

Instead I would suggest to make "state change" event.

OK

Quoted 4 lines
Quoted 1 line

OSM_EVENT_ID_SA_DB_DUMPED

Again, "Subnet Up" indicates that all sweep stuff is done (including dump files).

This is true. In fact, the way I posed it, there is no point adding this event. However, this event should also be sent when SA DB is dumped at the end of light sweep, and then SUBNET_UP cannot replace it.

Quoted 16 lines
Quoted 16 lines

The last event is reported when SA DB is actually dumped.

---

Changes from V2:
- reduced number of events that are reported
- rebased to latest master

---
  opensm/include/opensm/osm_event_plugin.h   |    7 ++++++-
  opensm/opensm/osm_state_mgr.c              |   16 +++++++++++++++-
  opensm/osmeventplugin/src/osmeventplugin.c |   15 +++++++++++++++
  3 files changed, 36 insertions(+), 2 deletions(-)
Quoted 12 lines

opensm/include/opensm/osm_event_plugin.h typedef enum { · line 75

Quoted 10 lines
opensm/include/opensm/osm_event_plugin.h +1 -1
index 33d1920..a565123 100644
@@ -72,7 +72,12 @@ typedef enum {
  	OSM_EVENT_ID_PORT_SELECT,
  	OSM_EVENT_ID_TRAP,
  	OSM_EVENT_ID_SUBNET_UP,
-	OSM_EVENT_ID_MAX
+	OSM_EVENT_ID_MAX,

Likely you wanted to move OSM_EVENT_ID_MAX to be last in the list.

Oops...

-- Yevgeny

Quoted 102 lines

Sasha

Quoted 100 lines
opensm/include/opensm/osm_event_plugin.h +5 -0
+	OSM_EVENT_ID_HEAVY_SWEEP_DONE,
+	OSM_EVENT_ID_UCAST_ROUTING_DONE,
+	OSM_EVENT_ID_ENTERING_STANDBY,
+	OSM_EVENT_ID_SM_PORT_DOWN,
+	OSM_EVENT_ID_SA_DB_DUMPED
  } osm_epi_event_id_t;
 
  typedef struct osm_epi_port_id {
opensm/opensm/osm_state_mgr.c +15 -1
index 81c8f54..3231ae9 100644
@@ -1151,6 +1151,8 @@ 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;
  		}
  	}
@@ -1185,6 +1187,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_SM_PORT_DOWN, NULL);
  		return;
  	}
 
@@ -1205,6 +1209,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_ENTERING_STANDBY, NULL);
  		return;
  	}
 
@@ -1212,6 +1218,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 +1323,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);
@@ -1375,7 +1386,10 @@ repeat_discovery:
 
  		if (osm_log_is_active(sm->p_log, OSM_LOG_VERBOSE) ||
  		    sm->p_subn->opt.sa_db_dump)
-			osm_sa_db_file_dump(sm->p_subn->p_osm);
+			if (!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);
+
  	}
 
  	/*
opensm/osmeventplugin/src/osmeventplugin.c +15 -1
index b4d9ce9..af68a5c 100644
@@ -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_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_ENTERING_STANDBY:
+		fprintf(log->log_file, "Entering stand-by state\n");
+		break;
+	case OSM_EVENT_ID_SM_PORT_DOWN:
+		fprintf(log->log_file, "SM port is down\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,
--

1.5.1.4

Quoted 6 lines
Quoted 5 lines

--
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

--
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