Skip to contentSkip to conversation

opensm/osm_prtn_config.c: Fix IPoIB broadcast group creation on non-default Pkey

PATCH New Alex Netes 1 participant 1 message Nov 29, 2011 InfiniBand

lore
Share & tools
lore

Alex Netes

author
#0 lore raw

PATCH 1/1 opensm/osm_prtn_config.c: Fix IPoIB broadcast group creation on non-default Pkey

Quoted 2 lines

From 1b42127324b3bc6e97da20118525c23e32c6d087 Mon Sep 17 00:00:00 2001

From: root <root-fIVdcA820AXJXU1vycJJuwC/[email protected]>
Date: Tue, 29 Nov 2011 17:46:32 +0200
Subject: [PATCH 1/1] Fix IPoIB broadcast group creation on non-default Pkey

In case you configure a partition in the folowing way (without specifing the mgid), no bradcast IPoIB group is created using NewPartition.

NewPartition=0x1 , ipoib : 0x123456=full 0x654321=full

Signed-off-by root <Alex Netes alexne-VPRAkNaXOzVWk0Htik3J/[email protected]>
---
 opensm/osm_prtn_config.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
opensm/osm_prtn_config.c +5 -3
index 4b8d86c..56691b0 100644
@@ -203,7 +203,7 @@ static void __create_mgrp(struct part_conf *conf, struct precreate_mgroup *group
 static int partition_create(unsigned lineno, struct part_conf *conf,
 			    char *name, char *id, char *flag, char *flag_val)
 {
-	uint16_t pkey;
+	ib_net16_t pkey;
 
 	if (!id && name && isdigit(*name)) {
 		id = name;
@@ -213,14 +213,14 @@ static int partition_create(unsigned lineno, struct part_conf *conf,
 	if (id) {
 		char *end;
 
-		pkey = (uint16_t) strtoul(id, &end, 0);
+		pkey = cl_hton16(uint16_t) strtoul(id, &end, 0));
 		if (end == id || *end)
 			return -1;
 	} else
 		pkey = 0;
 
 	conf->p_prtn = osm_prtn_make_new(conf->p_log, conf->p_subn,
-					 name, cl_hton16(pkey));
+					 name, pkey);
 	if (!conf->p_prtn)
 		return -1;
 
@@ -237,6 +237,8 @@ static int partition_create(unsigned lineno, struct part_conf *conf,
 		struct precreate_mgroup broadcast_mgroup;
 		memset(&broadcast_mgroup, 0, sizeof(broadcast_mgroup));
 		broadcast_mgroup.mgid = osm_ipoib_broadcast_mgid;
+		pkey |= cl_hton16(0x8000);
+		memcpy(&broadcast_mgroup.mgid.raw[4], &pkey , sizeof(pkey));
 		broadcast_mgroup.flags.mtu = conf->flags.mtu;
 		broadcast_mgroup.flags.rate = conf->flags.rate;
 		broadcast_mgroup.flags.sl = conf->flags.sl;
Signature · 6 lines
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html