[openib-general] [PATCH] OpenSM: Support C14-24-2.1 in terms of valid components when PortState is DOWN

Hal Rosenstock halr at voltaire.com
Mon May 22 09:34:10 PDT 2006


OpenSM: Support C14-24-2.1 in terms of valid components when PortState
is DOWN

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: include/opensm/osm_port.h
===================================================================
--- include/opensm/osm_port.h	(revision 7396)
+++ include/opensm/osm_port.h	(working copy)
@@ -427,7 +427,8 @@ osm_physp_set_health(
 *	osm_physp_set_port_info
 *
 * DESCRIPTION
-*	Copies the PortInfo attribute into the Physical Port object.
+*	Copies the PortInfo attribute into the Physical Port object
+*	based on the PortState.
 *
 * SYNOPSIS
 */
@@ -438,7 +439,19 @@ osm_physp_set_port_info(
 {
 	CL_ASSERT( p_pi );
 	CL_ASSERT( osm_physp_is_valid( p_physp ) );
-	p_physp->port_info = *p_pi;
+
+	if (ib_port_info_get_port_state(p_pi) == IB_LINK_DOWN)
+	{
+	  /* If PortState is down, only copy PortState */
+	  /* PortPhysicalState per C14-24-2.1 */
+	  ib_port_info_set_port_state(&p_physp->port_info, IB_LINK_DOWN);
+	  ib_port_info_set_port_phys_state(
+		ib_port_info_get_port_phys_state(p_pi), &p_physp->port_info);
+	}
+	else
+	{
+	  p_physp->port_info = *p_pi;
+	}
 }
 /*
 * PARAMETERS






More information about the general mailing list