]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sys/contrib/rdma/ib_user_cm.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sys / contrib / rdma / ib_user_cm.h
1 /*
2  * Copyright (c) 2005 Topspin Communications.  All rights reserved.
3  * Copyright (c) 2005 Intel Corporation.  All rights reserved.
4  *
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 4019 2005-11-11 00:33:09Z sean.hefty $
34  *
35  * $FreeBSD$
36  */
37
38 #ifndef IB_USER_CM_H
39 #define IB_USER_CM_H
40
41 #include <rdma/ib_user_sa.h>
42
43 #define IB_USER_CM_ABI_VERSION 5
44
45 enum {
46         IB_USER_CM_CMD_CREATE_ID,
47         IB_USER_CM_CMD_DESTROY_ID,
48         IB_USER_CM_CMD_ATTR_ID,
49
50         IB_USER_CM_CMD_LISTEN,
51         IB_USER_CM_CMD_NOTIFY,
52
53         IB_USER_CM_CMD_SEND_REQ,
54         IB_USER_CM_CMD_SEND_REP,
55         IB_USER_CM_CMD_SEND_RTU,
56         IB_USER_CM_CMD_SEND_DREQ,
57         IB_USER_CM_CMD_SEND_DREP,
58         IB_USER_CM_CMD_SEND_REJ,
59         IB_USER_CM_CMD_SEND_MRA,
60         IB_USER_CM_CMD_SEND_LAP,
61         IB_USER_CM_CMD_SEND_APR,
62         IB_USER_CM_CMD_SEND_SIDR_REQ,
63         IB_USER_CM_CMD_SEND_SIDR_REP,
64
65         IB_USER_CM_CMD_EVENT,
66         IB_USER_CM_CMD_INIT_QP_ATTR,
67 };
68 /*
69  * command ABI structures.
70  */
71 struct ib_ucm_cmd_hdr {
72         __u32 cmd;
73         __u16 in;
74         __u16 out;
75 };
76
77 struct ib_ucm_create_id {
78         __u64 uid;
79         __u64 response;
80 };
81
82 struct ib_ucm_create_id_resp {
83         __u32 id;
84 };
85
86 struct ib_ucm_destroy_id {
87         __u64 response;
88         __u32 id;
89         __u32 reserved;
90 };
91
92 struct ib_ucm_destroy_id_resp {
93         __u32 events_reported;
94 };
95
96 struct ib_ucm_attr_id {
97         __u64 response;
98         __u32 id;
99         __u32 reserved;
100 };
101
102 struct ib_ucm_attr_id_resp {
103         __be64 service_id;
104         __be64 service_mask;
105         __be32 local_id;
106         __be32 remote_id;
107 };
108
109 struct ib_ucm_init_qp_attr {
110         __u64 response;
111         __u32 id;
112         __u32 qp_state;
113 };
114
115 struct ib_ucm_listen {
116         __be64 service_id;
117         __be64 service_mask;
118         __u32 id;
119         __u32 reserved;
120 };
121
122 struct ib_ucm_notify {
123         __u32 id;
124         __u32 event;
125 };
126
127 struct ib_ucm_private_data {
128         __u64 data;
129         __u32 id;
130         __u8  len;
131         __u8  reserved[3];
132 };
133
134 struct ib_ucm_req {
135         __u32 id;
136         __u32 qpn;
137         __u32 qp_type;
138         __u32 psn;
139         __be64 sid;
140         __u64 data;
141         __u64 primary_path;
142         __u64 alternate_path;
143         __u8  len;
144         __u8  peer_to_peer;
145         __u8  responder_resources;
146         __u8  initiator_depth;
147         __u8  remote_cm_response_timeout;
148         __u8  flow_control;
149         __u8  local_cm_response_timeout;
150         __u8  retry_count;
151         __u8  rnr_retry_count;
152         __u8  max_cm_retries;
153         __u8  srq;
154         __u8  reserved[5];
155 };
156
157 struct ib_ucm_rep {
158         __u64 uid;
159         __u64 data;
160         __u32 id;
161         __u32 qpn;
162         __u32 psn;
163         __u8  len;
164         __u8  responder_resources;
165         __u8  initiator_depth;
166         __u8  target_ack_delay;
167         __u8  failover_accepted;
168         __u8  flow_control;
169         __u8  rnr_retry_count;
170         __u8  srq;
171         __u8  reserved[4];
172 };
173
174 struct ib_ucm_info {
175         __u32 id;
176         __u32 status;
177         __u64 info;
178         __u64 data;
179         __u8  info_len;
180         __u8  data_len;
181         __u8  reserved[6];
182 };
183
184 struct ib_ucm_mra {
185         __u64 data;
186         __u32 id;
187         __u8  len;
188         __u8  timeout;
189         __u8  reserved[2];
190 };
191
192 struct ib_ucm_lap {
193         __u64 path;
194         __u64 data;
195         __u32 id;
196         __u8  len;
197         __u8  reserved[3];
198 };
199
200 struct ib_ucm_sidr_req {
201         __u32 id;
202         __u32 timeout;
203         __be64 sid;
204         __u64 data;
205         __u64 path;
206         __u16 reserved_pkey;
207         __u8  len;
208         __u8  max_cm_retries;
209         __u8  reserved[4];
210 };
211
212 struct ib_ucm_sidr_rep {
213         __u32 id;
214         __u32 qpn;
215         __u32 qkey;
216         __u32 status;
217         __u64 info;
218         __u64 data;
219         __u8  info_len;
220         __u8  data_len;
221         __u8  reserved[6];
222 };
223 /*
224  * event notification ABI structures.
225  */
226 struct ib_ucm_event_get {
227         __u64 response;
228         __u64 data;
229         __u64 info;
230         __u8  data_len;
231         __u8  info_len;
232         __u8  reserved[6];
233 };
234
235 struct ib_ucm_req_event_resp {
236         struct ib_user_path_rec primary_path;
237         struct ib_user_path_rec alternate_path;
238         __be64                 remote_ca_guid;
239         __u32                  remote_qkey;
240         __u32                  remote_qpn;
241         __u32                  qp_type;
242         __u32                  starting_psn;
243         __u8  responder_resources;
244         __u8  initiator_depth;
245         __u8  local_cm_response_timeout;
246         __u8  flow_control;
247         __u8  remote_cm_response_timeout;
248         __u8  retry_count;
249         __u8  rnr_retry_count;
250         __u8  srq;
251         __u8  port;
252         __u8  reserved[7];
253 };
254
255 struct ib_ucm_rep_event_resp {
256         __be64 remote_ca_guid;
257         __u32 remote_qkey;
258         __u32 remote_qpn;
259         __u32 starting_psn;
260         __u8  responder_resources;
261         __u8  initiator_depth;
262         __u8  target_ack_delay;
263         __u8  failover_accepted;
264         __u8  flow_control;
265         __u8  rnr_retry_count;
266         __u8  srq;
267         __u8  reserved[5];
268 };
269
270 struct ib_ucm_rej_event_resp {
271         __u32 reason;
272         /* ari in ib_ucm_event_get info field. */
273 };
274
275 struct ib_ucm_mra_event_resp {
276         __u8  timeout;
277         __u8  reserved[3];
278 };
279
280 struct ib_ucm_lap_event_resp {
281         struct ib_user_path_rec path;
282 };
283
284 struct ib_ucm_apr_event_resp {
285         __u32 status;
286         /* apr info in ib_ucm_event_get info field. */
287 };
288
289 struct ib_ucm_sidr_req_event_resp {
290         __u16 pkey;
291         __u8  port;
292         __u8  reserved;
293 };
294
295 struct ib_ucm_sidr_rep_event_resp {
296         __u32 status;
297         __u32 qkey;
298         __u32 qpn;
299         /* info in ib_ucm_event_get info field. */
300 };
301
302 #define IB_UCM_PRES_DATA      0x01
303 #define IB_UCM_PRES_INFO      0x02
304 #define IB_UCM_PRES_PRIMARY   0x04
305 #define IB_UCM_PRES_ALTERNATE 0x08
306
307 struct ib_ucm_event_resp {
308         __u64 uid;
309         __u32 id;
310         __u32 event;
311         __u32 present;
312         __u32 reserved;
313         union {
314                 struct ib_ucm_req_event_resp req_resp;
315                 struct ib_ucm_rep_event_resp rep_resp;
316                 struct ib_ucm_rej_event_resp rej_resp;
317                 struct ib_ucm_mra_event_resp mra_resp;
318                 struct ib_ucm_lap_event_resp lap_resp;
319                 struct ib_ucm_apr_event_resp apr_resp;
320
321                 struct ib_ucm_sidr_req_event_resp sidr_req_resp;
322                 struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
323
324                 __u32                             send_status;
325         } u;
326 };
327
328 #endif /* IB_USER_CM_H */