提交 05127665 编写于 作者: S Selvin Xavier 提交者: Doug Ledford

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: NSelvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 c88a7858
...@@ -2996,8 +2996,10 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq, ...@@ -2996,8 +2996,10 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq,
enum ib_cq_notify_flags ib_cqn_flags) enum ib_cq_notify_flags ib_cqn_flags)
{ {
struct bnxt_re_cq *cq = container_of(ib_cq, struct bnxt_re_cq, ib_cq); struct bnxt_re_cq *cq = container_of(ib_cq, struct bnxt_re_cq, ib_cq);
int type = 0; int type = 0, rc = 0;
unsigned long flags;
spin_lock_irqsave(&cq->cq_lock, flags);
/* Trigger on the very next completion */ /* Trigger on the very next completion */
if (ib_cqn_flags & IB_CQ_NEXT_COMP) if (ib_cqn_flags & IB_CQ_NEXT_COMP)
type = DBR_DBR_TYPE_CQ_ARMALL; type = DBR_DBR_TYPE_CQ_ARMALL;
...@@ -3007,12 +3009,15 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq, ...@@ -3007,12 +3009,15 @@ int bnxt_re_req_notify_cq(struct ib_cq *ib_cq,
/* Poll to see if there are missed events */ /* Poll to see if there are missed events */
if ((ib_cqn_flags & IB_CQ_REPORT_MISSED_EVENTS) && if ((ib_cqn_flags & IB_CQ_REPORT_MISSED_EVENTS) &&
!(bnxt_qplib_is_cq_empty(&cq->qplib_cq))) !(bnxt_qplib_is_cq_empty(&cq->qplib_cq))) {
return 1; rc = 1;
goto exit;
}
bnxt_qplib_req_notify_cq(&cq->qplib_cq, type); bnxt_qplib_req_notify_cq(&cq->qplib_cq, type);
return 0; exit:
spin_unlock_irqrestore(&cq->cq_lock, flags);
return rc;
} }
/* Memory Regions */ /* Memory Regions */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册