From: Eli Cohen <e...@mellanox.com>

If an erroneous CQE was polled in the first iteration (e.g. npolled == 0), we
would not update the consumer index hence the hardware could get a wrong notion
of how many CQEs software polled. Fix this by unconditionally updating the
doorbell record. We could put a condition like

if (npolled || err != -EAGAIN)
        ...

but it does not seem worth the effort since a posted write to memory should not
cost too much.

Signed-off-by: Eli Cohen <e...@mellanox.com>
---
 drivers/infiniband/hw/mlx4/cq.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 5ecf38d..275861b 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -747,8 +747,7 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, 
struct ib_wc *wc)
                        break;
        }
 
-       if (npolled)
-               mlx4_cq_set_ci(&cq->mcq);
+       mlx4_cq_set_ci(&cq->mcq);
 
        spin_unlock_irqrestore(&cq->lock, flags);
 
-- 
1.6.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to