[openib-general] [PATCH] OpenSM/osm_ucast_lash.c: In osm_get_lash_sl, fix SL when CA ports on same switch

Hal Rosenstock halr at voltaire.com
Thu Feb 8 06:19:43 PST 2007


OpenSM/osm_ucast_lash.c: In osm_get_lash_sl, fix SL when CA ports on same switch
    
This change resolves an issue with strange SL assignment when
two HCAs communicate with other and are on the same switch.
Since LASH is switch to switch routing, the get_lash_sl
function was casting 9999 (the value assigned to the
variable NONE) to be a uint8_t when asked for an SL assignment
in this case. This change resolves this issue.
    
Signed-off-by: Thomas Sødring <tsodring at simula.no>
Signed-off-by: Hal Rosenstock <halr at voltaire.com>

diff --git a/osm/opensm/osm_ucast_lash.c b/osm/opensm/osm_ucast_lash.c
index 5dfe068..e5f751c 100644
--- a/osm/opensm/osm_ucast_lash.c
+++ b/osm/opensm/osm_ucast_lash.c
@@ -1468,6 +1468,7 @@ uint8_t osm_get_lash_sl(osm_opensm_t *p_
 			osm_port_t *p_src_port, osm_port_t *p_dst_port)
 {
 	unsigned dst_id;
+	unsigned src_id;
 	osm_switch_t *p_sw;
 
 	if (p_osm->routing_engine.ucast_build_fwd_tables != lash_process)
@@ -1482,6 +1483,10 @@ uint8_t osm_get_lash_sl(osm_opensm_t *p_
 	if (!p_sw || !p_sw->priv)
 		return OSM_DEFAULT_SL;
 
+	src_id = get_lash_id(p_sw);
+	if (src_id == dst_id) 
+		return OSM_DEFAULT_SL;
+
 	return (uint8_t)((switch_t *)p_sw->priv)->routing_table[dst_id].lane;
 }
 





More information about the general mailing list