diff options
Diffstat (limited to 'include/rdma/ib_user_verbs.h')
-rw-r--r-- | include/rdma/ib_user_verbs.h | 229 |
1 files changed, 181 insertions, 48 deletions
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index fd85725391a4..5ff1490c08db 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 4 |
46 | 47 | ||
47 | enum { | 48 | enum { |
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 | ||
97 | struct ib_uverbs_async_event_desc { | 99 | struct 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 | */ | ||
125 | struct ib_uverbs_query_params { | ||
126 | __u64 response; | ||
127 | }; | ||
128 | |||
129 | struct ib_uverbs_query_params_resp { | ||
130 | __u32 num_cq_events; | ||
131 | }; | ||
132 | |||
133 | struct ib_uverbs_get_context { | 123 | struct 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 | ||
139 | struct ib_uverbs_get_context_resp { | 128 | struct 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 | ||
144 | struct ib_uverbs_query_device { | 133 | struct 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 | ||
223 | struct 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 | |||
231 | struct ib_uverbs_query_gid_resp { | ||
232 | __u8 gid[16]; | ||
233 | }; | ||
234 | |||
235 | struct 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 | |||
243 | struct ib_uverbs_query_pkey_resp { | ||
244 | __u16 pkey; | ||
245 | __u16 reserved; | ||
246 | }; | ||
247 | |||
248 | struct ib_uverbs_alloc_pd { | 212 | struct 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 | ||
245 | struct ib_uverbs_create_comp_channel { | ||
246 | __u64 response; | ||
247 | }; | ||
248 | |||
249 | struct ib_uverbs_create_comp_channel_resp { | ||
250 | __u32 fd; | ||
251 | }; | ||
252 | |||
281 | struct ib_uverbs_create_cq { | 253 | struct 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 | ||
268 | struct ib_uverbs_poll_cq { | ||
269 | __u64 response; | ||
270 | __u32 cq_handle; | ||
271 | __u32 ne; | ||
272 | }; | ||
273 | |||
274 | struct 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 | |||
292 | struct ib_uverbs_poll_cq_resp { | ||
293 | __u32 count; | ||
294 | __u32 reserved; | ||
295 | struct ib_uverbs_wc wc[0]; | ||
296 | }; | ||
297 | |||
298 | struct ib_uverbs_req_notify_cq { | ||
299 | __u32 cq_handle; | ||
300 | __u32 solicited_only; | ||
301 | }; | ||
302 | |||
294 | struct ib_uverbs_destroy_cq { | 303 | struct ib_uverbs_destroy_cq { |
295 | __u64 response; | 304 | __u64 response; |
296 | __u32 cq_handle; | 305 | __u32 cq_handle; |
@@ -324,6 +333,11 @@ struct ib_uverbs_create_qp { | |||
324 | struct ib_uverbs_create_qp_resp { | 333 | struct ib_uverbs_create_qp_resp { |
325 | __u32 qp_handle; | 334 | __u32 qp_handle; |
326 | __u32 qpn; | 335 | __u32 qpn; |
336 | __u32 max_send_wr; | ||
337 | __u32 max_recv_wr; | ||
338 | __u32 max_send_sge; | ||
339 | __u32 max_recv_sge; | ||
340 | __u32 max_inline_data; | ||
327 | }; | 341 | }; |
328 | 342 | ||
329 | /* | 343 | /* |
@@ -388,6 +402,127 @@ struct ib_uverbs_destroy_qp_resp { | |||
388 | __u32 events_reported; | 402 | __u32 events_reported; |
389 | }; | 403 | }; |
390 | 404 | ||
405 | /* | ||
406 | * The ib_uverbs_sge structure isn't used anywhere, since we assume | ||
407 | * the ib_sge structure is packed the same way on 32-bit and 64-bit | ||
408 | * architectures in both kernel and user space. It's just here to | ||
409 | * document the ABI. | ||
410 | */ | ||
411 | struct ib_uverbs_sge { | ||
412 | __u64 addr; | ||
413 | __u32 length; | ||
414 | __u32 lkey; | ||
415 | }; | ||
416 | |||
417 | struct ib_uverbs_send_wr { | ||
418 | __u64 wr_id; | ||
419 | __u32 num_sge; | ||
420 | __u32 opcode; | ||
421 | __u32 send_flags; | ||
422 | __u32 imm_data; | ||
423 | union { | ||
424 | struct { | ||
425 | __u64 remote_addr; | ||
426 | __u32 rkey; | ||
427 | __u32 reserved; | ||
428 | } rdma; | ||
429 | struct { | ||
430 | __u64 remote_addr; | ||
431 | __u64 compare_add; | ||
432 | __u64 swap; | ||
433 | __u32 rkey; | ||
434 | __u32 reserved; | ||
435 | } atomic; | ||
436 | struct { | ||
437 | __u32 ah; | ||
438 | __u32 remote_qpn; | ||
439 | __u32 remote_qkey; | ||
440 | __u32 reserved; | ||
441 | } ud; | ||
442 | } wr; | ||
443 | }; | ||
444 | |||
445 | struct ib_uverbs_post_send { | ||
446 | __u64 response; | ||
447 | __u32 qp_handle; | ||
448 | __u32 wr_count; | ||
449 | __u32 sge_count; | ||
450 | __u32 wqe_size; | ||
451 | struct ib_uverbs_send_wr send_wr[0]; | ||
452 | }; | ||
453 | |||
454 | struct ib_uverbs_post_send_resp { | ||
455 | __u32 bad_wr; | ||
456 | }; | ||
457 | |||
458 | struct ib_uverbs_recv_wr { | ||
459 | __u64 wr_id; | ||
460 | __u32 num_sge; | ||
461 | __u32 reserved; | ||
462 | }; | ||
463 | |||
464 | struct ib_uverbs_post_recv { | ||
465 | __u64 response; | ||
466 | __u32 qp_handle; | ||
467 | __u32 wr_count; | ||
468 | __u32 sge_count; | ||
469 | __u32 wqe_size; | ||
470 | struct ib_uverbs_recv_wr recv_wr[0]; | ||
471 | }; | ||
472 | |||
473 | struct ib_uverbs_post_recv_resp { | ||
474 | __u32 bad_wr; | ||
475 | }; | ||
476 | |||
477 | struct ib_uverbs_post_srq_recv { | ||
478 | __u64 response; | ||
479 | __u32 srq_handle; | ||
480 | __u32 wr_count; | ||
481 | __u32 sge_count; | ||
482 | __u32 wqe_size; | ||
483 | struct ib_uverbs_recv_wr recv[0]; | ||
484 | }; | ||
485 | |||
486 | struct ib_uverbs_post_srq_recv_resp { | ||
487 | __u32 bad_wr; | ||
488 | }; | ||
489 | |||
490 | struct ib_uverbs_global_route { | ||
491 | __u8 dgid[16]; | ||
492 | __u32 flow_label; | ||
493 | __u8 sgid_index; | ||
494 | __u8 hop_limit; | ||
495 | __u8 traffic_class; | ||
496 | __u8 reserved; | ||
497 | }; | ||
498 | |||
499 | struct ib_uverbs_ah_attr { | ||
500 | struct ib_uverbs_global_route grh; | ||
501 | __u16 dlid; | ||
502 | __u8 sl; | ||
503 | __u8 src_path_bits; | ||
504 | __u8 static_rate; | ||
505 | __u8 is_global; | ||
506 | __u8 port_num; | ||
507 | __u8 reserved; | ||
508 | }; | ||
509 | |||
510 | struct ib_uverbs_create_ah { | ||
511 | __u64 response; | ||
512 | __u64 user_handle; | ||
513 | __u32 pd_handle; | ||
514 | __u32 reserved; | ||
515 | struct ib_uverbs_ah_attr attr; | ||
516 | }; | ||
517 | |||
518 | struct ib_uverbs_create_ah_resp { | ||
519 | __u32 ah_handle; | ||
520 | }; | ||
521 | |||
522 | struct ib_uverbs_destroy_ah { | ||
523 | __u32 ah_handle; | ||
524 | }; | ||
525 | |||
391 | struct ib_uverbs_attach_mcast { | 526 | struct ib_uverbs_attach_mcast { |
392 | __u8 gid[16]; | 527 | __u8 gid[16]; |
393 | __u32 qp_handle; | 528 | __u32 qp_handle; |
@@ -422,9 +557,7 @@ struct ib_uverbs_modify_srq { | |||
422 | __u32 srq_handle; | 557 | __u32 srq_handle; |
423 | __u32 attr_mask; | 558 | __u32 attr_mask; |
424 | __u32 max_wr; | 559 | __u32 max_wr; |
425 | __u32 max_sge; | ||
426 | __u32 srq_limit; | 560 | __u32 srq_limit; |
427 | __u32 reserved; | ||
428 | __u64 driver_data[0]; | 561 | __u64 driver_data[0]; |
429 | }; | 562 | }; |
430 | 563 | ||