public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yevgeny Kliteynik <kliteyn-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
To: Jim Schutt <jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org,
	eitan-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org
Subject: Re: [PATCH 09/11] opensm: Make it possible to configure no fallback routing engine.
Date: Thu, 04 Mar 2010 16:35:40 +0200	[thread overview]
Message-ID: <4B8FC53C.9060605@mellanox.co.il> (raw)
In-Reply-To: <1258744509-11148-9-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>

Hi Jim,

On 20/Nov/09 21:15, Jim Schutt wrote:
> For a fabric that requires routing with an engine with special properties,
> say avoiding credit loops via making use of SLs in routing, it might
> be preferable to not fall back to minhop if the configured routing engine
> fails.
>
> E.g. the torus-2QoS routing engine uses both SL2VL maps and path SL values
> to provide routing free of credit loops, but cannot route fabrics for
> some patterns of failed switches.  Should a switch fail that creates such
> a pattern, it may be preferable to keep the previous routing information
> loaded in the switches until a switch can be replaced that restores
> torus-2QoS's ability to route the fabric.
>
> The alternative, having some other engine route the fabric, will immediately
> introduce credit loops.

This is a great idea.
Regarding the implementation: I would prefer seeing this
as a purely OpenSM option and not as a new routing engine
keyword.
I think it would be cleaner to leave the list of routing
engines w/o special keys, and have a general option
that would prevent SM from falling back. Actually, the
fall-back itself is not bad, as it is defined by the list
of routing engines, and SM should try them one by one.
The problem is with using default routing that is not
specified in the routing engines list.

Here's the patch that implements OSM option
"use_default_routing", and a command line parameter
"no_default_routing" to control this option.

