1 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2 /* Copyright (c) 2019 Intel Corporation */
3 #define CREATE_TRACE_POINTS
6 const char *print_ip_addr(struct trace_seq
*p
, u32
*addr
, u16 port
, bool ipv4
)
8 const char *ret
= trace_seq_buffer_ptr(p
);
11 __be32 myaddr
= htonl(*addr
);
13 trace_seq_printf(p
, "%pI4:%d", &myaddr
, htons(port
));
15 trace_seq_printf(p
, "%pI6:%d", addr
, htons(port
));
22 const char *parse_iw_event_type(enum iw_cm_event_type iw_type
)
25 case IW_CM_EVENT_CONNECT_REQUEST
:
27 case IW_CM_EVENT_CONNECT_REPLY
:
29 case IW_CM_EVENT_ESTABLISHED
:
30 return "IwEstablished";
31 case IW_CM_EVENT_DISCONNECT
:
32 return "IwDisconnect";
33 case IW_CM_EVENT_CLOSE
:
40 const char *parse_cm_event_type(enum irdma_cm_event_type cm_type
)
43 case IRDMA_CM_EVENT_ESTABLISHED
:
44 return "CmEstablished";
45 case IRDMA_CM_EVENT_MPA_REQ
:
47 case IRDMA_CM_EVENT_MPA_CONNECT
:
48 return "CmMPA_CONNECT";
49 case IRDMA_CM_EVENT_MPA_ACCEPT
:
50 return "CmMPA_ACCEPT";
51 case IRDMA_CM_EVENT_MPA_REJECT
:
52 return "CmMPA_REJECT";
53 case IRDMA_CM_EVENT_MPA_ESTABLISHED
:
54 return "CmMPA_ESTABLISHED";
55 case IRDMA_CM_EVENT_CONNECTED
:
57 case IRDMA_CM_EVENT_RESET
:
59 case IRDMA_CM_EVENT_ABORTED
:
61 case IRDMA_CM_EVENT_UNKNOWN
:
67 const char *parse_cm_state(enum irdma_cm_node_state state
)
70 case IRDMA_CM_STATE_UNKNOWN
:
72 case IRDMA_CM_STATE_INITED
:
74 case IRDMA_CM_STATE_LISTENING
:
76 case IRDMA_CM_STATE_SYN_RCVD
:
78 case IRDMA_CM_STATE_SYN_SENT
:
80 case IRDMA_CM_STATE_ONE_SIDE_ESTABLISHED
:
81 return "ONE_SIDE_ESTABLISHED";
82 case IRDMA_CM_STATE_ESTABLISHED
:
84 case IRDMA_CM_STATE_ACCEPTING
:
86 case IRDMA_CM_STATE_MPAREQ_SENT
:
88 case IRDMA_CM_STATE_MPAREQ_RCVD
:
90 case IRDMA_CM_STATE_MPAREJ_RCVD
:
91 return "MPAREJ_RECVD";
92 case IRDMA_CM_STATE_OFFLOADED
:
94 case IRDMA_CM_STATE_FIN_WAIT1
:
96 case IRDMA_CM_STATE_FIN_WAIT2
:
98 case IRDMA_CM_STATE_CLOSE_WAIT
:
100 case IRDMA_CM_STATE_TIME_WAIT
:
102 case IRDMA_CM_STATE_LAST_ACK
:
104 case IRDMA_CM_STATE_CLOSING
:
106 case IRDMA_CM_STATE_LISTENER_DESTROYED
:
107 return "LISTENER_DESTROYED";
108 case IRDMA_CM_STATE_CLOSED
:
111 return ("Bad state");