Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (c) 2018 Intel Corporation.  All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #define TRACE_SYSTEM ib_mad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #if !defined(_TRACE_IB_MAD_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define _TRACE_IB_MAD_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <rdma/ib_mad.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #ifdef CONFIG_TRACEPOINTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) struct trace_event_raw_ib_mad_send_template;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) static void create_mad_addr_info(struct ib_mad_send_wr_private *mad_send_wr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 			  struct ib_mad_qp_info *qp_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 			  struct trace_event_raw_ib_mad_send_template *entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) DECLARE_EVENT_CLASS(ib_mad_send_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	TP_PROTO(struct ib_mad_send_wr_private *wr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 		 struct ib_mad_qp_info *qp_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	TP_ARGS(wr, qp_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 		__field(u8,             base_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 		__field(u8,             mgmt_class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 		__field(u8,             class_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 		__field(u8,             port_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 		__field(u32,            qp_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 		__field(u8,             method)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		__field(u8,             sl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 		__field(u16,            attr_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 		__field(u32,            attr_mod)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 		__field(u64,            wrtid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 		__field(u64,            tid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 		__field(u16,            status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 		__field(u16,            class_specific)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 		__field(u32,            length)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		__field(u32,            dlid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 		__field(u32,            rqpn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		__field(u32,            rqkey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 		__field(u32,            dev_index)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		__field(void *,         agent_priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 		__field(unsigned long,  timeout)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		__field(int,            retries_left)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		__field(int,            max_retries)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		__field(int,            retry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		__field(u16,            pkey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		__entry->dev_index = wr->mad_agent_priv->agent.device->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		__entry->port_num = wr->mad_agent_priv->agent.port_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		__entry->qp_num = wr->mad_agent_priv->qp_info->qp->qp_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		__entry->agent_priv = wr->mad_agent_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		__entry->wrtid = wr->tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		__entry->max_retries = wr->max_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		__entry->retries_left = wr->retries_left;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		__entry->retry = wr->retry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		__entry->timeout = wr->timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		__entry->length = wr->send_buf.hdr_len +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 				  wr->send_buf.data_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		__entry->base_version =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			((struct ib_mad_hdr *)wr->send_buf.mad)->base_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		__entry->mgmt_class =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 			((struct ib_mad_hdr *)wr->send_buf.mad)->mgmt_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		__entry->class_version =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 			((struct ib_mad_hdr *)wr->send_buf.mad)->class_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		__entry->method =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 			((struct ib_mad_hdr *)wr->send_buf.mad)->method;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		__entry->status =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 			((struct ib_mad_hdr *)wr->send_buf.mad)->status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		__entry->class_specific =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 			((struct ib_mad_hdr *)wr->send_buf.mad)->class_specific;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		__entry->tid = ((struct ib_mad_hdr *)wr->send_buf.mad)->tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		__entry->attr_id =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 			((struct ib_mad_hdr *)wr->send_buf.mad)->attr_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		__entry->attr_mod =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			((struct ib_mad_hdr *)wr->send_buf.mad)->attr_mod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		create_mad_addr_info(wr, qp_info, __entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	TP_printk("%d:%d QP%d agent %p: " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		  "wrtid 0x%llx; %d/%d retries(%d); timeout %lu length %d : " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		  "hdr : base_ver 0x%x class 0x%x class_ver 0x%x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		  "method 0x%x status 0x%x class_specific 0x%x tid 0x%llx " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		  "attr_id 0x%x attr_mod 0x%x  => dlid 0x%08x sl %d "\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		  "pkey 0x%x rpqn 0x%x rqpkey 0x%x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		__entry->dev_index, __entry->port_num, __entry->qp_num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		__entry->agent_priv, be64_to_cpu(__entry->wrtid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		__entry->retries_left, __entry->max_retries,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		__entry->retry, __entry->timeout, __entry->length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		__entry->base_version, __entry->mgmt_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		__entry->class_version,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		__entry->method, be16_to_cpu(__entry->status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		be16_to_cpu(__entry->class_specific),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		be64_to_cpu(__entry->tid), be16_to_cpu(__entry->attr_id),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		be32_to_cpu(__entry->attr_mod),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		be32_to_cpu(__entry->dlid), __entry->sl, __entry->pkey,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		__entry->rqpn, __entry->rqkey
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) DEFINE_EVENT(ib_mad_send_template, ib_mad_error_handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	TP_PROTO(struct ib_mad_send_wr_private *wr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		 struct ib_mad_qp_info *qp_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	TP_ARGS(wr, qp_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) DEFINE_EVENT(ib_mad_send_template, ib_mad_ib_send_mad,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	TP_PROTO(struct ib_mad_send_wr_private *wr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		 struct ib_mad_qp_info *qp_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	TP_ARGS(wr, qp_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) DEFINE_EVENT(ib_mad_send_template, ib_mad_send_done_resend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	TP_PROTO(struct ib_mad_send_wr_private *wr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		 struct ib_mad_qp_info *qp_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	TP_ARGS(wr, qp_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) TRACE_EVENT(ib_mad_send_done_handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	TP_PROTO(struct ib_mad_send_wr_private *wr, struct ib_wc *wc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	TP_ARGS(wr, wc),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		__field(u8,             port_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		__field(u8,             base_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		__field(u8,             mgmt_class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		__field(u8,             class_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		__field(u32,            qp_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		__field(u64,            wrtid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		__field(u16,            status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		__field(u16,            wc_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		__field(u32,            length)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		__field(void *,         agent_priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		__field(unsigned long,  timeout)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		__field(u32,            dev_index)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		__field(int,            retries_left)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		__field(int,            max_retries)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		__field(int,            retry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		__field(u8,             method)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		__entry->dev_index = wr->mad_agent_priv->agent.device->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		__entry->port_num = wr->mad_agent_priv->agent.port_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		__entry->qp_num = wr->mad_agent_priv->qp_info->qp->qp_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		__entry->agent_priv = wr->mad_agent_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		__entry->wrtid = wr->tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		__entry->max_retries = wr->max_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		__entry->retries_left = wr->retries_left;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		__entry->retry = wr->retry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		__entry->timeout = wr->timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		__entry->base_version =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 			((struct ib_mad_hdr *)wr->send_buf.mad)->base_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		__entry->mgmt_class =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 			((struct ib_mad_hdr *)wr->send_buf.mad)->mgmt_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		__entry->class_version =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 			((struct ib_mad_hdr *)wr->send_buf.mad)->class_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		__entry->method =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			((struct ib_mad_hdr *)wr->send_buf.mad)->method;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		__entry->status =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 			((struct ib_mad_hdr *)wr->send_buf.mad)->status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		__entry->wc_status = wc->status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		__entry->length = wc->byte_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	TP_printk("%d:%d QP%d : SEND WC Status %d : agent %p: " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		  "wrtid 0x%llx %d/%d retries(%d) timeout %lu length %d: " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		  "hdr : base_ver 0x%x class 0x%x class_ver 0x%x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		  "method 0x%x status 0x%x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		__entry->dev_index, __entry->port_num, __entry->qp_num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		__entry->wc_status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		__entry->agent_priv, be64_to_cpu(__entry->wrtid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		__entry->retries_left, __entry->max_retries,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		__entry->retry, __entry->timeout,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		__entry->length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		__entry->base_version, __entry->mgmt_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		__entry->class_version, __entry->method,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		be16_to_cpu(__entry->status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) TRACE_EVENT(ib_mad_recv_done_handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	TP_PROTO(struct ib_mad_qp_info *qp_info, struct ib_wc *wc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		 struct ib_mad_hdr *mad_hdr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	TP_ARGS(qp_info, wc, mad_hdr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		__field(u8,             base_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		__field(u8,             mgmt_class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		__field(u8,             class_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		__field(u8,             port_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		__field(u32,            qp_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		__field(u16,            status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		__field(u16,            class_specific)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		__field(u32,            length)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		__field(u64,            tid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		__field(u8,             method)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		__field(u8,             sl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		__field(u16,            attr_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		__field(u32,            attr_mod)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		__field(u16,            src_qp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		__field(u16,            wc_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		__field(u32,            slid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		__field(u32,            dev_index)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		__field(u16,            pkey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		__entry->dev_index = qp_info->port_priv->device->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		__entry->port_num = qp_info->port_priv->port_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		__entry->qp_num = qp_info->qp->qp_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		__entry->length = wc->byte_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		__entry->base_version = mad_hdr->base_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		__entry->mgmt_class = mad_hdr->mgmt_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		__entry->class_version = mad_hdr->class_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		__entry->method = mad_hdr->method;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 		__entry->status = mad_hdr->status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		__entry->class_specific = mad_hdr->class_specific;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		__entry->tid = mad_hdr->tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		__entry->attr_id = mad_hdr->attr_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		__entry->attr_mod = mad_hdr->attr_mod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 		__entry->slid = wc->slid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 		__entry->src_qp = wc->src_qp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		__entry->sl = wc->sl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		ib_query_pkey(qp_info->port_priv->device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 			      qp_info->port_priv->port_num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 			      wc->pkey_index, &__entry->pkey);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		__entry->wc_status = wc->status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	TP_printk("%d:%d QP%d : RECV WC Status %d : length %d : hdr : " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 		  "base_ver 0x%02x class 0x%02x class_ver 0x%02x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 		  "method 0x%02x status 0x%04x class_specific 0x%04x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 		  "tid 0x%016llx attr_id 0x%04x attr_mod 0x%08x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 		  "slid 0x%08x src QP%d, sl %d pkey 0x%04x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 		__entry->dev_index, __entry->port_num, __entry->qp_num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 		__entry->wc_status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 		__entry->length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		__entry->base_version, __entry->mgmt_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		__entry->class_version, __entry->method,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 		be16_to_cpu(__entry->status),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 		be16_to_cpu(__entry->class_specific),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 		be64_to_cpu(__entry->tid), be16_to_cpu(__entry->attr_id),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 		be32_to_cpu(__entry->attr_mod),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 		__entry->slid, __entry->src_qp, __entry->sl, __entry->pkey
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) DECLARE_EVENT_CLASS(ib_mad_agent_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	TP_PROTO(struct ib_mad_agent_private *agent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	TP_ARGS(agent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 		__field(u32,            dev_index)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 		__field(u32,            hi_tid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 		__field(u8,             port_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 		__field(u8,             mgmt_class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 		__field(u8,             mgmt_class_version)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 		__entry->dev_index = agent->agent.device->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 		__entry->port_num = agent->agent.port_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 		__entry->hi_tid = agent->agent.hi_tid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 		if (agent->reg_req) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 			__entry->mgmt_class = agent->reg_req->mgmt_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 			__entry->mgmt_class_version =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 				agent->reg_req->mgmt_class_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 			__entry->mgmt_class = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 			__entry->mgmt_class_version = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	TP_printk("%d:%d mad agent : hi_tid 0x%08x class 0x%02x class_ver 0x%02x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 		__entry->dev_index, __entry->port_num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 		__entry->hi_tid, __entry->mgmt_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 		__entry->mgmt_class_version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) DEFINE_EVENT(ib_mad_agent_template, ib_mad_recv_done_agent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	TP_PROTO(struct ib_mad_agent_private *agent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	TP_ARGS(agent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) DEFINE_EVENT(ib_mad_agent_template, ib_mad_send_done_agent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	TP_PROTO(struct ib_mad_agent_private *agent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	TP_ARGS(agent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) DEFINE_EVENT(ib_mad_agent_template, ib_mad_create_agent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	TP_PROTO(struct ib_mad_agent_private *agent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	TP_ARGS(agent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) DEFINE_EVENT(ib_mad_agent_template, ib_mad_unregister_agent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	TP_PROTO(struct ib_mad_agent_private *agent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 	TP_ARGS(agent));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) DECLARE_EVENT_CLASS(ib_mad_opa_smi_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 	TP_PROTO(struct opa_smp *smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	TP_ARGS(smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 		__field(u64,            mkey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 		__field(u32,            dr_slid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 		__field(u32,            dr_dlid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 		__field(u8,             hop_ptr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 		__field(u8,             hop_cnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 		__array(u8,             initial_path, OPA_SMP_MAX_PATH_HOPS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 		__array(u8,             return_path, OPA_SMP_MAX_PATH_HOPS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 		__entry->hop_ptr = smp->hop_ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 		__entry->hop_cnt = smp->hop_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 		__entry->mkey = smp->mkey;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 		__entry->dr_slid = smp->route.dr.dr_slid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 		__entry->dr_dlid = smp->route.dr.dr_dlid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 		memcpy(__entry->initial_path, smp->route.dr.initial_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 			OPA_SMP_MAX_PATH_HOPS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 		memcpy(__entry->return_path, smp->route.dr.return_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 			OPA_SMP_MAX_PATH_HOPS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	TP_printk("OPA SMP: hop_ptr %d hop_cnt %d " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 		  "mkey 0x%016llx dr_slid 0x%08x dr_dlid 0x%08x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 		  "initial_path %*ph return_path %*ph ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 		__entry->hop_ptr, __entry->hop_cnt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 		be64_to_cpu(__entry->mkey), be32_to_cpu(__entry->dr_slid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 		be32_to_cpu(__entry->dr_dlid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 		OPA_SMP_MAX_PATH_HOPS, __entry->initial_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		OPA_SMP_MAX_PATH_HOPS, __entry->return_path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) DEFINE_EVENT(ib_mad_opa_smi_template, ib_mad_handle_opa_smi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	TP_PROTO(struct opa_smp *smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	TP_ARGS(smp));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) DEFINE_EVENT(ib_mad_opa_smi_template, ib_mad_handle_out_opa_smi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 	TP_PROTO(struct opa_smp *smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	TP_ARGS(smp));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) DECLARE_EVENT_CLASS(ib_mad_opa_ib_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	TP_PROTO(struct ib_smp *smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 	TP_ARGS(smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 		__field(u64,            mkey)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 		__field(u32,            dr_slid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 		__field(u32,            dr_dlid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 		__field(u8,             hop_ptr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 		__field(u8,             hop_cnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 		__array(u8,             initial_path, IB_SMP_MAX_PATH_HOPS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 		__array(u8,             return_path, IB_SMP_MAX_PATH_HOPS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 		__entry->hop_ptr = smp->hop_ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 		__entry->hop_cnt = smp->hop_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 		__entry->mkey = smp->mkey;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 		__entry->dr_slid = smp->dr_slid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 		__entry->dr_dlid = smp->dr_dlid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 		memcpy(__entry->initial_path, smp->initial_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 			IB_SMP_MAX_PATH_HOPS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 		memcpy(__entry->return_path, smp->return_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 			IB_SMP_MAX_PATH_HOPS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 	TP_printk("OPA SMP: hop_ptr %d hop_cnt %d " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		  "mkey 0x%016llx dr_slid 0x%04x dr_dlid 0x%04x " \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 		  "initial_path %*ph return_path %*ph ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 		__entry->hop_ptr, __entry->hop_cnt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 		be64_to_cpu(__entry->mkey), be16_to_cpu(__entry->dr_slid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 		be16_to_cpu(__entry->dr_dlid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 		IB_SMP_MAX_PATH_HOPS, __entry->initial_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 		IB_SMP_MAX_PATH_HOPS, __entry->return_path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) DEFINE_EVENT(ib_mad_opa_ib_template, ib_mad_handle_ib_smi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	TP_PROTO(struct ib_smp *smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	TP_ARGS(smp));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) DEFINE_EVENT(ib_mad_opa_ib_template, ib_mad_handle_out_ib_smi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	TP_PROTO(struct ib_smp *smp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	TP_ARGS(smp));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) #endif /* _TRACE_IB_MAD_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) #include <trace/define_trace.h>