aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/cq.c
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.com>2012-03-06 08:50:51 -0500
committerRoland Dreier <roland@purestorage.com>2012-03-12 19:24:59 -0400
commit3616f9cead935d4e4c35915600d5e4d1384219cd (patch)
treeb82899b32ce3c64195195351358267764e535c04 /drivers/infiniband/hw/mlx4/cq.c
parent5984be90046fa978d94a5ec08bbf8f760cff2b30 (diff)
IB/mlx4: Fix possible missed completion event
If an erroneous CQE is polled in the first iteration (i.e. npolled == 0), we don't update the consumer index and hence the hardware could get a wrong notion of how many CQEs software polled. Fix this by unconditionally updating the doorbell record. We could change the check to be something 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 <eli@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/cq.c')
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 5ecf38d97269..275861bddf1c 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)
747 break; 747 break;
748 } 748 }
749 749
750 if (npolled) 750 mlx4_cq_set_ci(&cq->mcq);
751 mlx4_cq_set_ci(&cq->mcq);
752 751
753 spin_unlock_irqrestore(&cq->lock, flags); 752 spin_unlock_irqrestore(&cq->lock, flags);
754 753