I'll write the patch that adds this option to the
OSM trunk and send it to Sasha shortly.

Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
---
  opensm/include/opensm/osm_subnet.h |    2 +-
  opensm/opensm/main.c               |    9 +++++++++
  opensm/opensm/osm_opensm.c         |   10 ++++------
  opensm/opensm/osm_subnet.c         |    8 ++++++++
  opensm/opensm/osm_ucast_mgr.c      |    7 +++++--
  5 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index a4133a0..905f64d 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -190,6 +190,7 @@ typedef struct osm_subn_opt {
  	boolean_t sweep_on_trap;
  	char *routing_engine_names;
  	boolean_t use_ucast_cache;
+	boolean_t use_default_routing;
  	boolean_t connect_roots;
  	char *lid_matrix_dump_file;
  	char *lfts_file;
@@ -215,7 +216,6 @@ typedef struct osm_subn_opt {
  	osm_qos_options_t qos_rtr_options;
  	boolean_t enable_quirks;
  	boolean_t no_clients_rereg;
-	boolean_t no_fallback_routing_engine;
  #ifdef ENABLE_OSM_PERF_MGR
  	boolean_t perfmgr;
  	boolean_t perfmgr_redir;
diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index 096bf5f..47075a2 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -175,6 +175,10 @@ static void show_usage(void)
  	       "          separated by commas so that specific ordering of routing\n"
  	       "          algorithms will be tried if earlier routing engines fail.\n"
  	       "          Supported engines: updn, file, ftree, lash, dor, torus-2QoS\n\n");
+	printf("--no_default_routing\n"
+	       "          This option prevents OpenSM from falling back to default\n"
+	       "          routing if none of the provided engines was able to\n"
+	       "          configure the subnet.\n\n");
  	printf("--do_mesh_analysis\n"
  	       "          This option enables additional analysis for the lash\n"
  	       "          routing engine to precondition switch port assignments\n"
@@ -612,6 +616,7 @@ int main(int argc, char *argv[])
  		{"sm_sl", 1, NULL, 7},
  		{"retries", 1, NULL, 8},
  		{"torus_config", 1, NULL, 9},
+		{"no_default_routing", 0, NULL, 10},
  		{NULL, 0, NULL, 0}	/* Required at the end of the array */
  	};
  
@@ -993,6 +998,10 @@ int main(int argc, char *argv[])
  		case 9:
  			SET_STR_OPT(opt.torus_conf_file, optarg);
  			break;
+		case 10:
+			opt.use_default_routing = FALSE;
+			printf(" No fall back to default routing\n");
+			break;
  		case 'h':
  		case '?':
  		case ':':
diff --git a/opensm/opensm/osm_opensm.c b/opensm/opensm/osm_opensm.c
index e7ef55c..d153be5 100644
--- a/opensm/opensm/osm_opensm.c
+++ b/opensm/opensm/osm_opensm.c
@@ -159,11 +159,6 @@ static struct osm_routing_engine *setup_routing_engine(osm_opensm_t *osm,
  	struct osm_routing_engine *re;
  	const struct routing_engine_module *m;
  
-	if (!strcmp(name, "no_fallback")) {
-		osm->subn.opt.no_fallback_routing_engine = TRUE;
-		return NULL;
-	}
-
  	for (m = routing_modules; m->name && *m->name; m++) {
  		if (!strcmp(m->name, name)) {
  			re = malloc(sizeof(struct osm_routing_engine));
@@ -212,7 +207,10 @@ static void setup_routing_engines(osm_opensm_t *osm, const char *engine_names)
  		}
  		free(str);
  	}
-	if (!osm->default_routing_engine) {
+
+	if (!engine_names || !*engine_names ||
+	    (!osm->default_routing_engine &&
+	     osm->subn.opt.use_default_routing)) {
  		re = setup_routing_engine(osm, "minhop");
  		if (!osm->routing_engine_list && re)
  			append_routing_engine(osm, re);
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index 03d9538..274e807 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -327,6 +327,7 @@ static const opt_rec_t opt_tbl[] = {
  	{ "port_profile_switch_nodes", OPT_OFFSET(port_profile_switch_nodes), opts_parse_boolean, NULL, 1 },
  	{ "sweep_on_trap", OPT_OFFSET(sweep_on_trap), opts_parse_boolean, NULL, 1 },
  	{ "routing_engine", OPT_OFFSET(routing_engine_names), opts_parse_charp, NULL, 0 },
+	{ "use_default_routing", OPT_OFFSET(use_default_routing), opts_parse_boolean, NULL, 1 },
  	{ "connect_roots", OPT_OFFSET(connect_roots), opts_parse_boolean, NULL, 1 },
  	{ "use_ucast_cache", OPT_OFFSET(use_ucast_cache), opts_parse_boolean, NULL, 1 },
  	{ "log_file", OPT_OFFSET(log_file), opts_parse_charp, NULL, 0 },
@@ -743,6 +744,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt)
  	p_opt->port_profile_switch_nodes = FALSE;
  	p_opt->sweep_on_trap = TRUE;
  	p_opt->use_ucast_cache = FALSE;
+	p_opt->use_default_routing = TRUE;
  	p_opt->routing_engine_names = NULL;
  	p_opt->connect_roots = FALSE;
  	p_opt->lid_matrix_dump_file = NULL;
@@ -1392,6 +1394,12 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
  		p_opts->routing_engine_names : null_str);
  
  	fprintf(out,
+		"# Fall back to default routing engine if the provided\n"
+		"# routing engine(s) failed to configure the subnet\n"
+		"use_default_routing %s\n\n",
+		p_opts->use_default_routing ? "TRUE" : "FALSE");
+
+	fprintf(out,
  		"# Connect roots (use FALSE if unsure)\n"
  		"connect_roots %s\n\n",
  		p_opts->connect_roots ? "TRUE" : "FALSE");
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index fbc9244..9264753 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -979,8 +979,11 @@ int osm_ucast_mgr_process(IN osm_ucast_mgr_t * p_mgr)
  	}
  
  	if (!p_osm->routing_engine_used &&
-	    p_osm->subn.opt.no_fallback_routing_engine != TRUE) {
-		/* If configured routing algorithm failed, use default MinHop */
+	    p_osm->default_routing_engine) {
+		/*
+		 * If configured routing algorithms failed,
+		 * and default routing has been set, use it.
+		 */
  		struct osm_routing_engine *r = p_osm->default_routing_engine;
  
  		r->build_lid_matrices(r->context);
-- 
1.5.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-03-04 14:35 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 19:14 [PATCH 00/11] Add new torus routing engine: torus-2QoS Jim Schutt
     [not found] ` <1258744509-11148-1-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
2009-11-20 19:15   ` [PATCH 01/11] opensm: Prepare for routing engine input to path record SL lookup and SL2VL map setup Jim Schutt
2009-11-20 19:15   ` [PATCH 02/11] opensm: Allow the routing engine to influence SL2VL calculations Jim Schutt
     [not found]     ` <1258744509-11148-3-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
2010-01-14 12:36       ` Yevgeny Kliteynik
     [not found]         ` <4B4F0FBD.3040308-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-01-14 16:01           ` Jim Schutt
2010-02-10 16:15       ` Yevgeny Kliteynik
     [not found]         ` <4B72DBBD.9020709-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-02-15 21:45           ` Jim Schutt
2009-11-20 19:15   ` [PATCH 03/11] opensm: Allow the routing engine to participate in path SL calculations Jim Schutt
     [not found]     ` <1258744509-11148-4-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
2010-01-14 16:24       ` Yevgeny Kliteynik
     [not found]         ` <4B4F452B.7040007-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-01-18 19:24           ` Jim Schutt
     [not found]             ` <1263842661.5550.43.camel-mgfCWIlwujvg4c9jKm7R2O1ftBKYq+Ku@public.gmane.org>
2010-01-18 20:19               ` Yevgeny Kliteynik
2009-11-20 19:15   ` [PATCH 04/11] opensm: Track the minimum value in the fabric of data VLs supported Jim Schutt
2009-11-20 19:15   ` [PATCH 06/11] opensm: Enable torus-2QoS routing engine Jim Schutt
2009-11-20 19:15   ` [PATCH 07/11] opensm: Add opensm option to specify file name for extra torus-2QoS configuration information Jim Schutt
2009-11-20 19:15   ` [PATCH 08/11] opensm: Do not require -Q option for torus-2QoS routing engine Jim Schutt
2009-11-20 19:15   ` [PATCH 09/11] opensm: Make it possible to configure no fallback " Jim Schutt
     [not found]     ` <1258744509-11148-9-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
2010-03-04 14:35       ` Yevgeny Kliteynik [this message]
     [not found]         ` <4B8FC53C.9060605-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-03-04 21:38           ` Jim Schutt
2009-11-20 19:15   ` [PATCH 10/11] opensm: Avoid havoc in minhop caused by torus-2QoS persistent use of osm_port_t:priv Jim Schutt
2009-11-20 19:15   ` [PATCH 11/11] opensm: Update documentation to describe torus-2QoS Jim Schutt
2009-11-20 19:24   ` [PATCH 05/11] opensm: Add torus-2QoS routing engine Jim Schutt
2009-11-20 19:27   ` torus-2QoS example input files (was Re: [PATCH 00/11] Add new torus routing engine: torus-2QoS) Jim Schutt
2009-12-18 20:50   ` [PATCH 00/12] Add specialized multicast support to new torus routing engine: torus-2QoS Jim Schutt
     [not found]     ` <1261169461-2516-1-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
2009-12-18 20:54       ` [PATCH 05/12] opensm: Enforce torus-2QoS link ordering convention Jim Schutt
2010-02-16 16:16       ` [PATCH 0/3] opensm: Bug fixes for torus-2QoS patchset Jim Schutt
2010-02-16 16:16       ` [PATCH 1/3] opensm: Use local variables when searching for torus-2QoS master spanning tree root Jim Schutt
2010-02-16 16:16       ` [PATCH 2/3] opensm: Fix handling of torus-2QoS topology discovery for radix 4 torus dimensions Jim Schutt
2010-02-16 16:16       ` [PATCH 3/3] opensm: Avoid havoc in dump_ucast_routes() caused by torus-2QoS persistent use of osm_port_t:priv Jim Schutt
2009-12-18 20:50   ` [PATCH 01/12] opensm: Make error message for torus-2QoS dateline specification match code check Jim Schutt
2009-12-18 20:50   ` [PATCH 02/12] opensm: torus-2QoS should fail to route if message deadlock is possible Jim Schutt
2009-12-18 20:50   ` [PATCH 03/12] opensm: Remove unused port specification from torus-2QoS config file parsing Jim Schutt
     [not found]     ` <1261169461-2516-4-git-send-email-jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
2009-12-18 20:56       ` Jim Schutt
2009-12-18 20:50   ` [PATCH 04/12] opensm: Fix up some torus-2QoS comments to match code Jim Schutt
2009-12-18 20:50   ` [PATCH 06/12] opensm: Remove redundant function names in torus-2QoS logging Jim Schutt
2009-12-18 20:50   ` [PATCH 07/12] opensm: Make torus-2QoS always use OSM_LOG_INFO, never LOG_INFO Jim Schutt
2009-12-18 20:50   ` [PATCH 08/12] opensm: Add struct osm_routing_engine callback to build spanning trees for multicast Jim Schutt
2009-12-18 20:50   ` [PATCH 09/12] opensm: Make mcast_mgr_purge_tree() available outside osm_mcast_mgr.c Jim Schutt
2009-12-18 20:50   ` [PATCH 10/12] opensm: Implement master spanning tree for torus-2QoS multicast support Jim Schutt
2009-12-18 20:51   ` [PATCH 11/12] opensm: Implement multicast support for torus-2QoS Jim Schutt
2009-12-18 20:51   ` [PATCH 12/12] opensm: Update documentation to describe torus-2QoS multicast support Jim Schutt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B8FC53C.9060605@mellanox.co.il \
    --to=kliteyn-vpraknaxozvs1mouv/rt9w@public.gmane.org \
    --cc=eitan-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org \
    --cc=jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox