RDMA/bnxt_re: Fix return value of poll routine

Fix the incorrect reporting of number of polled
entries by taking into account the max CQ depth
in the driver.

Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Devesh Sharma 2017-06-29 12:28:17 -07:00 committed by Doug Ledford
parent 254cd2590d
commit 10d1dedf9b
1 changed files with 1 additions and 0 deletions

View File

@ -2900,6 +2900,7 @@ int bnxt_re_poll_cq(struct ib_cq *ib_cq, int num_entries, struct ib_wc *wc)
spin_lock_irqsave(&cq->cq_lock, flags); spin_lock_irqsave(&cq->cq_lock, flags);
budget = min_t(u32, num_entries, cq->max_cql); budget = min_t(u32, num_entries, cq->max_cql);
num_entries = budget;
if (!cq->cql) { if (!cq->cql) {
dev_err(rdev_to_dev(cq->rdev), "POLL CQ : no CQL to use"); dev_err(rdev_to_dev(cq->rdev), "POLL CQ : no CQL to use");
goto exit; goto exit;