]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ehca/ehca_qp.c
Merge git://git.infradead.org/iommu-2.6
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ehca / ehca_qp.c
index 4dbe2870e0145fac40e3e31e3d8a01298fa10f17..4d54b9f6456789cb17fa07e93481cebb322b2d81 100644 (file)
@@ -465,9 +465,9 @@ static struct ehca_qp *internal_create_qp(
        u32 swqe_size = 0, rwqe_size = 0, ib_qp_num;
        unsigned long flags;
 
-       if (!atomic_add_unless(&shca->num_qps, 1, ehca_max_qp)) {
+       if (!atomic_add_unless(&shca->num_qps, 1, shca->max_num_qps)) {
                ehca_err(pd->device, "Unable to create QP, max number of %i "
-                        "QPs reached.", ehca_max_qp);
+                        "QPs reached.", shca->max_num_qps);
                ehca_err(pd->device, "To increase the maximum number of QPs "
                         "use the number_of_qps module parameter.\n");
                return ERR_PTR(-ENOSPC);
@@ -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;