In order to support IB-to-IB routers, we need to provide path 
information about the remote subnet to the ib_cm.  For now, we
simply copy our local path information, but use permissive LIDs
in place of the actual, remote LIDs.  This indicates to the
remote ib_cm that it should use the LIDs/SL data from the LRH
received with CM REQ in place of the actual data carried in the
REQ message when configuring the remote QP.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
---

 drivers/infiniband/core/cma.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index fde92ce..430f104 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2170,7 +2170,19 @@ static int cma_connect_ib(struct rdma_id_private 
*id_priv,
                goto out;
        req.private_data = private_data;
 
-       req.primary_path = &route->path_rec[0];
+       if (route->path_rec[0].hop_limit > 1) {
+               req.primary_path = kmalloc(sizeof *req.primary_path * 2,
+                                          GFP_ATOMIC);
+               if (!req.primary_path) {
+                       ret = -ENOMEM;
+                       goto out;
+               }
+               req.primary_path[0] = route->path_rec[0];
+               req.primary_path[1] = route->path_rec[0];
+               req.primary_path[1].slid = IB_LID_PERMISSIVE;
+               req.primary_path[1].dlid = IB_LID_PERMISSIVE;
+       } else
+               req.primary_path = &route->path_rec[0];
        if (route->num_paths == 2)
                req.alternate_path = &route->path_rec[1];
 
@@ -2190,6 +2202,9 @@ static int cma_connect_ib(struct rdma_id_private *id_priv,
        req.srq = id_priv->srq ? 1 : 0;
 
        ret = ib_send_cm_req(id_priv->cm_id.ib, &req);
+
+       if (route->path_rec[0].hop_limit > 1)
+               kfree(req.primary_path);
 out:
        if (ret && !IS_ERR(id_priv->cm_id.ib)) {
                ib_destroy_cm_id(id_priv->cm_id.ib);

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to