xref: /freebsd/sys/ofed/include/uapi/rdma/mlx4-abi.h (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3  *
4  * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
5  * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved.
6  *
7  * This software is available to you under a choice of one of two
8  * licenses.  You may choose to be licensed under the terms of the GNU
9  * General Public License (GPL) Version 2, available from the file
10  * COPYING in the main directory of this source tree, or the
11  * OpenIB.org BSD license below:
12  *
13  *     Redistribution and use in source and binary forms, with or
14  *     without modification, are permitted provided that the following
15  *     conditions are met:
16  *
17  *      - Redistributions of source code must retain the above
18  *        copyright notice, this list of conditions and the following
19  *        disclaimer.
20  *
21  *      - Redistributions in binary form must reproduce the above
22  *        copyright notice, this list of conditions and the following
23  *        disclaimer in the documentation and/or other materials
24  *        provided with the distribution.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
30  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
31  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33  * SOFTWARE.
34  */
35 
36 #ifndef MLX4_ABI_USER_H
37 #define MLX4_ABI_USER_H
38 
39 #ifdef _KERNEL
40 #include <linux/types.h>
41 #else
42 #include <infiniband/types.h>
43 #endif
44 
45 /*
46  * Increment this value if any changes that break userspace ABI
47  * compatibility are made.
48  */
49 
50 #define MLX4_IB_UVERBS_NO_DEV_CAPS_ABI_VERSION	3
51 #define MLX4_IB_UVERBS_ABI_VERSION		4
52 
53 /*
54  * Make sure that all structs defined in this file remain laid out so
55  * that they pack the same way on 32-bit and 64-bit architectures (to
56  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
57  * In particular do not use pointer types -- pass pointers in __u64
58  * instead.
59  */
60 
61 struct mlx4_ib_alloc_ucontext_resp_v3 {
62 	__u32	qp_tab_size;
63 	__u16	bf_reg_size;
64 	__u16	bf_regs_per_page;
65 };
66 
67 struct mlx4_ib_alloc_ucontext_resp {
68 	__u32	dev_caps;
69 	__u32	qp_tab_size;
70 	__u16	bf_reg_size;
71 	__u16	bf_regs_per_page;
72 	__u32	cqe_size;
73 };
74 
75 struct mlx4_ib_alloc_pd_resp {
76 	__u32	pdn;
77 	__u32	reserved;
78 };
79 
80 struct mlx4_ib_create_cq {
81 	__u64	buf_addr;
82 	__u64	db_addr;
83 };
84 
85 struct mlx4_ib_create_cq_resp {
86 	__u32	cqn;
87 	__u32	reserved;
88 };
89 
90 struct mlx4_ib_resize_cq {
91 	__u64	buf_addr;
92 };
93 
94 struct mlx4_ib_create_srq {
95 	__u64	buf_addr;
96 	__u64	db_addr;
97 };
98 
99 struct mlx4_ib_create_srq_resp {
100 	__u32	srqn;
101 	__u32	reserved;
102 };
103 
104 struct mlx4_ib_create_qp {
105 	__u64	buf_addr;
106 	__u64	db_addr;
107 	__u8	log_sq_bb_count;
108 	__u8	log_sq_stride;
109 	__u8	sq_no_prefetch;
110 	__u8	reserved[5];
111 };
112 
113 #endif /* MLX4_ABI_USER_H */
114