blob: 24e0f2e98e6d88adc15f9f1bc0973f65cb84fe4f [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
Christopher Ferris653676d2014-09-18 13:14:58 -070022#include <linux/socket.h>
Christopher Ferris653676d2014-09-18 13:14:58 -070023#include <linux/in6.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#include <rdma/ib_user_verbs.h>
25#include <rdma/ib_user_sa.h>
26#define RDMA_USER_CM_ABI_VERSION 4
Christopher Ferris653676d2014-09-18 13:14:58 -070027#define RDMA_MAX_PRIVATE_DATA 256
Ben Cheng655a7c02013-10-16 16:09:24 -070028enum {
Tao Baod7db5942015-01-28 10:07:51 -080029 RDMA_USER_CM_CMD_CREATE_ID,
30 RDMA_USER_CM_CMD_DESTROY_ID,
Tao Baod7db5942015-01-28 10:07:51 -080031 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,
Tao Baod7db5942015-01-28 10:07:51 -080035 RDMA_USER_CM_CMD_CONNECT,
36 RDMA_USER_CM_CMD_LISTEN,
37 RDMA_USER_CM_CMD_ACCEPT,
38 RDMA_USER_CM_CMD_REJECT,
Tao Baod7db5942015-01-28 10:07:51 -080039 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,
Tao Baod7db5942015-01-28 10:07:51 -080043 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,
Tao Baod7db5942015-01-28 10:07:51 -080047 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,
Tao Baod7db5942015-01-28 10:07:51 -080051 RDMA_USER_CM_CMD_JOIN_MCAST
Ben Cheng655a7c02013-10-16 16:09:24 -070052};
53struct rdma_ucm_cmd_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080054 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u16 in;
56 __u16 out;
Ben Cheng655a7c02013-10-16 16:09:24 -070057};
58struct rdma_ucm_create_id {
Tao Baod7db5942015-01-28 10:07:51 -080059 __u64 uid;
60 __u64 response;
61 __u16 ps;
62 __u8 qp_type;
Tao Baod7db5942015-01-28 10:07:51 -080063 __u8 reserved[5];
Ben Cheng655a7c02013-10-16 16:09:24 -070064};
65struct rdma_ucm_create_id_resp {
Tao Baod7db5942015-01-28 10:07:51 -080066 __u32 id;
Christopher Ferris653676d2014-09-18 13:14:58 -070067};
Ben Cheng655a7c02013-10-16 16:09:24 -070068struct rdma_ucm_destroy_id {
Tao Baod7db5942015-01-28 10:07:51 -080069 __u64 response;
70 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -070072};
73struct rdma_ucm_destroy_id_resp {
Tao Baod7db5942015-01-28 10:07:51 -080074 __u32 events_reported;
Christopher Ferris653676d2014-09-18 13:14:58 -070075};
Christopher Ferris38062f92014-07-09 15:33:25 -070076struct rdma_ucm_bind_ip {
Tao Baod7db5942015-01-28 10:07:51 -080077 __u64 response;
78 struct sockaddr_in6 addr;
Tao Baod7db5942015-01-28 10:07:51 -080079 __u32 id;
Ben Cheng655a7c02013-10-16 16:09:24 -070080};
Christopher Ferris38062f92014-07-09 15:33:25 -070081struct rdma_ucm_bind {
Tao Baod7db5942015-01-28 10:07:51 -080082 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080083 __u16 addr_size;
84 __u16 reserved;
Elliott Hughes64f355f2017-08-30 16:10:24 -070085 struct sockaddr_storage addr;
Christopher Ferris38062f92014-07-09 15:33:25 -070086};
Christopher Ferris653676d2014-09-18 13:14:58 -070087struct rdma_ucm_resolve_ip {
Tao Baod7db5942015-01-28 10:07:51 -080088 struct sockaddr_in6 src_addr;
89 struct sockaddr_in6 dst_addr;
90 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080091 __u32 timeout_ms;
Christopher Ferris38062f92014-07-09 15:33:25 -070092};
93struct rdma_ucm_resolve_addr {
Tao Baod7db5942015-01-28 10:07:51 -080094 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080095 __u32 timeout_ms;
96 __u16 src_size;
97 __u16 dst_size;
98 __u32 reserved;
Elliott Hughes64f355f2017-08-30 16:10:24 -070099 struct sockaddr_storage src_addr;
100 struct sockaddr_storage dst_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700101};
102struct rdma_ucm_resolve_route {
Tao Baod7db5942015-01-28 10:07:51 -0800103 __u32 id;
104 __u32 timeout_ms;
Ben Cheng655a7c02013-10-16 16:09:24 -0700105};
Christopher Ferris38062f92014-07-09 15:33:25 -0700106enum {
Tao Baod7db5942015-01-28 10:07:51 -0800107 RDMA_USER_CM_QUERY_ADDR,
108 RDMA_USER_CM_QUERY_PATH,
109 RDMA_USER_CM_QUERY_GID
Christopher Ferris38062f92014-07-09 15:33:25 -0700110};
Christopher Ferris653676d2014-09-18 13:14:58 -0700111struct rdma_ucm_query {
Tao Baod7db5942015-01-28 10:07:51 -0800112 __u64 response;
113 __u32 id;
114 __u32 option;
Christopher Ferris653676d2014-09-18 13:14:58 -0700115};
Ben Cheng655a7c02013-10-16 16:09:24 -0700116struct rdma_ucm_query_route_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800117 __u64 node_guid;
118 struct ib_user_path_rec ib_route[2];
Tao Baod7db5942015-01-28 10:07:51 -0800119 struct sockaddr_in6 src_addr;
120 struct sockaddr_in6 dst_addr;
121 __u32 num_paths;
122 __u8 port_num;
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u8 reserved[3];
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
Christopher Ferris38062f92014-07-09 15:33:25 -0700125struct rdma_ucm_query_addr_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u64 node_guid;
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u8 port_num;
128 __u8 reserved;
129 __u16 pkey;
130 __u16 src_size;
Tao Baod7db5942015-01-28 10:07:51 -0800131 __u16 dst_size;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700132 struct sockaddr_storage src_addr;
133 struct sockaddr_storage dst_addr;
Christopher Ferris38062f92014-07-09 15:33:25 -0700134};
Christopher Ferris653676d2014-09-18 13:14:58 -0700135struct rdma_ucm_query_path_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u32 num_paths;
137 __u32 reserved;
138 struct ib_path_rec_data path_data[0];
Christopher Ferris653676d2014-09-18 13:14:58 -0700139};
Ben Cheng655a7c02013-10-16 16:09:24 -0700140struct rdma_ucm_conn_param {
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u32 qp_num;
142 __u32 qkey;
Tao Baod7db5942015-01-28 10:07:51 -0800143 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
144 __u8 private_data_len;
145 __u8 srq;
146 __u8 responder_resources;
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u8 initiator_depth;
148 __u8 flow_control;
149 __u8 retry_count;
150 __u8 rnr_retry_count;
Tao Baod7db5942015-01-28 10:07:51 -0800151 __u8 valid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700152};
153struct rdma_ucm_ud_param {
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u32 qp_num;
Tao Baod7db5942015-01-28 10:07:51 -0800155 __u32 qkey;
156 struct ib_uverbs_ah_attr ah_attr;
157 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
158 __u8 private_data_len;
Tao Baod7db5942015-01-28 10:07:51 -0800159 __u8 reserved[7];
Ben Cheng655a7c02013-10-16 16:09:24 -0700160};
161struct rdma_ucm_connect {
Tao Baod7db5942015-01-28 10:07:51 -0800162 struct rdma_ucm_conn_param conn_param;
Tao Baod7db5942015-01-28 10:07:51 -0800163 __u32 id;
164 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -0700165};
166struct rdma_ucm_listen {
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u32 id;
168 __u32 backlog;
Ben Cheng655a7c02013-10-16 16:09:24 -0700169};
170struct rdma_ucm_accept {
Tao Baod7db5942015-01-28 10:07:51 -0800171 __u64 uid;
172 struct rdma_ucm_conn_param conn_param;
173 __u32 id;
174 __u32 reserved;
Christopher Ferris653676d2014-09-18 13:14:58 -0700175};
Ben Cheng655a7c02013-10-16 16:09:24 -0700176struct rdma_ucm_reject {
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 id;
178 __u8 private_data_len;
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u8 reserved[3];
180 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
Ben Cheng655a7c02013-10-16 16:09:24 -0700181};
182struct rdma_ucm_disconnect {
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u32 id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700184};
185struct rdma_ucm_init_qp_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800186 __u64 response;
Tao Baod7db5942015-01-28 10:07:51 -0800187 __u32 id;
188 __u32 qp_state;
Ben Cheng655a7c02013-10-16 16:09:24 -0700189};
190struct rdma_ucm_notify {
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u32 id;
192 __u32 event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700193};
Christopher Ferris38062f92014-07-09 15:33:25 -0700194struct rdma_ucm_join_ip_mcast {
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u64 response;
196 __u64 uid;
197 struct sockaddr_in6 addr;
198 __u32 id;
Christopher Ferris653676d2014-09-18 13:14:58 -0700199};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800200enum {
201 RDMA_MC_JOIN_FLAG_FULLMEMBER,
202 RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800203 RDMA_MC_JOIN_FLAG_RESERVED,
204};
Christopher Ferris38062f92014-07-09 15:33:25 -0700205struct rdma_ucm_join_mcast {
Tao Baod7db5942015-01-28 10:07:51 -0800206 __u64 response;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800207 __u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800208 __u32 id;
209 __u16 addr_size;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800210 __u16 join_flags;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700211 struct sockaddr_storage addr;
Christopher Ferris653676d2014-09-18 13:14:58 -0700212};
Ben Cheng655a7c02013-10-16 16:09:24 -0700213struct rdma_ucm_get_event {
Tao Baod7db5942015-01-28 10:07:51 -0800214 __u64 response;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800215};
Christopher Ferris653676d2014-09-18 13:14:58 -0700216struct rdma_ucm_event_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800217 __u64 uid;
218 __u32 id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800219 __u32 event;
Tao Baod7db5942015-01-28 10:07:51 -0800220 __u32 status;
221 union {
222 struct rdma_ucm_conn_param conn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800223 struct rdma_ucm_ud_param ud;
Tao Baod7db5942015-01-28 10:07:51 -0800224 } param;
Ben Cheng655a7c02013-10-16 16:09:24 -0700225};
226enum {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227 RDMA_OPTION_ID = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800228 RDMA_OPTION_IB = 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700229};
230enum {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231 RDMA_OPTION_ID_TOS = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800232 RDMA_OPTION_ID_REUSEADDR = 1,
233 RDMA_OPTION_ID_AFONLY = 2,
234 RDMA_OPTION_IB_PATH = 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235};
Christopher Ferris653676d2014-09-18 13:14:58 -0700236struct rdma_ucm_set_option {
Tao Baod7db5942015-01-28 10:07:51 -0800237 __u64 optval;
238 __u32 id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239 __u32 level;
Tao Baod7db5942015-01-28 10:07:51 -0800240 __u32 optname;
241 __u32 optlen;
Ben Cheng655a7c02013-10-16 16:09:24 -0700242};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800243struct rdma_ucm_migrate_id {
Tao Baod7db5942015-01-28 10:07:51 -0800244 __u64 response;
245 __u32 id;
246 __u32 fd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247};
Christopher Ferris653676d2014-09-18 13:14:58 -0700248struct rdma_ucm_migrate_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u32 events_reported;
Ben Cheng655a7c02013-10-16 16:09:24 -0700250};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800251#endif