[ofa-general] [PATCH] use LIDs from REQ LRH for inter-subnet connections

Sean Hefty sean.hefty at intel.com
Mon Mar 19 21:48:53 PDT 2007


Jason,

When you get a chance, can you try out this patch?  I tested that it worked
for a local subnet connection by commenting out the hop_limit check.  So,
I'm interested to know if you run into any problems.  If you do run into
issues, madeye may be able to help.

- Sean


commit 1f2819006479bd72c6d79bdb80750d4766fad2f3
Author: Sean Hefty <sean.hefty at intel.com>
Date:   Mon Mar 19 21:09:25 2007 -0800

    To support inter-subnet connections, the passive endpoint needs to use
    its subnet local LIDs.  The LIDs carried in the REQ are currently the
    LIDs from the active subnet (SLID and router LID).  Replace LIDs in the
    REQ with subnet local LIDs from LRH.
    
    Signed-off-by: Sean Hefty <sean.hefty at intel.com>

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 842cd0b..6eb4685 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -1379,6 +1379,18 @@ static int cm_req_handler(struct cm_work *work)
 	cm_id_priv->id.service_id = req_msg->service_id;
 	cm_id_priv->id.service_mask = __constant_cpu_to_be64(~0ULL);
 
+	/*
+	 * Work-around for inter-subnet connections.  We need to override LID
+	 * data using LRH if path came from a remote subnet, since the remote
+	 * subnet doesn't know our local LID values.
+	 */
+	if (req_msg->primary_hop_limit > 1) {
+		req_msg->primary_local_lid = cpu_to_be16(work->mad_recv_wc->
+							 wc->slid);
+		req_msg->primary_remote_lid = cpu_to_be16(work->mad_recv_wc->
+							  wc->dlid_path_bits);
+	}
+
 	cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]);
 	ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av);
 	if (ret) {




More information about the general mailing list