Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[linux-2.6-block.git] / drivers / infiniband / hw / cxgb4 / cq.c
index 7151a02b4ebb3e3f48de3c270046684065d0e0d5..c04292c950f1750ac5fa2fc35b1ea4fda6a76079 100644 (file)
@@ -134,7 +134,8 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
                        V_FW_RI_RES_WR_IQANUS(0) |
                        V_FW_RI_RES_WR_IQANUD(1) |
                        F_FW_RI_RES_WR_IQANDST |
-                       V_FW_RI_RES_WR_IQANDSTINDEX(*rdev->lldi.rxq_ids));
+                       V_FW_RI_RES_WR_IQANDSTINDEX(
+                               rdev->lldi.ciq_ids[cq->vector]));
        res->u.cq.iqdroprss_to_iqesize = cpu_to_be16(
                        F_FW_RI_RES_WR_IQDROPRSS |
                        V_FW_RI_RES_WR_IQPCIECH(2) |
@@ -870,6 +871,9 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
 
        rhp = to_c4iw_dev(ibdev);
 
+       if (vector >= rhp->rdev.lldi.nciq)
+               return ERR_PTR(-EINVAL);
+
        chp = kzalloc(sizeof(*chp), GFP_KERNEL);
        if (!chp)
                return ERR_PTR(-ENOMEM);
@@ -915,6 +919,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
        }
        chp->cq.size = hwentries;
        chp->cq.memsize = memsize;
+       chp->cq.vector = vector;
 
        ret = create_cq(&rhp->rdev, &chp->cq,
                        ucontext ? &ucontext->uctx : &rhp->rdev.uctx);