aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_user_verbs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/ib_user_verbs.h')
-rw-r--r--include/rdma/ib_user_verbs.h222
1 files changed, 176 insertions, 46 deletions
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index fd85725391a4..072f3a2edace 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (c) 2005 Topspin Communications. All rights reserved. 2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Cisco Systems. All rights reserved. 3 * Copyright (c) 2005 Cisco Systems. All rights reserved.
4 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
4 * 5 *
5 * This software is available to you under a choice of one of two 6 * 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 * licenses. You may choose to be licensed under the terms of the GNU
@@ -42,15 +43,12 @@
42 * Increment this value if any changes that break userspace ABI 43 * Increment this value if any changes that break userspace ABI
43 * compatibility are made. 44 * compatibility are made.
44 */ 45 */
45#define IB_USER_VERBS_ABI_VERSION 2 46#define IB_USER_VERBS_ABI_VERSION 3
46 47
47enum { 48enum {
48 IB_USER_VERBS_CMD_QUERY_PARAMS,
49 IB_USER_VERBS_CMD_GET_CONTEXT, 49 IB_USER_VERBS_CMD_GET_CONTEXT,
50 IB_USER_VERBS_CMD_QUERY_DEVICE, 50 IB_USER_VERBS_CMD_QUERY_DEVICE,
51 IB_USER_VERBS_CMD_QUERY_PORT, 51 IB_USER_VERBS_CMD_QUERY_PORT,
52 IB_USER_VERBS_CMD_QUERY_GID,
53 IB_USER_VERBS_CMD_QUERY_PKEY,
54 IB_USER_VERBS_CMD_ALLOC_PD, 52 IB_USER_VERBS_CMD_ALLOC_PD,
55 IB_USER_VERBS_CMD_DEALLOC_PD, 53 IB_USER_VERBS_CMD_DEALLOC_PD,
56 IB_USER_VERBS_CMD_CREATE_AH, 54 IB_USER_VERBS_CMD_CREATE_AH,
@@ -65,6 +63,7 @@ enum {
65 IB_USER_VERBS_CMD_ALLOC_MW, 63 IB_USER_VERBS_CMD_ALLOC_MW,
66 IB_USER_VERBS_CMD_BIND_MW, 64 IB_USER_VERBS_CMD_BIND_MW,
67 IB_USER_VERBS_CMD_DEALLOC_MW, 65 IB_USER_VERBS_CMD_DEALLOC_MW,
66 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
68 IB_USER_VERBS_CMD_CREATE_CQ, 67 IB_USER_VERBS_CMD_CREATE_CQ,
69 IB_USER_VERBS_CMD_RESIZE_CQ, 68 IB_USER_VERBS_CMD_RESIZE_CQ,
70 IB_USER_VERBS_CMD_DESTROY_CQ, 69 IB_USER_VERBS_CMD_DESTROY_CQ,
@@ -90,8 +89,11 @@ enum {
90 * Make sure that all structs defined in this file remain laid out so 89 * Make sure that all structs defined in this file remain laid out so
91 * that they pack the same way on 32-bit and 64-bit architectures (to 90 * that they pack the same way on 32-bit and 64-bit architectures (to
92 * avoid incompatibility between 32-bit userspace and 64-bit kernels). 91 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
93 * In particular do not use pointer types -- pass pointers in __u64 92 * Specifically:
94 * instead. 93 * - Do not use pointer types -- pass pointers in __u64 instead.
94 * - Make sure that any structure larger than 4 bytes is padded to a
95 * multiple of 8 bytes. Otherwise the structure size will be
96 * different between 32-bit and 64-bit architectures.
95 */ 97 */
96 98
97struct ib_uverbs_async_event_desc { 99struct ib_uverbs_async_event_desc {
@@ -118,27 +120,14 @@ struct ib_uverbs_cmd_hdr {
118 __u16 out_words; 120 __u16 out_words;
119}; 121};
120 122
121/*
122 * No driver_data for "query params" command, since this is intended
123 * to be a core function with no possible device dependence.
124 */
125struct ib_uverbs_query_params {
126 __u64 response;
127};
128
129struct ib_uverbs_query_params_resp {
130 __u32 num_cq_events;
131};
132
133struct ib_uverbs_get_context { 123struct ib_uverbs_get_context {
134 __u64 response; 124 __u64 response;
135 __u64 cq_fd_tab;
136 __u64 driver_data[0]; 125 __u64 driver_data[0];
137}; 126};
138 127
139struct ib_uverbs_get_context_resp { 128struct ib_uverbs_get_context_resp {
140 __u32 async_fd; 129 __u32 async_fd;
141 __u32 reserved; 130 __u32 num_comp_vectors;
142}; 131};
143 132
144struct ib_uverbs_query_device { 133struct ib_uverbs_query_device {
@@ -220,31 +209,6 @@ struct ib_uverbs_query_port_resp {
220 __u8 reserved[3]; 209 __u8 reserved[3];
221}; 210};
222 211
223struct ib_uverbs_query_gid {
224 __u64 response;
225 __u8 port_num;
226 __u8 index;
227 __u8 reserved[6];
228 __u64 driver_data[0];
229};
230
231struct ib_uverbs_query_gid_resp {
232 __u8 gid[16];
233};
234
235struct ib_uverbs_query_pkey {
236 __u64 response;
237 __u8 port_num;
238 __u8 index;
239 __u8 reserved[6];
240 __u64 driver_data[0];
241};
242
243struct ib_uverbs_query_pkey_resp {
244 __u16 pkey;
245 __u16 reserved;
246};
247
248struct ib_uverbs_alloc_pd { 212struct ib_uverbs_alloc_pd {
249 __u64 response; 213 __u64 response;
250 __u64 driver_data[0]; 214 __u64 driver_data[0];
@@ -278,11 +242,21 @@ struct ib_uverbs_dereg_mr {
278 __u32 mr_handle; 242 __u32 mr_handle;
279}; 243};
280 244
245struct ib_uverbs_create_comp_channel {
246 __u64 response;
247};
248
249struct ib_uverbs_create_comp_channel_resp {
250 __u32 fd;
251};
252
281struct ib_uverbs_create_cq { 253struct ib_uverbs_create_cq {
282 __u64 response; 254 __u64 response;
283 __u64 user_handle; 255 __u64 user_handle;
284 __u32 cqe; 256 __u32 cqe;
285 __u32 event_handler; 257 __u32 comp_vector;
258 __s32 comp_channel;
259 __u32 reserved;
286 __u64 driver_data[0]; 260 __u64 driver_data[0];
287}; 261};
288 262
@@ -291,6 +265,41 @@ struct ib_uverbs_create_cq_resp {
291 __u32 cqe; 265 __u32 cqe;
292}; 266};
293 267
268struct ib_uverbs_poll_cq {
269 __u64 response;
270 __u32 cq_handle;
271 __u32 ne;
272};
273
274struct ib_uverbs_wc {
275 __u64 wr_id;
276 __u32 status;
277 __u32 opcode;
278 __u32 vendor_err;
279 __u32 byte_len;
280 __u32 imm_data;
281 __u32 qp_num;
282 __u32 src_qp;
283 __u32 wc_flags;
284 __u16 pkey_index;
285 __u16 slid;
286 __u8 sl;
287 __u8 dlid_path_bits;
288 __u8 port_num;
289 __u8 reserved;
290};
291
292struct ib_uverbs_poll_cq_resp {
293 __u32 count;
294 __u32 reserved;
295 struct ib_uverbs_wc wc[0];
296};
297
298struct ib_uverbs_req_notify_cq {
299 __u32 cq_handle;
300 __u32 solicited_only;
301};
302
294struct ib_uverbs_destroy_cq { 303struct ib_uverbs_destroy_cq {
295 __u64 response; 304 __u64 response;
296 __u32 cq_handle; 305 __u32 cq_handle;
@@ -388,6 +397,127 @@ struct ib_uverbs_destroy_qp_resp {
388 __u32 events_reported; 397 __u32 events_reported;
389}; 398};
390 399
400/*
401 * The ib_uverbs_sge structure isn't used anywhere, since we assume
402 * the ib_sge structure is packed the same way on 32-bit and 64-bit
403 * architectures in both kernel and user space. It's just here to
404 * document the ABI.
405 */
406struct ib_uverbs_sge {
407 __u64 addr;
408 __u32 length;
409 __u32 lkey;
410};
411
412struct ib_uverbs_send_wr {
413 __u64 wr_id;
414 __u32 num_sge;
415 __u32 opcode;
416 __u32 send_flags;
417 __u32 imm_data;
418 union {
419 struct {
420 __u64 remote_addr;
421 __u32 rkey;
422 __u32 reserved;
423 } rdma;
424 struct {
425 __u64 remote_addr;
426 __u64 compare_add;
427 __u64 swap;
428 __u32 rkey;
429 __u32 reserved;
430 } atomic;
431 struct {
432 __u32 ah;
433 __u32 remote_qpn;
434 __u32 remote_qkey;
435 __u32 reserved;
436 } ud;
437 } wr;
438};
439
440struct ib_uverbs_post_send {
441 __u64 response;
442 __u32 qp_handle;
443 __u32 wr_count;
444 __u32 sge_count;
445 __u32 wqe_size;
446 struct ib_uverbs_send_wr send_wr[0];
447};
448
449struct ib_uverbs_post_send_resp {
450 __u32 bad_wr;
451};
452
453struct ib_uverbs_recv_wr {
454 __u64 wr_id;
455 __u32 num_sge;
456 __u32 reserved;
457};
458
459struct ib_uverbs_post_recv {
460 __u64 response;
461 __u32 qp_handle;
462 __u32 wr_count;
463 __u32 sge_count;
464 __u32 wqe_size;
465 struct ib_uverbs_recv_wr recv_wr[0];
466};
467
468struct ib_uverbs_post_recv_resp {
469 __u32 bad_wr;
470};
471
472struct ib_uverbs_post_srq_recv {
473 __u64 response;
474 __u32 srq_handle;
475 __u32 wr_count;
476 __u32 sge_count;
477 __u32 wqe_size;
478 struct ib_uverbs_recv_wr recv[0];
479};
480
481struct ib_uverbs_post_srq_recv_resp {
482 __u32 bad_wr;
483};
484
485struct ib_uverbs_global_route {
486 __u8 dgid[16];
487 __u32 flow_label;
488 __u8 sgid_index;
489 __u8 hop_limit;
490 __u8 traffic_class;
491 __u8 reserved;
492};
493
494struct ib_uverbs_ah_attr {
495 struct ib_uverbs_global_route grh;
496 __u16 dlid;
497 __u8 sl;
498 __u8 src_path_bits;
499 __u8 static_rate;
500 __u8 is_global;
501 __u8 port_num;
502 __u8 reserved;
503};
504
505struct ib_uverbs_create_ah {
506 __u64 response;
507 __u64 user_handle;
508 __u32 pd_handle;
509 __u32 reserved;
510 struct ib_uverbs_ah_attr attr;
511};
512
513struct ib_uverbs_create_ah_resp {
514 __u32 ah_handle;
515};
516
517struct ib_uverbs_destroy_ah {
518 __u32 ah_handle;
519};
520
391struct ib_uverbs_attach_mcast { 521struct ib_uverbs_attach_mcast {
392 __u8 gid[16]; 522 __u8 gid[16];
393 __u32 qp_handle; 523 __u32 qp_handle;