[openib-general] [PATCH] CM: set/record correct message timeout

Sean Hefty mshefty at ichips.intel.com
Tue Jan 18 15:22:12 PST 2005


Committing patch that sets the timeout value for sent messages to the
correct timeout value, including setting the timeout to 0 for messages
that do not generate a response.  Also added recording the timeout
on the passive side of a connection.

- Sean

signed-off-by: Sean Hefty <sean.hefty at intel.com>

Index: core/cm.c
===================================================================
--- core/cm.c	(revision 1568)
+++ core/cm.c	(working copy)
@@ -161,7 +161,7 @@
 	m->send_wr.wr.ud.mad_hdr = &m->mad.mad_hdr;
 	m->send_wr.wr.ud.remote_qpn = 1;
 	m->send_wr.wr.ud.remote_qkey = IB_QP1_QKEY;
-	m->send_wr.wr.ud.timeout_ms = cm_id_priv->timeout_ms;
+	/* Timeout set by caller if response is expected. */
 	m->send_wr.wr.ud.pkey_index = cm_id_priv->pkey_index;
 
 	atomic_inc(&cm_id_priv->refcount);
@@ -755,6 +755,7 @@
 		goto out;
 
 	cm_format_req((struct cm_req_msg *)&msg->mad, cm_id_priv, param);
+	msg->send_wr.wr.ud.timeout_ms = cm_id_priv->timeout_ms;
 
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id->state == IB_CM_IDLE)
@@ -912,6 +913,8 @@
 		cm_id_priv = cur_cm_id_priv;
 	}
 	cm_id_priv->port = port;
+	cm_id_priv->timeout_ms = cm_convert_to_ms(
+					cm_req_get_local_resp_timeout(req_msg));
 	cm_id_priv->max_cm_retries = cm_req_get_max_cm_retries(req_msg);
 	cm_id_priv->remote_qpn = cm_req_get_local_qpn(req_msg);
 	cm_id_priv->remote_port_gid = req_msg->primary_local_gid;
@@ -1015,6 +1018,7 @@
 		goto out;
 
 	cm_format_rep((struct cm_rep_msg *)&msg->mad, cm_id_priv, param);
+	msg->send_wr.wr.ud.timeout_ms = cm_id_priv->timeout_ms;
 
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id->state == IB_CM_REQ_RCVD ||
@@ -1279,6 +1283,7 @@
 
 	cm_format_dreq((struct cm_dreq_msg *)&msg->mad, cm_id_priv,
 		       private_data, private_data_len);
+	msg->send_wr.wr.ud.timeout_ms = cm_id_priv->timeout_ms;
 
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id->state == IB_CM_ESTABLISHED)
@@ -1696,6 +1701,7 @@
 
 	cm_format_lap((struct cm_lap_msg *)&msg->mad, cm_id_priv,
 		      alternate_path, private_data, private_data_len);
+	msg->send_wr.wr.ud.timeout_ms = cm_id_priv->timeout_ms;
 
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id->state == IB_CM_ESTABLISHED &&
@@ -1956,6 +1962,7 @@
 
 	cm_format_sidr_req((struct cm_sidr_req_msg *)&msg->mad, cm_id_priv,
 			   param);
+	msg->send_wr.wr.ud.timeout_ms = cm_id_priv->timeout_ms;
 
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id->state == IB_CM_IDLE)



More information about the general mailing list