[ofa-general] [PATCH] opensm: merge force_immediate/delayed_heavy_sweep flags
Sasha Khapyorsky
sashak at voltaire.com
Sun Jan 27 08:30:29 PST 2008
When connectivity problems were detected by drop manager, we want to
enforce an usual heavy sweep. No need to keep a separate
force_delayed_heavy_sweep flag.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/include/opensm/osm_subnet.h | 13 ++-----------
opensm/opensm/main.c | 2 +-
opensm/opensm/osm_console.c | 5 ++---
opensm/opensm/osm_drop_mgr.c | 4 ++--
opensm/opensm/osm_node_info_rcv.c | 4 ++--
opensm/opensm/osm_sm_state_mgr.c | 8 ++++----
opensm/opensm/osm_state_mgr.c | 18 ++++++------------
opensm/opensm/osm_trap_rcv.c | 4 ++--
8 files changed, 21 insertions(+), 37 deletions(-)
diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index e60cf91..b5f2b6d 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -559,8 +559,7 @@ typedef struct _osm_subn {
uint8_t min_ca_rate;
boolean_t ignore_existing_lfts;
boolean_t subnet_initialization_error;
- boolean_t force_immediate_heavy_sweep;
- boolean_t force_delayed_heavy_sweep;
+ boolean_t force_heavy_sweep;
boolean_t in_sweep_hop_0;
boolean_t moved_to_master_state;
boolean_t first_time_master_sweep;
@@ -650,7 +649,7 @@ typedef struct _osm_subn {
* that failed). We want to declare the subnet as unhealthy, and force
* another heavy sweep.
*
-* force_immediate_heavy_sweep
+* force_heavy_sweep
* If TRUE - we want to force a heavy sweep. This can be done either
* due to receiving of trap - meaning there is some change on the subnet,
* or we received a handover from a remote sm.
@@ -658,14 +657,6 @@ typedef struct _osm_subn {
* This will cause another heavy sweep to occure when the current sweep
* is done.
*
-* force_delayed_heavy_sweep
-* In some means - similar to the force_immediate_heavy_sweep flag, only
-* it'll cause a heavy sweep in the next sweep. Note that this means that
-* if we are running with -s 0 (no sweeps) - then this forced heavy sweep
-* will not occur.
-* If we had some trouble on the subnet, that caused a strange dropping
-* of ports - we will try to do another heavy sweep on our next sweep.
-*
* in_sweep_hop_0
* When in_sweep_hop_0 flag is set to TRUE - this means we are
* in sweep_hop_0 - meaning we do not want to continue beyond
diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index de69f68..a21cfcc 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -1032,7 +1032,7 @@ int main(int argc, char *argv[])
if (osm_hup_flag) {
osm_hup_flag = 0;
/* a HUP signal should only start a new heavy sweep */
- osm.subn.force_immediate_heavy_sweep = TRUE;
+ osm.subn.force_heavy_sweep = TRUE;
osm_opensm_sweep(&osm);
}
}
diff --git a/opensm/opensm/osm_console.c b/opensm/opensm/osm_console.c
index c0e7886..f699ec3 100644
--- a/opensm/opensm/osm_console.c
+++ b/opensm/opensm/osm_console.c
@@ -474,9 +474,8 @@ static void resweep_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
fprintf(out, "Invalid resweep command\n");
help_resweep(out, 1);
} else {
- if (strcmp(p_cmd, "heavy") == 0) {
- p_osm->subn.force_immediate_heavy_sweep = TRUE;
- }
+ if (strcmp(p_cmd, "heavy") == 0)
+ p_osm->subn.force_heavy_sweep = TRUE;
osm_opensm_sweep(p_osm);
}
}
diff --git a/opensm/opensm/osm_drop_mgr.c b/opensm/opensm/osm_drop_mgr.c
index 2b8966c..40534ab 100644
--- a/opensm/opensm/osm_drop_mgr.c
+++ b/opensm/opensm/osm_drop_mgr.c
@@ -151,12 +151,12 @@ drop_mgr_clean_physp(IN const osm_drop_mgr_t * const p_mgr,
IB_LINK_ACTIVE) {
osm_log(p_mgr->p_log, OSM_LOG_VERBOSE,
"drop_mgr_clean_physp: "
- "Forcing delayed heavy sweep. Remote "
+ "Forcing new heavy sweep. Remote "
"port 0x%016" PRIx64 " port num: 0x%X "
"was recognized in ACTIVE state\n",
cl_ntoh64(p_remote_physp->port_guid),
p_remote_physp->port_num);
- p_mgr->p_subn->force_delayed_heavy_sweep = TRUE;
+ p_mgr->p_subn->force_heavy_sweep = TRUE;
}
/* If the remote node is ca or router - need to remove the remote port,
diff --git a/opensm/opensm/osm_node_info_rcv.c b/opensm/opensm/osm_node_info_rcv.c
index cfce437..3ac8d1f 100644
--- a/opensm/opensm/osm_node_info_rcv.c
+++ b/opensm/opensm/osm_node_info_rcv.c
@@ -183,7 +183,7 @@ __osm_ni_rcv_set_links(IN osm_sm_t * sm,
}
if (osm_node_has_any_link(p_node, port_num) &&
- sm->p_subn->force_immediate_heavy_sweep == FALSE &&
+ sm->p_subn->force_heavy_sweep == FALSE &&
(!p_ni_context->dup_count ||
(p_ni_context->dup_node_guid == osm_node_get_node_guid(p_node) &&
p_ni_context->dup_port_num == port_num))) {
@@ -207,7 +207,7 @@ __osm_ni_rcv_set_links(IN osm_sm_t * sm,
report_duplicated_guid(sm, p_physp,
p_neighbor_node,
p_ni_context->port_num);
- sm->p_subn->force_immediate_heavy_sweep = TRUE;
+ sm->p_subn->force_heavy_sweep = TRUE;
} else if (p_node->sw)
requery_dup_node_info(sm, p_physp->p_remote_physp,
p_ni_context->dup_count + 1);
diff --git a/opensm/opensm/osm_sm_state_mgr.c b/opensm/opensm/osm_sm_state_mgr.c
index 8cd3276..4d0b026 100644
--- a/opensm/opensm/osm_sm_state_mgr.c
+++ b/opensm/opensm/osm_sm_state_mgr.c
@@ -589,9 +589,9 @@ osm_sm_state_mgr_process(IN osm_sm_state_mgr_t * const p_sm_mgr,
if (p_sm_mgr->p_subn->first_time_master_sweep == FALSE)
p_sm_mgr->p_subn->first_time_master_sweep =
TRUE;
- /* Turn on the force_immediate_heavy_sweep - we want a
+ /* Turn on the force_heavy_sweep - we want a
* heavy sweep to occur on the first sweep of this SM. */
- p_sm_mgr->p_subn->force_immediate_heavy_sweep = TRUE;
+ p_sm_mgr->p_subn->force_heavy_sweep = TRUE;
p_sm_mgr->p_subn->sm_state = IB_SMINFO_STATE_MASTER;
/*
@@ -659,10 +659,10 @@ osm_sm_state_mgr_process(IN osm_sm_state_mgr_t * const p_sm_mgr,
*/
osm_log(p_sm_mgr->p_log, OSM_LOG_VERBOSE,
"osm_sm_state_mgr_process: "
- "Forcing immediate heavy sweep. "
+ "Forcing heavy sweep. "
"Received OSM_SM_SIGNAL_HANDOVER or OSM_SM_SIGNAL_POLLING_TIMEOUT\n");
p_sm_mgr->p_polling_sm = NULL;
- p_sm_mgr->p_subn->force_immediate_heavy_sweep = TRUE;
+ p_sm_mgr->p_subn->force_heavy_sweep = TRUE;
osm_sm_signal(&p_sm_mgr->p_subn->p_osm->sm,
OSM_SIGNAL_SWEEP);
break;
diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index 4b7dcac..93fd880 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -1386,21 +1386,15 @@ void osm_state_mgr_process(IN osm_state_mgr_t * const p_mgr,
IB_SMINFO_STATE_DISCOVERING
&& p_mgr->p_subn->opt.force_heavy_sweep ==
FALSE
- && p_mgr->p_subn->
- force_immediate_heavy_sweep == FALSE
- && p_mgr->p_subn->
- force_delayed_heavy_sweep == FALSE
+ && p_mgr->p_subn->force_heavy_sweep == FALSE
&& p_mgr->p_subn->subnet_initialization_error == FALSE) {
if (__osm_state_mgr_light_sweep_start(p_mgr) == IB_SUCCESS) {
p_mgr->state = OSM_SM_STATE_SWEEP_LIGHT;
}
} else {
- /* First of all - if force_immediate_heavy_sweep is TRUE then
+ /* First of all - if force_heavy_sweep is TRUE then
* need to unset it */
- p_mgr->p_subn->force_immediate_heavy_sweep = FALSE;
- /* If force_delayed_heavy_sweep is TRUE then
- * need to unset it */
- p_mgr->p_subn->force_delayed_heavy_sweep = FALSE;
+ p_mgr->p_subn->force_heavy_sweep = FALSE;
/* If subnet_initialization_error is TRUE then
* need to unset it. */
p_mgr->p_subn->subnet_initialization_error = FALSE;
@@ -1487,7 +1481,7 @@ void osm_state_mgr_process(IN osm_state_mgr_t * const p_mgr,
switch (signal) {
case OSM_SIGNAL_NO_PENDING_TRANSACTIONS:
case OSM_SIGNAL_DONE:
- if (p_mgr->p_subn->force_immediate_heavy_sweep) {
+ if (p_mgr->p_subn->force_heavy_sweep) {
/*
* Do not read next item from the idle queue.
* Immediate heavy sweep is requested, so it's
@@ -1631,7 +1625,7 @@ void osm_state_mgr_process(IN osm_state_mgr_t * const p_mgr,
case OSM_SIGNAL_NO_PENDING_TRANSACTIONS:
/* if new sweep requiested - don't bother with the rest */
- if (p_mgr->p_subn->force_immediate_heavy_sweep) {
+ if (p_mgr->p_subn->force_heavy_sweep) {
p_mgr->state = OSM_SM_STATE_IDLE;
signal = OSM_SIGNAL_SWEEP;
break;
@@ -2301,7 +2295,7 @@ void osm_state_mgr_process(IN osm_state_mgr_t * const p_mgr,
/* if we got a signal to force immediate heavy sweep in the middle of the sweep -
* try another sweep. */
- if ((p_mgr->p_subn->force_immediate_heavy_sweep) &&
+ if ((p_mgr->p_subn->force_heavy_sweep) &&
(p_mgr->state == OSM_SM_STATE_IDLE)) {
signal = OSM_SIGNAL_SWEEP;
}
diff --git a/opensm/opensm/osm_trap_rcv.c b/opensm/opensm/osm_trap_rcv.c
index 53269b4..6c02791 100644
--- a/opensm/opensm/osm_trap_rcv.c
+++ b/opensm/opensm/osm_trap_rcv.c
@@ -607,11 +607,11 @@ __osm_trap_rcv_process_request(IN osm_sm_t * sm,
run_heavy_sweep)) {
osm_log(sm->p_log, OSM_LOG_VERBOSE,
"__osm_trap_rcv_process_request: "
- "Forcing immediate heavy sweep. "
+ "Forcing heavy sweep. "
"Received trap:%u\n",
cl_ntoh16(p_ntci->g_or_v.generic.trap_num));
- sm->p_subn->force_immediate_heavy_sweep = TRUE;
+ sm->p_subn->force_heavy_sweep = TRUE;
}
osm_sm_signal(&sm->p_subn->p_osm->sm, OSM_SIGNAL_SWEEP);
}
--
1.5.4.rc5
More information about the general
mailing list