Hi Yevgeny,

On 17:27 Sun 27 Jan     , Yevgeny Kliteynik wrote:
> 
> Fat-tree routing should ignore port 0 and loopback
> connections on switches when populating its db.
> 
> Please apply to ofed_1_3 and master.
> 
> Signed-off-by:  Yevgeny Kliteynik <[EMAIL PROTECTED]>
> ---
>  opensm/opensm/osm_ucast_ftree.c |   15 ++++++++++++++-
>  1 files changed, 14 insertions(+), 1 deletions(-)
> 
> diff --git a/opensm/opensm/osm_ucast_ftree.c b/opensm/opensm/osm_ucast_ftree.c
> index dcbdc44..904a9c5 100644
> --- a/opensm/opensm/osm_ucast_ftree.c
> +++ b/opensm/opensm/osm_ucast_ftree.c
> @@ -3113,7 +3113,7 @@ static int __osm_ftree_fabric_construct_sw_ports(IN 
> ftree_fabric_t * p_ftree,
> 
>       CL_ASSERT(osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH);
> 
> -     for (i = 0; i < osm_node_get_num_physp(p_node); i++) {
> +     for (i = 1; i < osm_node_get_num_physp(p_node); i++) {
>               osm_physp_t *p_osm_port = osm_node_get_physp_ptr(p_node, i);
> 
>               if (!osm_physp_is_valid(p_osm_port))
> @@ -3158,6 +3158,19 @@ static int __osm_ftree_fabric_construct_sw_ports(IN 
> ftree_fabric_t * p_ftree,
>                           __osm_ftree_fabric_get_sw_by_guid(p_ftree,
>                                                             remote_node_guid);
>                       CL_ASSERT(p_remote_sw);
> +
> +                     /* ignore any loopback connection on switch */
> +                     if (p_sw == p_remote_sw) {
> +                             osm_log(&p_ftree->p_osm->log, OSM_LOG_DEBUG,
> +                                     "__osm_ftree_fabric_construct_sw_ports: 
> "
> +                                     "Ignoring loopback on switch 0x%016" 
> PRIx64
> +                                     ", LID 0x%04x, rank %u\n",
> +                                     __osm_ftree_sw_get_guid_ho(p_sw),
> +                                     cl_ntoh16(p_sw->base_lid),
> +                                     p_sw->rank);
> +                             continue;
> +                     }
> +

What about to make it before remote switch resolving (5 lines above)?
Something like:

        if (p_node == p_remote_node) {
                .....
                continue;
        }

should be faster.

Sasha
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to