blob: 96187345a9ac05517deb7f7ee7eccc2e08002cdc [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};
Christopher Ferris76a1d452018-06-27 14:12:29 -070053enum 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};
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct rdma_ucm_cmd_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080060 __u32 cmd;
Tao Baod7db5942015-01-28 10:07:51 -080061 __u16 in;
62 __u16 out;
Ben Cheng655a7c02013-10-16 16:09:24 -070063};
64struct rdma_ucm_create_id {
Christopher Ferris76a1d452018-06-27 14:12:29 -070065 __aligned_u64 uid;
66 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u16 ps;
68 __u8 qp_type;
Tao Baod7db5942015-01-28 10:07:51 -080069 __u8 reserved[5];
Ben Cheng655a7c02013-10-16 16:09:24 -070070};
71struct rdma_ucm_create_id_resp {
Tao Baod7db5942015-01-28 10:07:51 -080072 __u32 id;
Christopher Ferris653676d2014-09-18 13:14:58 -070073};
Ben Cheng655a7c02013-10-16 16:09:24 -070074struct rdma_ucm_destroy_id {
Christopher Ferris76a1d452018-06-27 14:12:29 -070075 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -080076 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080077 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -070078};
79struct rdma_ucm_destroy_id_resp {
Tao Baod7db5942015-01-28 10:07:51 -080080 __u32 events_reported;
Christopher Ferris653676d2014-09-18 13:14:58 -070081};
Christopher Ferris38062f92014-07-09 15:33:25 -070082struct rdma_ucm_bind_ip {
Christopher Ferris76a1d452018-06-27 14:12:29 -070083 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -080084 struct sockaddr_in6 addr;
Tao Baod7db5942015-01-28 10:07:51 -080085 __u32 id;
Ben Cheng655a7c02013-10-16 16:09:24 -070086};
Christopher Ferris38062f92014-07-09 15:33:25 -070087struct rdma_ucm_bind {
Tao Baod7db5942015-01-28 10:07:51 -080088 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080089 __u16 addr_size;
90 __u16 reserved;
Elliott Hughes64f355f2017-08-30 16:10:24 -070091 struct sockaddr_storage addr;
Christopher Ferris38062f92014-07-09 15:33:25 -070092};
Christopher Ferris653676d2014-09-18 13:14:58 -070093struct rdma_ucm_resolve_ip {
Tao Baod7db5942015-01-28 10:07:51 -080094 struct sockaddr_in6 src_addr;
95 struct sockaddr_in6 dst_addr;
96 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -080097 __u32 timeout_ms;
Christopher Ferris38062f92014-07-09 15:33:25 -070098};
99struct rdma_ucm_resolve_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u32 id;
Tao Baod7db5942015-01-28 10:07:51 -0800101 __u32 timeout_ms;
102 __u16 src_size;
103 __u16 dst_size;
104 __u32 reserved;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700105 struct sockaddr_storage src_addr;
106 struct sockaddr_storage dst_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700107};
108struct rdma_ucm_resolve_route {
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u32 id;
110 __u32 timeout_ms;
Ben Cheng655a7c02013-10-16 16:09:24 -0700111};
Christopher Ferris38062f92014-07-09 15:33:25 -0700112enum {
Tao Baod7db5942015-01-28 10:07:51 -0800113 RDMA_USER_CM_QUERY_ADDR,
114 RDMA_USER_CM_QUERY_PATH,
115 RDMA_USER_CM_QUERY_GID
Christopher Ferris38062f92014-07-09 15:33:25 -0700116};
Christopher Ferris653676d2014-09-18 13:14:58 -0700117struct rdma_ucm_query {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700118 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -0800119 __u32 id;
120 __u32 option;
Christopher Ferris653676d2014-09-18 13:14:58 -0700121};
Ben Cheng655a7c02013-10-16 16:09:24 -0700122struct rdma_ucm_query_route_resp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700123 __aligned_u64 node_guid;
Tao Baod7db5942015-01-28 10:07:51 -0800124 struct ib_user_path_rec ib_route[2];
Tao Baod7db5942015-01-28 10:07:51 -0800125 struct sockaddr_in6 src_addr;
126 struct sockaddr_in6 dst_addr;
127 __u32 num_paths;
128 __u8 port_num;
Tao Baod7db5942015-01-28 10:07:51 -0800129 __u8 reserved[3];
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700130 __u32 ibdev_index;
131 __u32 reserved1;
Ben Cheng655a7c02013-10-16 16:09:24 -0700132};
Christopher Ferris38062f92014-07-09 15:33:25 -0700133struct rdma_ucm_query_addr_resp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700134 __aligned_u64 node_guid;
Tao Baod7db5942015-01-28 10:07:51 -0800135 __u8 port_num;
136 __u8 reserved;
137 __u16 pkey;
138 __u16 src_size;
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u16 dst_size;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700140 struct sockaddr_storage src_addr;
141 struct sockaddr_storage dst_addr;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700142 __u32 ibdev_index;
143 __u32 reserved1;
Christopher Ferris38062f92014-07-09 15:33:25 -0700144};
Christopher Ferris653676d2014-09-18 13:14:58 -0700145struct rdma_ucm_query_path_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800146 __u32 num_paths;
147 __u32 reserved;
148 struct ib_path_rec_data path_data[0];
Christopher Ferris653676d2014-09-18 13:14:58 -0700149};
Ben Cheng655a7c02013-10-16 16:09:24 -0700150struct rdma_ucm_conn_param {
Tao Baod7db5942015-01-28 10:07:51 -0800151 __u32 qp_num;
152 __u32 qkey;
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
154 __u8 private_data_len;
155 __u8 srq;
156 __u8 responder_resources;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u8 initiator_depth;
158 __u8 flow_control;
159 __u8 retry_count;
160 __u8 rnr_retry_count;
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u8 valid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700162};
163struct rdma_ucm_ud_param {
Tao Baod7db5942015-01-28 10:07:51 -0800164 __u32 qp_num;
Tao Baod7db5942015-01-28 10:07:51 -0800165 __u32 qkey;
166 struct ib_uverbs_ah_attr ah_attr;
167 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
168 __u8 private_data_len;
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u8 reserved[7];
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700171struct rdma_ucm_ece {
172 __u32 vendor_id;
173 __u32 attr_mod;
174};
Ben Cheng655a7c02013-10-16 16:09:24 -0700175struct rdma_ucm_connect {
Tao Baod7db5942015-01-28 10:07:51 -0800176 struct rdma_ucm_conn_param conn_param;
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 id;
178 __u32 reserved;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700179 struct rdma_ucm_ece ece;
Ben Cheng655a7c02013-10-16 16:09:24 -0700180};
181struct rdma_ucm_listen {
Tao Baod7db5942015-01-28 10:07:51 -0800182 __u32 id;
183 __u32 backlog;
Ben Cheng655a7c02013-10-16 16:09:24 -0700184};
185struct rdma_ucm_accept {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700186 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800187 struct rdma_ucm_conn_param conn_param;
188 __u32 id;
189 __u32 reserved;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700190 struct rdma_ucm_ece ece;
Christopher Ferris653676d2014-09-18 13:14:58 -0700191};
Ben Cheng655a7c02013-10-16 16:09:24 -0700192struct rdma_ucm_reject {
Tao Baod7db5942015-01-28 10:07:51 -0800193 __u32 id;
194 __u8 private_data_len;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700195 __u8 reason;
196 __u8 reserved[2];
Tao Baod7db5942015-01-28 10:07:51 -0800197 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
Ben Cheng655a7c02013-10-16 16:09:24 -0700198};
199struct rdma_ucm_disconnect {
Tao Baod7db5942015-01-28 10:07:51 -0800200 __u32 id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700201};
202struct rdma_ucm_init_qp_attr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700203 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -0800204 __u32 id;
205 __u32 qp_state;
Ben Cheng655a7c02013-10-16 16:09:24 -0700206};
207struct rdma_ucm_notify {
Tao Baod7db5942015-01-28 10:07:51 -0800208 __u32 id;
209 __u32 event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700210};
Christopher Ferris38062f92014-07-09 15:33:25 -0700211struct rdma_ucm_join_ip_mcast {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700212 __aligned_u64 response;
213 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800214 struct sockaddr_in6 addr;
215 __u32 id;
Christopher Ferris653676d2014-09-18 13:14:58 -0700216};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800217enum {
218 RDMA_MC_JOIN_FLAG_FULLMEMBER,
219 RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800220 RDMA_MC_JOIN_FLAG_RESERVED,
221};
Christopher Ferris38062f92014-07-09 15:33:25 -0700222struct rdma_ucm_join_mcast {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700223 __aligned_u64 response;
224 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800225 __u32 id;
226 __u16 addr_size;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227 __u16 join_flags;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700228 struct sockaddr_storage addr;
Christopher Ferris653676d2014-09-18 13:14:58 -0700229};
Ben Cheng655a7c02013-10-16 16:09:24 -0700230struct rdma_ucm_get_event {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700231 __aligned_u64 response;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800232};
Christopher Ferris653676d2014-09-18 13:14:58 -0700233struct rdma_ucm_event_resp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700234 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800235 __u32 id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800236 __u32 event;
Tao Baod7db5942015-01-28 10:07:51 -0800237 __u32 status;
238 union {
239 struct rdma_ucm_conn_param conn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800240 struct rdma_ucm_ud_param ud;
Tao Baod7db5942015-01-28 10:07:51 -0800241 } param;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700242 __u32 reserved;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700243 struct rdma_ucm_ece ece;
Ben Cheng655a7c02013-10-16 16:09:24 -0700244};
245enum {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800246 RDMA_OPTION_ID = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800247 RDMA_OPTION_IB = 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700248};
249enum {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800250 RDMA_OPTION_ID_TOS = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800251 RDMA_OPTION_ID_REUSEADDR = 1,
252 RDMA_OPTION_ID_AFONLY = 2,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700253 RDMA_OPTION_ID_ACK_TIMEOUT = 3
254};
255enum {
Tao Baod7db5942015-01-28 10:07:51 -0800256 RDMA_OPTION_IB_PATH = 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800257};
Christopher Ferris653676d2014-09-18 13:14:58 -0700258struct rdma_ucm_set_option {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700259 __aligned_u64 optval;
Tao Baod7db5942015-01-28 10:07:51 -0800260 __u32 id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800261 __u32 level;
Tao Baod7db5942015-01-28 10:07:51 -0800262 __u32 optname;
263 __u32 optlen;
Ben Cheng655a7c02013-10-16 16:09:24 -0700264};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800265struct rdma_ucm_migrate_id {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700266 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -0800267 __u32 id;
268 __u32 fd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800269};
Christopher Ferris653676d2014-09-18 13:14:58 -0700270struct rdma_ucm_migrate_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800271 __u32 events_reported;
Ben Cheng655a7c02013-10-16 16:09:24 -0700272};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800273#endif