[ofa-general] [PATCH] opensm: fix QoS config bug
Sasha Khapyorsky
sashak at voltaire.com
Wed Nov 19 09:50:25 PST 2008
Then file is not given or OpenSM cannot open it config verification
procedure is not running and as result QoS parameters still have wrong
values - OpenSM crashes later when '-Q' is used.
This addresses bug #1401.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/include/opensm/osm_subnet.h | 1 +
opensm/opensm/main.c | 2 ++
opensm/opensm/osm_subnet.c | 8 +++++---
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index 2bcd232..d97d5f4 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -1100,6 +1100,7 @@ int osm_subn_write_conf_file(char *file_name, IN osm_subn_opt_t * const p_opt);
* Assumes the conf file is part of the cache dir which defaults to
* OSM_DEFAULT_CACHE_DIR or OSM_CACHE_DIR the name is opensm.opts
*********/
+int osm_subn_verify_config(osm_subn_opt_t * const p_opt);
END_C_DECLS
#endif /* _OSM_SUBNET_H_ */
diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index 53648d6..999e92f 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -948,6 +948,8 @@ int main(int argc, char *argv[])
exit(status);
}
+ osm_subn_verify_config(&opt);
+
if (vendor_debug)
osm_vendor_set_debug(osm.p_vendor, vendor_debug);
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index d787fe8..c41962d 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -949,7 +949,7 @@ static void subn_verify_qos_set(osm_qos_options_t *set, const char *prefix,
subn_verify_sl2vl(&set->sl2vl, prefix, dflt->sl2vl);
}
-static void subn_verify_conf_file(IN osm_subn_opt_t * const p_opts)
+int osm_subn_verify_config(IN osm_subn_opt_t * const p_opts)
{
if (p_opts->lmc > 7) {
log_report(" Invalid Cached Option Value:lmc = %u:"
@@ -1024,6 +1024,8 @@ static void subn_verify_conf_file(IN osm_subn_opt_t * const p_opts)
OSM_PERFMGR_DEFAULT_MAX_OUTSTANDING_QUERIES;
}
#endif
+
+ return 0;
}
/**********************************************************************
@@ -1285,7 +1287,7 @@ int osm_subn_parse_conf_file(char *file_name, osm_subn_opt_t * const p_opts)
}
fclose(opts_file);
- subn_verify_conf_file(p_opts);
+ osm_subn_verify_config(p_opts);
return 0;
}
@@ -1340,7 +1342,7 @@ int osm_subn_rescan_conf_files(IN osm_subn_t * const p_subn)
}
fclose(opts_file);
- subn_verify_conf_file(&p_subn->opt);
+ osm_subn_verify_config(&p_subn->opt);
osm_parse_prefix_routes_file(p_subn);
--
1.6.0.3.517.g759a
More information about the general
mailing list