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

Hal Rosenstock halr at voltaire.com
Mon Nov 27 05:30:12 PST 2006


On Sun, 2006-11-26 at 14:42, Yevgeny Kliteynik wrote:
> Sasha Khapyorsky wrote:
> > On 17:10 Sun 26 Nov     , Yevgeny Kliteynik wrote:
> >> Setting LinkSpeedSupported as LinkSpeedEnabled only when needed - 
> >> avoiding unnecessary changes in PortInfo to prevent issuing SetPortInfo
> >>
> >> --
> >> Yevgeny
> >>
> >> Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> >>  
> >> Index: opensm/osm_link_mgr.c
> >> ===================================================================
> >> --- opensm/osm_link_mgr.c	(revision 10161)
> >> +++ opensm/osm_link_mgr.c	(working copy)
> >> @@ -313,7 +313,11 @@ __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
> >> -      ib_port_info_set_link_speed_enabled( p_pi, IB_PORT_LINK_SPEED_ENABLED_MASK );
> >> +    {
> >> +       if (ib_port_info_get_link_speed_sup(p_pi) != 
> >> +           ib_port_info_get_link_speed_enabled(p_pi))
> >> +          ib_port_info_set_link_speed_enabled( p_pi, IB_PORT_LINK_SPEED_ENABLED_MASK );
> >> +    }
> > 
> > Looks fine.
> > 
> > Just cosmetic nit - what about to use 'else if(...)' and to drop unneded
> > braces?
> 
> Sasha, 
> Sure, that would be good too.
> 
> Hal, 
> Do you want me to resubmit with this change?

No need. It's simple enough... Thanks anyway.

-- Hal

> -- Yevgeny
>  
> > Sasha
> > 
> >>      if (memcmp( &p_pi->link_speed, &p_old_pi->link_speed,
> >>                  sizeof(p_pi->link_speed) ))
> >>        send_set = TRUE;
> >>
> >> _______________________________________________
> >> openib-general mailing list
> >> openib-general at openib.org
> >> http://openib.org/mailman/listinfo/openib-general
> >>
> >> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> >>
> > 





More information about the general mailing list