diff mbox

opensm/osm_state_mgr.c: force heavy sweep when fabric consists of single switch

Message ID 4AF0056A.5030503@dev.mellanox.co.il (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Yevgeny Kliteynik Nov. 3, 2009, 10:26 a.m. UTC
None
diff mbox

Patch

diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index 4303d6e..537c855 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -1062,13 +1062,18 @@  static void do_sweep(osm_sm_t * sm)
 	 * Otherwise, this is probably our first discovery pass
 	 * or we are connected in loopback. In both cases do a
 	 * heavy sweep.
-	 * Note: If we are connected in loopback we want a heavy
-	 * sweep, since we will not be getting any traps if there is
-	 * a lost connection.
+	 * Note the following:
+	 * 1. If we are connected in loopback we want a heavy sweep, since we
+	 *    will not be getting any traps if there is a lost connection.
+	 * 2. If we are in DISCOVERING state - this means it is either in
+	 *    initializing or wake up from STANDBY - run the heavy sweep.
+	 * 3. If there is only one node in the fabric, and this node is a
+	 *    switch, and OSM runs on top of it, there might be a race when
+	 *    OSM starts running before the external ports are up - run the
+	 *    heavy sweep.
 	 */
-	/*  if we are in DISCOVERING state - this means it is either in
-	 *  initializing or wake up from STANDBY - run the heavy sweep */
 	if (cl_qmap_count(&sm->p_subn->sw_guid_tbl)
+	    && cl_qmap_count(&sm->p_subn->node_guid_tbl) != 1
 	    && sm->p_subn->sm_state != IB_SMINFO_STATE_DISCOVERING
 	    && sm->p_subn->opt.force_heavy_sweep == FALSE
 	    && sm->p_subn->force_heavy_sweep == FALSE