[openib-general] calling to ibv_create_qp with big number in qp_init_attr.cap.max_ inline_data never return
Roland Dreier
rolandd at cisco.com
Mon Jul 25 15:23:19 PDT 2005
I just committed the change below to libmthca, which should fix this hang.
- R.
--- verbs.c (revision 2904)
+++ verbs.c (working copy)
@@ -284,6 +284,14 @@ struct ibv_qp *mthca_create_qp(struct ib
struct mthca_qp *qp;
int ret;
+ /* Sanity check QP size before proceeding */
+ if (attr->cap.max_send_wr > 65536 ||
+ attr->cap.max_recv_wr > 65536 ||
+ attr->cap.max_send_sge > 64 ||
+ attr->cap.max_recv_sge > 64 ||
+ attr->cap.max_inline_data > 1024)
+ return NULL;
+
qp = malloc(sizeof *qp);
if (!qp)
return NULL;
More information about the general
mailing list