[openib-general] [PATCH] osm: adding max_lid_ho field to osm_switch_t

Hal Rosenstock halr at voltaire.com
Tue Dec 19 14:27:32 PST 2006


Hi Yevgeny,

On Tue, 2006-12-19 at 14:35, Yevgeny Kliteynik wrote:
> Hi Hal
> 
> Adding max_lid_ho field to osm_switch_t to allow routing
> engines that don't use lid matrices to explicitly set the
> max lid (in host order) that is reachable from the switch.

One minor comment below.

> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> ---
>  osm/include/opensm/osm_switch.h |   37 +++++++++++++++++++++++++++++++++++++
>  osm/opensm/osm_switch.c         |    2 ++
>  2 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/osm/include/opensm/osm_switch.h b/osm/include/opensm/osm_switch.h
> index 4570f61..d2089bd 100644
> --- a/osm/include/opensm/osm_switch.h
> +++ b/osm/include/opensm/osm_switch.h
> @@ -107,6 +107,7 @@ typedef struct _osm_switch
>  	ib_switch_info_t			switch_info;
>  	osm_fwd_tbl_t				fwd_tbl;
>  	osm_lid_matrix_t			lmx;
> +	uint16_t				max_lid_ho;
>  	osm_port_profile_t			*p_prof;
>  	osm_mcast_tbl_t				mcast_tbl;
>  	uint32_t				discovery_count;
> @@ -129,6 +130,9 @@ typedef struct _osm_switch
>  *		LID Matrix for this switch containing the hop count
>  *		to every LID from every port.
>  *
> +*	max_lid_ho
> +*		Max LID that is accessible from this switch
> +* 
>  *	p_pro
>  *		Pointer to array of Port Profile objects for this switch.
>  *
> @@ -793,6 +797,8 @@ static inline uint16_t
>  osm_switch_get_max_lid_ho(
>  	IN const osm_switch_t* const p_sw )
>  {
> +	if (p_sw->max_lid_ho != 0)
> +		return p_sw->max_lid_ho;
>  	return( osm_lid_matrix_get_max_lid_ho( &p_sw->lmx ) );
>  }
>  /*
> @@ -809,6 +815,37 @@ osm_switch_get_max_lid_ho(
>  * SEE ALSO
>  *********/
>  
> +/****f* OpenSM: Switch/osm_switch_set_max_lid_ho
> +* NAME
> +*	osm_switch_set_max_lid_ho
> +*
> +* DESCRIPTION
> +*	Set the maximum LID (host order) value accessed from this switch
> +* SYNOPSIS
> +*/
> +static inline void
> +osm_switch_set_max_lid_ho(
> +	IN osm_switch_t* const p_sw,
> +	IN uint16_t max_lid_ho )
> +{
> +	p_sw->max_lid_ho = max_lid_ho;
> +}
> +/*
> +* PARAMETERS
> +*	p_sw
> +*		[in] Pointer to a switch object.
> +*
> +*	max_lid_ho
> +*		Max LID (host order) value accessed from this switch
> +*
> +* RETURN VALUES
> +*	None.
> +*
> +* NOTES
> +*
> +* SEE ALSO
> +*********/
> +
>  /****f* OpenSM: Switch/osm_switch_get_num_ports
>  * NAME
>  *	osm_switch_get_num_ports
> diff --git a/osm/opensm/osm_switch.c b/osm/opensm/osm_switch.c
> index 0dd3de5..4ca713a 100644
> --- a/osm/opensm/osm_switch.c
> +++ b/osm/opensm/osm_switch.c
> @@ -122,6 +122,8 @@ osm_switch_init(
>    for( port_num = 0; port_num < num_ports; port_num++ )
>      osm_port_prof_construct( &p_sw->p_prof[port_num] );
>  
> +  p_sw->max_lid_ho = 0;

This isn't really needed, is it ?

Doesn't osm_switch_construct clear this ?

-- Hal

> +
>   Exit:
>    return( status );
>  }





More information about the general mailing list