[ofa-general] [PATCH] opensm: remove unused state_step_mode
Sasha Khapyorsky
sashak at voltaire.com
Sun Jun 10 15:31:59 PDT 2007
This removes unused state_step_mode and associated flow from
osm_state_mgr_process().
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/include/opensm/osm_base.h | 29 ------------
opensm/include/opensm/osm_state_mgr.h | 2 -
opensm/opensm/osm_state_mgr.c | 81 +++------------------------------
3 files changed, 6 insertions(+), 106 deletions(-)
diff --git a/opensm/include/opensm/osm_base.h b/opensm/include/opensm/osm_base.h
index ee280d3..6bdea24 100644
--- a/opensm/include/opensm/osm_base.h
+++ b/opensm/include/opensm/osm_base.h
@@ -768,35 +768,6 @@ typedef enum _osm_sm_state
typedef uintn_t osm_signal_t;
/***********/
-/****d* OpenSM: Base/osm_state_mgr_mode_t
-* NAME
-* osm_state_mgr_mode_t
-*
-* DESCRIPTION
-* Enumerates the possible state progressing codes used by the OSM
-* state manager.
-*
-* SYNOPSIS
-*/
-typedef enum _osm_state_mgr_mode
-{
- OSM_STATE_STEP_CONTINUOUS = 0,
- OSM_STATE_STEP_TAKE_ONE,
- OSM_STATE_STEP_BREAK
-} osm_state_mgr_mode_t;
-/*
-* OSM_STATE_STEP_CONTINUOUS
-* normal automatic progress mode
-*
-* OSM_STATE_STEP_TAKE_ONE
-* Do one step
-*
-* OSM_STATE_STEP_BREAK
-* Stop before taking next step (the while loop in the state
-* manager automatically change to this state).
-*
-**********/
-
/****d* OpenSM: Base/osm_sm_signal_t
* NAME
* osm_sm_signal_t
diff --git a/opensm/include/opensm/osm_state_mgr.h b/opensm/include/opensm/osm_state_mgr.h
index 427b156..6975d18 100644
--- a/opensm/include/opensm/osm_state_mgr.h
+++ b/opensm/include/opensm/osm_state_mgr.h
@@ -118,8 +118,6 @@ typedef struct _osm_state_mgr
cl_plock_t *p_lock;
cl_event_t *p_subnet_up_event;
osm_sm_state_t state;
- osm_state_mgr_mode_t state_step_mode;
- osm_signal_t next_stage_signal;
} osm_state_mgr_t;
/*
* FIELDS
diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index bcf68f2..893a423 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -153,8 +153,6 @@ osm_state_mgr_init(
p_mgr->state = OSM_SM_STATE_IDLE;
p_mgr->p_lock = p_lock;
p_mgr->p_subnet_up_event = p_subnet_up_event;
- p_mgr->state_step_mode = OSM_STATE_STEP_CONTINUOUS;
- p_mgr->next_stage_signal = OSM_SIGNAL_NONE;
status = cl_spinlock_init( &p_mgr->state_lock );
if( status != CL_SUCCESS )
@@ -2332,21 +2330,8 @@ Idle:
{
case OSM_SIGNAL_NO_PENDING_TRANSACTIONS:
case OSM_SIGNAL_DONE:
- /* If we run single step we have already done this */
- if( p_mgr->state_step_mode != OSM_STATE_STEP_TAKE_ONE )
- {
- __osm_state_mgr_set_sm_lid_done_msg( p_mgr );
- __osm_state_mgr_notify_lid_change( p_mgr );
- }
-
- /* Break on single step mode - if not continuous */
- if( p_mgr->state_step_mode == OSM_STATE_STEP_BREAK )
- {
- p_mgr->next_stage_signal = signal;
- signal = OSM_SIGNAL_NONE;
- break;
- }
-
+ __osm_state_mgr_set_sm_lid_done_msg( p_mgr );
+ __osm_state_mgr_notify_lid_change( p_mgr );
p_mgr->state = OSM_SM_STATE_SET_SUBNET_UCAST_LIDS;
signal = osm_lid_mgr_process_subnet( p_mgr->p_lid_mgr );
break;
@@ -2422,17 +2407,7 @@ Idle:
* their destination. */
__osm_state_mgr_check_tbl_consistency( p_mgr );
- /* If we run single step we have already done this */
- if( p_mgr->state_step_mode != OSM_STATE_STEP_TAKE_ONE )
- __osm_state_mgr_lid_assign_msg( p_mgr );
-
- /* Break on single step mode - just before taking next step */
- if( p_mgr->state_step_mode == OSM_STATE_STEP_BREAK )
- {
- p_mgr->next_stage_signal = signal;
- signal = OSM_SIGNAL_NONE;
- break;
- }
+ __osm_state_mgr_lid_assign_msg( p_mgr );
/*
* OK, the wire is clear, so proceed with
@@ -2444,12 +2419,6 @@ Idle:
p_mgr->state = OSM_SM_STATE_SET_UCAST_TABLES;
signal = osm_ucast_mgr_process( p_mgr->p_ucast_mgr );
- /* Break on single step mode */
- if( p_mgr->state_step_mode != OSM_STATE_STEP_CONTINUOUS )
- {
- p_mgr->next_stage_signal = signal;
- signal = OSM_SIGNAL_NONE;
- }
break;
default:
@@ -2507,17 +2476,7 @@ Idle:
* take into account these lfts. */
p_mgr->p_subn->ignore_existing_lfts = FALSE;
- /* If we run single step we have already done this */
- if( p_mgr->state_step_mode != OSM_STATE_STEP_TAKE_ONE )
- __osm_state_mgr_switch_config_msg( p_mgr );
-
- /* Break on single step mode - just before taking next step */
- if( p_mgr->state_step_mode == OSM_STATE_STEP_BREAK )
- {
- p_mgr->next_stage_signal = signal;
- signal = OSM_SIGNAL_NONE;
- break;
- }
+ __osm_state_mgr_switch_config_msg( p_mgr );
if( !p_mgr->p_subn->opt.disable_multicast )
{
@@ -2582,17 +2541,7 @@ Idle:
{
case OSM_SIGNAL_NO_PENDING_TRANSACTIONS:
case OSM_SIGNAL_DONE:
- /* If we run single step we have already done this */
- if( p_mgr->state_step_mode != OSM_STATE_STEP_TAKE_ONE )
- __osm_state_mgr_multicast_config_msg( p_mgr );
-
- /* Break on single step mode - just before taking next step */
- if( p_mgr->state_step_mode == OSM_STATE_STEP_BREAK )
- {
- p_mgr->next_stage_signal = signal;
- signal = OSM_SIGNAL_NONE;
- break;
- }
+ __osm_state_mgr_multicast_config_msg( p_mgr );
p_mgr->state = OSM_SM_STATE_SET_LINK_PORTS;
signal = osm_link_mgr_process( p_mgr->p_link_mgr,
@@ -2714,17 +2663,7 @@ Idle:
case OSM_SIGNAL_NO_PENDING_TRANSACTIONS:
case OSM_SIGNAL_DONE:
- /* If we run single step we have already done this */
- if( p_mgr->state_step_mode != OSM_STATE_STEP_TAKE_ONE )
- __osm_state_mgr_links_armed_msg( p_mgr );
-
- /* Break on single step mode - just before taking next step */
- if( p_mgr->state_step_mode == OSM_STATE_STEP_BREAK )
- {
- p_mgr->next_stage_signal = signal;
- signal = OSM_SIGNAL_NONE;
- break;
- }
+ __osm_state_mgr_links_armed_msg( p_mgr );
p_mgr->state = OSM_SM_STATE_SET_ACTIVE;
signal = osm_link_mgr_process( p_mgr->p_link_mgr,
@@ -2925,14 +2864,6 @@ Idle:
signal = OSM_SIGNAL_SWEEP;
}
- /*
- * for single step mode - some stages need to break only
- * after evaluating a single step.
- * For those we track the fact we have already performed
- * a single loop
- */
- if( p_mgr->state_step_mode == OSM_STATE_STEP_TAKE_ONE )
- p_mgr->state_step_mode = OSM_STATE_STEP_BREAK;
}
cl_spinlock_release( &p_mgr->state_lock );
--
1.5.2.1.137.g426c
More information about the general
mailing list