[openib-general] [PATCH] OpenSM/osm_port_info_rcv.c: In __osm_pi_rcv_process_switch_port, better BSP0 handling

Hal Rosenstock halr at voltaire.com
Tue Jun 27 10:29:10 PDT 2006


OpenSM/osm_port_info_rcv.c: In __osm_pi_rcv_process_switch_port, better
BSP0 handling

In __osm_pi_rcv_process_switch_port, if base switch port 0, then copy
the received PortInfo attribute into the physp structure regardless of
the port state. On BSP0, the port state is not used so this protects
against an SMA which set this to LINK_DOWN. This makes the code for BSP0
more similar to how it originally was at the cost of an extra copy of
the PortInfo attribute.

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

Index: opensm/osm_port_info_rcv.c
===================================================================
--- opensm/osm_port_info_rcv.c	(revision 8252)
+++ opensm/osm_port_info_rcv.c	(working copy)
@@ -239,6 +239,8 @@ __osm_pi_rcv_process_switch_port(
   uint8_t port_num;
   uint8_t remote_port_num;
   osm_dr_path_t path;
+  osm_switch_t *p_sw;
+  ib_switch_info_t *p_si;
 
   OSM_LOG_ENTER( p_rcv->p_log, __osm_pi_rcv_process_switch_port );
 
@@ -350,6 +352,15 @@ __osm_pi_rcv_process_switch_port(
 			 "__osm_pi_rcv_process_switch_port: ERR 0F04: "
 			 "Invalid base LID 0x%x corrected\n",
 			 cl_ntoh16( orig_lid ) );
+	/* Determine if base switch port 0 */
+	p_sw = osm_get_switch_by_guid(p_rcv->p_subn,
+				      osm_node_get_node_guid( p_node )); 
+	if (p_sw && (p_si = osm_switch_get_si_ptr(p_sw)) && 
+	    !ib_switch_info_is_enhanced_port0(p_si))
+        {
+		/* PortState is not used on BSP0 but just in case it is DOWN */
+		p_physp->port_info = *p_pi;
+        }
 	__osm_pi_rcv_process_endport(p_rcv, p_physp, p_pi);
   }
 







More information about the general mailing list