提交 895cf5f3 编写于 作者: S Steve Wise 提交者: Roland Dreier

RDMA/cxgb4: CQ size must be IQ size - 2

We need 1 extra entry for the status page and 1 to always have 1 free
entry to detect when the queue is full.
Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 1c01c538
...@@ -780,6 +780,9 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, ...@@ -780,6 +780,9 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
/* account for the status page. */ /* account for the status page. */
entries++; entries++;
/* IQ needs one extra entry to differentiate full vs empty. */
entries++;
/* /*
* entries must be multiple of 16 for HW. * entries must be multiple of 16 for HW.
*/ */
...@@ -801,7 +804,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries, ...@@ -801,7 +804,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
chp->rhp = rhp; chp->rhp = rhp;
chp->cq.size--; /* status page */ chp->cq.size--; /* status page */
chp->ibcq.cqe = chp->cq.size; chp->ibcq.cqe = chp->cq.size - 1;
spin_lock_init(&chp->lock); spin_lock_init(&chp->lock);
atomic_set(&chp->refcnt, 1); atomic_set(&chp->refcnt, 1);
init_waitqueue_head(&chp->wait); init_waitqueue_head(&chp->wait);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册