[openib-general] [PATCH] osm_link_mgr: handle different MTU

Ofer Gigi oferg at mellanox.co.il
Wed Mar 8 08:17:14 PST 2006


Hi Hal,

There was a bug that in case of a difference between the MTU of two ports, only the 
port with the higher MTU was set to down. Its remote port was written in the DB in ACTIVE
state although its real status was INIT. Because of that the SM didn't try to lift the remote
port to ACTIVE. 
The change below fixes this issue.

Thanks

Ofer G.

Signed-off-by:  Ofer Gigi <oferg at mellanox.co.il>

Index: osm_lid_mgr.c
===================================================================
--- osm_lid_mgr.c	(revision 5628)
+++ osm_lid_mgr.c	(working copy)
@@ -893,6 +893,21 @@ __osm_lid_mgr_get_port_lid(
 }
 
 /**********************************************************************
+ Set to INIT the remote port of the given physical port
+ **********************************************************************/
+static void
+__osm_lid_mgr_set_remote_pi_state_to_init(
+  IN osm_lid_mgr_t *       const p_mgr,
+  IN osm_physp_t*          const p_physp)
+{
+  osm_physp_t *p_rem_port = osm_physp_get_remote(p_physp);
+  CL_ASSERT(p_rem_port);
+
+  ib_port_info_t * p_pi = osm_physp_get_port_info_ptr( p_rem_port );
+  ib_port_info_set_port_state( p_pi, IB_LINK_INIT );
+}
+
+/**********************************************************************
  **********************************************************************/
 static boolean_t
 __osm_lid_mgr_set_physp_pi(
@@ -1090,10 +1105,6 @@ __osm_lid_mgr_set_physp_pi(
       send_set = TRUE;
 
     /*
-      TO DO -
-      If the subnet is being reconfigured, should we force the link
-      to the INIT state?
-
       To reset the port state machine we can send PortInfo.State = DOWN.
       (see: 7.2.7 p161 lines:10-19.)
     */
@@ -1109,6 +1120,13 @@ __osm_lid_mgr_set_physp_pi(
                  op_vls, ib_port_info_get_op_vls(p_old_pi)
                  );
       }
+
+      /* 
+         we need to make sure the internal DB will follow the fact the remote
+         port is also going through "down" state into "init"...
+      */
+      __osm_lid_mgr_set_remote_pi_state_to_init(p_mgr, p_pi);
+
       ib_port_info_set_port_state( p_pi, IB_LINK_DOWN );
       if ( ib_port_info_get_port_state(p_pi) !=
            ib_port_info_get_port_state(p_old_pi) )





More information about the general mailing list