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

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Tue Dec 19 13:03:28 PST 2006


Sasha Khapyorsky wrote:
> On 21:35 Tue 19 Dec     , 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.
>>
>> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
>> ---
> 
> Looks fine. Small comments below.
> 
>> @@ -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 ) );
>>  }
> 
> What do you think about to remove osm_lid_matrix_get_max_lid_ho() at
> all?

Basically, I have no objection to this. We just have to update 
the switch.max_lid_ho in the default, updn and file routings.
 
>> @@ -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
>> +*********/
>> +
> 
> Do we need those +31 lines of code instead of just
> p_sw->max_lid_ho = N; ?

Since there are access functions for the rest of the fields,
I didn't want to make an exception in this case either.

-- Yevgeny.
 
> Sasha
> 




More information about the general mailing list