[ofa-general] [PATCH] opensm/osm_pkey_mgr.c: setting/clearing both inbound and outbound partition enforcements

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Dec 27 07:39:32 PST 2007


Turning on inbound partition enforcement bit on switch ports -
undoing part of the changes that were done by the previous pkey patch.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_pkey_mgr.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/opensm/opensm/osm_pkey_mgr.c b/opensm/opensm/osm_pkey_mgr.c
index 209fa71..61bd076 100644
--- a/opensm/opensm/osm_pkey_mgr.c
+++ b/opensm/opensm/osm_pkey_mgr.c
@@ -212,7 +212,7 @@ pkey_mgr_enforce_partition(IN osm_log_t * p_log,

 	p_pi = &p_physp->port_info;

-	if (((p_pi->vl_enforce & 0xc) == 0x4 && enforce) ||
+	if (((p_pi->vl_enforce & 0xc) == 0xc && enforce) ||
 	    ((p_pi->vl_enforce & 0xc) == 0 && !enforce)) {
 		osm_log(p_log, OSM_LOG_DEBUG,
 			"pkey_mgr_enforce_partition: "
@@ -229,11 +229,10 @@ pkey_mgr_enforce_partition(IN osm_log_t * p_log,

 	p_pi = (ib_port_info_t *) payload;

-	/* clearing enforcement in both directions */
-	p_pi->vl_enforce &= ~0xc;
-	if (enforce == TRUE)
-		/* enforcing only in outbound direction */
-		p_pi->vl_enforce |= 0x4;
+	if (enforce)
+		p_pi->vl_enforce |= 0xc;
+	else
+		p_pi->vl_enforce &= ~0xc;

 	p_pi->state_info2 = 0;
 	ib_port_info_set_port_state(p_pi, IB_LINK_NO_CHANGE);
-- 
1.5.1.4




More information about the general mailing list