From patchwork Thu Jan 21 16:04:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 74378 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0LG3qWL005195 for ; Thu, 21 Jan 2010 16:04:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700Ab0AUQE0 (ORCPT ); Thu, 21 Jan 2010 11:04:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752538Ab0AUQE0 (ORCPT ); Thu, 21 Jan 2010 11:04:26 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:43343 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752700Ab0AUQEX (ORCPT ); Thu, 21 Jan 2010 11:04:23 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from kliteyn@dev.mellanox.co.il) with SMTP; 21 Jan 2010 18:04:20 +0200 Received: from [10.4.1.29] ([10.4.1.29]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 21 Jan 2010 18:04:20 +0200 Message-ID: <4B587AFA.9020102@dev.mellanox.co.il> Date: Thu, 21 Jan 2010 18:04:10 +0200 From: Yevgeny Kliteynik Reply-To: kliteyn@dev.mellanox.co.il User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky CC: Linux RDMA Subject: [PATCH] opensm/osmeventplugin: added couple of events to monitor SM X-OriginalArrivalTime: 21 Jan 2010 16:04:20.0165 (UTC) FILETIME=[64098750:01CA9AB3] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17144.005 X-TM-AS-Result: No--12.309200-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/include/opensm/osm_event_plugin.h b/opensm/include/opensm/osm_event_plugin.h index 33d1920..f5a57d7 100644 --- a/opensm/include/opensm/osm_event_plugin.h +++ b/opensm/include/opensm/osm_event_plugin.h @@ -72,7 +72,15 @@ 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_L_SWEEP_STARTED, + OSM_EVENT_ID_L_SWEEP_DONE, + OSM_EVENT_ID_H_SWEEP_STARTED, + OSM_EVENT_ID_H_SWEEP_DONE, + OSM_EVENT_ID_REROUTE_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 { diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index e43463f..7e64f37 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1076,6 +1076,9 @@ static void do_sweep(osm_sm_t * sm) sm->p_subn->sm_state != IB_SMINFO_STATE_DISCOVERING) return; + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_L_SWEEP_STARTED, NULL); + if (sm->p_subn->coming_out_of_standby) /* * Need to force re-write of sm_base_lid to all ports @@ -1111,6 +1114,8 @@ static void do_sweep(osm_sm_t * sm) osm_sa_db_file_dump(sm->p_subn->p_osm); OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "LIGHT SWEEP COMPLETE"); + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_L_SWEEP_DONE, NULL); return; } } @@ -1151,6 +1156,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_REROUTE_DONE, NULL); return; } } @@ -1158,6 +1165,9 @@ static void do_sweep(osm_sm_t * sm) /* go to heavy sweep */ repeat_discovery: + osm_opensm_report_event(sm->p_subn->p_osm, + OSM_EVENT_ID_H_SWEEP_STARTED, NULL); + /* First of all - unset all flags */ sm->p_subn->force_heavy_sweep = FALSE; sm->p_subn->force_reroute = FALSE; @@ -1185,6 +1195,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 +1217,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; } @@ -1375,7 +1389,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); + } /* diff --git a/opensm/osmeventplugin/src/osmeventplugin.c b/opensm/osmeventplugin/src/osmeventplugin.c index b4d9ce9..5029be2 100644 --- a/opensm/osmeventplugin/src/osmeventplugin.c +++ b/opensm/osmeventplugin/src/osmeventplugin.c @@ -176,6 +176,30 @@ 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_L_SWEEP_STARTED: + fprintf(log->log_file, "Light sweep started\n"); + break; + case OSM_EVENT_ID_L_SWEEP_DONE: + fprintf(log->log_file, "Light sweep completed\n"); + break; + case OSM_EVENT_ID_H_SWEEP_STARTED: + fprintf(log->log_file, "Heavy sweep started\n"); + break; + case OSM_EVENT_ID_H_SWEEP_DONE: + fprintf(log->log_file, "Heavy sweep completed\n"); + break; + case OSM_EVENT_ID_REROUTE_DONE: + fprintf(log->log_file, "Re-route 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,