[openib-general] [kDAPL][PATCH] delete cno user level code from kdapl

Itamar Rabenstein itamar at mellanox.co.il
Wed May 4 05:33:13 PDT 2005


clean up kdapl code : delete cno user level code

Signed-off-by: Itamar Rabenstein <itamar at mellanox.co.il>

Index: linux-kernel/dat-provider/dapl_evd_free.c
===================================================================
--- linux-kernel/dat-provider/dapl_evd_free.c	(revision 2251)
+++ linux-kernel/dat-provider/dapl_evd_free.c	(working copy)
@@ -74,16 +74,8 @@
 	}
 
 	if (cno_ptr != NULL)
-	{
-		if (atomic_read (&cno_ptr->cno_ref_count) > 0 ||
cno_ptr->cno_waiters > 0)
-		{
-			dat_status = DAT_ERROR (DAT_INVALID_STATE,
DAT_INVALID_STATE_EVD_IN_USE);
-			goto bail;
-		}
-		dapl_ia_unlink_cno (cno_ptr->header.owner_ia, cno_ptr);
-		dapl_cno_dealloc (cno_ptr);
-	}
-
+        dapl_cno_dealloc (cno_ptr);
+    
       bail:
 	dapl_dbg_log(DAPL_DBG_TYPE_RTN,
 		     "dapl_evd_free () returns 0x%x\n", dat_status);
Index: linux-kernel/dat-provider/dapl_ia_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_ia_util.c	(revision 2251)
+++ linux-kernel/dat-provider/dapl_ia_util.c	(working copy)
@@ -98,7 +98,6 @@
 	dapl_llist_init_head(&ia_ptr->rmr_list_head);
 	dapl_llist_init_head(&ia_ptr->pz_list_head);
 	dapl_llist_init_head(&ia_ptr->evd_list_head);
-	dapl_llist_init_head(&ia_ptr->cno_list_head);
 	dapl_llist_init_head(&ia_ptr->rsp_list_head);
 	dapl_llist_init_head(&ia_ptr->psp_list_head);
 
@@ -491,7 +490,6 @@
 	dapl_os_assert(dapl_llist_is_empty(&ia_ptr->rmr_list_head));
 	dapl_os_assert(dapl_llist_is_empty(&ia_ptr->ep_list_head));
 	dapl_os_assert(dapl_llist_is_empty(&ia_ptr->evd_list_head));
-	dapl_os_assert(dapl_llist_is_empty(&ia_ptr->cno_list_head));
 	dapl_os_assert(dapl_llist_is_empty(&ia_ptr->psp_list_head));
 	dapl_os_assert(dapl_llist_is_empty(&ia_ptr->rsp_list_head));
 
@@ -638,29 +636,6 @@
 }
 
 /*
- * Add an cno to the IA structure
- */
-void dapl_ia_link_cno(DAPL_IA * ia_ptr, DAPL_CNO * cno_ptr)
-{
-    spin_lock (&ia_ptr->header.lock);
-    dapl_llist_add_head (&ia_ptr->cno_list_head,
-                         &cno_ptr->header.ia_list_entry,
-                         cno_ptr);
-    spin_unlock (&ia_ptr->header.lock);
-}
-
-/*
- * Remove an cno from the ia info structure
- */
-void dapl_ia_unlink_cno(DAPL_IA * ia_ptr, DAPL_CNO * cno_ptr)
-{
-    spin_lock (&ia_ptr->header.lock);
-    dapl_llist_remove_entry (&ia_ptr->cno_list_head,
-                             &cno_ptr->header.ia_list_entry);
-    spin_unlock (&ia_ptr->header.lock);
-}
-
-/*
  * Add an psp to the IA structure
  */
 void dapl_ia_link_psp(DAPL_IA * ia_ptr, DAPL_SP * sp_ptr)
Index: linux-kernel/dat-provider/dapl_ia_util.h
===================================================================
--- linux-kernel/dat-provider/dapl_ia_util.h	(revision 2251)
+++ linux-kernel/dat-provider/dapl_ia_util.h	(working copy)
@@ -71,10 +71,6 @@
 
 void dapl_ia_unlink_evd(DAPL_IA * ia_ptr, DAPL_EVD * evd_info);
 
