mirror of https://gitee.com/openkylin/linux.git
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 <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
1c8f1da5d8
commit
cbb40fadd3
|
@ -109,9 +109,11 @@ static void post_qp_event(struct c4iw_dev *dev, struct c4iw_cq *chp,
|
||||||
if (qhp->ibqp.event_handler)
|
if (qhp->ibqp.event_handler)
|
||||||
(*qhp->ibqp.event_handler)(&event, qhp->ibqp.qp_context);
|
(*qhp->ibqp.event_handler)(&event, qhp->ibqp.qp_context);
|
||||||
|
|
||||||
spin_lock_irqsave(&chp->comp_handler_lock, flag);
|
if (t4_clear_cq_armed(&chp->cq)) {
|
||||||
(*chp->ibcq.comp_handler)(&chp->ibcq, chp->ibcq.cq_context);
|
spin_lock_irqsave(&chp->comp_handler_lock, flag);
|
||||||
spin_unlock_irqrestore(&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)
|
void c4iw_ev_dispatch(struct c4iw_dev *dev, struct t4_cqe *err_cqe)
|
||||||
|
|
|
@ -813,10 +813,12 @@ static void complete_sq_drain_wr(struct c4iw_qp *qhp, struct ib_send_wr *wr)
|
||||||
t4_swcq_produce(cq);
|
t4_swcq_produce(cq);
|
||||||
spin_unlock_irqrestore(&schp->lock, flag);
|
spin_unlock_irqrestore(&schp->lock, flag);
|
||||||
|
|
||||||
spin_lock_irqsave(&schp->comp_handler_lock, flag);
|
if (t4_clear_cq_armed(&schp->cq)) {
|
||||||
(*schp->ibcq.comp_handler)(&schp->ibcq,
|
spin_lock_irqsave(&schp->comp_handler_lock, flag);
|
||||||
schp->ibcq.cq_context);
|
(*schp->ibcq.comp_handler)(&schp->ibcq,
|
||||||
spin_unlock_irqrestore(&schp->comp_handler_lock, flag);
|
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)
|
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);
|
t4_swcq_produce(cq);
|
||||||
spin_unlock_irqrestore(&rchp->lock, flag);
|
spin_unlock_irqrestore(&rchp->lock, flag);
|
||||||
|
|
||||||
spin_lock_irqsave(&rchp->comp_handler_lock, flag);
|
if (t4_clear_cq_armed(&rchp->cq)) {
|
||||||
(*rchp->ibcq.comp_handler)(&rchp->ibcq,
|
spin_lock_irqsave(&rchp->comp_handler_lock, flag);
|
||||||
rchp->ibcq.cq_context);
|
(*rchp->ibcq.comp_handler)(&rchp->ibcq,
|
||||||
spin_unlock_irqrestore(&rchp->comp_handler_lock, flag);
|
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,
|
int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
|
||||||
|
|
Loading…
Reference in New Issue