summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/bnxt_re/ib_verbs.c
diff options
context:
space:
mode:
authorSelvin Xavier2017-06-29 21:28:18 +0200
committerDoug Ledford2017-07-20 17:20:50 +0200
commit499e456981d376ef614e257d5dcb280581db9ac6 (patch)
treecc23bc5c9e008a67b134f591f7930836a069c4b9 /drivers/infiniband/hw/bnxt_re/ib_verbs.c
parentRDMA/bnxt_re: Fix return value of poll routine (diff)
downloadkernel-qcow2-linux-499e456981d376ef614e257d5dcb280581db9ac6.tar.gz
kernel-qcow2-linux-499e456981d376ef614e257d5dcb280581db9ac6.tar.xz
kernel-qcow2-linux-499e456981d376ef614e257d5dcb280581db9ac6.zip
RDMA/bnxt_re: Report MISSED_EVENTS in req_notify_cq
While invoking the req_notify_cq hook, ULPs can request whether the CQs have any CQEs pending. If CQEs are pending, drivers can indicate it by returning 1 for req_notify_cq. The stack will poll CQ again till CQ is empty. This patch peeks the CQ for any valid entries and return accordingly. Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/ib_verbs.c')
-rw-r--r--drivers/infiniband/hw/bnxt_re/ib_verbs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index b92a06d17186..d5aa5a1a7e00 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -3027,6 +3027,11 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq,
else if (ib_cqn_flags & IB_CQ_SOLICITED)
type = DBR_DBR_TYPE_CQ_ARMSE;
+ /* Poll to see if there are missed events */
+ if ((ib_cqn_flags & IB_CQ_REPORT_MISSED_EVENTS) &&
+ !(bnxt_qplib_is_cq_empty(&cq->qplib_cq)))
+ return 1;
+
bnxt_qplib_req_notify_cq(&cq->qplib_cq, type);
return 0;