Commit 57f6b663 authored by Kaike Wan's avatar Kaike Wan Committed by Doug Ledford

IB/rdmavt: Add trace for RNRNAK timer

This patch adds static trace for RNRNAK timer. Currently the output from
hrtimer static trace only shows the addresses of hrtimers in the system
and there is no easy way to correlate an RNRNAK timer with its entries in
the hrtimer trace. This patch adds the correlation among a QP, its RNRNAK
timer, and its entries in the hrtimer trace. This correlation will be
enormously helpful when debugging RNRNAK related issues. In addition, this
patch cleans up rvt_stop_rnr_timer() to be void while here.
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarKaike Wan <kaike.wan@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 11f0e897
......@@ -2075,6 +2075,7 @@ void rvt_add_rnr_timer(struct rvt_qp *qp, u32 aeth)
lockdep_assert_held(&qp->s_lock);
qp->s_flags |= RVT_S_WAIT_RNR;
to = rvt_aeth_to_usec(aeth);
trace_rvt_rnrnak_add(qp, to);
hrtimer_start(&qp->s_rnr_timer,
ns_to_ktime(1000 * to), HRTIMER_MODE_REL);
}
......@@ -2104,15 +2105,14 @@ EXPORT_SYMBOL(rvt_stop_rc_timers);
* stop an rnr timer and return if the timer
* had been pending.
*/
static int rvt_stop_rnr_timer(struct rvt_qp *qp)
static void rvt_stop_rnr_timer(struct rvt_qp *qp)
{
int rval = 0;
lockdep_assert_held(&qp->s_lock);
/* Remove QP from rnr timer */
if (qp->s_flags & RVT_S_WAIT_RNR)
if (qp->s_flags & RVT_S_WAIT_RNR) {
qp->s_flags &= ~RVT_S_WAIT_RNR;
return rval;
trace_rvt_rnrnak_stop(qp, 0);
}
}
/**
......@@ -2165,6 +2165,7 @@ enum hrtimer_restart rvt_rc_rnr_retry(struct hrtimer *t)
spin_lock_irqsave(&qp->s_lock, flags);
rvt_stop_rnr_timer(qp);
trace_rvt_rnrnak_timeout(qp, 0);
rdi->driver_f.schedule_send(qp);
spin_unlock_irqrestore(&qp->s_lock, flags);
return HRTIMER_NORESTART;
......
......@@ -85,6 +85,48 @@ DEFINE_EVENT(rvt_qphash_template, rvt_qpremove,
TP_PROTO(struct rvt_qp *qp, u32 bucket),
TP_ARGS(qp, bucket));
DECLARE_EVENT_CLASS(
rvt_rnrnak_template,
TP_PROTO(struct rvt_qp *qp, u32 to),
TP_ARGS(qp, to),
TP_STRUCT__entry(
RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
__field(u32, qpn)
__field(void *, hrtimer)
__field(u32, s_flags)
__field(u32, to)
),
TP_fast_assign(
RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device))
__entry->qpn = qp->ibqp.qp_num;
__entry->hrtimer = &qp->s_rnr_timer;
__entry->s_flags = qp->s_flags;
__entry->to = to;
),
TP_printk(
"[%s] qpn 0x%x hrtimer 0x%p s_flags 0x%x timeout %u us",
__get_str(dev),
__entry->qpn,
__entry->hrtimer,
__entry->s_flags,
__entry->to
)
);
DEFINE_EVENT(
rvt_rnrnak_template, rvt_rnrnak_add,
TP_PROTO(struct rvt_qp *qp, u32 to),
TP_ARGS(qp, to));
DEFINE_EVENT(
rvt_rnrnak_template, rvt_rnrnak_timeout,
TP_PROTO(struct rvt_qp *qp, u32 to),
TP_ARGS(qp, to));
DEFINE_EVENT(
rvt_rnrnak_template, rvt_rnrnak_stop,
TP_PROTO(struct rvt_qp *qp, u32 to),
TP_ARGS(qp, to));
#endif /* __RVT_TRACE_QP_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment