IB/ehca: Don't allow creating UC QP with SRQ
authorHoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Fri, 10 Oct 2008 21:40:39 +0000 (14:40 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 10 Oct 2008 21:40:39 +0000 (14:40 -0700)
This patch prevents a UC QP to be created attached to an SRQ, since
current firmware does not support this feature.

Signed-off-by: Michael Faath <micfaath@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ehca/ehca_qp.c

index 4dbe2870e0145fac40e3e31e3d8a01298fa10f17..40b578d601c505e588212a733fc1abf737792d84 100644 (file)
@@ -502,6 +502,12 @@ static struct ehca_qp *internal_create_qp(
        if (init_attr->srq) {
                my_srq = container_of(init_attr->srq, struct ehca_qp, ib_srq);
 
+               if (qp_type == IB_QPT_UC) {
+                       ehca_err(pd->device, "UC with SRQ not supported");
+                       atomic_dec(&shca->num_qps);
+                       return ERR_PTR(-EINVAL);
+               }
+
                has_srq = 1;
                parms.ext_type = EQPT_SRQBASE;
                parms.srq_qpn = my_srq->real_qp_num;