From patchwork Wed Nov 4 11:00:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 57515 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA4Asscs032503 for ; Wed, 4 Nov 2009 10:55:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755345AbZKDKzd (ORCPT ); Wed, 4 Nov 2009 05:55:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755346AbZKDKzc (ORCPT ); Wed, 4 Nov 2009 05:55:32 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:33681 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755345AbZKDKzc (ORCPT ); Wed, 4 Nov 2009 05:55:32 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from kliteyn@dev.mellanox.co.il) with SMTP; 4 Nov 2009 13:01:08 +0200 Received: from [10.4.1.29] ([10.4.1.29]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2009 12:55:29 +0200 Message-ID: <4AF15EDC.5000700@dev.mellanox.co.il> Date: Wed, 04 Nov 2009 13:00:44 +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 2/3 v2] opensm SA DB dump/restore: added option to dump SA DB on every sweep X-OriginalArrivalTime: 04 Nov 2009 10:55:29.0400 (UTC) FILETIME=[529EAF80:01CA5D3D] 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_subnet.h b/opensm/include/opensm/osm_subnet.h index 871a833..7bc59f8 100644 --- a/opensm/include/opensm/osm_subnet.h +++ b/opensm/include/opensm/osm_subnet.h @@ -201,6 +201,7 @@ typedef struct osm_subn_opt { char *guid_routing_order_file; char *sa_db_file; boolean_t sa_db_load_once; + boolean_t sa_db_dump; boolean_t do_mesh_analysis; boolean_t exit_on_fatal; boolean_t honor_guid2lid_file; @@ -416,6 +417,10 @@ typedef struct osm_subn_opt { * When TRUE causes sa_db_file to be loaded only at the * first master sweep. * +* sa_db_dump +* When TRUE causes OpenSM to dump SA DB at the end of every +* light sweep regardless the current verbosity level. +* * exit_on_fatal * If TRUE (default) - SM will exit on fatal subnet initialization * issues. diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index 4303d6e..9bca7e0 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1078,6 +1078,8 @@ 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); OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "LIGHT SWEEP COMPLETE"); return; @@ -1342,7 +1344,8 @@ _repeat_discovery: state_mgr_up_msg(sm); sm->p_subn->first_time_master_sweep = FALSE; - if (osm_log_is_active(sm->p_log, OSM_LOG_VERBOSE)) + 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); } diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c index b0ffddd..47cd7d9 100644 --- a/opensm/opensm/osm_subnet.c +++ b/opensm/opensm/osm_subnet.c @@ -349,6 +349,7 @@ static const opt_rec_t opt_tbl[] = { { "guid_routing_order_file", OPT_OFFSET(guid_routing_order_file), opts_parse_charp, NULL, 0 }, { "sa_db_file", OPT_OFFSET(sa_db_file), opts_parse_charp, NULL, 0 }, { "sa_db_load_once", OPT_OFFSET(sa_db_load_once), opts_parse_boolean, NULL, 1 }, + { "sa_db_dump", OPT_OFFSET(sa_db_dump), opts_parse_boolean, NULL, 1 }, { "do_mesh_analysis", OPT_OFFSET(do_mesh_analysis), opts_parse_boolean, NULL, 1 }, { "exit_on_fatal", OPT_OFFSET(exit_on_fatal), opts_parse_boolean, NULL, 1 }, { "honor_guid2lid_file", OPT_OFFSET(honor_guid2lid_file), opts_parse_boolean, NULL, 1 }, @@ -748,6 +749,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt) p_opt->guid_routing_order_file = NULL; p_opt->sa_db_file = NULL; p_opt->sa_db_load_once = FALSE; + p_opt->sa_db_dump = FALSE; p_opt->do_mesh_analysis = FALSE; p_opt->exit_on_fatal = TRUE; p_opt->enable_quirks = FALSE; @@ -1453,6 +1455,12 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts) p_opts->sa_db_load_once ? "TRUE" : "FALSE"); fprintf(out, + "# If TRUE causes OpenSM to dump SA database at the end of\n" + "# every light sweep, regardless of the verbosity level\n" + "sa_db_dump %s\n\n", + p_opts->sa_db_dump ? "TRUE" : "FALSE"); + + fprintf(out, "#\n# HANDOVER - MULTIPLE SMs OPTIONS\n#\n" "# SM priority used for deciding who is the master\n" "# Range goes from 0 (lowest priority) to 15 (highest).\n"