[openib-general] [PATCH] OpenSM: Support configurable SL per partition

Patrick Mullaney pmullaney at novell.com
Wed Jul 12 07:26:41 PDT 2006


Hi Hal,

Yea, I think it should be ULONG_MAX and your local variable sl should
also be an unsigned long. Its precision will get truncated on the
assignment to conf->sl but no problem due to the range being
limited(0-15).

Pat


>>> Hal Rosenstock <halr at voltaire.com> 07/12/06 7:08 AM >>>
Hi again Pat,

On Tue, 2006-07-11 at 17:14, Patrick Mullaney wrote:
> This will avoid an invalid warning about service level value if sl=0
is
> used in the partition config file. Can you include something like it
in
> your original patch?
> 
> Thanks.
> Pat
> 
>
--------------------------------------------------------------------------------------------------
> 
> --- opensm.old/osm_prtn_config.c	2006-07-11 16:06:33.000000000
> -0400
> +++ opensm/osm_prtn_config.c	2006-07-11 16:08:00.000000000 -0400
> @@ -52,6 +52,7 @@
>  #include <string.h>
>  #include <errno.h>
>  #include <ctype.h>
> +#include <limits.h>
>  
>  #include <iba/ib_types.h>
>  #include <opensm/osm_base.h>
> @@ -159,7 +160,7 @@ static int partition_add_flag(unsigned l
>  	} else if (!strncmp(flag, "sl", len)) {
>  		unsigned sl;
>  
> -		if (!val || (sl = strtoul(val, NULL, 0)) == 0 || sl >
> 15)
> +		if (!val || (sl = strtoul(val, NULL, 0)) == UINT_MAX

Should this be UINT_MAX or ULONG_MAX ?

-- Hal

>  ||
> sl > 15)
>  			PARSEWARN(conf->p_log, lineno,
>  				"flag \'sl\' requires valid value"
>  				" - skipped.\n");
> 






More information about the general mailing list