[openib-general] [PATCH] ib_mad: Consolidate receive lists

Hal Rosenstock halr at voltaire.com
Thu Sep 16 05:53:19 PDT 2004


ib_mad: Consolidate receive lists

Index: ib_mad_priv.h
===================================================================
--- ib_mad_priv.h	(revision 847)
+++ ib_mad_priv.h	(working copy)
@@ -84,9 +84,8 @@
 
 struct ib_mad_private_header {
 	struct ib_mad_recv_wc recv_wc; /* must be first member (for now !!!)
*/
-	struct list_head mad_list;
-	struct ib_mad_buf buf;
 	struct ib_mad_recv_buf recv_buf;
+	struct ib_mad_buf buf;
 } __attribute__ ((packed));
 
 struct ib_mad_private {
Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 848)
+++ ib_mad.c	(working copy)
@@ -709,10 +709,10 @@
 	if
(!list_empty(&port_priv->recv_posted_mad_list[convert_qpnum(qp_num)])) {
 		recv =
list_entry(&port_priv->recv_posted_mad_list[convert_qpnum(qp_num)],
 				  struct ib_mad_private,
-				  header.mad_list);
+				  header.recv_buf.list);
 
 		/* Remove from posted receive MAD list */
-		list_del(&recv->header.mad_list);
+		list_del(&recv->header.recv_buf.list);
 
 		port_priv->recv_posted_mad_count[convert_qpnum(qp_num)]--;
 
@@ -984,7 +984,7 @@
 
 	/* Link receive WR into posted receive MAD list */
 	spin_lock_irqsave(&port_priv->recv_list_lock, flags);
-	list_add_tail(&mad_priv->header.mad_list,
+	list_add_tail(&mad_priv->header.recv_buf.list,
 		      &port_priv->recv_posted_mad_list[convert_qpnum(qp->qp_num)]);
 	port_priv->recv_posted_mad_count[convert_qpnum(qp->qp_num)]++;
 	spin_unlock_irqrestore(&port_priv->recv_list_lock, flags);
@@ -1001,7 +1001,7 @@
 
 		/* Unlink from posted receive MAD list */
 		spin_lock_irqsave(&port_priv->recv_list_lock, flags);
-		list_del(&mad_priv->header.mad_list);
+		list_del(&mad_priv->header.recv_buf.list);
 		port_priv->recv_posted_mad_count[convert_qpnum(qp->qp_num)]--;
 		spin_unlock_irqrestore(&port_priv->recv_list_lock, flags);
 





More information about the general mailing list