Blame SOURCES/opensm-3.3.13-prefix.patch

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