[ofa-general] [PATCH] librdmacm: override default responder_resources with user value

Sean Hefty sean.hefty at intel.com
Thu Jan 3 15:54:23 PST 2008


By default, the responder_resources parameter is set to that received
in a connection request.  The passive side may override this value
when accepting the connection.  Use the value provided by the passive
side when transitioning the QP to RTR state, rather than the value
given in the connect request.  Without this change, the RTR transition
may fail if the passive side supports fewer responder_resources than
that requested in the request.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
This fixes an issue seen by uDAPL.  The kernel rdma_cm will need a
similar fix.  I will wait a couple of weeks and release yet another
version of librdmacm (1.0.6) for OFED 1.3 that includes this fix.

 src/cma.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/cma.c b/src/cma.c
index 00ea394..751ca9d 100644
--- a/src/cma.c
+++ b/src/cma.c
@@ -611,7 +611,8 @@ static int rdma_init_qp_attr(struct rdma_cm_id *id, struct ibv_qp_attr *qp_attr,
 	return 0;
 }
 
-static int ucma_modify_qp_rtr(struct rdma_cm_id *id)
+static int ucma_modify_qp_rtr(struct rdma_cm_id *id,
+			      struct rdma_conn_param *conn_param)
 {
 	struct ibv_qp_attr qp_attr;
 	int qp_attr_mask, ret;
@@ -634,6 +635,8 @@ static int ucma_modify_qp_rtr(struct rdma_cm_id *id)
 	if (ret)
 		return ret;
 
+	if (conn_param)
+		qp_attr.max_dest_rd_atomic = conn_param->responder_resources;
 	return ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
 }
 
@@ -911,7 +914,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 		return ret;
 
 	if (!ucma_is_ud_ps(id->ps)) {
-		ret = ucma_modify_qp_rtr(id);
+		ret = ucma_modify_qp_rtr(id, conn_param);
 		if (ret)
 			return ret;
 	}
@@ -1193,7 +1196,7 @@ static int ucma_process_conn_resp(struct cma_id_private *id_priv)
 	void *msg;
 	int ret, size;
 
-	ret = ucma_modify_qp_rtr(&id_priv->id);
+	ret = ucma_modify_qp_rtr(&id_priv->id, NULL);
 	if (ret)
 		goto err;
 






More information about the general mailing list