RDMA/ocrdma: Prevent CQ-Doorbell floods
authorDevesh Sharma <devesh.sharma@avagotech.com>
Tue, 20 Oct 2015 08:47:59 +0000 (14:17 +0530)
committerDoug Ledford <dledford@redhat.com>
Wed, 21 Oct 2015 21:28:19 +0000 (17:28 -0400)
Changing CQ-Doorbell(DB) logic to prevent DB floods, it is supposed to be
pressed only if any hw CQE is polled. If cq-arm was requested
previously then don't bother about number of hw CQEs polled and
arm the CQ.

Signed-off-by: Devesh Sharma <devesh.sharma@avagotech.com>
Signed-off-by: Selvin Xavier <selvin.xavier@avagotech.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

index 1f3affb6a477156dec43694d80b70b3b8339c27d..1c4e83d5d153a4f7b02b5a252ba562f0a867ea1a 100644 (file)
@@ -2933,16 +2933,11 @@ expand_cqe:
        }
 stop_cqe:
        cq->getp = cur_getp;
-       if (cq->deferred_arm) {
-               ocrdma_ring_cq_db(dev, cq->id, true, cq->deferred_sol,
-                                 polled_hw_cqes);
+       if (cq->deferred_arm || polled_hw_cqes) {
+               ocrdma_ring_cq_db(dev, cq->id, cq->deferred_arm,
+                                 cq->deferred_sol, polled_hw_cqes);
                cq->deferred_arm = false;
                cq->deferred_sol = false;
-       } else {
-               /* We need to pop the CQE. No need to arm */
-               ocrdma_ring_cq_db(dev, cq->id, false, cq->deferred_sol,
-                                 polled_hw_cqes);
-               cq->deferred_sol = false;
        }
 
        return i;