-void dapl_ia_link_cno(DAPL_IA * ia_ptr, DAPL_CNO * cno_info);
-
-void dapl_ia_unlink_cno(DAPL_IA * ia_ptr, DAPL_CNO * cno_info);
-
 void dapl_ia_link_psp(DAPL_IA * ia_ptr, DAPL_SP * sp_info);
 
 void dapl_ia_unlink_sp(DAPL_IA * ia_ptr, DAPL_SP * sp_info);
Index: linux-kernel/dat-provider/dapl_evd_kcreate.c
===================================================================
--- linux-kernel/dat-provider/dapl_evd_kcreate.c	(revision 2251)
+++ linux-kernel/dat-provider/dapl_evd_kcreate.c	(working copy)
@@ -104,10 +104,8 @@
         	goto bail;
     	}
 
-    	cno_ptr->cno_state = DAPL_CNO_STATE_TRIGGERED;
     	cno_ptr->cno_upcall_policy = upcall_policy;
 
-    	dapl_ia_link_cno (ia_ptr, cno_ptr);
 
 	dat_status = dapl_evd_internal_create(ia_ptr,
 					      cno_ptr,
@@ -125,7 +123,6 @@
       bail:
 	if (dat_status != DAT_SUCCESS && cno_ptr != NULL)
 	{
-		dapl_ia_unlink_cno (ia_ptr, cno_ptr);
 		dapl_cno_dealloc (cno_ptr);
 	}
 
Index: linux-kernel/dat-provider/dapl_cno_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_cno_util.c	(revision 2251)
+++ linux-kernel/dat-provider/dapl_cno_util.c	(working copy)
@@ -70,12 +70,7 @@
     /*
      * Initialize the body
      */
-    cno_ptr->cno_waiters = 0;
-    atomic_set (&cno_ptr->cno_ref_count, 0);
-    cno_ptr->cno_state = DAPL_CNO_STATE_UNTRIGGERED;
-    cno_ptr->cno_evd_triggered = NULL;
     cno_ptr->cno_upcall = *upcall;
-    dapl_os_wait_object_init (&cno_ptr->cno_wait_object);
 
     return cno_ptr;
 }
@@ -88,14 +83,11 @@
     DAPL_CNO *cno_ptr)
 {
     dapl_os_assert (cno_ptr->header.magic == DAPL_MAGIC_CNO);
-    dapl_os_assert (atomic_read (&cno_ptr->cno_ref_count) == 0);
-
     /*
      * deinitialize the header
      */
     cno_ptr->header.magic = DAPL_MAGIC_INVALID; /* reset magic to prevent
reuse */
 
-    dapl_os_wait_object_destroy (&cno_ptr->cno_wait_object);
     kfree (cno_ptr);
 }
 
@@ -134,60 +126,16 @@
 
     spin_lock (&cno_ptr->header.lock);
 
