diff mbox

[1/2] opensm/osm_req.c: In req_determine_mkey, fix DR algorithm

Message ID 50BCC458.1030305@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock Dec. 3, 2012, 3:25 p.m. UTC
so that it works regardless of SM port type
Now works on switch port 0 as well as CA and router ports

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 opensm/osm_req.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Comments

Alex Netes Jan. 30, 2013, 5:45 p.m. UTC | #1
Hi Hal,

On 10:25 Mon 03 Dec     , Hal Rosenstock wrote:
> 
> so that it works regardless of SM port type
> Now works on switch port 0 as well as CA and router ports
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied the series, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_req.c b/opensm/osm_req.c
index 1f5db3f..b48be48 100644
--- a/opensm/osm_req.c
+++ b/opensm/osm_req.c
@@ -87,16 +87,20 @@  static ib_net64_t req_determine_mkey(IN osm_sm_t * sm,
 		goto Remote_Guid;
 	}
 
-	if (p_sm_port)
+	if (p_sm_port) {
+		/* get the node for the SM */
+		p_node = p_sm_port->p_node;
 		p_physp = p_sm_port->p_physp;
+	}
 
-	/* hop_count == 1: outgoing physp is SM physp */
-	for (hop = 2; p_physp && hop <= p_path->hop_count; hop++) {
+	for (hop = 1; p_physp && hop <= p_path->hop_count; hop++) {
+		p_physp = osm_node_get_physp_ptr(p_node, p_path->path[hop]);
+		if (!p_physp)
+			break;
 		p_physp = p_physp->p_remote_physp;
 		if (!p_physp)
 			break;
 		p_node = p_physp->p_node;
-		p_physp = osm_node_get_physp_ptr(p_node, p_path->path[hop]);
 	}
 
 	/* At this point, p_physp points at the outgoing physp on the