iw_cxgb4: only call the cq comp_handler when the cq is armed
Subsystems (2)
PATCH 1/2 iw_cxgb4: only call the cq comp_handler when the cq is armed
The ULPs completion handler should only be called if the CQ is armed for notification.
Signed-off-by Steve Wise <[email protected]>
--- drivers/infiniband/hw/cxgb4/ev.c | 8 +++++--- drivers/infiniband/hw/cxgb4/qp.c | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-)
drivers/infiniband/hw/cxgb4/ev.c +5 -3
@@ -109,9 +109,11 @@ static void post_qp_event(struct c4iw_dev *dev, struct c4iw_cq *chp,if (qhp->ibqp.event_handler) (*qhp->ibqp.event_handler)(&event, qhp->ibqp.qp_context); -spin_lock_irqsave (&chp->comp_handler_lock, flag); - (*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context); -spin_unlock_irqrestore (&chp->comp_handler_lock, flag); +if (t4_clear_cq_armed (&chp->cq)) { +spin_lock_irqsave (&chp->comp_handler_lock, flag); + (*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context); +spin_unlock_irqrestore (&chp->comp_handler_lock, flag); + } }void c4iw_ev_dispatch (struct c4iw_dev *dev,struct t4_cqe *err_cqe)
drivers/infiniband/hw/cxgb4/qp.c +12 -8
@@ -813,10 +813,12 @@ static void complete_sq_drain_wr(struct c4iw_qp *qhp, struct ib_send_wr *wr)t4_swcq_produce (cq);spin_unlock_irqrestore (&schp->lock, flag); -spin_lock_irqsave (&schp->comp_handler_lock, flag); - (*schp->ibcq.comp_handler)(&schp->ibcq, - schp->ibcq.cq_context); -spin_unlock_irqrestore (&schp->comp_handler_lock, flag); +if (t4_clear_cq_armed (&schp->cq)) { +spin_lock_irqsave (&schp->comp_handler_lock, flag); + (*schp->ibcq.comp_handler)(&schp->ibcq, + schp->ibcq.cq_context); +spin_unlock_irqrestore (&schp->comp_handler_lock, flag); + } }static void complete_rq_drain_wr (struct c4iw_qp *qhp,struct ib_recv_wr *wr)
@@ -842,10 +844,12 @@ static void complete_rq_drain_wr(struct c4iw_qp *qhp, struct ib_recv_wr *wr)t4_swcq_produce (cq);spin_unlock_irqrestore (&rchp->lock, flag); -spin_lock_irqsave (&rchp->comp_handler_lock, flag); - (*rchp->ibcq.comp_handler)(&rchp->ibcq, - rchp->ibcq.cq_context); -spin_unlock_irqrestore (&rchp->comp_handler_lock, flag); +if (t4_clear_cq_armed (&rchp->cq)) { +spin_lock_irqsave (&rchp->comp_handler_lock, flag); + (*rchp->ibcq.comp_handler)(&rchp->ibcq, + rchp->ibcq.cq_context); +spin_unlock_irqrestore (&rchp->comp_handler_lock, flag); + } } int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
Signature · 6 lines
1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Doug Ledford
AppliedQuoted 4 lines · Steve Wise
The ULPs completion handler should only be called if the CQ is armed for notification.
Signed-off-by Steve Wise <[email protected]>
Thanks, applied.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD