diff options
author | Selvin Xavier <selvin.xavier@broadcom.com> | 2017-11-06 11:07:32 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-11-13 15:53:57 -0500 |
commit | 051276658b86729909fb6e28e1fabab11c109615 (patch) | |
tree | 550ddfada11d29b8642a77ad32d89b2bfd776a98 | |
parent | c88a7858d721af5e2d059e3b0b751fed0504e814 (diff) |
RDMA/bnxt_re: synchronize poll_cq and req_notify_cq verbs
Synchronize poll_cq and req_notify_cq verbs using cq_lock,
instead of the lower level qplib->hwq.lock.
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/ib_verbs.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index c29f33af334b..526ab3f10a90 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c | |||
@@ -2996,8 +2996,10 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq, | |||
2996 | enum ib_cq_notify_flags ib_cqn_flags) | 2996 | enum ib_cq_notify_flags ib_cqn_flags) |
2997 | { | 2997 | { |
2998 | struct bnxt_re_cq *cq = container_of(ib_cq, struct bnxt_re_cq, ib_cq); | 2998 | struct bnxt_re_cq *cq = container_of(ib_cq, struct bnxt_re_cq, ib_cq); |
2999 | int type = 0; | 2999 | int type = 0, rc = 0; |
3000 | unsigned long flags; | ||
3000 | 3001 | ||
3002 | spin_lock_irqsave(&cq->cq_lock, flags); | ||
3001 | /* Trigger on the very next completion */ | 3003 | /* Trigger on the very next completion */ |
3002 | if (ib_cqn_flags & IB_CQ_NEXT_COMP) | 3004 | if (ib_cqn_flags & IB_CQ_NEXT_COMP) |
3003 | type = DBR_DBR_TYPE_CQ_ARMALL; | 3005 | type = DBR_DBR_TYPE_CQ_ARMALL; |
@@ -3007,12 +3009,15 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq, | |||
3007 | 3009 | ||
3008 | /* Poll to see if there are missed events */ | 3010 | /* Poll to see if there are missed events */ |
3009 | if ((ib_cqn_flags & IB_CQ_REPORT_MISSED_EVENTS) && | 3011 | if ((ib_cqn_flags & IB_CQ_REPORT_MISSED_EVENTS) && |
3010 | !(bnxt_qplib_is_cq_empty(&cq->qplib_cq))) | 3012 | !(bnxt_qplib_is_cq_empty(&cq->qplib_cq))) { |
3011 | return 1; | 3013 | rc = 1; |
3012 | 3014 | goto exit; | |
3015 | } | ||
3013 | bnxt_qplib_req_notify_cq(&cq->qplib_cq, type); | 3016 | bnxt_qplib_req_notify_cq(&cq->qplib_cq, type); |
3014 | 3017 | ||
3015 | return 0; | 3018 | exit: |
3019 | spin_unlock_irqrestore(&cq->cq_lock, flags); | ||
3020 | return rc; | ||
3016 | } | 3021 | } |
3017 | 3022 | ||
3018 | /* Memory Regions */ | 3023 | /* Memory Regions */ |