[ofa-general] Re: [PATCH] osm_port.c: do not force max_op_vls = 0 to 1

Sasha Khapyorsky sashak at voltaire.com
Thu May 7 04:52:12 PDT 2009


Hi Doron,

On 10:39 Thu 07 May     , Doron Shoham wrote:
> when setting max_op_vls = 0
> do not force it to 1.
> 0 is valid value which means "No change"
> 
> Signed-off-by: Doron Shoham <dorons at voltaire.com>
> ---
>  opensm/opensm/osm_port.c   |    4 ++--
>  opensm/opensm/osm_subnet.c |    8 ++++++++
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/opensm/opensm/osm_port.c b/opensm/opensm/osm_port.c
> index 2e6c642..3679f29 100644
> --- a/opensm/opensm/osm_port.c
> +++ b/opensm/opensm/osm_port.c
> @@ -379,8 +379,8 @@ uint8_t osm_physp_calc_link_op_vls(IN osm_log_t * p_log,
>  	/* support user limitation of max_op_vls */
>  	if (op_vls > p_subn->opt.max_op_vls)
>  		op_vls = p_subn->opt.max_op_vls;
> -
> -	if (op_vls == 0) {
> +	else if (op_vls == 0) {
> +		/* for non compliant implementations */
>  		OSM_LOG(p_log, OSM_LOG_DEBUG, "ERR 4102: "
>  			"Invalid OP_VLS = 0. Forcing correction to 1 (VL0)\n");
>  		op_vls = 1;

I would suggest to not mix zero OperVLs workaround and max_op_vls=0
processing. Just move 'op_vls == 0' check to be above max_op_vls
comparison.

Also (need to repeat my original comment) using max_op_vls = 0 will
enforce PortInfo update attempt, which actually may not be needed if the
only "changed" field is OperVLs changed to 0 ("No change") - see the
code in osm_link_mgr.c.

Sasha



More information about the general mailing list