[ofa-general] [PATCHv2] osm: Clearing lid matrices before rebuilding them

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Mar 19 04:42:56 PDT 2007


Hi Hal,

[V2 of the patch]

This patch fixes a bug in the lid matrices creation:

The lid matrices were not cleared, which caused OSM routing
to crash when routing nonexisting (disconnected) lids.

Please apply to ofed_1_2.

I'm not sure about the trunk though.
Sasha,
Can you please check that you latest improvements to the
routing don't have this problem?

Thanks. 

-- Yevgeny

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 osm/opensm/osm_ucast_mgr.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
index ee6b3f9..8643754 100644
--- a/osm/opensm/osm_ucast_mgr.c
+++ b/osm/opensm/osm_ucast_mgr.c
@@ -1189,6 +1189,7 @@ ucast_mgr_setup_all_switches(osm_subn_t
 {
   osm_switch_t *p_sw;
   uint16_t lids;
+  uint16_t i;
 
   lids = (uint16_t)cl_ptr_vector_get_size(&p_subn->port_lid_tbl);
   lids = lids ? lids - 1 : 0;
@@ -1196,12 +1197,19 @@ ucast_mgr_setup_all_switches(osm_subn_t
   for (p_sw = (osm_switch_t*)cl_qmap_head(&p_subn->sw_guid_tbl);
        p_sw != (osm_switch_t*)cl_qmap_end(&p_subn->sw_guid_tbl);
        p_sw = (osm_switch_t*)cl_qmap_next(&p_sw->map_item))
-  if (osm_switch_prepare_path_rebuild(p_sw, lids)) {
-    osm_log(&p_subn->p_osm->log, OSM_LOG_ERROR,
-            "ucast_mgr_setup_all_switches: ERR 3A0B: "
-            "cannot setup switch 0x%016" PRIx64 "\n",
-            cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)));
-    return -1;
+  {
+    if (osm_switch_prepare_path_rebuild(p_sw, lids)) {
+      osm_log(&p_subn->p_osm->log, OSM_LOG_ERROR,
+              "ucast_mgr_setup_all_switches: ERR 3A0B: "
+              "cannot setup switch 0x%016" PRIx64 "\n",
+              cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)));
+      return -1;
+    }
+
+    /* Clear the LID matrix of the switch */
+    for ( i = 0; i < p_sw->num_hops; i++ )
+      if (p_sw->hops[i])
+        memset(p_sw->hops[i], OSM_NO_PATH, p_sw->num_ports);
   }
 
   return 0;
-- 
1.4.4.1.GIT




More information about the general mailing list