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

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


Hal,

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 |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
index ee6b3f9..05e07d5 100644
--- a/osm/opensm/osm_ucast_mgr.c
+++ b/osm/opensm/osm_ucast_mgr.c
@@ -1196,12 +1196,21 @@ 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