[openib-general] [PATCH] osm: added an option for providing dump function per routing engine

Hal Rosenstock halr at voltaire.com
Wed Dec 20 04:33:10 PST 2006


Hi Yevgeny,

On Tue, 2006-12-19 at 14:37, Yevgeny Kliteynik wrote:
> Hi Hal
> 
> As you suggested, added an option for providing dump 
> function per routing engine.
> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>

Thanks, Applied.

One minor question below:

>  osm/include/opensm/osm_opensm.h |    4 ++++
>  osm/opensm/osm_ucast_mgr.c      |   23 ++++++++++++++---------
>  2 files changed, 18 insertions(+), 9 deletions(-)

[snip...]

> diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
> index e051c66..fcf6f72 100644
> --- a/osm/opensm/osm_ucast_mgr.c
> +++ b/osm/opensm/osm_ucast_mgr.c

[snip...]

> @@ -1256,16 +1257,20 @@ osm_ucast_mgr_process(
>      build and download the switch forwarding tables.
>    */
>  
> -  if (!p_routing_eng->ucast_build_fwd_tables ||
> -      p_routing_eng->ucast_build_fwd_tables(p_routing_eng->context) != 0)
> -  {
> -    cl_qmap_apply_func( p_sw_guid_tbl,
> -                        __osm_ucast_mgr_process_tbl, p_mgr );
> -  }
> +  if ( p_routing_eng->ucast_build_fwd_tables && 
> +       (p_routing_eng->ucast_build_fwd_tables(p_routing_eng->context) == 0) )
> +     default_routing = FALSE;
> +  else
> +     cl_qmap_apply_func( p_sw_guid_tbl, __osm_ucast_mgr_process_tbl, p_mgr );
>  
>    /* dump fdb into file: */
>    if ( osm_log_is_active( p_mgr->p_log, OSM_LOG_ROUTING ) )
> -    __osm_ucast_mgr_dump_tables( p_mgr );
> +  {
> +     if ( !default_routing && p_routing_eng->ucast_dump_tables )
> +        p_routing_eng->ucast_dump_tables(p_routing_eng->context);
> +     else
> +        __osm_ucast_mgr_dump_tables( p_mgr );
> +  }

Not sure if this is best going forward. Should it be like this:

	if ( default_routing )
	  __osm_ucast_mgr_dump_tables( p_mgr );
	else
	{
	  if ( p_routing_eng->ucast_dump_tables != 0 )
	    p_routing_eng->ucast_dump_tables(p_routing_eng->context);
	}
-- Hal






More information about the general mailing list