Blame SOURCES/opensm-3.3.13-prefix.patch

7185bf
diff --git a/man/opensm.8.in b/man/opensm.8.in
7185bf
index df557682058f..283483389d20 100644
7185bf
--- a/man/opensm.8.in
7185bf
+++ b/man/opensm.8.in
7185bf
@@ -11,6 +11,7 @@ opensm \- InfiniBand subnet manager and administration (SM/SA)
7185bf
 [\-g(uid) <GUID in hex>]
7185bf
 [\-l(mc) <LMC>]
7185bf
 [\-p(riority) <PRIORITY>]
7185bf
+[\-\-subnet_prefix <PREFIX in hex>]
7185bf
 [\-\-smkey <SM_Key>]
7185bf
 [\-\-sm_sl <SL number>]
7185bf
 [\-r(eassign_lids)]
7185bf
@@ -136,6 +137,13 @@ This will effect the handover cases, where master
7185bf
 is chosen by priority and GUID.  Range goes from 0
7185bf
 (default and lowest priority) to 15 (highest).
7185bf
 .TP
7185bf
+\fB\-\-subnet_prefix\fR <PREFIX in hex>
7185bf
+This option specifies the subnet prefix to use
7185bf
+on the fabric.  The default prefix is
7185bf
+0xfe80000000000000.  OpenMPI in particular requires
7185bf
+separate fabrics plugged into different ports to
7185bf
+have different prefixes or else it won't run.
7185bf
+.TP
7185bf
 \fB\-\-smkey\fR <SM_Key value>
7185bf
 This option specifies the SM\'s SM_Key (64 bits).
7185bf
 This will effect SM authentication.
7185bf
diff --git a/opensm/main.c b/opensm/main.c
7185bf
index 2d23fe2befef..b4bb3481cf8f 100644
7185bf
--- a/opensm/main.c
7185bf
+++ b/opensm/main.c
7185bf
@@ -161,6 +161,9 @@ static void show_usage(void)
7185bf
 	       "          This will effect the handover cases, where master\n"
7185bf
 	       "          is chosen by priority and GUID.  Range goes\n"
7185bf
 	       "          from 0 (lowest priority) to 15 (highest).\n\n");
7185bf
+	printf("--subnet_prefix <prefix>\n"
7185bf
+	       "          Set the subnet prefix to something other than the\n"
7185bf
+	       "          default value of 0xfe80000000000000\n\n");
7185bf
 	printf("--smkey, -k <SM_Key>\n"
7185bf
 	       "          This option specifies the SM's SM_Key (64 bits).\n"
7185bf
 	       "          This will effect SM authentication.\n"
7185bf
@@ -665,6 +668,7 @@ int main(int argc, char *argv[])
7185bf
 		{"once", 0, NULL, 'o'},
7185bf
 		{"reassign_lids", 0, NULL, 'r'},
7185bf
 		{"priority", 1, NULL, 'p'},
7185bf
+		{"subnet_prefix", 1, NULL, 15},
7185bf
 		{"smkey", 1, NULL, 'k'},
7185bf
 		{"routing_engine", 1, NULL, 'R'},
7185bf
 		{"ucast_cache", 0, NULL, 'A'},
7185bf
@@ -1008,6 +1012,11 @@ int main(int argc, char *argv[])
7185bf
 			printf(" Priority = %d\n", temp);
7185bf
 			break;
7185bf
 
7185bf
+		case 16:
7185bf
+			opt.subnet_prefix = cl_hton64(strtoull(optarg, NULL, 16));
7185bf
+			printf(" Subnet_Prefix = <0x%" PRIx64 ">\n", cl_hton64(opt.subnet_prefix));
7185bf
+			break;
7185bf
+
7185bf
 		case 'k':
7185bf
 			sm_key = cl_hton64(strtoull(optarg, NULL, 16));
7185bf
 			printf(" SM Key <0x%" PRIx64 ">\n", cl_hton64(sm_key));