[ofa-general] [PATCH v2] opensm/osm_state_mgr.c: bug fix in unicast cache

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Nov 20 00:33:19 PST 2008


Hi Sasha,

When there are errors during initialization and new
heavy sweep is forced, unicast cache might hold a
snapshot of the previous routing, and since there
might be no *topology* changes, unicast cache will
apply that cached routing, which might be wrong.

This patch invalidates cache explicitly if there
were initialization errors in addition to few other
cases.

V2: don't invalidate cache when
    opt.force_heavy_sweep is on.

This fix addresses bug #1398.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_state_mgr.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index 841438c..788da51 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -1064,6 +1064,15 @@ static void do_sweep(osm_sm_t * sm)
 	}

 	/*
+	 * Unicast cache should be invalidated if there were errors
+	 * during initialization or if subnet re-route is requested.
+	 */
+	if (sm->p_subn->opt.use_ucast_cache &&
+	    (sm->p_subn->subnet_initialization_error ||
+	     sm->p_subn->force_reroute))
+		osm_ucast_cache_invalidate(&sm->ucast_mgr);
+
+	/*
 	 * If we don't need to do a heavy sweep and we want to do a reroute,
 	 * just reroute only.
 	 */
@@ -1079,10 +1088,6 @@ static void do_sweep(osm_sm_t * sm)
 		/* Re-program the switches fully */
 		sm->p_subn->ignore_existing_lfts = TRUE;

-		/* we want to re-route, so cache should be invalidated */
-		if (sm->p_subn->opt.use_ucast_cache)
-			osm_ucast_cache_invalidate(&sm->ucast_mgr);
-
 		osm_ucast_mgr_process(&sm->ucast_mgr);

 		/* Reset flag */
-- 
1.5.1.4




More information about the general mailing list