• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef RDMA_USER_CM_H
20 #define RDMA_USER_CM_H
21 #include <linux/types.h>
22 #include <linux/socket.h>
23 #include <linux/in6.h>
24 #include <rdma/ib_user_verbs.h>
25 #include <rdma/ib_user_sa.h>
26 #define RDMA_USER_CM_ABI_VERSION 4
27 #define RDMA_MAX_PRIVATE_DATA 256
28 enum {
29   RDMA_USER_CM_CMD_CREATE_ID,
30   RDMA_USER_CM_CMD_DESTROY_ID,
31   RDMA_USER_CM_CMD_BIND_IP,
32   RDMA_USER_CM_CMD_RESOLVE_IP,
33   RDMA_USER_CM_CMD_RESOLVE_ROUTE,
34   RDMA_USER_CM_CMD_QUERY_ROUTE,
35   RDMA_USER_CM_CMD_CONNECT,
36   RDMA_USER_CM_CMD_LISTEN,
37   RDMA_USER_CM_CMD_ACCEPT,
38   RDMA_USER_CM_CMD_REJECT,
39   RDMA_USER_CM_CMD_DISCONNECT,
40   RDMA_USER_CM_CMD_INIT_QP_ATTR,
41   RDMA_USER_CM_CMD_GET_EVENT,
42   RDMA_USER_CM_CMD_GET_OPTION,
43   RDMA_USER_CM_CMD_SET_OPTION,
44   RDMA_USER_CM_CMD_NOTIFY,
45   RDMA_USER_CM_CMD_JOIN_IP_MCAST,
46   RDMA_USER_CM_CMD_LEAVE_MCAST,
47   RDMA_USER_CM_CMD_MIGRATE_ID,
48   RDMA_USER_CM_CMD_QUERY,
49   RDMA_USER_CM_CMD_BIND,
50   RDMA_USER_CM_CMD_RESOLVE_ADDR,
51   RDMA_USER_CM_CMD_JOIN_MCAST
52 };
53 enum rdma_ucm_port_space {
54   RDMA_PS_IPOIB = 0x0002,
55   RDMA_PS_IB = 0x013F,
56   RDMA_PS_TCP = 0x0106,
57   RDMA_PS_UDP = 0x0111,
58 };
59 struct rdma_ucm_cmd_hdr {
60   __u32 cmd;
61   __u16 in;
62   __u16 out;
63 };
64 struct rdma_ucm_create_id {
65   __aligned_u64 uid;
66   __aligned_u64 response;
67   __u16 ps;
68   __u8 qp_type;
69   __u8 reserved[5];
70 };
71 struct rdma_ucm_create_id_resp {
72   __u32 id;
73 };
74 struct rdma_ucm_destroy_id {
75   __aligned_u64 response;
76   __u32 id;
77   __u32 reserved;
78 };
79 struct rdma_ucm_destroy_id_resp {
80   __u32 events_reported;
81 };
82 struct rdma_ucm_bind_ip {
83   __aligned_u64 response;
84   struct sockaddr_in6 addr;
85   __u32 id;
86 };
87 struct rdma_ucm_bind {
88   __u32 id;
89   __u16 addr_size;
90   __u16 reserved;
91   struct sockaddr_storage addr;
92 };
93 struct rdma_ucm_resolve_ip {
94   struct sockaddr_in6 src_addr;
95   struct sockaddr_in6 dst_addr;
96   __u32 id;
97   __u32 timeout_ms;
98 };
99 struct rdma_ucm_resolve_addr {
100   __u32 id;
101   __u32 timeout_ms;
102   __u16 src_size;
103   __u16 dst_size;
104   __u32 reserved;
105   struct sockaddr_storage src_addr;
106   struct sockaddr_storage dst_addr;
107 };
108 struct rdma_ucm_resolve_route {
109   __u32 id;
110   __u32 timeout_ms;
111 };
112 enum {
113   RDMA_USER_CM_QUERY_ADDR,
114   RDMA_USER_CM_QUERY_PATH,
115   RDMA_USER_CM_QUERY_GID
116 };
117 struct rdma_ucm_query {
118   __aligned_u64 response;
119   __u32 id;
120   __u32 option;
121 };
122 struct rdma_ucm_query_route_resp {
123   __aligned_u64 node_guid;
124   struct ib_user_path_rec ib_route[2];
125   struct sockaddr_in6 src_addr;
126   struct sockaddr_in6 dst_addr;
127   __u32 num_paths;
128   __u8 port_num;
129   __u8 reserved[3];
130   __u32 ibdev_index;
131   __u32 reserved1;
132 };
133 struct rdma_ucm_query_addr_resp {
134   __aligned_u64 node_guid;
135   __u8 port_num;
136   __u8 reserved;
137   __u16 pkey;
138   __u16 src_size;
139   __u16 dst_size;
140   struct sockaddr_storage src_addr;
141   struct sockaddr_storage dst_addr;
142   __u32 ibdev_index;
143   __u32 reserved1;
144 };
145 struct rdma_ucm_query_path_resp {
146   __u32 num_paths;
147   __u32 reserved;
148   struct ib_path_rec_data path_data[0];
149 };
150 struct rdma_ucm_conn_param {
151   __u32 qp_num;
152   __u32 qkey;
153   __u8 private_data[RDMA_MAX_PRIVATE_DATA];
154   __u8 private_data_len;
155   __u8 srq;
156   __u8 responder_resources;
157   __u8 initiator_depth;
158   __u8 flow_control;
159   __u8 retry_count;
160   __u8 rnr_retry_count;
161   __u8 valid;
162 };
163 struct rdma_ucm_ud_param {
164   __u32 qp_num;
165   __u32 qkey;
166   struct ib_uverbs_ah_attr ah_attr;
167   __u8 private_data[RDMA_MAX_PRIVATE_DATA];
168   __u8 private_data_len;
169   __u8 reserved[7];
170 };
171 struct rdma_ucm_ece {
172   __u32 vendor_id;
173   __u32 attr_mod;
174 };
175 struct rdma_ucm_connect {
176   struct rdma_ucm_conn_param conn_param;
177   __u32 id;
178   __u32 reserved;
179   struct rdma_ucm_ece ece;
180 };
181 struct rdma_ucm_listen {
182   __u32 id;
183   __u32 backlog;
184 };
185 struct rdma_ucm_accept {
186   __aligned_u64 uid;
187   struct rdma_ucm_conn_param conn_param;
188   __u32 id;
189   __u32 reserved;
190   struct rdma_ucm_ece ece;
191 };
192 struct rdma_ucm_reject {
193   __u32 id;
194   __u8 private_data_len;
195   __u8 reason;
196   __u8 reserved[2];
197   __u8 private_data[RDMA_MAX_PRIVATE_DATA];
198 };
199 struct rdma_ucm_disconnect {
200   __u32 id;
201 };
202 struct rdma_ucm_init_qp_attr {
203   __aligned_u64 response;
204   __u32 id;
205   __u32 qp_state;
206 };
207 struct rdma_ucm_notify {
208   __u32 id;
209   __u32 event;
210 };
211 struct rdma_ucm_join_ip_mcast {
212   __aligned_u64 response;
213   __aligned_u64 uid;
214   struct sockaddr_in6 addr;
215   __u32 id;
216 };
217 enum {
218   RDMA_MC_JOIN_FLAG_FULLMEMBER,
219   RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
220   RDMA_MC_JOIN_FLAG_RESERVED,
221 };
222 struct rdma_ucm_join_mcast {
223   __aligned_u64 response;
224   __aligned_u64 uid;
225   __u32 id;
226   __u16 addr_size;
227   __u16 join_flags;
228   struct sockaddr_storage addr;
229 };
230 struct rdma_ucm_get_event {
231   __aligned_u64 response;
232 };
233 struct rdma_ucm_event_resp {
234   __aligned_u64 uid;
235   __u32 id;
236   __u32 event;
237   __u32 status;
238   union {
239     struct rdma_ucm_conn_param conn;
240     struct rdma_ucm_ud_param ud;
241   } param;
242   __u32 reserved;
243   struct rdma_ucm_ece ece;
244 };
245 enum {
246   RDMA_OPTION_ID = 0,
247   RDMA_OPTION_IB = 1
248 };
249 enum {
250   RDMA_OPTION_ID_TOS = 0,
251   RDMA_OPTION_ID_REUSEADDR = 1,
252   RDMA_OPTION_ID_AFONLY = 2,
253   RDMA_OPTION_ID_ACK_TIMEOUT = 3
254 };
255 enum {
256   RDMA_OPTION_IB_PATH = 1
257 };
258 struct rdma_ucm_set_option {
259   __aligned_u64 optval;
260   __u32 id;
261   __u32 level;
262   __u32 optname;
263   __u32 optlen;
264 };
265 struct rdma_ucm_migrate_id {
266   __aligned_u64 response;
267   __u32 id;
268   __u32 fd;
269 };
270 struct rdma_ucm_migrate_resp {
271   __u32 events_reported;
272 };
273 #endif
274