[ewg] [PATCH] cma: add module parameter to control cm retry count

Yossi Etigin yosefe at Voltaire.COM
Mon Oct 6 10:32:22 PDT 2008


Add a module parameter to rdma_cm that controls the number of cm retries.
We want to be able to lower the timeout for unsuccessful rdma_cm connections,
and with cma_response_timeout alone there's a lower bound of ~30 seconds.

Signed-off-by: Yossi Etigin <yosefe at voltaire.com>

--

This patch should be applied on top of cma_0010_response_timeout.patch.

Index: b/drivers/infiniband/core/cma.c
===================================================================
--- a/drivers/infiniband/core/cma.c	2008-10-06 18:58:15.000000000 +0200
+++ b/drivers/infiniband/core/cma.c	2008-10-06 19:01:22.000000000 +0200
@@ -62,6 +62,10 @@ static int cma_response_timeout = CMA_CM
 module_param_named(cma_response_timeout, cma_response_timeout, int, 0644);
 MODULE_PARM_DESC(cma_response_timeout, "CMA_CM_RESPONSE_TIMEOUT default=20");
 
+static int cma_max_retries = CMA_MAX_CM_RETRIES;
+module_param(cma_max_retries, int, 0644);
+MODULE_PARM_DESC(cma_max_retries, "max number of retries for CM requests");
+
 static void cma_add_one(struct ib_device *device);
 static void cma_remove_one(struct ib_device *device);
 
@@ -2237,7 +2241,7 @@ static int cma_resolve_ib_udp(struct rdm
 	req.service_id = cma_get_service_id(id_priv->id.ps,
 					    (struct sockaddr *) &route->addr.dst_addr);
 	req.timeout_ms = 1 << (cma_response_timeout - 8);
-	req.max_cm_retries = CMA_MAX_CM_RETRIES;
+	req.max_cm_retries = cma_max_retries;
 
 	ret = ib_send_cm_sidr_req(id_priv->cm_id.ib, &req);
 	if (ret) {
@@ -2297,7 +2301,7 @@ static int cma_connect_ib(struct rdma_id
 	req.rnr_retry_count = conn_param->rnr_retry_count;
 	req.remote_cm_response_timeout = cma_response_timeout;
 	req.local_cm_response_timeout = cma_response_timeout;
-	req.max_cm_retries = CMA_MAX_CM_RETRIES;
+	req.max_cm_retries = cma_max_retries;
 	req.srq = id_priv->srq ? 1 : 0;
 
 	ret = ib_send_cm_req(id_priv->cm_id.ib, &req);

-- 
--Yossi



More information about the ewg mailing list