blob: 9042b6fa40ad06cc2274c190fa24f79a8055e421 [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];
Ben Cheng655a7c02013-10-16 16:09:24 -0700130};
Christopher Ferris38062f92014-07-09 15:33:25 -0700131struct rdma_ucm_query_addr_resp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700132 __aligned_u64 node_guid;
Tao Baod7db5942015-01-28 10:07:51 -0800133 __u8 port_num;
134 __u8 reserved;
135 __u16 pkey;
136 __u16 src_size;
Tao Baod7db5942015-01-28 10:07:51 -0800137 __u16 dst_size;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700138 struct sockaddr_storage src_addr;
139 struct sockaddr_storage dst_addr;
Christopher Ferris38062f92014-07-09 15:33:25 -0700140};
Christopher Ferris653676d2014-09-18 13:14:58 -0700141struct rdma_ucm_query_path_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 num_paths;
143 __u32 reserved;
144 struct ib_path_rec_data path_data[0];
Christopher Ferris653676d2014-09-18 13:14:58 -0700145};
Ben Cheng655a7c02013-10-16 16:09:24 -0700146struct rdma_ucm_conn_param {
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u32 qp_num;
148 __u32 qkey;
Tao Baod7db5942015-01-28 10:07:51 -0800149 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
150 __u8 private_data_len;
151 __u8 srq;
152 __u8 responder_resources;
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u8 initiator_depth;
154 __u8 flow_control;
155 __u8 retry_count;
156 __u8 rnr_retry_count;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u8 valid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700158};
159struct rdma_ucm_ud_param {
Tao Baod7db5942015-01-28 10:07:51 -0800160 __u32 qp_num;
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u32 qkey;
162 struct ib_uverbs_ah_attr ah_attr;
163 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
164 __u8 private_data_len;
Tao Baod7db5942015-01-28 10:07:51 -0800165 __u8 reserved[7];
Ben Cheng655a7c02013-10-16 16:09:24 -0700166};
167struct rdma_ucm_connect {
Tao Baod7db5942015-01-28 10:07:51 -0800168 struct rdma_ucm_conn_param conn_param;
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u32 id;
170 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -0700171};
172struct rdma_ucm_listen {
Tao Baod7db5942015-01-28 10:07:51 -0800173 __u32 id;
174 __u32 backlog;
Ben Cheng655a7c02013-10-16 16:09:24 -0700175};
176struct rdma_ucm_accept {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700177 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800178 struct rdma_ucm_conn_param conn_param;
179 __u32 id;
180 __u32 reserved;
Christopher Ferris653676d2014-09-18 13:14:58 -0700181};
Ben Cheng655a7c02013-10-16 16:09:24 -0700182struct rdma_ucm_reject {
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u32 id;
184 __u8 private_data_len;
Tao Baod7db5942015-01-28 10:07:51 -0800185 __u8 reserved[3];
186 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
Ben Cheng655a7c02013-10-16 16:09:24 -0700187};
188struct rdma_ucm_disconnect {
Tao Baod7db5942015-01-28 10:07:51 -0800189 __u32 id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700190};
191struct rdma_ucm_init_qp_attr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700192 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -0800193 __u32 id;
194 __u32 qp_state;
Ben Cheng655a7c02013-10-16 16:09:24 -0700195};
196struct rdma_ucm_notify {
Tao Baod7db5942015-01-28 10:07:51 -0800197 __u32 id;
198 __u32 event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700199};
Christopher Ferris38062f92014-07-09 15:33:25 -0700200struct rdma_ucm_join_ip_mcast {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700201 __aligned_u64 response;
202 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800203 struct sockaddr_in6 addr;
204 __u32 id;
Christopher Ferris653676d2014-09-18 13:14:58 -0700205};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800206enum {
207 RDMA_MC_JOIN_FLAG_FULLMEMBER,
208 RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800209 RDMA_MC_JOIN_FLAG_RESERVED,
210};
Christopher Ferris38062f92014-07-09 15:33:25 -0700211struct rdma_ucm_join_mcast {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700212 __aligned_u64 response;
213 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800214 __u32 id;
215 __u16 addr_size;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800216 __u16 join_flags;
Elliott Hughes64f355f2017-08-30 16:10:24 -0700217 struct sockaddr_storage addr;
Christopher Ferris653676d2014-09-18 13:14:58 -0700218};
Ben Cheng655a7c02013-10-16 16:09:24 -0700219struct rdma_ucm_get_event {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700220 __aligned_u64 response;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800221};
Christopher Ferris653676d2014-09-18 13:14:58 -0700222struct rdma_ucm_event_resp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700223 __aligned_u64 uid;
Tao Baod7db5942015-01-28 10:07:51 -0800224 __u32 id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800225 __u32 event;
Tao Baod7db5942015-01-28 10:07:51 -0800226 __u32 status;
227 union {
228 struct rdma_ucm_conn_param conn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800229 struct rdma_ucm_ud_param ud;
Tao Baod7db5942015-01-28 10:07:51 -0800230 } param;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700231 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -0700232};
233enum {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800234 RDMA_OPTION_ID = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800235 RDMA_OPTION_IB = 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700236};
237enum {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800238 RDMA_OPTION_ID_TOS = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800239 RDMA_OPTION_ID_REUSEADDR = 1,
240 RDMA_OPTION_ID_AFONLY = 2,
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700241 RDMA_OPTION_ID_ACK_TIMEOUT = 3
242};
243enum {
Tao Baod7db5942015-01-28 10:07:51 -0800244 RDMA_OPTION_IB_PATH = 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800245};
Christopher Ferris653676d2014-09-18 13:14:58 -0700246struct rdma_ucm_set_option {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700247 __aligned_u64 optval;
Tao Baod7db5942015-01-28 10:07:51 -0800248 __u32 id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800249 __u32 level;
Tao Baod7db5942015-01-28 10:07:51 -0800250 __u32 optname;
251 __u32 optlen;
Ben Cheng655a7c02013-10-16 16:09:24 -0700252};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800253struct rdma_ucm_migrate_id {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700254 __aligned_u64 response;
Tao Baod7db5942015-01-28 10:07:51 -0800255 __u32 id;
256 __u32 fd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800257};
Christopher Ferris653676d2014-09-18 13:14:58 -0700258struct rdma_ucm_migrate_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800259 __u32 events_reported;
Ben Cheng655a7c02013-10-16 16:09:24 -0700260};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800261#endif