[ofa-general] [PATCH 2/6 v2] opensm/Unicast Routing Cache: add -A / --ucast_cache option

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Wed Oct 15 14:35:09 PDT 2008


Add "-A" or "--ucast_cache" option to opensm.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/include/opensm/osm_subnet.h |    6 +++++-
 opensm/opensm/main.c               |   19 +++++++++++++++++--
 opensm/opensm/osm_subnet.c         |   11 ++++++++++-
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index 0c7f3b9..1ee6362 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2008 Xsigo Systems Inc.  All rights reserved.
  *
@@ -183,6 +183,7 @@ typedef struct osm_subn_opt {
 	boolean_t port_profile_switch_nodes;
 	boolean_t sweep_on_trap;
 	char *routing_engine_names;
+	boolean_t use_ucast_cache;
 	boolean_t connect_roots;
 	char *lid_matrix_dump_file;
 	char *lfts_file;
@@ -361,6 +362,9 @@ typedef struct osm_subn_opt {
 *		up/down routing engine (even if this violates "pure" deadlock
 *		free up/down algorithm)
 *
+*	use_ucast_cache
+*		When TRUE enables unicast routing cache.
+*
 *	lid_matrix_dump_file
 *		Name of the lid matrix dump file from where switch
 *		lid matrices (min hops tables) will be loaded
diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index 81b0a01..89c98fa 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -180,6 +180,15 @@ static void show_usage(void)
 	       "          and in this way be IBA compliant. In many cases,\n"
 	       "          this can violate \"pure\" deadlock free algorithm, so\n"
 	       "          use it carefully.\n\n");
+	printf("--ucast_cache, -A\n"
+	       "          This option enables unicast routing cache to prevent\n"
+	       "          routing recalculation (which is a heavy task in a\n"
+	       "          large cluster) when there was no topology change\n"
+	       "          detected during the heavy sweep, or when the topology\n"
+	       "          change does not require new routing calculation,\n"
+	       "          e.g. in case of host reboot.\n"
+	       "          This option becomes very handy when the cluster size\n"
+	       "          is thousands of nodes.\n\n");
 	printf("--lid_matrix_file, -M <file name>\n"
 	       "          This option specifies the name of the lid matrix dump file\n"
 	       "          from where switch lid matrices (min hops tables will be\n"
@@ -516,7 +525,7 @@ int main(int argc, char *argv[])
 	uint32_t val;
 	unsigned config_file_done = 0;
 	const char *const short_option =
-	    "F:c:i:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:NBIQvVhoryxp:n:q:k:C:";
+	    "F:c:i:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:";

 	/*
 	   In the array below, the 2nd parameter specifies the number
@@ -553,6 +562,7 @@ int main(int argc, char *argv[])
 		{"priority", 1, NULL, 'p'},
 		{"smkey", 1, NULL, 'k'},
 		{"routing_engine", 1, NULL, 'R'},
+		{"ucast_cache", 0, NULL, 'A'},
 		{"connect_roots", 0, NULL, 'z'},
 		{"lid_matrix_file", 1, NULL, 'M'},
 		{"lfts_file", 1, NULL, 'U'},
@@ -832,6 +842,11 @@ int main(int argc, char *argv[])
 			printf(" Connect roots option is on\n");
 			break;

+		case 'A':
+			opt.use_ucast_cache = TRUE;
+			printf(" Unicast routing cache option is on\n");
+			break;
+
 		case 'M':
 			opt.lid_matrix_dump_file = optarg;
 			printf(" Lid matrix dump file is \'%s\'\n", optarg);
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index a39ce75..63c111c 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2002-2008 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2008 Xsigo Systems Inc.  All rights reserved.
  *
@@ -442,6 +442,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * const p_opt)
 	p_opt->port_prof_ignore_file = NULL;
 	p_opt->port_profile_switch_nodes = FALSE;
 	p_opt->sweep_on_trap = TRUE;
+	p_opt->use_ucast_cache = FALSE;
 	p_opt->routing_engine_names = NULL;
 	p_opt->connect_roots = FALSE;
 	p_opt->lid_matrix_dump_file = NULL;
@@ -1269,6 +1270,9 @@ int osm_subn_parse_conf_file(char *file_name, osm_subn_opt_t * const p_opts)
 		opts_unpack_boolean("connect_roots",
 				    p_key, p_val, &p_opts->connect_roots);

+		opts_unpack_boolean("use_ucast_cache",
+				    p_key, p_val, &p_opts->use_ucast_cache);
+
 		opts_unpack_charp("log_file", p_key, p_val, &p_opts->log_file);

 		opts_unpack_uint32("log_max_size",
@@ -1534,6 +1538,11 @@ int osm_subn_write_conf_file(char *file_name, IN osm_subn_opt_t *const p_opts)
 		p_opts->connect_roots ? "TRUE" : "FALSE");

 	fprintf(opts_file,
+		"# Use unicast routing cache (use FALSE if unsure)\n"
+		"use_ucast_cache %s\n\n",
+		p_opts->use_ucast_cache ? "TRUE" : "FALSE");
+
+	fprintf(opts_file,
 		"# Lid matrix dump file name\n"
 		"lid_matrix_dump_file %s\n\n", p_opts->lid_matrix_dump_file ?
 		p_opts->lid_matrix_dump_file : null_str);
-- 
1.5.1.4




More information about the general mailing list