***SPAM*** [ofa-general] [PATCH 4/5] opensm/osm_qos.c support new arrangement of qos parameters
Eli Dorfman (Voltaire)
dorfman.eli at gmail.com
Tue Jan 20 06:05:24 PST 2009
support new arrangement of qos parameters
change functions to access qos parameters flat below subnet opt
Signed-off-by: Eli Dorfman <elid at voltaire.com>
---
opensm/opensm/osm_qos.c | 46 +++++++++++++++++++++++++++++++---------------
1 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c
index b451c25..d5b62cf 100644
--- a/opensm/opensm/osm_qos.c
+++ b/opensm/opensm/osm_qos.c
@@ -261,6 +261,15 @@ static ib_api_status_t qos_physp_setup(osm_log_t * p_log, osm_sm_t * sm,
return IB_SUCCESS;
}
+#define qos_init_local_opts(opt, subn_opt) \
+{ \
+ opt ## _max_vls = subn_opt ## _max_vls; \
+ opt ## _high_limit = subn_opt ## _high_limit; \
+ opt ## _vlarb_high = subn_opt ## _vlarb_high; \
+ opt ## _vlarb_low = subn_opt ## _vlarb_low; \
+ opt ## _sl2vl = subn_opt ## _sl2vl; \
+}
+
osm_signal_t osm_qos_setup(osm_opensm_t * p_osm)
{
struct qos_config ca_config, sw0_config, swe_config, rtr_config;
@@ -274,20 +283,27 @@ osm_signal_t osm_qos_setup(osm_opensm_t * p_osm)
ib_api_status_t status;
unsigned force_update;
uint8_t i;
+ osm_qos_options_t qos_options;
+ osm_qos_options_t qos_ca_options;
+ osm_qos_options_t qos_sw0_options;
+ osm_qos_options_t qos_swe_options;
+ osm_qos_options_t qos_rtr_options;
if (!p_osm->subn.opt.qos)
return OSM_SIGNAL_DONE;
OSM_LOG_ENTER(&p_osm->log);
- qos_build_config(&ca_config, &p_osm->subn.opt.qos_ca_options,
- &p_osm->subn.opt.qos_options);
- qos_build_config(&sw0_config, &p_osm->subn.opt.qos_sw0_options,
- &p_osm->subn.opt.qos_options);
- qos_build_config(&swe_config, &p_osm->subn.opt.qos_swe_options,
- &p_osm->subn.opt.qos_options);
- qos_build_config(&rtr_config, &p_osm->subn.opt.qos_rtr_options,
- &p_osm->subn.opt.qos_options);
+ qos_init_local_opts(qos_options.qos, p_osm->subn.opt.qos);
+ qos_init_local_opts(qos_ca_options.qos, p_osm->subn.opt.qos_ca);
+ qos_init_local_opts(qos_sw0_options.qos, p_osm->subn.opt.qos_sw0);
+ qos_init_local_opts(qos_swe_options.qos, p_osm->subn.opt.qos_swe);
+ qos_init_local_opts(qos_rtr_options.qos, p_osm->subn.opt.qos_rtr);
+
+ qos_build_config(&ca_config, &qos_ca_options, &qos_options);
+ qos_build_config(&sw0_config, &qos_sw0_options, &qos_options);
+ qos_build_config(&swe_config, &qos_swe_options, &qos_options);
+ qos_build_config(&rtr_config, &qos_rtr_options, &qos_options);
cl_plock_excl_acquire(&p_osm->lock);
@@ -381,14 +397,14 @@ static void qos_build_config(struct qos_config *cfg,
memset(cfg, 0, sizeof(*cfg));
- cfg->max_vls = opt->max_vls > 0 ? opt->max_vls : dflt->max_vls;
+ cfg->max_vls = opt->qos_max_vls > 0 ? opt->qos_max_vls : dflt->qos_max_vls;
- if (opt->high_limit >= 0)
- cfg->vl_high_limit = (uint8_t) opt->high_limit;
+ if (opt->qos_high_limit >= 0)
+ cfg->vl_high_limit = (uint8_t) opt->qos_high_limit;
else
- cfg->vl_high_limit = (uint8_t) dflt->high_limit;
+ cfg->vl_high_limit = (uint8_t) dflt->qos_high_limit;
- p = opt->vlarb_high ? opt->vlarb_high : dflt->vlarb_high;
+ p = opt->qos_vlarb_high ? opt->qos_vlarb_high : dflt->qos_vlarb_high;
for (i = 0; i < 2 * IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK; i++) {
p += parse_vlarb_entry(p,
&cfg->vlarb_high[i /
@@ -397,7 +413,7 @@ static void qos_build_config(struct qos_config *cfg,
IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK]);
}
- p = opt->vlarb_low ? opt->vlarb_low : dflt->vlarb_low;
+ p = opt->qos_vlarb_low ? opt->qos_vlarb_low : dflt->qos_vlarb_low;
for (i = 0; i < 2 * IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK; i++) {
p += parse_vlarb_entry(p,
&cfg->vlarb_low[i /
@@ -406,7 +422,7 @@ static void qos_build_config(struct qos_config *cfg,
IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK]);
}
- p = opt->sl2vl ? opt->sl2vl : dflt->sl2vl;
+ p = opt->qos_sl2vl ? opt->qos_sl2vl : dflt->qos_sl2vl;
for (i = 0; i < IB_MAX_NUM_VLS / 2; i++)
p += parse_sl2vl_entry(p, &cfg->sl2vl.raw_vl_by_sl[i]);
--
1.5.5
More information about the general
mailing list