[ofa-general] [PATCH] opensm: remove static __some_hop_count_set var

Sasha Khapyorsky sashak at voltaire.com
Thu Jul 26 16:32:47 PDT 2007


This removes static variable __some_hop_count_set from osm_ucast_mgr
and instead uses flag stored as structure memmber.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/include/opensm/osm_ucast_mgr.h |    6 ++++++
 opensm/opensm/osm_ucast_mgr.c         |   16 ++++------------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/opensm/include/opensm/osm_ucast_mgr.h b/opensm/include/opensm/osm_ucast_mgr.h
index 3381616..4824971 100644
--- a/opensm/include/opensm/osm_ucast_mgr.h
+++ b/opensm/include/opensm/osm_ucast_mgr.h
@@ -105,6 +105,7 @@ typedef struct _osm_ucast_mgr
 	osm_log_t	*p_log;
 	cl_plock_t	*p_lock;
 	boolean_t	 any_change;
+	boolean_t	some_hop_count_set;
 	uint8_t		*lft_buf;
 } osm_ucast_mgr_t;
 /*
@@ -126,6 +127,11 @@ typedef struct _osm_ucast_mgr
 *		set to TRUE by osm_ucast_mgr_set_fwd_table() if any mad
 *		was sent.
 *
+*	some_hop_count_set
+*		Initialized to FALSE at the beginning of each the min hop
+*		tables calculation iteration cycle, set to TRUE to indicate
+*		that some hop count changes were done.
+*
 *	lft_buf
 *		LFT buffer - used during LFT calculation/setup.
 *
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index a8fc649..f049e74 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -66,14 +66,6 @@
 
 /**********************************************************************
  **********************************************************************/
-/*
- * This flag is used for stopping the relaxation algorithm if no
- * change detected during the fabric scan
- */
-static boolean_t __some_hop_count_set;
-
-/**********************************************************************
- **********************************************************************/
 void
 osm_ucast_mgr_construct(
   IN osm_ucast_mgr_t* const p_mgr )
@@ -531,7 +523,7 @@ __osm_ucast_mgr_process_neighbor(
                  "cannot set hops for lid %u at switch 0x%" PRIx64 "\n",
                  lid_ho,
                  cl_ntoh64(osm_node_get_node_guid(p_this_sw->p_node)));
-      __some_hop_count_set = TRUE;
+      p_mgr->some_hop_count_set = TRUE;
     }
   }
 
@@ -1020,10 +1012,10 @@ osm_ucast_mgr_build_lid_matrices(
       if non of the switches was set will exit the
       while loop
     */
-    __some_hop_count_set = TRUE;
-    for( i = 0; (i < iteration_max) && __some_hop_count_set; i++ )
+    p_mgr->some_hop_count_set = TRUE;
+    for( i = 0; (i < iteration_max) && p_mgr->some_hop_count_set; i++ )
     {
-      __some_hop_count_set = FALSE;
+      p_mgr->some_hop_count_set = FALSE;
       cl_qmap_apply_func( p_sw_guid_tbl,
                           __osm_ucast_mgr_process_neighbors, p_mgr );
     }
-- 
1.5.3.rc2.38.g11308




More information about the general mailing list