[openib-general] [PATCH 2/2] Implement error handling in resize failure.

Krishna Kumar krkumar at us.ibm.com
Wed Nov 3 17:48:52 PST 2004


The only issue is whether the code below for CQ_ACCESS_ERROR is
correct. I have taken it from mthca_eq.c :

        MTHCA_EVENT_TYPE_WQ_ACCESS_ERROR    = 0x11

thanks,

- KK

diff -ruNp 2/mad.c 3/mad.c
--- 2/mad.c	2004-11-03 17:37:31.000000000 -0800
+++ 3/mad.c	2004-11-03 17:38:40.000000000 -0800
@@ -1744,6 +1744,21 @@ static void destroy_mad_qp(struct ib_mad
 }

 /*
+ * "Inaccessible" error cannot be handled by QP resize operation.
+ */
+static inline int is_catastrophic_error(int err)
+{
+#define	CQ_ACCESS_ERROR		0x11
+
+	switch (err) {
+	default:	/* OK */
+		return 0;
+	case CQ_ACCESS_ERROR:
+		return 1;
+	}
+}
+
+/*
  * Open the port
  * Create the QP, PD, MR, and CQ if needed
  */
@@ -1825,6 +1840,10 @@ static int ib_mad_port_open(struct ib_de
 		if ((ret = ib_resize_cq(port_priv->cq, total_qp_size)) < 0) {
 			printk(KERN_DEBUG PFX "Couldn't increase CQ size - "
 			       "err:%d\n", ret);
+			if (is_catastrophic_error(ret)) {
+				/* Clean up qp[0,1] */
+				goto error8;
+			}
 			/* continue, not an error */
 		}
 	}




More information about the general mailing list