[openib-general] [PATCH 2/2] [RFC] Implement error handling in resize of CQ
Krishna Kumar
krkumar at us.ibm.com
Wed Nov 3 13:24:34 PST 2004
Again, this has been build-tested only.
Thx,
- KK
diff -ruNp 2/mad.c 3/mad.c
--- 2/mad.c 2004-11-03 13:15:49.000000000 -0800
+++ 3/mad.c 2004-11-03 13:16:47.000000000 -0800
@@ -1686,6 +1686,23 @@ static void destroy_mad_qp(struct ib_mad
}
/*
+ * Overrun and Inaccessible errors cannot be handled by QP resize operation.
+ */
+static inline int is_catastrophic_error(int err)
+{
+#define CQ_OVERFLOW_ERROR 0x0f
+#define CQ_ACCESS_ERROR 0x11
+
+ switch (err) {
+ default: /* OK */
+ return 0;
+ case CQ_ACCESS_ERROR:
+ case CQ_OVERFLOW_ERROR:
+ return 1;
+ }
+}
+
+/*
* Open the port
* Create the QP, PD, MR, and CQ if needed
*/
@@ -1764,6 +1781,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_info[0,1] */
+ goto error8;
+ }
/* continue, not an error */
}
}
More information about the general
mailing list