[openib-general] [PATCH] osm: Fat-tree routing failed to recognize non-fat-tree topology.

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Tue Jan 2 08:22:46 PST 2007


Hi Hal

Fixing bug in fat-tree routing: 
it failed to recognize non-fat-tree topology.

--
Yevgeny

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

diff --git a/osm/opensm/osm_ucast_ftree.c b/osm/opensm/osm_ucast_ftree.c
index 7f8b556..eb7cf96 100644
--- a/osm/opensm/osm_ucast_ftree.c
+++ b/osm/opensm/osm_ucast_ftree.c
@@ -178,9 +178,9 @@ typedef struct ftree_sw_t_
    ftree_tuple_t          tuple;
    ib_net16_t             base_lid;
    ftree_port_group_t  ** down_port_groups;
-   uint16_t               down_port_groups_num;
+   uint8_t                down_port_groups_num;
    ftree_port_group_t  ** up_port_groups;
-   uint16_t               up_port_groups_num;
+   uint8_t                up_port_groups_num;
    ftree_fwd_tbl_t        lft_buf;
 } ftree_sw_t;
 
@@ -747,6 +747,7 @@ __osm_ftree_sw_add_port(
          p_sw->down_port_groups[p_sw->down_port_groups_num++] = p_group;
    }
    __osm_ftree_port_group_add_port(p_group,port_num,remote_port_num);
+
 } /* __osm_ftree_sw_add_port() */
 
 /***************************************************/
@@ -2731,9 +2732,27 @@ __osm_ftree_fabric_construct_sw_ports(
 
             p_remote_sw = (ftree_sw_t *)cl_qmap_get(&p_ftree->sw_tbl,remote_node_guid);
             CL_ASSERT(p_remote_sw != (ftree_sw_t *)cl_qmap_end(&p_ftree->sw_tbl));
-            CL_ASSERT(abs(p_sw->rank - p_remote_sw->rank) == 1);
             p_remote_hca_or_sw = (void *)p_remote_sw;
 
+            if (abs(p_sw->rank - p_remote_sw->rank) != 1)
+            {
+               osm_log(&p_ftree->p_osm->log, OSM_LOG_ERROR,
+                       "__osm_ftree_fabric_construct_sw_ports: ERR AB16: "
+                       "Illegal link between switches with ranks %u and %u:\n"
+                       "       GUID 0x%016" PRIx64 ", LID 0x%x, rank %u\n"
+                       "       GUID 0x%016" PRIx64 ", LID 0x%x, rank %u\n",
+                       p_sw->rank,
+                       p_remote_sw->rank,
+                       cl_ntoh64(osm_node_get_node_guid(osm_switch_get_node_ptr(p_sw->p_osm_sw))),
+                       cl_ntoh16(p_sw->base_lid),
+                       p_sw->rank,
+                       cl_ntoh64(osm_node_get_node_guid(osm_switch_get_node_ptr(p_remote_sw->p_osm_sw))),
+                       cl_ntoh16(p_remote_sw->base_lid),
+                       p_remote_sw->rank);
+               res = -1;
+               goto Exit;
+            }
+
             if (p_sw->rank > p_remote_sw->rank)
                direction = FTREE_DIRECTION_UP;
             else
@@ -3012,6 +3031,9 @@ __osm_ftree_construct_fabric(
 
    if (! __osm_ftree_fabric_validate_topology(p_ftree))
    {
+      osm_log(&p_ftree->p_osm->log, OSM_LOG_SYS,
+              "Fabric topology is not a fat-tree - "
+              "routing falls back to default routing\n");
       status = -1;
       goto Exit;
    }
-- 
1.4.4.1.GIT





More information about the general mailing list