public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH ] opensm/osm_prtn_config.c: Fix IPoIB broadcast group creation on non-default Pkey
@ 2011-11-29 15:50 Alex Netes
  0 siblings, 0 replies; only message in thread
From: Alex Netes @ 2011-11-29 15:50 UTC (permalink / raw)
  To: Ira Weiny, linux-rdma-u79uwXL29TY76Z2rM5mHXA


>From 1b42127324b3bc6e97da20118525c23e32c6d087 Mon Sep 17 00:00:00 2001
From: root <root-fIVdcA820AXJXU1vycJJuwC/G2K4zDHf@public.gmane.org>
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/w@public.gmane.org>
---
 opensm/osm_prtn_config.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/opensm/osm_prtn_config.c b/opensm/osm_prtn_config.c
index 4b8d86c..56691b0 100644
--- a/opensm/osm_prtn_config.c
+++ b/opensm/osm_prtn_config.c
@@ -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;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-29 15:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-29 15:50 [PATCH ] opensm/osm_prtn_config.c: Fix IPoIB broadcast group creation on non-default Pkey Alex Netes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox