• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef RDMA_USER_CM_H
7 #define RDMA_USER_CM_H
8 #include <linux/types.h>
9 #include <linux/socket.h>
10 #include <linux/in6.h>
11 #include <rdma/ib_user_verbs.h>
12 #include <rdma/ib_user_sa.h>
13 #define RDMA_USER_CM_ABI_VERSION	4
14 #define RDMA_MAX_PRIVATE_DATA		256
15 enum {
16 	RDMA_USER_CM_CMD_CREATE_ID,
17 	RDMA_USER_CM_CMD_DESTROY_ID,
18 	RDMA_USER_CM_CMD_BIND_IP,
19 	RDMA_USER_CM_CMD_RESOLVE_IP,
20 	RDMA_USER_CM_CMD_RESOLVE_ROUTE,
21 	RDMA_USER_CM_CMD_QUERY_ROUTE,
22 	RDMA_USER_CM_CMD_CONNECT,
23 	RDMA_USER_CM_CMD_LISTEN,
24 	RDMA_USER_CM_CMD_ACCEPT,
25 	RDMA_USER_CM_CMD_REJECT,
26 	RDMA_USER_CM_CMD_DISCONNECT,
27 	RDMA_USER_CM_CMD_INIT_QP_ATTR,
28 	RDMA_USER_CM_CMD_GET_EVENT,
29 	RDMA_USER_CM_CMD_GET_OPTION,
30 	RDMA_USER_CM_CMD_SET_OPTION,
31 	RDMA_USER_CM_CMD_NOTIFY,
32 	RDMA_USER_CM_CMD_JOIN_IP_MCAST,
33 	RDMA_USER_CM_CMD_LEAVE_MCAST,
34 	RDMA_USER_CM_CMD_MIGRATE_ID,
35 	RDMA_USER_CM_CMD_QUERY,
36 	RDMA_USER_CM_CMD_BIND,
37 	RDMA_USER_CM_CMD_RESOLVE_ADDR,
38 	RDMA_USER_CM_CMD_JOIN_MCAST
39 };
40 enum rdma_ucm_port_space {
41 	RDMA_PS_IPOIB = 0x0002,
42 	RDMA_PS_IB    = 0x013F,
43 	RDMA_PS_TCP   = 0x0106,
44 	RDMA_PS_UDP   = 0x0111,
45 };
46 struct rdma_ucm_cmd_hdr {
47 	__u32 cmd;
48 	__u16 in;
49 	__u16 out;
50 };
51 struct rdma_ucm_create_id {
52 	__aligned_u64 uid;
53 	__aligned_u64 response;
54 	__u16 ps;
55 	__u8  qp_type;
56 	__u8  reserved[5];
57 };
58 struct rdma_ucm_create_id_resp {
59 	__u32 id;
60 };
61 struct rdma_ucm_destroy_id {
62 	__aligned_u64 response;
63 	__u32 id;
64 	__u32 reserved;
65 };
66 struct rdma_ucm_destroy_id_resp {
67 	__u32 events_reported;
68 };
69 struct rdma_ucm_bind_ip {
70 	__aligned_u64 response;
71 	struct sockaddr_in6 addr;
72 	__u32 id;
73 };
74 struct rdma_ucm_bind {
75 	__u32 id;
76 	__u16 addr_size;
77 	__u16 reserved;
78 	struct sockaddr_storage addr;
79 };
80 struct rdma_ucm_resolve_ip {
81 	struct sockaddr_in6 src_addr;
82 	struct sockaddr_in6 dst_addr;
83 	__u32 id;
84 	__u32 timeout_ms;
85 };
86 struct rdma_ucm_resolve_addr {
87 	__u32 id;
88 	__u32 timeout_ms;
89 	__u16 src_size;
90 	__u16 dst_size;
91 	__u32 reserved;
92 	struct sockaddr_storage src_addr;
93 	struct sockaddr_storage dst_addr;
94 };
95 struct rdma_ucm_resolve_route {
96 	__u32 id;
97 	__u32 timeout_ms;
98 };
99 enum {
100 	RDMA_USER_CM_QUERY_ADDR,
101 	RDMA_USER_CM_QUERY_PATH,
102 	RDMA_USER_CM_QUERY_GID
103 };
104 struct rdma_ucm_query {
105 	__aligned_u64 response;
106 	__u32 id;
107 	__u32 option;
108 };
109 struct rdma_ucm_query_route_resp {
110 	__aligned_u64 node_guid;
111 	struct ib_user_path_rec ib_route[2];
112 	struct sockaddr_in6 src_addr;
113 	struct sockaddr_in6 dst_addr;
114 	__u32 num_paths;
115 	__u8 port_num;
116 	__u8 reserved[3];
117 };
118 struct rdma_ucm_query_addr_resp {
119 	__aligned_u64 node_guid;
120 	__u8  port_num;
121 	__u8  reserved;
122 	__u16 pkey;
123 	__u16 src_size;
124 	__u16 dst_size;
125 	struct sockaddr_storage src_addr;
126 	struct sockaddr_storage dst_addr;
127 };
128 struct rdma_ucm_query_path_resp {
129 	__u32 num_paths;
130 	__u32 reserved;
131 	struct ib_path_rec_data path_data[0];
132 };
133 struct rdma_ucm_conn_param {
134 	__u32 qp_num;
135 	__u32 qkey;
136 	__u8  private_data[RDMA_MAX_PRIVATE_DATA];
137 	__u8  private_data_len;
138 	__u8  srq;
139 	__u8  responder_resources;
140 	__u8  initiator_depth;
141 	__u8  flow_control;
142 	__u8  retry_count;
143 	__u8  rnr_retry_count;
144 	__u8  valid;
145 };
146 struct rdma_ucm_ud_param {
147 	__u32 qp_num;
148 	__u32 qkey;
149 	struct ib_uverbs_ah_attr ah_attr;
150 	__u8  private_data[RDMA_MAX_PRIVATE_DATA];
151 	__u8  private_data_len;
152 	__u8  reserved[7];
153 };
154 struct rdma_ucm_connect {
155 	struct rdma_ucm_conn_param conn_param;
156 	__u32 id;
157 	__u32 reserved;
158 };
159 struct rdma_ucm_listen {
160 	__u32 id;
161 	__u32 backlog;
162 };
163 struct rdma_ucm_accept {
164 	__aligned_u64 uid;
165 	struct rdma_ucm_conn_param conn_param;
166 	__u32 id;
167 	__u32 reserved;
168 };
169 struct rdma_ucm_reject {
170 	__u32 id;
171 	__u8  private_data_len;
172 	__u8  reserved[3];
173 	__u8  private_data[RDMA_MAX_PRIVATE_DATA];
174 };
175 struct rdma_ucm_disconnect {
176 	__u32 id;
177 };
178 struct rdma_ucm_init_qp_attr {
179 	__aligned_u64 response;
180 	__u32 id;
181 	__u32 qp_state;
182 };
183 struct rdma_ucm_notify {
184 	__u32 id;
185 	__u32 event;
186 };
187 struct rdma_ucm_join_ip_mcast {
188 	__aligned_u64 response;
189 	__aligned_u64 uid;
190 	struct sockaddr_in6 addr;
191 	__u32 id;
192 };
193 enum {
194 	RDMA_MC_JOIN_FLAG_FULLMEMBER,
195 	RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
196 	RDMA_MC_JOIN_FLAG_RESERVED,
197 };
198 struct rdma_ucm_join_mcast {
199 	__aligned_u64 response;
200 	__aligned_u64 uid;
201 	__u32 id;
202 	__u16 addr_size;
203 	__u16 join_flags;
204 	struct sockaddr_storage addr;
205 };
206 struct rdma_ucm_get_event {
207 	__aligned_u64 response;
208 };
209 struct rdma_ucm_event_resp {
210 	__aligned_u64 uid;
211 	__u32 id;
212 	__u32 event;
213 	__u32 status;
214 
215 	union {
216 		struct rdma_ucm_conn_param conn;
217 		struct rdma_ucm_ud_param   ud;
218 	} param;
219 	__u32 reserved;
220 };
221 enum {
222 	RDMA_OPTION_ID		= 0,
223 	RDMA_OPTION_IB		= 1
224 };
225 enum {
226 	RDMA_OPTION_ID_TOS	 = 0,
227 	RDMA_OPTION_ID_REUSEADDR = 1,
228 	RDMA_OPTION_ID_AFONLY	 = 2,
229 	RDMA_OPTION_IB_PATH	 = 1
230 };
231 struct rdma_ucm_set_option {
232 	__aligned_u64 optval;
233 	__u32 id;
234 	__u32 level;
235 	__u32 optname;
236 	__u32 optlen;
237 };
238 struct rdma_ucm_migrate_id {
239 	__aligned_u64 response;
240 	__u32 id;
241 	__u32 fd;
242 };
243 struct rdma_ucm_migrate_resp {
244 	__u32 events_reported;
245 };
246 #endif
247