diff options
| -rw-r--r-- | drivers/infiniband/hw/cxgb4/cq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index fb1aafcc294f..46ac00f728f3 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c | |||
| @@ -780,6 +780,9 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, | |||
| 780 | /* account for the status page. */ | 780 | /* account for the status page. */ |
| 781 | entries++; | 781 | entries++; |
| 782 | 782 | ||
| 783 | /* IQ needs one extra entry to differentiate full vs empty. */ | ||
| 784 | entries++; | ||
| 785 | |||
| 783 | /* | 786 | /* |
| 784 | * entries must be multiple of 16 for HW. | 787 | * entries must be multiple of 16 for HW. |
| 785 | */ | 788 | */ |
| @@ -801,7 +804,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, | |||
| 801 | 804 | ||
| 802 | chp->rhp = rhp; | 805 | chp->rhp = rhp; |
| 803 | chp->cq.size--; /* status page */ | 806 | chp->cq.size--; /* status page */ |
| 804 | chp->ibcq.cqe = chp->cq.size; | 807 | chp->ibcq.cqe = chp->cq.size - 1; |
| 805 | spin_lock_init(&chp->lock); | 808 | spin_lock_init(&chp->lock); |
| 806 | atomic_set(&chp->refcnt, 1); | 809 | atomic_set(&chp->refcnt, 1); |
| 807 | init_waitqueue_head(&chp->wait); | 810 | init_waitqueue_head(&chp->wait); |
