[openib-general] [PATCH] ib_mad: Change completion hander WC status handling not to restart port

Hal Rosenstock halr at voltaire.com
Wed Oct 6 06:00:15 PDT 2004


ib_mad: Change completion handler WC status handling to not restart port

Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 935)
+++ ib_mad.c	(working copy)
@@ -80,7 +80,6 @@
 static int add_mad_reg_req(struct ib_mad_reg_req *mad_reg_req,
 			   struct ib_mad_agent_private *priv);
 static void remove_mad_reg_req(struct ib_mad_agent_private *priv); 
-static int ib_mad_port_restart(struct ib_mad_port_private *priv);
 static int ib_mad_post_receive_mad(struct ib_mad_port_private
*port_priv,
 				   struct ib_qp *qp);
 static int ib_mad_post_receive_mads(struct ib_mad_port_private *priv);
@@ -1010,35 +1009,22 @@
 static void ib_mad_completion_handler(struct ib_mad_port_private
*port_priv)
 {
 	struct ib_wc wc;
-	int err_status = 0;
 
 	ib_req_notify_cq(port_priv->cq, IB_CQ_NEXT_COMP);
 	
 	while (ib_poll_cq(port_priv->cq, 1, &wc) == 1) {
 		printk(KERN_DEBUG "Completion opcode 0x%x WRID 0x%Lx\n", wc.opcode,
wc.wr_id);
-		if (wc.status != IB_WC_SUCCESS) {
-			switch (wc.opcode) {
-			case IB_WC_SEND:
-				printk(KERN_ERR "Send completion error %d\n",
-					wc.status);
-				break;
-			case IB_WC_RECV:
-				printk(KERN_ERR "Recv completion error %d\n",
-					wc.status);
-				break;
-			default:
-				printk(KERN_ERR "Unknown completion 0x%x with error %d\n",
wc.opcode, wc.status);
-				break;
-			}
-			err_status = 1;
-			break;
-		}
-
 		switch (wc.opcode) {
 		case IB_WC_SEND:
+			if (wc.status != IB_WC_SUCCESS)
+				printk(KERN_ERR "Send completion error %d\n",
+				       wc.status);
 			ib_mad_send_done_handler(port_priv, &wc);
 			break;
 		case IB_WC_RECV:
+			if (wc.status != IB_WC_SUCCESS)
+				printk(KERN_ERR "Recv completion error %d\n",
+				       wc.status);
 			ib_mad_recv_done_handler(port_priv, &wc);
 			break;
 		default:
@@ -1049,9 +1035,6 @@
 			}
 		}
 	}
-
-	if (err_status)
-		ib_mad_port_restart(port_priv);
 }
 
 static void cancel_mads(struct ib_mad_agent_private *mad_agent_priv)
@@ -1567,23 +1550,6 @@
 }
 
 /*
- * Restart the port
- */
-static int ib_mad_port_restart(struct ib_mad_port_private *port_priv)
-{
-	int ret;
-
-	ib_mad_port_stop(port_priv);
-	ret = ib_mad_port_start(port_priv);
-	if (ret) {
-		printk(KERN_ERR "Couldn't restart %s port %d\n",
-			port_priv->device->name, port_priv->port_num);
-	}	
-
-	return ret;
-}
-
-/*
  * Open the port
  * Create the QP, PD, MR, and CQ if needed
  */






More information about the general mailing list