2 * Copyright(c) 2016 Intel Corporation.
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
24 * - Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * - Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in
28 * the documentation and/or other materials provided with the
30 * - Neither the name of Intel Corporation nor the names of its
31 * contributors may be used to endorse or promote products derived
32 * from this software without specific prior written permission.
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 #if !defined(__RVT_TRACE_TX_H) || defined(TRACE_HEADER_MULTI_READ)
48 #define __RVT_TRACE_TX_H
50 #include <linux/tracepoint.h>
51 #include <linux/trace_seq.h>
53 #include <rdma/ib_verbs.h>
54 #include <rdma/rdmavt_qp.h>
57 #define TRACE_SYSTEM rvt_tx
59 #define wr_opcode_name(opcode) { IB_WR_##opcode, #opcode }
60 #define show_wr_opcode(opcode) \
61 __print_symbolic(opcode, \
62 wr_opcode_name(RDMA_WRITE), \
63 wr_opcode_name(RDMA_WRITE_WITH_IMM), \
64 wr_opcode_name(SEND), \
65 wr_opcode_name(SEND_WITH_IMM), \
66 wr_opcode_name(RDMA_READ), \
67 wr_opcode_name(ATOMIC_CMP_AND_SWP), \
68 wr_opcode_name(ATOMIC_FETCH_AND_ADD), \
69 wr_opcode_name(LSO), \
70 wr_opcode_name(SEND_WITH_INV), \
71 wr_opcode_name(RDMA_READ_WITH_INV), \
72 wr_opcode_name(LOCAL_INV), \
73 wr_opcode_name(MASKED_ATOMIC_CMP_AND_SWP), \
74 wr_opcode_name(MASKED_ATOMIC_FETCH_AND_ADD), \
75 wr_opcode_name(RESERVED1), \
76 wr_opcode_name(RESERVED2), \
77 wr_opcode_name(RESERVED3), \
78 wr_opcode_name(RESERVED4), \
79 wr_opcode_name(RESERVED5), \
80 wr_opcode_name(RESERVED6), \
81 wr_opcode_name(RESERVED7), \
82 wr_opcode_name(RESERVED8), \
83 wr_opcode_name(RESERVED9), \
84 wr_opcode_name(RESERVED10))
87 "[%s] wqe %p wr_id %llx send_flags %x qpn %x qpt %u psn %x lpsn %x ssn %x length %u opcode 0x%.2x,%s size %u avail %u head %u last %u pid %u num_sge %u wr_num_sge %u"
91 TP_PROTO(struct rvt_qp *qp, struct rvt_swqe *wqe, int wr_num_sge),
92 TP_ARGS(qp, wqe, wr_num_sge),
94 RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
96 __field(struct rvt_swqe *, wqe)
108 __field(int, send_flags)
110 __field(int, num_sge)
111 __field(int, wr_num_sge)
114 RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device));
116 __entry->wr_id = wqe->wr.wr_id;
117 __entry->qpn = qp->ibqp.qp_num;
118 __entry->qpt = qp->ibqp.qp_type;
119 __entry->psn = wqe->psn;
120 __entry->lpsn = wqe->lpsn;
121 __entry->length = wqe->length;
122 __entry->opcode = wqe->wr.opcode;
123 __entry->size = qp->s_size;
124 __entry->avail = qp->s_avail;
125 __entry->head = qp->s_head;
126 __entry->last = qp->s_last;
127 __entry->pid = qp->pid;
128 __entry->ssn = wqe->ssn;
129 __entry->send_flags = wqe->wr.send_flags;
130 __entry->num_sge = wqe->wr.num_sge;
131 __entry->wr_num_sge = wr_num_sge;
145 __entry->opcode, show_wr_opcode(__entry->opcode),
157 rvt_qp_send_completion,
158 TP_PROTO(struct rvt_qp *qp, struct rvt_swqe *wqe, u32 idx),
159 TP_ARGS(qp, wqe, idx),
161 RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
162 __field(struct rvt_swqe *, wqe)
169 __field(enum ib_wr_opcode, opcode)
170 __field(int, send_flags)
173 RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device));
175 __entry->wr_id = wqe->wr.wr_id;
176 __entry->qpn = qp->ibqp.qp_num;
177 __entry->qpt = qp->ibqp.qp_type;
178 __entry->length = wqe->length;
180 __entry->ssn = wqe->ssn;
181 __entry->opcode = wqe->wr.opcode;
182 __entry->send_flags = wqe->wr.send_flags;
185 "[%s] qpn 0x%x qpt %u wqe %p idx %u wr_id %llx length %u ssn %u opcode %x send_flags %x",
198 #endif /* __RVT_TRACE_TX_H */
200 #undef TRACE_INCLUDE_PATH
201 #undef TRACE_INCLUDE_FILE
202 #define TRACE_INCLUDE_PATH .
203 #define TRACE_INCLUDE_FILE trace_tx
204 #include <trace/define_trace.h>