[openib-general] [PATCH] mad: Minor reordering so prints follow unlocking or buffer posting rather than preceeding them

Hal Rosenstock halr at voltaire.com
Fri Oct 29 07:42:06 PDT 2004


mad: Minor reordering so prints follow unlocking or buffer posting
rather than preceeding them

Index: mad.c
===================================================================
--- mad.c	(revision 1089)
+++ mad.c	(working copy)
@@ -933,9 +933,9 @@
 	qp_num = wrid.wrid_field.qpn;
 	qpn = convert_qpnum(qp_num);
 	if (qpn == -1) {
+		ib_mad_post_receive_mad(port_priv, port_priv->qp[qp_num]);
 		printk(KERN_ERR PFX "Packet received on unknown QPN %d\n",
 		       qp_num);
-		ib_mad_post_receive_mad(port_priv, port_priv->qp[qp_num]);
 		return;
 	}
 	
@@ -958,11 +958,12 @@
 		port_priv->recv_posted_mad_count[qpn]--;
 
 	} else {
+		spin_unlock_irqrestore(&port_priv->recv_list_lock, flags);
+		ib_mad_post_receive_mad(port_priv, port_priv->qp[qp_num]);
 		printk(KERN_ERR PFX "Receive completion WR ID 0x%Lx on QP %d "
-		       "with no posted receive\n", (unsigned long long) wc->wr_id,
+		       "with no posted receive\n",
+		       (unsigned long long) wc->wr_id,
 		       qp_num);
-		spin_unlock_irqrestore(&port_priv->recv_list_lock, flags);
-		ib_mad_post_receive_mad(port_priv, port_priv->qp[qp_num]);
 		return;
 	}
 	spin_unlock_irqrestore(&port_priv->recv_list_lock, flags);
@@ -1015,7 +1016,6 @@
 
 	/* Post another receive request for this QP */
 	ib_mad_post_receive_mad(port_priv, port_priv->qp[qp_num]);
-	return;
 }
 
 static void adjust_timeout(struct ib_mad_agent_private *mad_agent_priv)






More information about the general mailing list