[openib-general] [PATCHv2] osm: setting LinkSpeedSupported as LinkSpeedEnabled only when needed

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Nov 27 06:24:58 PST 2006


Hi Hal

Second version of the patch - previous one was fixing only half of the problem.
This patch assumes that you haven't applied the first version yet.
Thanks.

--
Yevgeny

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
 
Index: opensm/osm_lid_mgr.c
===================================================================
--- opensm/osm_lid_mgr.c	(revision 10162)
+++ opensm/osm_lid_mgr.c	(working copy)
@@ -1148,8 +1148,10 @@ __osm_lid_mgr_set_physp_pi(
 
     if ( p_mgr->p_subn->opt.force_link_speed )
       ib_port_info_set_link_speed_enabled( p_pi, IB_LINK_SPEED_ACTIVE_2_5 );
+    else if (ib_port_info_get_link_speed_enabled(p_old_pi) != ib_port_info_get_link_speed_sup(p_pi))
+       ib_port_info_set_link_speed_enabled( p_pi, IB_PORT_LINK_SPEED_ENABLED_MASK );
     else
-      ib_port_info_set_link_speed_enabled( p_pi, IB_PORT_LINK_SPEED_ENABLED_MASK );
+       ib_port_info_set_link_speed_enabled( p_pi, ib_port_info_get_link_speed_enabled(p_old_pi));
     if (memcmp( &p_pi->link_speed, &p_old_pi->link_speed,
                 sizeof(p_pi->link_speed) ))
       send_set = TRUE;
Index: opensm/osm_link_mgr.c
===================================================================
--- opensm/osm_link_mgr.c	(revision 10162)
+++ opensm/osm_link_mgr.c	(working copy)
@@ -312,8 +312,10 @@ __osm_link_mgr_set_physp_pi(
 
     if ( p_mgr->p_subn->opt.force_link_speed )
       ib_port_info_set_link_speed_enabled( p_pi, IB_LINK_SPEED_ACTIVE_2_5 );
+    else if (ib_port_info_get_link_speed_enabled(p_old_pi) != ib_port_info_get_link_speed_sup(p_pi))
+       ib_port_info_set_link_speed_enabled( p_pi, IB_PORT_LINK_SPEED_ENABLED_MASK );
     else
-      ib_port_info_set_link_speed_enabled( p_pi, IB_PORT_LINK_SPEED_ENABLED_MASK );
+       ib_port_info_set_link_speed_enabled( p_pi, ib_port_info_get_link_speed_enabled(p_old_pi));
     if (memcmp( &p_pi->link_speed, &p_old_pi->link_speed,
                 sizeof(p_pi->link_speed) ))
       send_set = TRUE;




More information about the general mailing list