xref: /openbmc/linux/include/uapi/rdma/mthca-abi.h (revision c74a7469f97c0f40b46e82ee979f9fb1bb6e847c)
1*d50e14abSJason Gunthorpe /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2486f6095SLeon Romanovsky /*
3486f6095SLeon Romanovsky  * Copyright (c) 2005 Topspin Communications.  All rights reserved.
4486f6095SLeon Romanovsky  * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
5486f6095SLeon Romanovsky  *
6486f6095SLeon Romanovsky  * This software is available to you under a choice of one of two
7486f6095SLeon Romanovsky  * licenses.  You may choose to be licensed under the terms of the GNU
8486f6095SLeon Romanovsky  * General Public License (GPL) Version 2, available from the file
9486f6095SLeon Romanovsky  * COPYING in the main directory of this source tree, or the
10486f6095SLeon Romanovsky  * OpenIB.org BSD license below:
11486f6095SLeon Romanovsky  *
12486f6095SLeon Romanovsky  *     Redistribution and use in source and binary forms, with or
13486f6095SLeon Romanovsky  *     without modification, are permitted provided that the following
14486f6095SLeon Romanovsky  *     conditions are met:
15486f6095SLeon Romanovsky  *
16486f6095SLeon Romanovsky  *      - Redistributions of source code must retain the above
17486f6095SLeon Romanovsky  *        copyright notice, this list of conditions and the following
18486f6095SLeon Romanovsky  *        disclaimer.
19486f6095SLeon Romanovsky  *
20486f6095SLeon Romanovsky  *      - Redistributions in binary form must reproduce the above
21486f6095SLeon Romanovsky  *        copyright notice, this list of conditions and the following
22486f6095SLeon Romanovsky  *        disclaimer in the documentation and/or other materials
23486f6095SLeon Romanovsky  *        provided with the distribution.
24486f6095SLeon Romanovsky  *
25486f6095SLeon Romanovsky  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26486f6095SLeon Romanovsky  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27486f6095SLeon Romanovsky  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28486f6095SLeon Romanovsky  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29486f6095SLeon Romanovsky  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30486f6095SLeon Romanovsky  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31486f6095SLeon Romanovsky  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32486f6095SLeon Romanovsky  * SOFTWARE.
33486f6095SLeon Romanovsky  */
34486f6095SLeon Romanovsky 
35486f6095SLeon Romanovsky #ifndef MTHCA_ABI_USER_H
36486f6095SLeon Romanovsky #define MTHCA_ABI_USER_H
37486f6095SLeon Romanovsky 
38486f6095SLeon Romanovsky #include <linux/types.h>
39486f6095SLeon Romanovsky 
40486f6095SLeon Romanovsky /*
41486f6095SLeon Romanovsky  * Increment this value if any changes that break userspace ABI
42486f6095SLeon Romanovsky  * compatibility are made.
43486f6095SLeon Romanovsky  */
44486f6095SLeon Romanovsky #define MTHCA_UVERBS_ABI_VERSION	1
45486f6095SLeon Romanovsky 
46486f6095SLeon Romanovsky /*
47486f6095SLeon Romanovsky  * Make sure that all structs defined in this file remain laid out so
48486f6095SLeon Romanovsky  * that they pack the same way on 32-bit and 64-bit architectures (to
49486f6095SLeon Romanovsky  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
50486f6095SLeon Romanovsky  * In particular do not use pointer types -- pass pointers in __u64
51486f6095SLeon Romanovsky  * instead.
52486f6095SLeon Romanovsky  */
53486f6095SLeon Romanovsky struct mthca_alloc_ucontext_resp {
54486f6095SLeon Romanovsky 	__u32 qp_tab_size;
55486f6095SLeon Romanovsky 	__u32 uarc_size;
56486f6095SLeon Romanovsky };
57486f6095SLeon Romanovsky 
58486f6095SLeon Romanovsky struct mthca_alloc_pd_resp {
59486f6095SLeon Romanovsky 	__u32 pdn;
60486f6095SLeon Romanovsky 	__u32 reserved;
61486f6095SLeon Romanovsky };
62486f6095SLeon Romanovsky 
63486f6095SLeon Romanovsky /*
64486f6095SLeon Romanovsky  * Mark the memory region with a DMA attribute that causes
65486f6095SLeon Romanovsky  * in-flight DMA to be flushed when the region is written to:
66486f6095SLeon Romanovsky  */
67486f6095SLeon Romanovsky #define MTHCA_MR_DMASYNC	0x1
68486f6095SLeon Romanovsky 
69486f6095SLeon Romanovsky struct mthca_reg_mr {
70486f6095SLeon Romanovsky 	__u32 mr_attrs;
71486f6095SLeon Romanovsky 	__u32 reserved;
72486f6095SLeon Romanovsky };
73486f6095SLeon Romanovsky 
74486f6095SLeon Romanovsky struct mthca_create_cq {
75486f6095SLeon Romanovsky 	__u32 lkey;
76486f6095SLeon Romanovsky 	__u32 pdn;
7726b99066SJason Gunthorpe 	__aligned_u64 arm_db_page;
7826b99066SJason Gunthorpe 	__aligned_u64 set_db_page;
79486f6095SLeon Romanovsky 	__u32 arm_db_index;
80486f6095SLeon Romanovsky 	__u32 set_db_index;
81486f6095SLeon Romanovsky };
82486f6095SLeon Romanovsky 
83486f6095SLeon Romanovsky struct mthca_create_cq_resp {
84486f6095SLeon Romanovsky 	__u32 cqn;
85486f6095SLeon Romanovsky 	__u32 reserved;
86486f6095SLeon Romanovsky };
87486f6095SLeon Romanovsky 
88486f6095SLeon Romanovsky struct mthca_resize_cq {
89486f6095SLeon Romanovsky 	__u32 lkey;
90486f6095SLeon Romanovsky 	__u32 reserved;
91486f6095SLeon Romanovsky };
92486f6095SLeon Romanovsky 
93486f6095SLeon Romanovsky struct mthca_create_srq {
94486f6095SLeon Romanovsky 	__u32 lkey;
95486f6095SLeon Romanovsky 	__u32 db_index;
9626b99066SJason Gunthorpe 	__aligned_u64 db_page;
97486f6095SLeon Romanovsky };
98486f6095SLeon Romanovsky 
99486f6095SLeon Romanovsky struct mthca_create_srq_resp {
100486f6095SLeon Romanovsky 	__u32 srqn;
101486f6095SLeon Romanovsky 	__u32 reserved;
102486f6095SLeon Romanovsky };
103486f6095SLeon Romanovsky 
104486f6095SLeon Romanovsky struct mthca_create_qp {
105486f6095SLeon Romanovsky 	__u32 lkey;
106486f6095SLeon Romanovsky 	__u32 reserved;
10726b99066SJason Gunthorpe 	__aligned_u64 sq_db_page;
10826b99066SJason Gunthorpe 	__aligned_u64 rq_db_page;
109486f6095SLeon Romanovsky 	__u32 sq_db_index;
110486f6095SLeon Romanovsky 	__u32 rq_db_index;
111486f6095SLeon Romanovsky };
112486f6095SLeon Romanovsky #endif /* MTHCA_ABI_USER_H */
113