diff mbox

ib/mlx4: add IB_CQ_REPORT_MISSED_EVENTS support

Message ID 4C4E96F9.4040503@Voltaire.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Or Gerlitz July 27, 2010, 8:21 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 5a219a2..4366811 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -755,6 +755,13 @@  int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
 		    to_mdev(ibcq->device)->uar_map,
 		    MLX4_GET_DOORBELL_LOCK(&to_mdev(ibcq->device)->uar_lock));
 
+	if (flags & IB_CQ_REPORT_MISSED_EVENTS) {
+		struct mlx4_cqe *cqe;
+		cqe = next_cqe_sw(to_mcq(ibcq));
+		if (cqe)
+			return 1;
+	}
+
 	return 0;
 }