Commit c05fc156 authored by Kaike Wan's avatar Kaike Wan Committed by Jason Gunthorpe

IB/hfi1: Add traces for TID RDMA READ

This patch adds traces to debug packet loss and retry for TID RDMA READ
protocol.

Link: https://lore.kernel.org/r/20190911113041.126040.64541.stgit@awfm-01.aw.intel.comReviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarKaike Wan <kaike.wan@intel.com>
Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 4db8fd49
...@@ -1483,6 +1483,11 @@ static void update_num_rd_atomic(struct rvt_qp *qp, u32 psn, ...@@ -1483,6 +1483,11 @@ static void update_num_rd_atomic(struct rvt_qp *qp, u32 psn,
req->ack_pending = cur_seg - req->comp_seg; req->ack_pending = cur_seg - req->comp_seg;
priv->pending_tid_r_segs += req->ack_pending; priv->pending_tid_r_segs += req->ack_pending;
qp->s_num_rd_atomic += req->ack_pending; qp->s_num_rd_atomic += req->ack_pending;
trace_hfi1_tid_req_update_num_rd_atomic(qp, 0,
wqe->wr.opcode,
wqe->psn,
wqe->lpsn,
req);
} else { } else {
priv->pending_tid_r_segs += req->total_segs; priv->pending_tid_r_segs += req->total_segs;
qp->s_num_rd_atomic += req->total_segs; qp->s_num_rd_atomic += req->total_segs;
......
...@@ -2646,6 +2646,9 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd, ...@@ -2646,6 +2646,9 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd,
u32 fpsn; u32 fpsn;
lockdep_assert_held(&qp->r_lock); lockdep_assert_held(&qp->r_lock);
trace_hfi1_rsp_read_kdeth_eflags(qp, ibpsn);
trace_hfi1_sender_read_kdeth_eflags(qp);
trace_hfi1_tid_read_sender_kdeth_eflags(qp, 0);
spin_lock(&qp->s_lock); spin_lock(&qp->s_lock);
/* If the psn is out of valid range, drop the packet */ /* If the psn is out of valid range, drop the packet */
if (cmp_psn(ibpsn, qp->s_last_psn) < 0 || if (cmp_psn(ibpsn, qp->s_last_psn) < 0 ||
...@@ -2710,6 +2713,8 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd, ...@@ -2710,6 +2713,8 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd,
goto s_unlock; goto s_unlock;
req = wqe_to_tid_req(wqe); req = wqe_to_tid_req(wqe);
trace_hfi1_tid_req_read_kdeth_eflags(qp, 0, wqe->wr.opcode, wqe->psn,
wqe->lpsn, req);
switch (rcv_type) { switch (rcv_type) {
case RHF_RCV_TYPE_EXPECTED: case RHF_RCV_TYPE_EXPECTED:
switch (rte) { switch (rte) {
...@@ -2724,6 +2729,9 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd, ...@@ -2724,6 +2729,9 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd,
* packets that could be still in the fabric. * packets that could be still in the fabric.
*/ */
flow = &req->flows[req->clear_tail]; flow = &req->flows[req->clear_tail];
trace_hfi1_tid_flow_read_kdeth_eflags(qp,
req->clear_tail,
flow);
if (priv->s_flags & HFI1_R_TID_SW_PSN) { if (priv->s_flags & HFI1_R_TID_SW_PSN) {
diff = cmp_psn(psn, diff = cmp_psn(psn,
flow->flow_state.r_next_psn); flow->flow_state.r_next_psn);
......
...@@ -627,6 +627,12 @@ DEFINE_EVENT(/* event */ ...@@ -627,6 +627,12 @@ DEFINE_EVENT(/* event */
TP_ARGS(qp, index, flow) TP_ARGS(qp, index, flow)
); );
DEFINE_EVENT(/* event */
hfi1_tid_flow_template, hfi1_tid_flow_read_kdeth_eflags,
TP_PROTO(struct rvt_qp *qp, int index, struct tid_rdma_flow *flow),
TP_ARGS(qp, index, flow)
);
DECLARE_EVENT_CLASS(/* tid_node */ DECLARE_EVENT_CLASS(/* tid_node */
hfi1_tid_node_template, hfi1_tid_node_template,
TP_PROTO(struct rvt_qp *qp, const char *msg, u32 index, u32 base, TP_PROTO(struct rvt_qp *qp, const char *msg, u32 index, u32 base,
...@@ -851,6 +857,12 @@ DEFINE_EVENT(/* event */ ...@@ -851,6 +857,12 @@ DEFINE_EVENT(/* event */
TP_ARGS(qp, psn) TP_ARGS(qp, psn)
); );
DEFINE_EVENT(/* event */
hfi1_responder_info_template, hfi1_rsp_read_kdeth_eflags,
TP_PROTO(struct rvt_qp *qp, u32 psn),
TP_ARGS(qp, psn)
);
DECLARE_EVENT_CLASS(/* sender_info */ DECLARE_EVENT_CLASS(/* sender_info */
hfi1_sender_info_template, hfi1_sender_info_template,
TP_PROTO(struct rvt_qp *qp), TP_PROTO(struct rvt_qp *qp),
...@@ -955,6 +967,12 @@ DEFINE_EVENT(/* event */ ...@@ -955,6 +967,12 @@ DEFINE_EVENT(/* event */
TP_ARGS(qp) TP_ARGS(qp)
); );
DEFINE_EVENT(/* event */
hfi1_sender_info_template, hfi1_sender_read_kdeth_eflags,
TP_PROTO(struct rvt_qp *qp),
TP_ARGS(qp)
);
DECLARE_EVENT_CLASS(/* tid_read_sender */ DECLARE_EVENT_CLASS(/* tid_read_sender */
hfi1_tid_read_sender_template, hfi1_tid_read_sender_template,
TP_PROTO(struct rvt_qp *qp, char newreq), TP_PROTO(struct rvt_qp *qp, char newreq),
...@@ -1015,6 +1033,12 @@ DEFINE_EVENT(/* event */ ...@@ -1015,6 +1033,12 @@ DEFINE_EVENT(/* event */
TP_ARGS(qp, newreq) TP_ARGS(qp, newreq)
); );
DEFINE_EVENT(/* event */
hfi1_tid_read_sender_template, hfi1_tid_read_sender_kdeth_eflags,
TP_PROTO(struct rvt_qp *qp, char newreq),
TP_ARGS(qp, newreq)
);
DECLARE_EVENT_CLASS(/* tid_rdma_request */ DECLARE_EVENT_CLASS(/* tid_rdma_request */
hfi1_tid_rdma_request_template, hfi1_tid_rdma_request_template,
TP_PROTO(struct rvt_qp *qp, char newreq, u8 opcode, u32 psn, u32 lpsn, TP_PROTO(struct rvt_qp *qp, char newreq, u8 opcode, u32 psn, u32 lpsn,
...@@ -1215,6 +1239,13 @@ DEFINE_EVENT(/* event */ ...@@ -1215,6 +1239,13 @@ DEFINE_EVENT(/* event */
TP_ARGS(qp, newreq, opcode, psn, lpsn, req) TP_ARGS(qp, newreq, opcode, psn, lpsn, req)
); );
DEFINE_EVENT(/* event */
hfi1_tid_rdma_request_template, hfi1_tid_req_read_kdeth_eflags,
TP_PROTO(struct rvt_qp *qp, char newreq, u8 opcode, u32 psn, u32 lpsn,
struct tid_rdma_request *req),
TP_ARGS(qp, newreq, opcode, psn, lpsn, req)
);
DEFINE_EVENT(/* event */ DEFINE_EVENT(/* event */
hfi1_tid_rdma_request_template, hfi1_tid_req_make_rc_ack_write, hfi1_tid_rdma_request_template, hfi1_tid_req_make_rc_ack_write,
TP_PROTO(struct rvt_qp *qp, char newreq, u8 opcode, u32 psn, u32 lpsn, TP_PROTO(struct rvt_qp *qp, char newreq, u8 opcode, u32 psn, u32 lpsn,
...@@ -1229,6 +1260,13 @@ DEFINE_EVENT(/* event */ ...@@ -1229,6 +1260,13 @@ DEFINE_EVENT(/* event */
TP_ARGS(qp, newreq, opcode, psn, lpsn, req) TP_ARGS(qp, newreq, opcode, psn, lpsn, req)
); );
DEFINE_EVENT(/* event */
hfi1_tid_rdma_request_template, hfi1_tid_req_update_num_rd_atomic,
TP_PROTO(struct rvt_qp *qp, char newreq, u8 opcode, u32 psn, u32 lpsn,
struct tid_rdma_request *req),
TP_ARGS(qp, newreq, opcode, psn, lpsn, req)
);
DECLARE_EVENT_CLASS(/* rc_rcv_err */ DECLARE_EVENT_CLASS(/* rc_rcv_err */
hfi1_rc_rcv_err_template, hfi1_rc_rcv_err_template,
TP_PROTO(struct rvt_qp *qp, u32 opcode, u32 psn, int diff), TP_PROTO(struct rvt_qp *qp, u32 opcode, u32 psn, int diff),
......
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