[ofw] [PATCH] uDAPL v2: CNO pre-triggered events not delivered during cno_wait

Arlin Davis arlin.r.davis at intel.com
Tue Aug 4 22:32:03 PDT 2009


CNO events, once triggered will not be returned during the cno wait.
Check for triggered state before going to sleep in cno_wait. Reset
triggered EVD reference after reporting.

diff --git a/dapl/udapl/dapl_cno_wait.c b/dapl/udapl/dapl_cno_wait.c
index e89317d..6bbd249 100644
--- a/dapl/udapl/dapl_cno_wait.c
+++ b/dapl/udapl/dapl_cno_wait.c
@@ -82,6 +82,14 @@ DAT_RETURN DAT_API dapl_cno_wait(IN DAT_CNO_HANDLE cno_handle,	/* cno_handle */
 	}
 
 	dapl_os_lock(&cno_ptr->header.lock);
+	if (cno_ptr->cno_state == DAPL_CNO_STATE_TRIGGERED) {
+		cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
+		*evd_handle = cno_ptr->cno_evd_triggered;
+		cno_ptr->cno_evd_triggered = NULL;
+		dapl_os_unlock(&cno_ptr->header.lock);
+		goto bail;
+	}
+
 	while (cno_ptr->cno_state == DAPL_CNO_STATE_UNTRIGGERED
 	       && DAT_GET_TYPE(dat_status) != DAT_TIMEOUT_EXPIRED) {
 		cno_ptr->cno_waiters++;
@@ -104,6 +112,7 @@ DAT_RETURN DAT_API dapl_cno_wait(IN DAT_CNO_HANDLE cno_handle,	/* cno_handle */
 		dapl_os_assert(cno_ptr->cno_state == DAPL_CNO_STATE_TRIGGERED);
 		cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
 		*evd_handle = cno_ptr->cno_evd_triggered;
+		cno_ptr->cno_evd_triggered = NULL;
 	} else if (DAT_GET_TYPE(dat_status) == DAT_TIMEOUT_EXPIRED) {
 		cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
 		*evd_handle = NULL;




More information about the ofw mailing list