[openib-general] [PATCH] osm: bug that caused ucast manager to 'hang'

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Dec 14 11:58:29 PST 2006


Hi Hal

This patch fixes a bug that caused ucast manager to return
OSM_SIGNAL_DONE_PENDING even if there are no pending transactions.
Added a boolean flag that marks whether there was some change or not
(in which case OSM_SIGNAL_DONE should be returned).

--
Yevgeny

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 osm/include/opensm/osm_ucast_mgr.h |    6 ++++++
 osm/opensm/osm_ucast_mgr.c         |   13 ++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/osm/include/opensm/osm_ucast_mgr.h b/osm/include/opensm/osm_ucast_mgr.h
index 8237963..39bf45a 100644
--- a/osm/include/opensm/osm_ucast_mgr.h
+++ b/osm/include/opensm/osm_ucast_mgr.h
@@ -104,6 +104,7 @@ typedef struct _osm_ucast_mgr
 	osm_req_t	*p_req;
 	osm_log_t	*p_log;
 	cl_plock_t	*p_lock;
+	boolean_t	 any_change;
 	uint8_t		*lft_buf;
 } osm_ucast_mgr_t;
 /*
@@ -120,6 +121,11 @@ typedef struct _osm_ucast_mgr
 *	p_lock
 *		Pointer to the serializing lock.
 *
+*	any_change
+*		Initialized to FALSE at the beginning of the algorithm,
+*		set to TRUE by osm_ucast_mgr_set_fwd_table() if any mad 
+*		was sent.
+*
 *	lft_buf
 *		LFT buffer - used during LFT calculation/setup.
 *
diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
index 3341eea..e977253 100644
--- a/osm/opensm/osm_ucast_mgr.c
+++ b/osm/opensm/osm_ucast_mgr.c
@@ -984,6 +984,7 @@ osm_ucast_mgr_set_fwd_table(
     }
     else
     {
+      p_mgr->any_change = TRUE;
       /*
         HACK: for now we will assume we succeeded to send
         and set the local DB based on it. This should allow
@@ -1220,6 +1221,7 @@ osm_ucast_mgr_process(
   if (cl_qmap_count( p_sw_guid_tbl ) == 0)
     goto Exit;
 
+  p_mgr->any_change = FALSE;
   cl_qmap_apply_func(p_sw_guid_tbl, __osm_ucast_mgr_clean_switch, NULL);
 
   if (!p_routing_eng->build_lid_matrices ||
@@ -1246,13 +1248,10 @@ osm_ucast_mgr_process(
   if ( osm_log_is_active( p_mgr->p_log, OSM_LOG_ROUTING ) )
     __osm_ucast_mgr_dump_tables( p_mgr );
 
-  /*
-    For now don't bother checking if the switch forwarding tables
-    actually needed updating.  The current code will always update
-    them, and thus leave transactions pending on the wire.
-    Therefore, return OSM_SIGNAL_DONE_PENDING.
-  */
-  signal = OSM_SIGNAL_DONE_PENDING;
+  if (p_mgr->any_change)
+     signal = OSM_SIGNAL_DONE_PENDING;
+  else
+     signal = OSM_SIGNAL_DONE;
 
   osm_log(p_mgr->p_log, OSM_LOG_VERBOSE,
           "osm_ucast_mgr_process: "
-- 
1.4.4.1.GIT





More information about the general mailing list