[openib-general] [PATCH] agent: Better wr_id in send WR makes for slightly simpler completion handling

Hal Rosenstock halr at voltaire.com
Thu Nov 11 05:35:31 PST 2004


agent: Better wr_id in send WR makes for slightly simpler completion
handling (comment from Sean)

Index: agent.c
===================================================================
--- agent.c	(revision 1200)
+++ agent.c	(working copy)
@@ -172,7 +172,7 @@
 		send_wr.wr.ud.remote_qkey = 0; /* for SMPs */
 	}
 	send_wr.wr.ud.mad_hdr = &mad->mad.mad.mad_hdr;
-	send_wr.wr_id = (unsigned long)&agent_send_wr->send_list;
+	send_wr.wr_id = (unsigned long)agent_send_wr;
 
 	pci_unmap_addr_set(agent_send_wr, mapping, gather_list.addr);
 
@@ -236,7 +236,6 @@
 {
 	struct ib_agent_port_private	*port_priv;
 	struct ib_agent_send_wr		*agent_send_wr;
-	struct list_head		*send_wr;
 	unsigned long			flags;
 
 	/* Find matching MAD agent */
@@ -247,10 +246,8 @@
 		return;
 	}
 
+	agent_send_wr = (struct ib_agent_send_wr *)(unsigned long)mad_send_wc->wr_id;
 	spin_lock_irqsave(&port_priv->send_list_lock, flags);
-	send_wr = (struct list_head *)(unsigned long)mad_send_wc->wr_id;
-	agent_send_wr =  container_of(send_wr, struct ib_agent_send_wr,
-				     send_list);
 	/* Remove completed send from posted send MAD list */
 	list_del(&agent_send_wr->send_list);
 	spin_unlock_irqrestore(&port_priv->send_list_lock, flags);






More information about the general mailing list