IB/hfi1, qib, rdmavt: Move two IB event functions into rdmavt
Add rvt_rc_error() and rvt_comm_est() as shared functions in rdmavt, moved from hfi1/qib logic. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Brian Welty <brian.welty@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
这个提交包含在:
@@ -1868,3 +1868,41 @@ int rvt_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* qp_comm_est - handle trap with QP established
|
||||
* @qp: the QP
|
||||
*/
|
||||
void rvt_comm_est(struct rvt_qp *qp)
|
||||
{
|
||||
qp->r_flags |= RVT_R_COMM_EST;
|
||||
if (qp->ibqp.event_handler) {
|
||||
struct ib_event ev;
|
||||
|
||||
ev.device = qp->ibqp.device;
|
||||
ev.element.qp = &qp->ibqp;
|
||||
ev.event = IB_EVENT_COMM_EST;
|
||||
qp->ibqp.event_handler(&ev, qp->ibqp.qp_context);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(rvt_comm_est);
|
||||
|
||||
void rvt_rc_error(struct rvt_qp *qp, enum ib_wc_status err)
|
||||
{
|
||||
unsigned long flags;
|
||||
int lastwqe;
|
||||
|
||||
spin_lock_irqsave(&qp->s_lock, flags);
|
||||
lastwqe = rvt_error_qp(qp, err);
|
||||
spin_unlock_irqrestore(&qp->s_lock, flags);
|
||||
|
||||
if (lastwqe) {
|
||||
struct ib_event ev;
|
||||
|
||||
ev.device = qp->ibqp.device;
|
||||
ev.element.qp = &qp->ibqp;
|
||||
ev.event = IB_EVENT_QP_LAST_WQE_REACHED;
|
||||
qp->ibqp.event_handler(&ev, qp->ibqp.qp_context);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(rvt_rc_error);
|
||||
|
在新工单中引用
屏蔽一个用户