blob: 19be116047f676d89b4f336cf7ab30f55e49a7eb [file] [log] [blame]
Hal Rosenstock8aa00912005-07-27 11:45:43 -07001/*
2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
Sean Hefty0b2b35f2005-09-01 09:28:03 -07003 * Copyright (c) 2005 Intel Corporation. All rights reserved.
Hal Rosenstock8aa00912005-07-27 11:45:43 -07004 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 *
33 * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $
34 */
35
36#ifndef IB_USER_CM_H
37#define IB_USER_CM_H
38
39#include <linux/types.h>
40
Sean Hefty7b28b0d2005-11-01 13:18:54 -080041#define IB_USER_CM_ABI_VERSION 4
Hal Rosenstock8aa00912005-07-27 11:45:43 -070042
43enum {
44 IB_USER_CM_CMD_CREATE_ID,
45 IB_USER_CM_CMD_DESTROY_ID,
46 IB_USER_CM_CMD_ATTR_ID,
47
48 IB_USER_CM_CMD_LISTEN,
49 IB_USER_CM_CMD_ESTABLISH,
50
51 IB_USER_CM_CMD_SEND_REQ,
52 IB_USER_CM_CMD_SEND_REP,
53 IB_USER_CM_CMD_SEND_RTU,
54 IB_USER_CM_CMD_SEND_DREQ,
55 IB_USER_CM_CMD_SEND_DREP,
56 IB_USER_CM_CMD_SEND_REJ,
57 IB_USER_CM_CMD_SEND_MRA,
58 IB_USER_CM_CMD_SEND_LAP,
59 IB_USER_CM_CMD_SEND_APR,
60 IB_USER_CM_CMD_SEND_SIDR_REQ,
61 IB_USER_CM_CMD_SEND_SIDR_REP,
62
63 IB_USER_CM_CMD_EVENT,
Sean Hefty0b2b35f2005-09-01 09:28:03 -070064 IB_USER_CM_CMD_INIT_QP_ATTR,
Hal Rosenstock8aa00912005-07-27 11:45:43 -070065};
66/*
67 * command ABI structures.
68 */
69struct ib_ucm_cmd_hdr {
70 __u32 cmd;
71 __u16 in;
72 __u16 out;
73};
74
75struct ib_ucm_create_id {
Sean Hefty0b2b35f2005-09-01 09:28:03 -070076 __u64 uid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -070077 __u64 response;
78};
79
80struct ib_ucm_create_id_resp {
81 __u32 id;
82};
83
84struct ib_ucm_destroy_id {
Sean Hefty0b2b35f2005-09-01 09:28:03 -070085 __u64 response;
Hal Rosenstock8aa00912005-07-27 11:45:43 -070086 __u32 id;
Sean Hefty7b28b0d2005-11-01 13:18:54 -080087 __u32 reserved;
Hal Rosenstock8aa00912005-07-27 11:45:43 -070088};
89
Sean Hefty0b2b35f2005-09-01 09:28:03 -070090struct ib_ucm_destroy_id_resp {
91 __u32 events_reported;
92};
93
Hal Rosenstock8aa00912005-07-27 11:45:43 -070094struct ib_ucm_attr_id {
95 __u64 response;
96 __u32 id;
Sean Hefty7b28b0d2005-11-01 13:18:54 -080097 __u32 reserved;
Hal Rosenstock8aa00912005-07-27 11:45:43 -070098};
99
100struct ib_ucm_attr_id_resp {
Sean Hefty97f52eb2005-08-13 21:05:57 -0700101 __be64 service_id;
102 __be64 service_mask;
103 __be32 local_id;
104 __be32 remote_id;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700105};
106
Sean Hefty0b2b35f2005-09-01 09:28:03 -0700107struct ib_ucm_init_qp_attr {
108 __u64 response;
109 __u32 id;
110 __u32 qp_state;
111};
112
113struct ib_ucm_ah_attr {
114 __u8 grh_dgid[16];
115 __u32 grh_flow_label;
116 __u16 dlid;
117 __u16 reserved;
118 __u8 grh_sgid_index;
119 __u8 grh_hop_limit;
120 __u8 grh_traffic_class;
121 __u8 sl;
122 __u8 src_path_bits;
123 __u8 static_rate;
124 __u8 is_global;
125 __u8 port_num;
126};
127
128struct ib_ucm_init_qp_attr_resp {
129 __u32 qp_attr_mask;
130 __u32 qp_state;
131 __u32 cur_qp_state;
132 __u32 path_mtu;
133 __u32 path_mig_state;
134 __u32 qkey;
135 __u32 rq_psn;
136 __u32 sq_psn;
137 __u32 dest_qp_num;
138 __u32 qp_access_flags;
139
140 struct ib_ucm_ah_attr ah_attr;
141 struct ib_ucm_ah_attr alt_ah_attr;
142
143 /* ib_qp_cap */
144 __u32 max_send_wr;
145 __u32 max_recv_wr;
146 __u32 max_send_sge;
147 __u32 max_recv_sge;
148 __u32 max_inline_data;
149
150 __u16 pkey_index;
151 __u16 alt_pkey_index;
152 __u8 en_sqd_async_notify;
153 __u8 sq_draining;
154 __u8 max_rd_atomic;
155 __u8 max_dest_rd_atomic;
156 __u8 min_rnr_timer;
157 __u8 port_num;
158 __u8 timeout;
159 __u8 retry_cnt;
160 __u8 rnr_retry;
161 __u8 alt_port_num;
162 __u8 alt_timeout;
163};
164
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700165struct ib_ucm_listen {
Sean Hefty97f52eb2005-08-13 21:05:57 -0700166 __be64 service_id;
167 __be64 service_mask;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700168 __u32 id;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800169 __u32 reserved;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700170};
171
172struct ib_ucm_establish {
173 __u32 id;
174};
175
176struct ib_ucm_private_data {
177 __u64 data;
178 __u32 id;
179 __u8 len;
180 __u8 reserved[3];
181};
182
183struct ib_ucm_path_rec {
184 __u8 dgid[16];
185 __u8 sgid[16];
Sean Hefty97f52eb2005-08-13 21:05:57 -0700186 __be16 dlid;
187 __be16 slid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700188 __u32 raw_traffic;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700189 __be32 flow_label;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700190 __u32 reversible;
191 __u32 mtu;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700192 __be16 pkey;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700193 __u8 hop_limit;
194 __u8 traffic_class;
195 __u8 numb_path;
196 __u8 sl;
197 __u8 mtu_selector;
198 __u8 rate_selector;
199 __u8 rate;
200 __u8 packet_life_time_selector;
201 __u8 packet_life_time;
202 __u8 preference;
203};
204
205struct ib_ucm_req {
206 __u32 id;
207 __u32 qpn;
208 __u32 qp_type;
209 __u32 psn;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700210 __be64 sid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700211 __u64 data;
212 __u64 primary_path;
213 __u64 alternate_path;
214 __u8 len;
215 __u8 peer_to_peer;
216 __u8 responder_resources;
217 __u8 initiator_depth;
218 __u8 remote_cm_response_timeout;
219 __u8 flow_control;
220 __u8 local_cm_response_timeout;
221 __u8 retry_count;
222 __u8 rnr_retry_count;
223 __u8 max_cm_retries;
224 __u8 srq;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800225 __u8 reserved[5];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700226};
227
228struct ib_ucm_rep {
Sean Hefty0b2b35f2005-09-01 09:28:03 -0700229 __u64 uid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700230 __u64 data;
231 __u32 id;
232 __u32 qpn;
233 __u32 psn;
234 __u8 len;
235 __u8 responder_resources;
236 __u8 initiator_depth;
237 __u8 target_ack_delay;
238 __u8 failover_accepted;
239 __u8 flow_control;
240 __u8 rnr_retry_count;
241 __u8 srq;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800242 __u8 reserved[4];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700243};
244
245struct ib_ucm_info {
246 __u32 id;
247 __u32 status;
248 __u64 info;
249 __u64 data;
250 __u8 info_len;
251 __u8 data_len;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800252 __u8 reserved[6];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700253};
254
255struct ib_ucm_mra {
256 __u64 data;
257 __u32 id;
258 __u8 len;
259 __u8 timeout;
260 __u8 reserved[2];
261};
262
263struct ib_ucm_lap {
264 __u64 path;
265 __u64 data;
266 __u32 id;
267 __u8 len;
268 __u8 reserved[3];
269};
270
271struct ib_ucm_sidr_req {
272 __u32 id;
273 __u32 timeout;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700274 __be64 sid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700275 __u64 data;
276 __u64 path;
277 __u16 pkey;
278 __u8 len;
279 __u8 max_cm_retries;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800280 __u8 reserved[4];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700281};
282
283struct ib_ucm_sidr_rep {
284 __u32 id;
285 __u32 qpn;
286 __u32 qkey;
287 __u32 status;
288 __u64 info;
289 __u64 data;
290 __u8 info_len;
291 __u8 data_len;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800292 __u8 reserved[6];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700293};
294/*
295 * event notification ABI structures.
296 */
297struct ib_ucm_event_get {
298 __u64 response;
299 __u64 data;
300 __u64 info;
301 __u8 data_len;
302 __u8 info_len;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800303 __u8 reserved[6];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700304};
305
306struct ib_ucm_req_event_resp {
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700307 struct ib_ucm_path_rec primary_path;
308 struct ib_ucm_path_rec alternate_path;
Sean Hefty97f52eb2005-08-13 21:05:57 -0700309 __be64 remote_ca_guid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700310 __u32 remote_qkey;
311 __u32 remote_qpn;
312 __u32 qp_type;
313 __u32 starting_psn;
314 __u8 responder_resources;
315 __u8 initiator_depth;
316 __u8 local_cm_response_timeout;
317 __u8 flow_control;
318 __u8 remote_cm_response_timeout;
319 __u8 retry_count;
320 __u8 rnr_retry_count;
321 __u8 srq;
Sean Hefty07d357d2005-10-17 15:37:43 -0700322 __u8 port;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800323 __u8 reserved[7];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700324};
325
326struct ib_ucm_rep_event_resp {
Sean Hefty97f52eb2005-08-13 21:05:57 -0700327 __be64 remote_ca_guid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700328 __u32 remote_qkey;
329 __u32 remote_qpn;
330 __u32 starting_psn;
331 __u8 responder_resources;
332 __u8 initiator_depth;
333 __u8 target_ack_delay;
334 __u8 failover_accepted;
335 __u8 flow_control;
336 __u8 rnr_retry_count;
337 __u8 srq;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800338 __u8 reserved[5];
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700339};
340
341struct ib_ucm_rej_event_resp {
342 __u32 reason;
343 /* ari in ib_ucm_event_get info field. */
344};
345
346struct ib_ucm_mra_event_resp {
347 __u8 timeout;
348 __u8 reserved[3];
349};
350
351struct ib_ucm_lap_event_resp {
352 struct ib_ucm_path_rec path;
353};
354
355struct ib_ucm_apr_event_resp {
356 __u32 status;
357 /* apr info in ib_ucm_event_get info field. */
358};
359
360struct ib_ucm_sidr_req_event_resp {
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700361 __u16 pkey;
Sean Hefty07d357d2005-10-17 15:37:43 -0700362 __u8 port;
363 __u8 reserved;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700364};
365
366struct ib_ucm_sidr_rep_event_resp {
367 __u32 status;
368 __u32 qkey;
369 __u32 qpn;
370 /* info in ib_ucm_event_get info field. */
371};
372
373#define IB_UCM_PRES_DATA 0x01
374#define IB_UCM_PRES_INFO 0x02
375#define IB_UCM_PRES_PRIMARY 0x04
376#define IB_UCM_PRES_ALTERNATE 0x08
377
378struct ib_ucm_event_resp {
Sean Hefty0b2b35f2005-09-01 09:28:03 -0700379 __u64 uid;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700380 __u32 id;
381 __u32 event;
382 __u32 present;
Sean Hefty7b28b0d2005-11-01 13:18:54 -0800383 __u32 reserved;
Hal Rosenstock8aa00912005-07-27 11:45:43 -0700384 union {
385 struct ib_ucm_req_event_resp req_resp;
386 struct ib_ucm_rep_event_resp rep_resp;
387 struct ib_ucm_rej_event_resp rej_resp;
388 struct ib_ucm_mra_event_resp mra_resp;
389 struct ib_ucm_lap_event_resp lap_resp;
390 struct ib_ucm_apr_event_resp apr_resp;
391
392 struct ib_ucm_sidr_req_event_resp sidr_req_resp;
393 struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
394
395 __u32 send_status;
396 } u;
397};
398
399#endif /* IB_USER_CM_H */