Skip to contentSkip to conversation

osm_sa_path_record.c: path_sl may return SL different from requested SL

PATCH In review Hal Rosenstock 2 participants 2 messages Dec 11, 2013 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 osm_sa_path_record.c: path_sl may return SL different from requested SL

From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/[email protected]>

---
 opensm/osm_sa_path_record.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
opensm/osm_sa_path_record.c +19 -1
index d2ff93b..8384ece 100644
@@ -839,10 +839,28 @@ static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa,
 	 * send the currently computed SL value as a hint and let the routing
 	 * engine override it.
 	 */
-	if (p_re && p_re->path_sl)
+	if (p_re && p_re->path_sl) {
+		uint8_t pr_sl;
+		pr_sl = sl;
+
 		sl = p_re->path_sl(p_re->context, sl,
 				   cl_hton16(src_lid_ho), cl_hton16(dest_lid_ho));
 
+		if ((comp_mask & IB_PR_COMPMASK_SL) && (sl != pr_sl)) {
+			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F2A: "
+				"Requested SL (%u) doesn't match SL calculated"
+				"by routing engine (%u) "
+				"[%s port %d <-> %s port %d]\n",
+				pr_sl,
+				sl,
+				p_src_alias_guid->p_base_port->p_node->print_desc,
+				p_src_alias_guid->p_base_port->p_physp->port_num,
+				p_dest_alias_guid->p_base_port->p_node->print_desc,
+				p_dest_alias_guid->p_base_port->p_physp->port_num);
+			status = IB_NOT_FOUND;
+			goto Exit;
+		}
+	}
 	/* reset pkey when raw traffic */
 	if (comp_mask & IB_PR_COMPMASK_RAWTRAFFIC &&
 	    cl_ntoh32(p_pr->hop_flow_raw) & (1 << 31))
Signature · 6 lines
1.7.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 52A8B0A4.9040402-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

Acked-by
#2 lore raw
Quoted 1 line · Hal Rosenstock

From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/[email protected]>

Nice catch!

Quoted 32 lines
---
 opensm/osm_sa_path_record.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
opensm/osm_sa_path_record.c +12 -1
index d2ff93b..8384ece 100644
@@ -839,10 +839,28 @@ static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa,
 	 * send the currently computed SL value as a hint and let the routing
 	 * engine override it.
 	 */
-	if (p_re && p_re->path_sl)
+	if (p_re && p_re->path_sl) {
+		uint8_t pr_sl;
+		pr_sl = sl;
+
 		sl = p_re->path_sl(p_re->context, sl,
 				   cl_hton16(src_lid_ho), cl_hton16(dest_lid_ho));
 
+		if ((comp_mask & IB_PR_COMPMASK_SL) && (sl != pr_sl)) {
+			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F2A: "
+				"Requested SL (%u) doesn't match SL calculated"
+				"by routing engine (%u) "
+				"[%s port %d <-> %s port %d]\n",
+				pr_sl,
+				sl,
+				p_src_alias_guid->p_base_port->p_node->print_desc,

opensm/osm_sa_path_record.c static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa, · line 866

Quoted 10 lines
opensm/osm_sa_path_record.c +7 -0
+				p_src_alias_guid->p_base_port->p_physp->port_num,
+				p_dest_alias_guid->p_base_port->p_node->print_desc,
+				p_dest_alias_guid->p_base_port->p_physp->port_num);
+			status = IB_NOT_FOUND;
+			goto Exit;
+		}
+	}
 	/* reset pkey when raw traffic */
 	if (comp_mask & IB_PR_COMPMASK_RAWTRAFFIC &&
 	    cl_ntoh32(p_pr->hop_flow_raw) & (1 << 31))

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html