Hi Hal

A previous patch adding explicit set remote port state DOWN in case the 
local one is recycled was not safe. In a case of irresponsive remote 
port it would actually try and traverse a null pointer of the port info.

This simple fix is just a little more careful about it.
I also renamed the p_rem_port to p_rem_physp as the pointer actually 
points to a physical port...

Eitan

Signed-off-by:  Eitan Zahavi <[EMAIL PROTECTED]>

Index: opensm/osm_lid_mgr.c
===================================================================
--- opensm/osm_lid_mgr.c        (revision 6076)
+++ opensm/osm_lid_mgr.c        (working copy)
@@ -920,13 +920,18 @@ __osm_lid_mgr_set_remote_pi_state_to_ini
   IN osm_physp_t*          const p_physp)
 {
   ib_port_info_t *p_pi;
-  osm_physp_t *p_rem_port = osm_physp_get_remote(p_physp);
+  osm_physp_t *p_rem_physp = osm_physp_get_remote(p_physp);
 
-  CL_ASSERT(p_rem_port);
+  CL_ASSERT(p_rem_physp);
 
-  p_pi = osm_physp_get_port_info_ptr( p_rem_port );
+  if (osm_physp_is_valid( p_rem_physp ))
+  {
+    p_pi = osm_physp_get_port_info_ptr( p_rem_physp );
+    /* but on some rare cases the remote side might be irresponsive  */
+    if (p_pi)
   ib_port_info_set_port_state( p_pi, IB_LINK_INIT );
 }
+}
 
 /**********************************************************************
  **********************************************************************/

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to