[openib-general] [PATCH] Opensm - lid assignment issues

Yael Kalka yael at mellanox.co.il
Sun Nov 13 02:18:05 PST 2005


Hi Hal,

During some windows tests we've discovered that there is still another
problem in the lid_mgr. The problem happend when 2  HCAs had the same
lid - opensm entered an infinite loop.
The following patch fixes this.

Thanks,
Yael

Signed-off-by:  Yael Kalka <yael at mellanox.co.il>

Index: opensm/osm_lid_mgr.c
===================================================================
--- opensm/osm_lid_mgr.c	(revision 4032)
+++ opensm/osm_lid_mgr.c	(working copy)
@@ -550,6 +550,9 @@ __osm_lid_mgr_init_sweep(
       {
               /* This port will use its local lid, and consume the entire required lid range.
                  Thus we can skip that range. */
+              /* If the disc_max_lid is greater then lid - we can skip right to it, 
+                 since we've done all neccessary checks on the lids in between. */
+              if (disc_max_lid > lid)
         lid = disc_max_lid;
       }
     }
@@ -593,7 +596,14 @@ __osm_lid_mgr_init_sweep(
   {
     p_range =
       (osm_lid_mgr_range_t *)cl_malloc(sizeof(osm_lid_mgr_range_t));
-    p_range->min_lid = 1;
+    /* 
+       The p_range can be NULL in one of 2 cases:
+       1. If max_defined_lid == 0. In this case, we want the entire range.
+       2. If all lids discovered in the loop where mapped. In this case
+          no free range exists, and we want to define it after the last 
+          mapped lid.
+    */
+    p_range->min_lid = lid;
   }
   p_range->max_lid = p_mgr->p_subn->max_unicast_lid_ho - 1;
   cl_qlist_insert_tail( &p_mgr->free_ranges, &p_range->item );





More information about the general mailing list