[openib-general] [PATCH] opensm: fix SL2VL capability check for switch's external ports

Sasha Khapyorsky sashak at voltaire.com
Sun May 14 05:23:34 PDT 2006


Fix SL2VL capability check for case of switch's external ports -
PortInfo::CapabilityMask is not used for such ports and capability check
should be based on number of supported data VLs.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---

 osm/opensm/osm_qos.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/osm/opensm/osm_qos.c b/osm/opensm/osm_qos.c
index 5944e9e..e72a0c0 100644
--- a/osm/opensm/osm_qos.c
+++ b/osm/opensm/osm_qos.c
@@ -206,8 +206,14 @@ static ib_api_status_t sl2vl_update(osm_
 	unsigned i, num_ports;
 	ib_port_info_t *p_pi = osm_physp_get_port_info_ptr(p);
 
-	if (p_pi && !(p_pi->capability_mask & IB_PORT_CAP_HAS_SL_MAP))
-		return IB_SUCCESS;
+	if (!p_pi)
+		return IB_ERROR;
+	if (port_num == 0) {
+		if (!(p_pi->capability_mask & IB_PORT_CAP_HAS_SL_MAP))
+			return IB_SUCCESS;
+	}
+	else if (ib_port_info_get_vl_cap(p_pi) == 1)
+			return IB_SUCCESS;
 
 	if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH)
 		num_ports = osm_node_get_num_physp(osm_physp_get_node_ptr(p));



More information about the general mailing list