diff options
author | Selvin Xavier <selvin.xavier@broadcom.com> | 2017-11-06 11:07:31 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-11-13 15:53:57 -0500 |
commit | c88a7858d721af5e2d059e3b0b751fed0504e814 (patch) | |
tree | dee8f99cd851b6af9f752d099701b27d6a5d762b | |
parent | 237379fc339750cbe6680f6a3565ab5c24e32229 (diff) |
RDMA/bnxt_re: Flush CQ notification Work Queue before destroying QP
Destroy_qp shall wait for any outstanding CQ notification to be
flushed out before proceeding with QP destroy. Flushing the WQ
before destroying the QP.
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 | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/qplib_fp.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/qplib_fp.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index adc42d7ff4f8..c29f33af334b 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c | |||
@@ -785,6 +785,7 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp) | |||
785 | struct bnxt_re_dev *rdev = qp->rdev; | 785 | struct bnxt_re_dev *rdev = qp->rdev; |
786 | int rc; | 786 | int rc; |
787 | 787 | ||
788 | bnxt_qplib_flush_cqn_wq(&qp->qplib_qp); | ||
788 | bnxt_qplib_del_flush_qp(&qp->qplib_qp); | 789 | bnxt_qplib_del_flush_qp(&qp->qplib_qp); |
789 | rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp); | 790 | rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp); |
790 | if (rc) { | 791 | if (rc) { |
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 805a6124a48c..c0f813366ad6 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c | |||
@@ -2537,3 +2537,10 @@ void bnxt_qplib_req_notify_cq(struct bnxt_qplib_cq *cq, u32 arm_type) | |||
2537 | atomic_set(&cq->arm_state, 1); | 2537 | atomic_set(&cq->arm_state, 1); |
2538 | spin_unlock_irqrestore(&cq->hwq.lock, flags); | 2538 | spin_unlock_irqrestore(&cq->hwq.lock, flags); |
2539 | } | 2539 | } |
2540 | |||
2541 | void bnxt_qplib_flush_cqn_wq(struct bnxt_qplib_qp *qp) | ||
2542 | { | ||
2543 | flush_workqueue(qp->scq->nq->cqn_wq); | ||
2544 | if (qp->scq != qp->rcq) | ||
2545 | flush_workqueue(qp->rcq->nq->cqn_wq); | ||
2546 | } | ||
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h index 8ead70ca1c1d..c582d4ec8173 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h | |||
@@ -478,4 +478,5 @@ void bnxt_qplib_release_cq_locks(struct bnxt_qplib_qp *qp, | |||
478 | int bnxt_qplib_process_flush_list(struct bnxt_qplib_cq *cq, | 478 | int bnxt_qplib_process_flush_list(struct bnxt_qplib_cq *cq, |
479 | struct bnxt_qplib_cqe *cqe, | 479 | struct bnxt_qplib_cqe *cqe, |
480 | int num_cqes); | 480 | int num_cqes); |
481 | void bnxt_qplib_flush_cqn_wq(struct bnxt_qplib_qp *qp); | ||
481 | #endif /* __BNXT_QPLIB_FP_H__ */ | 482 | #endif /* __BNXT_QPLIB_FP_H__ */ |