[openib-general][PATCH][kdapl]: FMR and EVD patch

James Lentini jlentini at netapp.com
Thu Aug 18 12:28:35 PDT 2005



Hi Guy,

The one piece of this patch that remains unaccepted is:

Index: ib/dapl_evd.c
===================================================================
--- ib/dapl_evd.c	(revision 3136)
+++ ib/dapl_evd.c	(working copy)
@@ -1028,6 +1028,7 @@
 {
 	struct dapl_evd *evd;
 	int status = 0;
+	int pending_events;
 
 	evd = (struct dapl_evd *)evd_handle;
 	dapl_dbg_log (DAPL_DBG_TYPE_API, "%s: (evd=%p, upcall_policy=%d)\n",
@@ -1035,14 +1036,25 @@
 
 	spin_lock_irqsave(&evd->common.lock, evd->common.flags);
 	if ((upcall_policy != DAT_UPCALL_TEARDOWN) &&
-	    (upcall_policy != DAT_UPCALL_DISABLE) &&
-	    (evd->evd_flags & DAT_EVD_DTO_FLAG)) {
-		status = ib_req_notify_cq(evd->cq, IB_CQ_NEXT_COMP);
-		if (status) {
-			printk(KERN_ERR "%s: dapls_ib_completion_notify failed "
-			       "(status=0x%x)\n",__func__, status);
+	    (upcall_policy != DAT_UPCALL_DISABLE)) {
+		pending_events = dapl_rbuf_count(&evd->pending_event_queue);
+		if (pending_events) {
+			dapl_dbg_log(DAPL_DBG_TYPE_WARN,
+				     "%s: (evd %p) there are still %d pending "
+				     "events in the queue - policy stays disabled\n",
+				     __func__, evd_handle, pending_events);
+			status = -EBUSY;
 			goto bail;
 		}
+		if (evd->evd_flags & DAT_EVD_DTO_FLAG) {
+			status = ib_req_notify_cq(evd->cq, IB_CQ_NEXT_COMP);
+			if (status) {
+				printk(KERN_ERR "%s: dapls_ib_completion_notify"
+					" failed (status=0x%x) \n",__func__,
+					status);
+				goto bail;
+			}
+		}
 	}
 	evd->upcall_policy = upcall_policy;
 	evd->upcall = *upcall;

The IB analog to this function, ib_req_notify_cq(), does not require 
that the CQ be empty. The kDAPL specification does not define an empty 
EVD as a requirement for modifying the upcall and previous 
implementations of the API have not made this requirement. 



More information about the general mailing list