Nothing too fancy in this patch.  Parse command line options, add
manpage entries, etc.

Al

-- 
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From 1ad2b885b573e24672ef96722723e686b76fcb8d Mon Sep 17 00:00:00 2001
From: Albert L. Chu <[EMAIL PROTECTED]>
Date: Thu, 22 May 2008 10:14:45 -0700
Subject: [PATCH] add guid_routing_order_file option


Signed-off-by: Albert L. Chu <[EMAIL PROTECTED]>
---
 opensm/include/opensm/osm_subnet.h |    5 +++++
 opensm/man/opensm.8.in             |    9 ++++++++-
 opensm/opensm/main.c               |   14 +++++++++++++-
 opensm/opensm/osm_subnet.c         |    8 ++++++++
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index 1b862c0..3d7be78 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -258,6 +258,7 @@ typedef struct _osm_subn_opt {
 	char *root_guid_file;
 	char *cn_guid_file;
 	char *ids_guid_file;
+	char *guid_routing_order_file;
 	char *sa_db_file;
 	boolean_t exit_on_fatal;
 	boolean_t honor_guid2lid_file;
@@ -448,6 +449,10 @@ typedef struct _osm_subn_opt {
 *		Name of the file that contains list of ids which should be
 *		used by Up/Down algorithm instead of node GUIDs
 *
+*	guid_routing_order_file
+*		Name of the file that contains list of guids for routing order
+*		that will be used by up/dn routing (provided by User).
+*
 *	sa_db_file
 *		Name of the SA database file.
 *
diff --git a/opensm/man/opensm.8.in b/opensm/man/opensm.8.in
index bb58f8a..60946a0 100644
--- a/opensm/man/opensm.8.in
+++ b/opensm/man/opensm.8.in
@@ -12,7 +12,9 @@ opensm \- InfiniBand subnet manager and administration (SM/SA)
 [\-M <file name> | \-\-lid_matrix_file <file name>]
 [\-U <file name> | \-\-ucast_file <file name>]
 [\-S | \-\-sadb_file <file name>] [\-a | \-\-root_guid_file <path to file>]
-[\-u | \-\-cn_guid_file <path to file>] [\-m | \-\-ids_guid_file <path to file>]
+[\-u | \-\-cn_guid_file <path to file>] 
+[\-X | \-\-guid_routing_order_file <path to file>]
+[\-m | \-\-ids_guid_file <path to file>]
 [\-o(nce)] [\-s(weep) <interval>]
 [\-t(imeout) <milliseconds>] [\-maxsmps <number>]
 [\-console [off | local | socket | loopback]] [\-console-port <port>]
@@ -144,6 +146,11 @@ Name of the map file with set of the IDs which will be used
 by Up/Down routing algorithm instead of node GUIDs
 (format: <guid> <id> per line).
 .TP
+\fB\-X\fR, \fB\-\-guid_routing_order_file\fR
+Set the order port guids will be routed for the Up/Down
+routing algorithm to the guids provided in the
+given file (one to a line).
+.TP
 \fB\-o\fR, \fB\-\-once\fR
 This option causes OpenSM to configure the subnet
 once, then exit.  Ports remain in the ACTIVE state.
diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index 05b3dd5..f81a2cb 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -215,6 +215,11 @@ static void show_usage(void)
 	       "          Name of the map file with set of the IDs which will be used\n"
 	       "          by Up/Down routing algorithm instead of node GUIDs\n"
 	       "          (format: <guid> <id> per line)\n");
+	printf("-X\n"
+	       "--guid_routing_order_file <path to file>\n"
+	       "          Set the order port guids will be routed for the Up/Down\n"
+	       "          routing algorithm to the guids provided in the\n"
+	       "          given file (one to a line)\n\n");
 	printf("-o\n"
 	       "--once\n"
 	       "          This option causes OpenSM to configure the subnet\n"
@@ -603,7 +608,7 @@ int main(int argc, char *argv[])
 	uint32_t val;
 	unsigned config_file_done = 0;
 	const char *const short_option =
-	    "F:i:f:ed:g:l:L:s:t:a:u:m:R:zM:U:S:P:Y:NBIQvVhorcyxp:n:q:k:C:";
+	    "F:i:f:ed:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:NBIQvVhorcyxp:n:q:k:C:";
 
 	/*
 	   In the array below, the 2nd parameter specifies the number
@@ -645,6 +650,7 @@ int main(int argc, char *argv[])
 		{"root_guid_file", 1, NULL, 'a'},
 		{"cn_guid_file", 1, NULL, 'u'},
 		{"ids_guid_file", 1, NULL, 'm'},
+		{"guid_routing_order_file", 1, NULL, 'X'},
 		{"cache-options", 0, NULL, 'c'},
 		{"stay_on_fatal", 0, NULL, 'y'},
 		{"honor_guid2lid", 0, NULL, 'x'},
@@ -947,6 +953,12 @@ int main(int argc, char *argv[])
 			printf(" IDs Guid File: %s\n", opt.ids_guid_file);
 			break;
 
+		case 'X':
+			/* Specifies guid routing order file */
+			opt.guid_routing_order_file = optarg;
+			printf(" GUID Routing Order File: %s\n", opt.guid_routing_order_file);
+			break;
+
 		case 'c':
 			cache_options = TRUE;
 			printf(" Caching command line options\n");
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index 38f1e80..61d17d2 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -458,6 +458,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * const p_opt)
 	p_opt->root_guid_file = NULL;
 	p_opt->cn_guid_file = NULL;
 	p_opt->ids_guid_file = NULL;
+	p_opt->guid_routing_order_file = NULL;
 	p_opt->sa_db_file = NULL;
 	p_opt->exit_on_fatal = TRUE;
 	p_opt->enable_quirks = FALSE;
@@ -1308,6 +1309,9 @@ int osm_subn_parse_conf_file(char *file_name, osm_subn_opt_t * const p_opts)
 		opts_unpack_charp("ids_guid_file",
 				  p_key, p_val, &p_opts->ids_guid_file);
 
+		opts_unpack_charp("guid_routing_order_file",
+				  p_key, p_val, &p_opts->guid_routing_order_file);
+
 		opts_unpack_charp("sa_db_file",
 				  p_key, p_val, &p_opts->sa_db_file);
 
@@ -1547,6 +1551,10 @@ int osm_subn_write_conf_file(char *file_name, IN osm_subn_opt_t *const p_opts)
 		" Up/Down algorithm instead\n# of GUIDs (one guid and"
 		" id in each line)\nids_guid_file %s\n\n",
 		p_opts->ids_guid_file ? p_opts->ids_guid_file : null_str);
+	
+	fprintf(opts_file,
+		"# The file holding guid routing order guids (for Up/Down)\n"
+		"guid_routing_order_file %s\n\n", p_opts->guid_routing_order_file);
 
 	fprintf(opts_file,
 		"# SA database file name\nsa_db_file %s\n\n",
-- 
1.5.1

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to