aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_user_verbs.h
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-10-14 18:21:44 -0400
committerRoland Dreier <rolandd@cisco.com>2005-10-17 18:20:30 -0400
commit91ecd4ae178bed83da4f6a94ced7992e4d7711eb (patch)
treebb1758547300968ceb47cc929c9c50b96060c759 /include/rdma/ib_user_verbs.h
parent883a99c7024c5763d6d4f22d9239c133893e8d74 (diff)
[IB] uverbs: Add ABI structures for more commands
Add kernel/user ABI structures for marshalling poll CQ, request CQ notification, post send, post receive, post SRQ receive, create AH and destroy AH commands. These commands allow us to support userspace verbs for devices that can't perform these operations directly from userspace (eg the PathScale HCA). Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/rdma/ib_user_verbs.h')
-rw-r--r--include/rdma/ib_user_verbs.h164
1 files changed, 162 insertions, 2 deletions
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index 0532b78200ca..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
@@ -88,8 +89,11 @@ enum {
88 * 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
89 * 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
90 * avoid incompatibility between 32-bit userspace and 64-bit kernels). 91 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
91 * In particular do not use pointer types -- pass pointers in __u64 92 * Specifically:
92 * 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.
93 */ 97 */
94 98
95struct ib_uverbs_async_event_desc { 99struct ib_uverbs_async_event_desc {
@@ -261,6 +265,41 @@ struct ib_uverbs_create_cq_resp {
261 __u32 cqe; 265 __u32 cqe;
262}; 266};
263 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
264struct ib_uverbs_destroy_cq { 303struct ib_uverbs_destroy_cq {
265 __u64 response; 304 __u64 response;
266 __u32 cq_handle; 305 __u32 cq_handle;
@@ -358,6 +397,127 @@ struct ib_uverbs_destroy_qp_resp {
358 __u32 events_reported; 397 __u32 events_reported;
359}; 398};
360 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
361struct ib_uverbs_attach_mcast { 521struct ib_uverbs_attach_mcast {
362 __u8 gid[16]; 522 __u8 gid[16];
363 __u32 qp_handle; 523 __u32 qp_handle;