[ofa-general] [PATCH] opensm/osm_ucast_ftree.c: ignore port 0 and loopbacks on swithces

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Jan 27 07:27:05 PST 2008


Hi Sasha,

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 <kliteyn at dev.mellanox.co.il>
---
 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;
+			}
+
 			p_remote_hca_or_sw = (void *)p_remote_sw;

 			if (abs(p_sw->rank - p_remote_sw->rank) != 1) {
-- 
1.5.1.4




More information about the general mailing list