[openib-general] [PATCH] opensm: osm_prtn.c: strip pkey value unconditionally

Sasha Khapyorsky sashak at voltaire.com
Sun Oct 29 12:06:55 PST 2006


Then new partition creation is requested strip unconditionally
membership bit before == 0 verification (when autogenerated pkey value
is requested).

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/opensm/osm_prtn.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/osm/opensm/osm_prtn.c b/osm/opensm/osm_prtn.c
index dbed3bc..ae0f6e0 100644
--- a/osm/opensm/osm_prtn.c
+++ b/osm/opensm/osm_prtn.c
@@ -268,17 +268,11 @@ osm_prtn_t *osm_prtn_make_new(osm_log_t
 {
 	osm_prtn_t *p = NULL, *p_check;
 
+	pkey &= cl_hton16((uint16_t)~0x8000);
+
 	if (pkey == 0 && !(pkey = __generate_pkey(p_subn)))
 		return NULL;
 
-	if (cl_ntoh16(pkey) & 0x8000) {
-		pkey &= cl_hton16((uint16_t)~0x8000);
-		osm_log(p_log, OSM_LOG_VERBOSE,
-			"osm_prtn_make_new: pkey stripped for"
-			" partition \'%s\' (0x%04x)\n",
-			name, cl_ntoh16(pkey));
-	}
-
 	p = osm_prtn_new(name, pkey);
 	if (!p) {
 		osm_log(p_log, OSM_LOG_ERROR,
-- 
1.4.3.2.g4bf7





More information about the general mailing list