[openib-general] [PATCH] osm: Fixing bug in fat-tree routing error path

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Wed Jan 3 07:35:34 PST 2007


Hi Hal.

Fixing a bug in fat-tree:

Unlike UPDN or File engines, the second stage of fat-tree engine
(fdb tables) can't be run if the first stage of the algorithn
(ranking and indexing) failed. Adding flag to let the routing
know that the first stage has failed.

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

diff --git a/osm/opensm/osm_ucast_ftree.c b/osm/opensm/osm_ucast_ftree.c
index e937982..cb40ab6 100644
--- a/osm/opensm/osm_ucast_ftree.c
+++ b/osm/opensm/osm_ucast_ftree.c
@@ -215,6 +215,7 @@ typedef struct ftree_fabric_t_
    uint16_t        max_hcas_per_leaf;
    cl_pool_t       sw_fwd_tbl_pool;
    uint16_t        lft_max_lid_ho;
+   boolean_t       fabric_built;
 } ftree_fabric_t;
 
 /***************************************************
@@ -1008,6 +1009,7 @@ __osm_ftree_fabric_clear(ftree_fabric_t
 
    p_ftree->leaf_switches_num = 0;
    p_ftree->leaf_switches = NULL;
+   p_ftree->fabric_built = FALSE;
 
 } /* __osm_ftree_fabric_destroy() */
 
@@ -3051,6 +3053,8 @@ __osm_ftree_construct_fabric(
              "Clearing FatTree Fabric data structures\n");
      __osm_ftree_fabric_clear(p_ftree);
    }
+   else
+      p_ftree->fabric_built = TRUE;
 
    osm_log(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,
            "__osm_ftree_construct_fabric: \n"
@@ -3061,7 +3065,7 @@ __osm_ftree_construct_fabric(
 
    OSM_LOG_EXIT(&p_ftree->p_osm->log);
    return status;
-}
+} /* __osm_ftree_construct_fabric() */
 
 /***************************************************
  ***************************************************/
@@ -3074,6 +3078,9 @@ __osm_ftree_do_routing(
 
    OSM_LOG_ENTER(&p_ftree->p_osm->log, __osm_ftree_do_routing);
 
+   if (!p_ftree->fabric_built)
+      goto Exit;
+
    osm_log(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,"__osm_ftree_do_routing: "
            "Starting FatTree routing\n");
 
@@ -3094,6 +3101,7 @@ __osm_ftree_do_routing(
    osm_log(&p_ftree->p_osm->log, OSM_LOG_VERBOSE,"__osm_ftree_do_routing: "
            "FatTree routing is done\n");
 
+ Exit:
    OSM_LOG_EXIT(&p_ftree->p_osm->log);
    return 0;
 }
-- 
1.4.4.1.GIT

 




More information about the general mailing list