[ofa-general] Re: [PATCH] opensm/qos_config: no invalid option message on default values
Yevgeny Kliteynik
kliteyn at dev.mellanox.co.il
Mon Feb 9 10:36:01 PST 2009
Hi Sasha,
Sasha Khapyorsky wrote:
> Don't comply about invalid QoS options when its default values are used.
Looks good. This also fixes bug #1451:
https://bugs.openfabrics.org/show_bug.cgi?id=1451
-- Yevgeny
> Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
> ---
> opensm/opensm/osm_subnet.c | 18 +++++++++---------
> 1 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
> index 3324af9..69937c1 100644
> --- a/opensm/opensm/osm_subnet.c
> +++ b/opensm/opensm/osm_subnet.c
> @@ -911,9 +911,11 @@ static ib_api_status_t osm_parse_prefix_routes_file(IN osm_subn_t * const p_subn
> **********************************************************************/
> static void subn_verify_max_vls(unsigned *max_vls, const char *prefix, unsigned dflt)
> {
> - if (!(*max_vls) || *max_vls > 15) {
> - log_report(" Invalid Cached Option: %s_max_vls=%u: "
> - "Using Default = %u\n", prefix, *max_vls, dflt);
> + if (!*max_vls || *max_vls > 15) {
> + if (*max_vls)
> + log_report(" Invalid Cached Option: %s_max_vls=%u: "
> + "Using Default = %u\n",
> + prefix, *max_vls, dflt);
> *max_vls = dflt;
> }
> }
> @@ -921,8 +923,10 @@ static void subn_verify_max_vls(unsigned *max_vls, const char *prefix, unsigned
> static void subn_verify_high_limit(int *high_limit, const char *prefix, int dflt)
> {
> if (*high_limit < 0 || *high_limit > 255) {
> - log_report(" Invalid Cached Option: %s_high_limit=%d: "
> - "Using Default: %d\n", prefix, *high_limit, dflt);
> + if (*high_limit > 255)
> + log_report(" Invalid Cached Option: %s_high_limit=%d: "
> + "Using Default: %d\n",
> + prefix, *high_limit, dflt);
> *high_limit = dflt;
> }
> }
> @@ -934,8 +938,6 @@ static void subn_verify_vlarb(char **vlarb, const char *prefix,
> int count = 0;
>
> if (*vlarb == NULL) {
> - log_report(" Invalid Cached Option: %s_vlarb_%s: "
> - "Using Default\n", prefix, suffix);
> *vlarb = strdup(dflt);
> return;
> }
> @@ -1003,8 +1005,6 @@ static void subn_verify_sl2vl(char **sl2vl, const char *prefix, char *dflt)
> int count = 0;
>
> if (*sl2vl == NULL) {
> - log_report(" Invalid Cached Option: %s_sl2vl: Using Default\n",
> - prefix);
> *sl2vl = strdup(dflt);
> return;
> }
More information about the general
mailing list