[openib-general] [PATCH 3/9] kDAPL: convert the rmr list to linux native

Tom Duffy Tom.Duffy at Sun.COM
Mon Jun 13 17:18:07 PDT 2005


Signed-off-by: Tom Duffy <tduffy at sun.com>

diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll3/dat-provider/dapl.h linux-kernel-ll4/dat-provider/dapl.h
--- linux-kernel-ll3/dat-provider/dapl.h	2005-06-13 15:27:19.134000000 -0700
+++ linux-kernel-ll4/dat-provider/dapl.h	2005-06-13 15:35:21.410008000 -0700
@@ -156,7 +156,7 @@ struct dapl_ia {
 	struct dapl_llist_entry hca_ia_list_entry;	/* HCAs list of IAs */
 	struct list_head ep_list;	/* EP queue */
 	struct list_head lmr_list;	/* LMR queue */
-	struct dapl_llist_entry *rmr_list_head;	/* RMR queue */
+	struct list_head rmr_list;	/* RMR queue */
 	struct dapl_llist_entry *pz_list_head;	/* PZ queue */
 	struct dapl_llist_entry *evd_list_head;	/* EVD queue */
 	struct dapl_llist_entry *psp_list_head;	/* PSP queue */
@@ -260,6 +260,7 @@ struct dapl_lmr {
 struct dapl_rmr {
 	struct dat_rmr rmr;
 	struct dapl_common common;
+	struct list_head list;
 	struct dat_rmr_param param;
 	struct dapl_ep *ep;
 	struct dapl_pz *pz;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll3/dat-provider/dapl_ia.c linux-kernel-ll4/dat-provider/dapl_ia.c
--- linux-kernel-ll3/dat-provider/dapl_ia.c	2005-06-13 15:30:24.780010000 -0700
+++ linux-kernel-ll4/dat-provider/dapl_ia.c	2005-06-13 15:38:50.547003000 -0700
@@ -65,7 +65,7 @@ struct dapl_ia *dapl_ia_alloc(struct dat
 	dapl_llist_init_entry(&ia->hca_ia_list_entry);
 	INIT_LIST_HEAD(&ia->ep_list);
 	INIT_LIST_HEAD(&ia->lmr_list);
-	dapl_llist_init_head(&ia->rmr_list_head);
+	INIT_LIST_HEAD(&ia->rmr_list);
 	dapl_llist_init_head(&ia->pz_list_head);
 	dapl_llist_init_head(&ia->evd_list_head);
 	dapl_llist_init_head(&ia->rsp_list_head);
@@ -106,7 +106,7 @@ u32 dapl_ia_abrupt_close(struct dapl_ia 
 	u32 dat_status = DAT_SUCCESS;
 	struct dapl_ep *ep;
 	struct dapl_lmr *lmr;
-	struct dapl_rmr *rmr, *next_rmr;
+	struct dapl_rmr *rmr;
 	struct dapl_pz *pz, *next_pz;
 	struct dapl_evd *evd, *next_evd;
 	struct dapl_sp *sp, *next_sp;	/* for PSP and RSP queues */
@@ -123,18 +123,12 @@ u32 dapl_ia_abrupt_close(struct dapl_ia 
 	 * if we end up skipping an entry.
 	 */
 
-	rmr = (dapl_llist_is_empty(&ia->rmr_list_head)
-		   ? NULL : dapl_llist_peek_head(&ia->rmr_list_head));
-	while (rmr != NULL) {
-		next_rmr = dapl_llist_next_entry(&ia->rmr_list_head,
-						     &rmr->common.
-						     ia_list_entry);
+	list_for_each_entry(rmr, &ia->rmr_list, list) {
 		dat_status = dapl_rmr_free((struct dat_rmr *)rmr);
 		if (dat_status != DAT_SUCCESS)
 			dapl_dbg_log(DAPL_DBG_TYPE_WARN,
 				     "ia_close(ABRUPT): rmr_free(%p) returns %x\n",
 				     rmr, dat_status);
-		rmr = next_rmr;
 	}
 
 	sp = (dapl_llist_is_empty(&ia->rsp_list_head)
@@ -312,7 +306,7 @@ u32 dapl_ia_graceful_close(struct dapl_i
 	struct dapl_llist_entry *entry;
 	struct dapl_hca *hca;
 
-	if (!dapl_llist_is_empty(&ia->rmr_list_head) ||
+	if (!list_empty(&ia->rmr_list) ||
 	    !dapl_llist_is_empty(&ia->rsp_list_head) ||
 	    !list_empty(&ia->ep_list) ||
 	    !list_empty(&ia->lmr_list) ||
@@ -408,7 +402,7 @@ void dapl_ia_free(struct dapl_ia *ia)
 {
 	dapl_os_assert(ia->async_error_evd == NULL);
 	dapl_os_assert(list_empty(&ia->lmr_list));
-	dapl_os_assert(dapl_llist_is_empty(&ia->rmr_list_head));
+	dapl_os_assert(list_empty(&ia->rmr_list));
 	dapl_os_assert(list_empty(&ia->ep_list));
 	dapl_os_assert(dapl_llist_is_empty(&ia->evd_list_head));
 	dapl_os_assert(dapl_llist_is_empty(&ia->psp_list_head));
@@ -488,8 +482,7 @@ void dapl_ia_unlink_lmr(struct dapl_ia *
 void dapl_ia_link_rmr(struct dapl_ia *ia, struct dapl_rmr *rmr)
 {
 	spin_lock_irqsave(&ia->common.lock, ia->common.flags);
-	dapl_llist_add_head(&ia->rmr_list_head,
-			    &rmr->common.ia_list_entry, rmr);
+	list_add(&rmr->list, &ia->rmr_list);
 	spin_unlock_irqrestore(&ia->common.lock, ia->common.flags);
 }
 
@@ -499,8 +492,7 @@ void dapl_ia_link_rmr(struct dapl_ia *ia
 void dapl_ia_unlink_rmr(struct dapl_ia *ia, struct dapl_rmr *rmr)
 {
 	spin_lock_irqsave(&ia->common.lock, ia->common.flags);
-	dapl_llist_remove_entry(&ia->rmr_list_head,
-				&rmr->common.ia_list_entry);
+	list_del(&rmr->list);
 	spin_unlock_irqrestore(&ia->common.lock, ia->common.flags);
 }
 




More information about the general mailing list