[ofw] [PATCH 2/3] DAPL v2.0: ucm: cm object needs to be on work queue before req sent on wire

Davis, Arlin R arlin.r.davis at intel.com
Sat Feb 12 11:33:46 PST 2011


With the delay in cm object queuing there is potential for replies
being dropped coming back with a NO MATCH. Start with INIT
state and queue it up, move to state REP_PENDING when
sending out on the wire to start request timer.

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/openib_ucm/cm.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 69f7610..b2db32c 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -951,7 +951,7 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm)
 		 htons(cm->msg.dport));
 
 	dapl_os_lock(&cm->lock);
-	if (cm->state != DCM_REP_PENDING) {
+	if (cm->state != DCM_INIT && cm->state != DCM_REP_PENDING) {
 		dapl_os_unlock(&cm->lock);
 		return DAT_INVALID_STATE;
 	}
@@ -985,8 +985,9 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm)
 				 DAT_INVALID_ADDRESS_UNREACHABLE);
 	}
 
+	cm->state = DCM_REP_PENDING;
 	cm->msg.op = htons(DCM_REQ);
-	dapl_os_get_time(&cm->timer); /* reply expected */
+	dapl_os_get_time(&cm->timer); /* reset reply timer */
 	if (ucm_send(&cm->hca->ib_trans, &cm->msg, 
 		     &cm->msg.p_data, ntohs(cm->msg.p_size))) {
 		dapl_os_unlock(&cm->lock);
@@ -994,10 +995,6 @@ dapli_cm_connect(DAPL_EP *ep, dp_ib_cm_handle_t cm)
 	}
 	dapl_os_unlock(&cm->lock);
 
-	/* first time through, link EP and CM, put on work queue */
-	if (!cm->retries) {
-		dapli_queue_conn(cm);
-	}
 	return DAT_SUCCESS;
 
 bail:
@@ -1658,7 +1655,10 @@ dapls_ib_connect(IN DAT_EP_HANDLE ep_handle,
 		dapl_os_memcpy(&cm->msg.p_data, p_data, p_size);
 	}
 	
-	cm->state = DCM_REP_PENDING;
+	cm->state = DCM_INIT;
+
+	/* link EP and CM, put on work queue */
+	dapli_queue_conn(cm);
 
 	/* build connect request, send to remote CM based on r_addr info */
 	return (dapli_cm_connect(ep, cm));
-- 
1.7.3






More information about the ofw mailing list