-    /* Maybe I should just return, but this really shouldn't happen.  */
-    dapl_os_assert (cno_ptr->cno_state != DAPL_CNO_STATE_DEAD);
-
-    if (cno_ptr->cno_state == DAPL_CNO_STATE_UNTRIGGERED)
-    {
-	/* Separate assignments for windows compiler.  */
-	cno_ptr->cno_upcall = DAT_UPCALL_NULL;
-	cno_ptr->cno_evd_triggered = evd_ptr;
-
-	/*
-	 * Must set to triggerred and let waiter untrigger to handle
-	 * timeout of waiter.
-	 */
-	cno_ptr->cno_state = DAPL_CNO_STATE_TRIGGERED;
-	if (cno_ptr->cno_waiters > 0)
-	{
-	    dapl_os_wait_object_wakeup (&cno_ptr->cno_wait_object);
-	}
-
 	spin_unlock (&cno_ptr->header.lock);
-
-	dat_status = dapl_evd_dequeue ( (DAT_EVD_HANDLE)evd_ptr,
-				       &event );
-	while (dat_status == DAT_SUCCESS )
-	{
-	    if (cno_ptr->cno_upcall.upcall_func != (DAT_UPCALL_FUNC) NULL)
-	    {
+	dat_status = dapl_evd_dequeue ((DAT_EVD_HANDLE)evd_ptr, &event);
+	while (dat_status == DAT_SUCCESS ) {
+	    if (cno_ptr->cno_upcall.upcall_func != (DAT_UPCALL_FUNC) NULL) {
 		cno_ptr->cno_upcall.upcall_func (
 					cno_ptr->cno_upcall.instance_data,
 					&event,
 					DAT_FALSE);
 	    }
-	    dat_status = dapl_evd_dequeue ( (DAT_EVD_HANDLE)evd_ptr,
-					   &event );
+	    dat_status = dapl_evd_dequeue ( (DAT_EVD_HANDLE)evd_ptr,
&event);
 	}
-    }
-    else
-    {
-	spin_unlock (&cno_ptr->header.lock);
-	dat_status = dapl_evd_dequeue ( (DAT_EVD_HANDLE)evd_ptr,
-				       &event );
-	while (dat_status == DAT_SUCCESS )
-	{
-	    if (cno_ptr->cno_upcall.upcall_func != (DAT_UPCALL_FUNC) NULL)
-	    {
-		cno_ptr->cno_upcall.upcall_func (
-					cno_ptr->cno_upcall.instance_data,
-					&event,
-					DAT_FALSE);
-	    }
-	    dat_status = dapl_evd_dequeue ( (DAT_EVD_HANDLE)evd_ptr,
-					   &event );
-	}
-    }
-
     return;
 }
Index: linux-kernel/dat-provider/dapl_evd_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_evd_util.c	(revision 2251)
+++ linux-kernel/dat-provider/dapl_evd_util.c	(working copy)
@@ -174,11 +174,6 @@
 	dapl_os_wait_object_init(&evd_ptr->wait_object);
 
 	evd_ptr->cno_active_count = 0;
-	if ( cno_ptr != NULL )
-	{
-		/* Take a reference count on the CNO */
-		atomic_inc (&cno_ptr->cno_ref_count);
-	}
 	evd_ptr->cno_ptr = cno_ptr;
 
       bail:
@@ -323,7 +318,6 @@
 	/* Release reference on the CNO if it exists */
 	if ( evd_ptr->cno_ptr != NULL )
 	{
-		atomic_dec ( &evd_ptr->cno_ptr->cno_ref_count );
 		evd_ptr->cno_ptr = NULL;
 	}
 
Index: linux-kernel/dat-provider/dapl.h
===================================================================
--- linux-kernel/dat-provider/dapl.h	(revision 2251)
+++ linux-kernel/dat-provider/dapl.h	(working copy)
@@ -78,12 +78,6 @@
 	DAPL_EVD_STATE_UNSIGNALLED
 } DAPL_EVD_COMPLETION;
 
-typedef enum dapl_cno_state {
-    DAPL_CNO_STATE_UNTRIGGERED,
-    DAPL_CNO_STATE_TRIGGERED,
-    DAPL_CNO_STATE_DEAD = 0xDeadFeed,
-} DAPL_CNO_STATE;
-
 typedef enum dapl_qp_state {
 	DAPL_QP_STATE_UNCONNECTED,
 	DAPL_QP_STATE_RESERVED,
@@ -256,7 +250,6 @@
 	DAPL_LLIST_HEAD rmr_list_head;	/* RMR queue */
 	DAPL_LLIST_HEAD pz_list_head;	/* PZ queue */
 	DAPL_LLIST_HEAD evd_list_head;	/* EVD queue */
-	DAPL_LLIST_HEAD cno_list_head;  /* CNO queue */
 	DAPL_LLIST_HEAD psp_list_head;	/* PSP queue */
 	DAPL_LLIST_HEAD rsp_list_head;	/* RSP queue */
 	DAPL_LLIST_HEAD srq_list_head;	/* SRQ queue */
@@ -266,16 +259,8 @@
 struct dapl_cno
 {
     DAPL_HEADER header;
-
-    /* A CNO cannot be freed while it is referenced elsewhere.  */
-    atomic_t                 cno_ref_count;
-    DAPL_CNO_STATE              cno_state;
-
-    DAT_COUNT                   cno_waiters;
-    DAPL_EVD                    *cno_evd_triggered;
     DAT_UPCALL_OBJECT           cno_upcall;
     DAT_UPCALL_POLICY           cno_upcall_policy;
-    DAPL_OS_WAIT_OBJECT         cno_wait_object;
 };
 
 /* DAPL_EVD maps to DAT_EVD_HANDLE */




More information about the general mailing list