blob: 6894bf120537bae8d66fa2337eb8936a6e8c8d17 [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 IB_USER_VERBS_H
20#define IB_USER_VERBS_H
21#include <linux/types.h>
22#define IB_USER_VERBS_ABI_VERSION 6
Christopher Ferris38062f92014-07-09 15:33:25 -070023#define IB_USER_VERBS_CMD_THRESHOLD 50
Christopher Ferrisd842e432019-03-07 10:21:59 -080024enum ib_uverbs_write_cmds {
Tao Baod7db5942015-01-28 10:07:51 -080025 IB_USER_VERBS_CMD_GET_CONTEXT,
26 IB_USER_VERBS_CMD_QUERY_DEVICE,
Tao Baod7db5942015-01-28 10:07:51 -080027 IB_USER_VERBS_CMD_QUERY_PORT,
28 IB_USER_VERBS_CMD_ALLOC_PD,
29 IB_USER_VERBS_CMD_DEALLOC_PD,
30 IB_USER_VERBS_CMD_CREATE_AH,
Tao Baod7db5942015-01-28 10:07:51 -080031 IB_USER_VERBS_CMD_MODIFY_AH,
32 IB_USER_VERBS_CMD_QUERY_AH,
33 IB_USER_VERBS_CMD_DESTROY_AH,
34 IB_USER_VERBS_CMD_REG_MR,
Tao Baod7db5942015-01-28 10:07:51 -080035 IB_USER_VERBS_CMD_REG_SMR,
36 IB_USER_VERBS_CMD_REREG_MR,
37 IB_USER_VERBS_CMD_QUERY_MR,
38 IB_USER_VERBS_CMD_DEREG_MR,
Tao Baod7db5942015-01-28 10:07:51 -080039 IB_USER_VERBS_CMD_ALLOC_MW,
40 IB_USER_VERBS_CMD_BIND_MW,
41 IB_USER_VERBS_CMD_DEALLOC_MW,
42 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
Tao Baod7db5942015-01-28 10:07:51 -080043 IB_USER_VERBS_CMD_CREATE_CQ,
44 IB_USER_VERBS_CMD_RESIZE_CQ,
45 IB_USER_VERBS_CMD_DESTROY_CQ,
46 IB_USER_VERBS_CMD_POLL_CQ,
Tao Baod7db5942015-01-28 10:07:51 -080047 IB_USER_VERBS_CMD_PEEK_CQ,
48 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
49 IB_USER_VERBS_CMD_CREATE_QP,
50 IB_USER_VERBS_CMD_QUERY_QP,
Tao Baod7db5942015-01-28 10:07:51 -080051 IB_USER_VERBS_CMD_MODIFY_QP,
52 IB_USER_VERBS_CMD_DESTROY_QP,
53 IB_USER_VERBS_CMD_POST_SEND,
54 IB_USER_VERBS_CMD_POST_RECV,
Tao Baod7db5942015-01-28 10:07:51 -080055 IB_USER_VERBS_CMD_ATTACH_MCAST,
56 IB_USER_VERBS_CMD_DETACH_MCAST,
57 IB_USER_VERBS_CMD_CREATE_SRQ,
58 IB_USER_VERBS_CMD_MODIFY_SRQ,
Tao Baod7db5942015-01-28 10:07:51 -080059 IB_USER_VERBS_CMD_QUERY_SRQ,
60 IB_USER_VERBS_CMD_DESTROY_SRQ,
61 IB_USER_VERBS_CMD_POST_SRQ_RECV,
62 IB_USER_VERBS_CMD_OPEN_XRCD,
Tao Baod7db5942015-01-28 10:07:51 -080063 IB_USER_VERBS_CMD_CLOSE_XRCD,
64 IB_USER_VERBS_CMD_CREATE_XSRQ,
65 IB_USER_VERBS_CMD_OPEN_QP,
Ben Cheng655a7c02013-10-16 16:09:24 -070066};
Christopher Ferris38062f92014-07-09 15:33:25 -070067enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -080068 IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
69 IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
70 IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080071 IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
Christopher Ferris05d08e92016-02-04 13:16:38 -080072 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
73 IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
Christopher Ferris49f525c2016-12-12 14:55:36 -080074 IB_USER_VERBS_EX_CMD_CREATE_WQ,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080075 IB_USER_VERBS_EX_CMD_MODIFY_WQ,
Christopher Ferris49f525c2016-12-12 14:55:36 -080076 IB_USER_VERBS_EX_CMD_DESTROY_WQ,
77 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
Christopher Ferris934ec942018-01-31 15:29:16 -080078 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
79 IB_USER_VERBS_EX_CMD_MODIFY_CQ
Christopher Ferris48af7cb2017-02-21 12:35:09 -080080};
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080081enum ib_placement_type {
82 IB_FLUSH_GLOBAL = 1U << 0,
83 IB_FLUSH_PERSISTENT = 1U << 1,
84};
85enum ib_selectivity_level {
86 IB_FLUSH_RANGE = 0,
87 IB_FLUSH_MR,
88};
Christopher Ferris49f525c2016-12-12 14:55:36 -080089struct ib_uverbs_async_event_desc {
Christopher Ferris76a1d452018-06-27 14:12:29 -070090 __aligned_u64 element;
Tao Baod7db5942015-01-28 10:07:51 -080091 __u32 event_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080092 __u32 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -080093};
Ben Cheng655a7c02013-10-16 16:09:24 -070094struct ib_uverbs_comp_event_desc {
Christopher Ferris76a1d452018-06-27 14:12:29 -070095 __aligned_u64 cq_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080096};
Christopher Ferris934ec942018-01-31 15:29:16 -080097struct ib_uverbs_cq_moderation_caps {
98 __u16 max_cq_moderation_count;
99 __u16 max_cq_moderation_period;
100 __u32 reserved;
101};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800102#define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
Christopher Ferris76a1d452018-06-27 14:12:29 -0700103#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
Christopher Ferris49f525c2016-12-12 14:55:36 -0800104struct ib_uverbs_cmd_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800105 __u32 command;
106 __u16 in_words;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800107 __u16 out_words;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108};
Christopher Ferris38062f92014-07-09 15:33:25 -0700109struct ib_uverbs_ex_cmd_hdr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700110 __aligned_u64 response;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800111 __u16 provider_in_words;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800112 __u16 provider_out_words;
Tao Baod7db5942015-01-28 10:07:51 -0800113 __u32 cmd_hdr_reserved;
Christopher Ferris38062f92014-07-09 15:33:25 -0700114};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800115struct ib_uverbs_get_context {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700116 __aligned_u64 response;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700117 __aligned_u64 driver_data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700118};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800119struct ib_uverbs_get_context_resp {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800120 __u32 async_fd;
Tao Baod7db5942015-01-28 10:07:51 -0800121 __u32 num_comp_vectors;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700122 __aligned_u64 driver_data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700123};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800124struct ib_uverbs_query_device {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700125 __aligned_u64 response;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700126 __aligned_u64 driver_data[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700127};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800128struct ib_uverbs_query_device_resp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700129 __aligned_u64 fw_ver;
Tao Baod7db5942015-01-28 10:07:51 -0800130 __be64 node_guid;
131 __be64 sys_image_guid;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700132 __aligned_u64 max_mr_size;
133 __aligned_u64 page_size_cap;
Tao Baod7db5942015-01-28 10:07:51 -0800134 __u32 vendor_id;
135 __u32 vendor_part_id;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800136 __u32 hw_ver;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800137 __u32 max_qp;
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u32 max_qp_wr;
139 __u32 device_cap_flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800140 __u32 max_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800141 __u32 max_sge_rd;
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 max_cq;
143 __u32 max_cqe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800144 __u32 max_mr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800145 __u32 max_pd;
Tao Baod7db5942015-01-28 10:07:51 -0800146 __u32 max_qp_rd_atom;
147 __u32 max_ee_rd_atom;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800148 __u32 max_res_rd_atom;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800149 __u32 max_qp_init_rd_atom;
Tao Baod7db5942015-01-28 10:07:51 -0800150 __u32 max_ee_init_rd_atom;
151 __u32 atomic_cap;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800152 __u32 max_ee;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800153 __u32 max_rdd;
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u32 max_mw;
155 __u32 max_raw_ipv6_qp;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800156 __u32 max_raw_ethy_qp;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800157 __u32 max_mcast_grp;
Tao Baod7db5942015-01-28 10:07:51 -0800158 __u32 max_mcast_qp_attach;
159 __u32 max_total_mcast_qp_attach;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800160 __u32 max_ah;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800161 __u32 max_fmr;
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u32 max_map_per_fmr;
163 __u32 max_srq;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800164 __u32 max_srq_wr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800165 __u32 max_srq_sge;
Tao Baod7db5942015-01-28 10:07:51 -0800166 __u16 max_pkeys;
167 __u8 local_ca_ack_delay;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800168 __u8 phys_port_cnt;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800169 __u8 reserved[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800170};
171struct ib_uverbs_ex_query_device {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800172 __u32 comp_mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800173 __u32 reserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800174};
175struct ib_uverbs_odp_caps {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700176 __aligned_u64 general_caps;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800177 struct {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800178 __u32 rc_odp_caps;
179 __u32 uc_odp_caps;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800180 __u32 ud_odp_caps;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800181 } per_transport_caps;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800182 __u32 reserved;
183};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800184struct ib_uverbs_rss_caps {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800185 __u32 supported_qpts;
186 __u32 max_rwq_indirection_tables;
187 __u32 max_rwq_indirection_table_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800188 __u32 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800189};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800190struct ib_uverbs_tm_caps {
191 __u32 max_rndv_hdr_size;
192 __u32 max_num_tags;
193 __u32 flags;
194 __u32 max_ops;
195 __u32 max_sge;
196 __u32 reserved;
197};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800198struct ib_uverbs_ex_query_device_resp {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800199 struct ib_uverbs_query_device_resp base;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800200 __u32 comp_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800201 __u32 response_length;
202 struct ib_uverbs_odp_caps odp_caps;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700203 __aligned_u64 timestamp_mask;
204 __aligned_u64 hca_core_clock;
205 __aligned_u64 device_cap_flags_ex;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800206 struct ib_uverbs_rss_caps rss_caps;
207 __u32 max_wq_type_rq;
Christopher Ferris525ce912017-07-26 13:12:53 -0700208 __u32 raw_packet_caps;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800209 struct ib_uverbs_tm_caps tm_caps;
Christopher Ferris934ec942018-01-31 15:29:16 -0800210 struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700211 __aligned_u64 max_dm_size;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700212 __u32 xrc_odp_caps;
213 __u32 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800214};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800215struct ib_uverbs_query_port {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700216 __aligned_u64 response;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800217 __u8 port_num;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800218 __u8 reserved[7];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700219 __aligned_u64 driver_data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700220};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800221struct ib_uverbs_query_port_resp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800222 __u32 port_cap_flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800223 __u32 max_msg_sz;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700224 __u32 bad_pkey_cntr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800225 __u32 qkey_viol_cntr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800226 __u32 gid_tbl_len;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227 __u16 pkey_tbl_len;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700228 __u16 lid;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800229 __u16 sm_lid;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800230 __u8 state;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231 __u8 max_mtu;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700232 __u8 active_mtu;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800233 __u8 lmc;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800234 __u8 max_vl_num;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235 __u8 sm_sl;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700236 __u8 subnet_timeout;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800237 __u8 init_type_reply;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800238 __u8 active_width;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239 __u8 active_speed;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700240 __u8 phys_state;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800241 __u8 link_layer;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700242 __u8 flags;
243 __u8 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800244};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700245struct ib_uverbs_alloc_pd {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700246 __aligned_u64 response;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700247 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800248};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700249struct ib_uverbs_alloc_pd_resp {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800250 __u32 pd_handle;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700251 __u32 driver_data[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800252};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800253struct ib_uverbs_dealloc_pd {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700254 __u32 pd_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800255};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800256struct ib_uverbs_open_xrcd {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700257 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700258 __u32 fd;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800259 __u32 oflags;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700260 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800261};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700262struct ib_uverbs_open_xrcd_resp {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800263 __u32 xrcd_handle;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700264 __u32 driver_data[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800265};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800266struct ib_uverbs_close_xrcd {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700267 __u32 xrcd_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800268};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800269struct ib_uverbs_reg_mr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700270 __aligned_u64 response;
271 __aligned_u64 start;
272 __aligned_u64 length;
273 __aligned_u64 hca_va;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800274 __u32 pd_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700275 __u32 access_flags;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700276 __aligned_u64 driver_data[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800277};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800278struct ib_uverbs_reg_mr_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700279 __u32 mr_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800280 __u32 lkey;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800281 __u32 rkey;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700282 __u32 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800283};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700284struct ib_uverbs_rereg_mr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700285 __aligned_u64 response;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800286 __u32 mr_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800287 __u32 flags;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700288 __aligned_u64 start;
289 __aligned_u64 length;
290 __aligned_u64 hca_va;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800291 __u32 pd_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700292 __u32 access_flags;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700293 __aligned_u64 driver_data[];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800294};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800295struct ib_uverbs_rereg_mr_resp {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800296 __u32 lkey;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700297 __u32 rkey;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700298 __aligned_u64 driver_data[];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800299};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800300struct ib_uverbs_dereg_mr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800301 __u32 mr_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700302};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800303struct ib_uverbs_alloc_mw {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700304 __aligned_u64 response;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800305 __u32 pd_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700306 __u8 mw_type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800307 __u8 reserved[3];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700308 __aligned_u64 driver_data[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800309};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800310struct ib_uverbs_alloc_mw_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700311 __u32 mw_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800312 __u32 rkey;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700313 __aligned_u64 driver_data[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800314};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800315struct ib_uverbs_dealloc_mw {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700316 __u32 mw_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800317};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800318struct ib_uverbs_create_comp_channel {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700319 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700320};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800321struct ib_uverbs_create_comp_channel_resp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800322 __u32 fd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800323};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700324struct ib_uverbs_create_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700325 __aligned_u64 response;
326 __aligned_u64 user_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800327 __u32 cqe;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700328 __u32 comp_vector;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800329 __s32 comp_channel;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800330 __u32 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700331 __aligned_u64 driver_data[];
Christopher Ferris76a1d452018-06-27 14:12:29 -0700332};
333enum ib_uverbs_ex_create_cq_flags {
334 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
335 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700336};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800337struct ib_uverbs_ex_create_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700338 __aligned_u64 user_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800339 __u32 cqe;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700340 __u32 comp_vector;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800341 __s32 comp_channel;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800342 __u32 comp_mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800343 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700344 __u32 reserved;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800345};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800346struct ib_uverbs_create_cq_resp {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800347 __u32 cq_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700348 __u32 cqe;
Christopher Ferrisd842e432019-03-07 10:21:59 -0800349 __aligned_u64 driver_data[0];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800350};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800351struct ib_uverbs_ex_create_cq_resp {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800352 struct ib_uverbs_create_cq_resp base;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700353 __u32 comp_mask;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800354 __u32 response_length;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800355};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800356struct ib_uverbs_resize_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700357 __aligned_u64 response;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800358 __u32 cq_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800359 __u32 cqe;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700360 __aligned_u64 driver_data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700361};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800362struct ib_uverbs_resize_cq_resp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800363 __u32 cqe;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800364 __u32 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700365 __aligned_u64 driver_data[];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800366};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800367struct ib_uverbs_poll_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700368 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700369 __u32 cq_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800370 __u32 ne;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800371};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800372enum ib_uverbs_wc_opcode {
373 IB_UVERBS_WC_SEND = 0,
374 IB_UVERBS_WC_RDMA_WRITE = 1,
375 IB_UVERBS_WC_RDMA_READ = 2,
376 IB_UVERBS_WC_COMP_SWAP = 3,
377 IB_UVERBS_WC_FETCH_ADD = 4,
378 IB_UVERBS_WC_BIND_MW = 5,
379 IB_UVERBS_WC_LOCAL_INV = 6,
380 IB_UVERBS_WC_TSO = 7,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800381 IB_UVERBS_WC_FLUSH = 8,
382 IB_UVERBS_WC_ATOMIC_WRITE = 9,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800383};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800384struct ib_uverbs_wc {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700385 __aligned_u64 wr_id;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800386 __u32 status;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800387 __u32 opcode;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800388 __u32 vendor_err;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700389 __u32 byte_len;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800390 union {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700391 __be32 imm_data;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800392 __u32 invalidate_rkey;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700393 } ex;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800394 __u32 qp_num;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800395 __u32 src_qp;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800396 __u32 wc_flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700397 __u16 pkey_index;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800398 __u16 slid;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800399 __u8 sl;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800400 __u8 dlid_path_bits;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700401 __u8 port_num;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800402 __u8 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800403};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800404struct ib_uverbs_poll_cq_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700405 __u32 count;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800406 __u32 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700407 struct ib_uverbs_wc wc[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800408};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700409struct ib_uverbs_req_notify_cq {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800410 __u32 cq_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800411 __u32 solicited_only;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800412};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700413struct ib_uverbs_destroy_cq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700414 __aligned_u64 response;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800415 __u32 cq_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800416 __u32 reserved;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700417};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800418struct ib_uverbs_destroy_cq_resp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800419 __u32 comp_events_reported;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800420 __u32 async_events_reported;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700421};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800422struct ib_uverbs_global_route {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800423 __u8 dgid[16];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800424 __u32 flow_label;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700425 __u8 sgid_index;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800426 __u8 hop_limit;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800427 __u8 traffic_class;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800428 __u8 reserved;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700429};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800430struct ib_uverbs_ah_attr {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800431 struct ib_uverbs_global_route grh;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800432 __u16 dlid;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700433 __u8 sl;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800434 __u8 src_path_bits;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800435 __u8 static_rate;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800436 __u8 is_global;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700437 __u8 port_num;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800438 __u8 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800439};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800440struct ib_uverbs_qp_attr {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700441 __u32 qp_attr_mask;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800442 __u32 qp_state;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800443 __u32 cur_qp_state;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800444 __u32 path_mtu;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700445 __u32 path_mig_state;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800446 __u32 qkey;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800447 __u32 rq_psn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800448 __u32 sq_psn;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700449 __u32 dest_qp_num;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800450 __u32 qp_access_flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800451 struct ib_uverbs_ah_attr ah_attr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800452 struct ib_uverbs_ah_attr alt_ah_attr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700453 __u32 max_send_wr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800454 __u32 max_recv_wr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800455 __u32 max_send_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800456 __u32 max_recv_sge;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700457 __u32 max_inline_data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800458 __u16 pkey_index;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800459 __u16 alt_pkey_index;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800460 __u8 en_sqd_async_notify;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700461 __u8 sq_draining;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800462 __u8 max_rd_atomic;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800463 __u8 max_dest_rd_atomic;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800464 __u8 min_rnr_timer;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700465 __u8 port_num;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800466 __u8 timeout;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800467 __u8 retry_cnt;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800468 __u8 rnr_retry;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700469 __u8 alt_port_num;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800470 __u8 alt_timeout;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800471 __u8 reserved[5];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800472};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700473struct ib_uverbs_create_qp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700474 __aligned_u64 response;
475 __aligned_u64 user_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800476 __u32 pd_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700477 __u32 send_cq_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800478 __u32 recv_cq_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800479 __u32 srq_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800480 __u32 max_send_wr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700481 __u32 max_recv_wr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800482 __u32 max_send_sge;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800483 __u32 max_recv_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800484 __u32 max_inline_data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700485 __u8 sq_sig_all;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800486 __u8 qp_type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800487 __u8 is_srq;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800488 __u8 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700489 __aligned_u64 driver_data[];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800490};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800491enum ib_uverbs_create_qp_mask {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800492 IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
493};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800494enum {
495 IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
496};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800497struct ib_uverbs_ex_create_qp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700498 __aligned_u64 user_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800499 __u32 pd_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800500 __u32 send_cq_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800501 __u32 recv_cq_handle;
502 __u32 srq_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800503 __u32 max_send_wr;
Tao Baod7db5942015-01-28 10:07:51 -0800504 __u32 max_recv_wr;
505 __u32 max_send_sge;
506 __u32 max_recv_sge;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800507 __u32 max_inline_data;
Tao Baod7db5942015-01-28 10:07:51 -0800508 __u8 sq_sig_all;
509 __u8 qp_type;
510 __u8 is_srq;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800511 __u8 reserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800512 __u32 comp_mask;
513 __u32 create_flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800514 __u32 rwq_ind_tbl_handle;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800515 __u32 source_qpn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800516};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700517struct ib_uverbs_open_qp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700518 __aligned_u64 response;
519 __aligned_u64 user_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800520 __u32 pd_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700521 __u32 qpn;
Tao Baod7db5942015-01-28 10:07:51 -0800522 __u8 qp_type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800523 __u8 reserved[7];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700524 __aligned_u64 driver_data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700525};
Ben Cheng655a7c02013-10-16 16:09:24 -0700526struct ib_uverbs_create_qp_resp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800527 __u32 qp_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800528 __u32 qpn;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700529 __u32 max_send_wr;
Tao Baod7db5942015-01-28 10:07:51 -0800530 __u32 max_recv_wr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800531 __u32 max_send_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800532 __u32 max_recv_sge;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700533 __u32 max_inline_data;
Tao Baod7db5942015-01-28 10:07:51 -0800534 __u32 reserved;
Christopher Ferrisd842e432019-03-07 10:21:59 -0800535 __u32 driver_data[0];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800536};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800537struct ib_uverbs_ex_create_qp_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700538 struct ib_uverbs_create_qp_resp base;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800539 __u32 comp_mask;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800540 __u32 response_length;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800541};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700542struct ib_uverbs_qp_dest {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800543 __u8 dgid[16];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800544 __u32 flow_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800545 __u16 dlid;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700546 __u16 reserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800547 __u8 sgid_index;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800548 __u8 hop_limit;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800549 __u8 traffic_class;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700550 __u8 sl;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800551 __u8 src_path_bits;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800552 __u8 static_rate;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800553 __u8 is_global;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700554 __u8 port_num;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800555};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800556struct ib_uverbs_query_qp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700557 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700558 __u32 qp_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800559 __u32 attr_mask;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700560 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800561};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700562struct ib_uverbs_query_qp_resp {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800563 struct ib_uverbs_qp_dest dest;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800564 struct ib_uverbs_qp_dest alt_dest;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800565 __u32 max_send_wr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700566 __u32 max_recv_wr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800567 __u32 max_send_sge;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800568 __u32 max_recv_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800569 __u32 max_inline_data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700570 __u32 qkey;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800571 __u32 rq_psn;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800572 __u32 sq_psn;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800573 __u32 dest_qp_num;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700574 __u32 qp_access_flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800575 __u16 pkey_index;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800576 __u16 alt_pkey_index;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800577 __u8 qp_state;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700578 __u8 cur_qp_state;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800579 __u8 path_mtu;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800580 __u8 path_mig_state;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800581 __u8 sq_draining;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700582 __u8 max_rd_atomic;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800583 __u8 max_dest_rd_atomic;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800584 __u8 min_rnr_timer;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800585 __u8 port_num;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700586 __u8 timeout;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800587 __u8 retry_cnt;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800588 __u8 rnr_retry;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800589 __u8 alt_port_num;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700590 __u8 alt_timeout;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800591 __u8 sq_sig_all;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800592 __u8 reserved[5];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700593 __aligned_u64 driver_data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700594};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800595struct ib_uverbs_modify_qp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800596 struct ib_uverbs_qp_dest dest;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800597 struct ib_uverbs_qp_dest alt_dest;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700598 __u32 qp_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800599 __u32 attr_mask;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800600 __u32 qkey;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800601 __u32 rq_psn;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700602 __u32 sq_psn;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800603 __u32 dest_qp_num;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800604 __u32 qp_access_flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800605 __u16 pkey_index;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700606 __u16 alt_pkey_index;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800607 __u8 qp_state;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800608 __u8 cur_qp_state;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800609 __u8 path_mtu;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700610 __u8 path_mig_state;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800611 __u8 en_sqd_async_notify;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800612 __u8 max_rd_atomic;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800613 __u8 max_dest_rd_atomic;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700614 __u8 min_rnr_timer;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800615 __u8 port_num;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800616 __u8 timeout;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800617 __u8 retry_cnt;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700618 __u8 rnr_retry;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800619 __u8 alt_port_num;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800620 __u8 alt_timeout;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800621 __u8 reserved[2];
Christopher Ferris76a1d452018-06-27 14:12:29 -0700622 __aligned_u64 driver_data[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800623};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800624struct ib_uverbs_ex_modify_qp {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800625 struct ib_uverbs_modify_qp base;
626 __u32 rate_limit;
627 __u32 reserved;
628};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800629struct ib_uverbs_ex_modify_qp_resp {
630 __u32 comp_mask;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800631 __u32 response_length;
632};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700633struct ib_uverbs_destroy_qp {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700634 __aligned_u64 response;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800635 __u32 qp_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800636 __u32 reserved;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700637};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800638struct ib_uverbs_destroy_qp_resp {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800639 __u32 events_reported;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800640};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700641struct ib_uverbs_sge {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700642 __aligned_u64 addr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800643 __u32 length;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800644 __u32 lkey;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700645};
Christopher Ferris86a48372019-01-10 14:14:59 -0800646enum ib_uverbs_wr_opcode {
647 IB_UVERBS_WR_RDMA_WRITE = 0,
648 IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
649 IB_UVERBS_WR_SEND = 2,
650 IB_UVERBS_WR_SEND_WITH_IMM = 3,
651 IB_UVERBS_WR_RDMA_READ = 4,
652 IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
653 IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
654 IB_UVERBS_WR_LOCAL_INV = 7,
655 IB_UVERBS_WR_BIND_MW = 8,
656 IB_UVERBS_WR_SEND_WITH_INV = 9,
657 IB_UVERBS_WR_TSO = 10,
658 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
659 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
660 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800661 IB_UVERBS_WR_FLUSH = 14,
662 IB_UVERBS_WR_ATOMIC_WRITE = 15,
Christopher Ferris86a48372019-01-10 14:14:59 -0800663};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800664struct ib_uverbs_send_wr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700665 __aligned_u64 wr_id;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800666 __u32 num_sge;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700667 __u32 opcode;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800668 __u32 send_flags;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800669 union {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700670 __be32 imm_data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700671 __u32 invalidate_rkey;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800672 } ex;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800673 union {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800674 struct {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700675 __aligned_u64 remote_addr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800676 __u32 rkey;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800677 __u32 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800678 } rdma;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700679 struct {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700680 __aligned_u64 remote_addr;
681 __aligned_u64 compare_add;
682 __aligned_u64 swap;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700683 __u32 rkey;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800684 __u32 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800685 } atomic;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800686 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700687 __u32 ah;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800688 __u32 remote_qpn;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800689 __u32 remote_qkey;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800690 __u32 reserved;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700691 } ud;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800692 } wr;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800693};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800694struct ib_uverbs_post_send {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700695 __aligned_u64 response;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800696 __u32 qp_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800697 __u32 wr_count;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800698 __u32 sge_count;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700699 __u32 wqe_size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700700 struct ib_uverbs_send_wr send_wr[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800701};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800702struct ib_uverbs_post_send_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700703 __u32 bad_wr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800704};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800705struct ib_uverbs_recv_wr {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700706 __aligned_u64 wr_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700707 __u32 num_sge;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800708 __u32 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800709};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800710struct ib_uverbs_post_recv {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700711 __aligned_u64 response;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800712 __u32 qp_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800713 __u32 wr_count;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800714 __u32 sge_count;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700715 __u32 wqe_size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700716 struct ib_uverbs_recv_wr recv_wr[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800717};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800718struct ib_uverbs_post_recv_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700719 __u32 bad_wr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800720};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800721struct ib_uverbs_post_srq_recv {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700722 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700723 __u32 srq_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800724 __u32 wr_count;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800725 __u32 sge_count;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800726 __u32 wqe_size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700727 struct ib_uverbs_recv_wr recv[];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800728};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800729struct ib_uverbs_post_srq_recv_resp {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800730 __u32 bad_wr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700731};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800732struct ib_uverbs_create_ah {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700733 __aligned_u64 response;
734 __aligned_u64 user_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700735 __u32 pd_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800736 __u32 reserved;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800737 struct ib_uverbs_ah_attr attr;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700738 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800739};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700740struct ib_uverbs_create_ah_resp {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800741 __u32 ah_handle;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700742 __u32 driver_data[];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800743};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800744struct ib_uverbs_destroy_ah {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700745 __u32 ah_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800746};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800747struct ib_uverbs_attach_mcast {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800748 __u8 gid[16];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700749 __u32 qp_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800750 __u16 mlid;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800751 __u16 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700752 __aligned_u64 driver_data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700753};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800754struct ib_uverbs_detach_mcast {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800755 __u8 gid[16];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800756 __u32 qp_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700757 __u16 mlid;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800758 __u16 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700759 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800760};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700761struct ib_uverbs_flow_spec_hdr {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800762 __u32 type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800763 __u16 size;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800764 __u16 reserved;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700765 __aligned_u64 flow_spec_data[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800766};
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800767struct ib_uverbs_flow_eth_filter {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800768 __u8 dst_mac[6];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700769 __u8 src_mac[6];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800770 __be16 ether_type;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800771 __be16 vlan_tag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800772};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700773struct ib_uverbs_flow_spec_eth {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800774 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800775 struct ib_uverbs_flow_spec_hdr hdr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800776 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700777 __u32 type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800778 __u16 size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800779 __u16 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800780 };
Christopher Ferris106b3a82016-08-24 12:15:38 -0700781 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800782 struct ib_uverbs_flow_eth_filter val;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800783 struct ib_uverbs_flow_eth_filter mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800784};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700785struct ib_uverbs_flow_ipv4_filter {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800786 __be32 src_ip;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800787 __be32 dst_ip;
788 __u8 proto;
789 __u8 tos;
790 __u8 ttl;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800791 __u8 flags;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800792};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700793struct ib_uverbs_flow_spec_ipv4 {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800794 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800795 struct ib_uverbs_flow_spec_hdr hdr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800796 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700797 __u32 type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800798 __u16 size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800799 __u16 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800800 };
Christopher Ferris106b3a82016-08-24 12:15:38 -0700801 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800802 struct ib_uverbs_flow_ipv4_filter val;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800803 struct ib_uverbs_flow_ipv4_filter mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800804};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700805struct ib_uverbs_flow_tcp_udp_filter {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800806 __be16 dst_port;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800807 __be16 src_port;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800808};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700809struct ib_uverbs_flow_spec_tcp_udp {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800810 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800811 struct ib_uverbs_flow_spec_hdr hdr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800812 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700813 __u32 type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800814 __u16 size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800815 __u16 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800816 };
Christopher Ferris106b3a82016-08-24 12:15:38 -0700817 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800818 struct ib_uverbs_flow_tcp_udp_filter val;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800819 struct ib_uverbs_flow_tcp_udp_filter mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800820};
821struct ib_uverbs_flow_ipv6_filter {
822 __u8 src_ip[16];
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800823 __u8 dst_ip[16];
824 __be32 flow_label;
825 __u8 next_hdr;
826 __u8 traffic_class;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800827 __u8 hop_limit;
828 __u8 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800829};
830struct ib_uverbs_flow_spec_ipv6 {
831 union {
832 struct ib_uverbs_flow_spec_hdr hdr;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800833 struct {
834 __u32 type;
835 __u16 size;
836 __u16 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800837 };
838 };
839 struct ib_uverbs_flow_ipv6_filter val;
840 struct ib_uverbs_flow_ipv6_filter mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800841};
Christopher Ferris525ce912017-07-26 13:12:53 -0700842struct ib_uverbs_flow_spec_action_tag {
843 union {
844 struct ib_uverbs_flow_spec_hdr hdr;
845 struct {
846 __u32 type;
847 __u16 size;
848 __u16 reserved;
849 };
850 };
851 __u32 tag_id;
852 __u32 reserved1;
853};
854struct ib_uverbs_flow_spec_action_drop {
855 union {
856 struct ib_uverbs_flow_spec_hdr hdr;
857 struct {
858 __u32 type;
859 __u16 size;
860 __u16 reserved;
861 };
862 };
863};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700864struct ib_uverbs_flow_spec_action_handle {
865 union {
866 struct ib_uverbs_flow_spec_hdr hdr;
867 struct {
868 __u32 type;
869 __u16 size;
870 __u16 reserved;
871 };
872 };
873 __u32 handle;
874 __u32 reserved1;
875};
Christopher Ferris9ce28842018-10-25 12:11:39 -0700876struct ib_uverbs_flow_spec_action_count {
877 union {
878 struct ib_uverbs_flow_spec_hdr hdr;
879 struct {
880 __u32 type;
881 __u16 size;
882 __u16 reserved;
883 };
884 };
885 __u32 handle;
886 __u32 reserved1;
887};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800888struct ib_uverbs_flow_tunnel_filter {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800889 __be32 tunnel_id;
890};
891struct ib_uverbs_flow_spec_tunnel {
892 union {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800893 struct ib_uverbs_flow_spec_hdr hdr;
894 struct {
895 __u32 type;
896 __u16 size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800897 __u16 reserved;
898 };
899 };
900 struct ib_uverbs_flow_tunnel_filter val;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800901 struct ib_uverbs_flow_tunnel_filter mask;
902};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700903struct ib_uverbs_flow_spec_esp_filter {
904 __u32 spi;
905 __u32 seq;
906};
907struct ib_uverbs_flow_spec_esp {
908 union {
909 struct ib_uverbs_flow_spec_hdr hdr;
910 struct {
911 __u32 type;
912 __u16 size;
913 __u16 reserved;
914 };
915 };
916 struct ib_uverbs_flow_spec_esp_filter val;
917 struct ib_uverbs_flow_spec_esp_filter mask;
918};
Christopher Ferris9ce28842018-10-25 12:11:39 -0700919struct ib_uverbs_flow_gre_filter {
920 __be16 c_ks_res0_ver;
921 __be16 protocol;
922 __be32 key;
923};
924struct ib_uverbs_flow_spec_gre {
925 union {
926 struct ib_uverbs_flow_spec_hdr hdr;
927 struct {
928 __u32 type;
929 __u16 size;
930 __u16 reserved;
931 };
932 };
933 struct ib_uverbs_flow_gre_filter val;
934 struct ib_uverbs_flow_gre_filter mask;
935};
936struct ib_uverbs_flow_mpls_filter {
937 __be32 label;
938};
939struct ib_uverbs_flow_spec_mpls {
940 union {
941 struct ib_uverbs_flow_spec_hdr hdr;
942 struct {
943 __u32 type;
944 __u16 size;
945 __u16 reserved;
946 };
947 };
948 struct ib_uverbs_flow_mpls_filter val;
949 struct ib_uverbs_flow_mpls_filter mask;
950};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800951struct ib_uverbs_flow_attr {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800952 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800953 __u16 size;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800954 __u16 priority;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700955 __u8 num_of_specs;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800956 __u8 reserved[2];
Tao Baod7db5942015-01-28 10:07:51 -0800957 __u8 port;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800958 __u32 flags;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700959 struct ib_uverbs_flow_spec_hdr flow_specs[];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800960};
Christopher Ferris38062f92014-07-09 15:33:25 -0700961struct ib_uverbs_create_flow {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800962 __u32 comp_mask;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700963 __u32 qp_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800964 struct ib_uverbs_flow_attr flow_attr;
Christopher Ferris38062f92014-07-09 15:33:25 -0700965};
966struct ib_uverbs_create_flow_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700967 __u32 comp_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800968 __u32 flow_handle;
Christopher Ferris38062f92014-07-09 15:33:25 -0700969};
970struct ib_uverbs_destroy_flow {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700971 __u32 comp_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800972 __u32 flow_handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700973};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800974struct ib_uverbs_create_srq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700975 __aligned_u64 response;
976 __aligned_u64 user_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800977 __u32 pd_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800978 __u32 max_wr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700979 __u32 max_sge;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800980 __u32 srq_limit;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700981 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800982};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700983struct ib_uverbs_create_xsrq {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700984 __aligned_u64 response;
985 __aligned_u64 user_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800986 __u32 srq_type;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700987 __u32 pd_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800988 __u32 max_wr;
Tao Baod7db5942015-01-28 10:07:51 -0800989 __u32 max_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800990 __u32 srq_limit;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800991 __u32 max_num_tags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800992 __u32 xrcd_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800993 __u32 cq_handle;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700994 __aligned_u64 driver_data[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700995};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800996struct ib_uverbs_create_srq_resp {
Tao Baod7db5942015-01-28 10:07:51 -0800997 __u32 srq_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800998 __u32 max_wr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700999 __u32 max_sge;
Christopher Ferris05d08e92016-02-04 13:16:38 -08001000 __u32 srqn;
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001001 __u32 driver_data[];
Ben Cheng655a7c02013-10-16 16:09:24 -07001002};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001003struct ib_uverbs_modify_srq {
Christopher Ferris106b3a82016-08-24 12:15:38 -07001004 __u32 srq_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -08001005 __u32 attr_mask;
Tao Baod7db5942015-01-28 10:07:51 -08001006 __u32 max_wr;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001007 __u32 srq_limit;
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001008 __aligned_u64 driver_data[];
Christopher Ferris05d08e92016-02-04 13:16:38 -08001009};
Ben Cheng655a7c02013-10-16 16:09:24 -07001010struct ib_uverbs_query_srq {
Christopher Ferris76a1d452018-06-27 14:12:29 -07001011 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -07001012 __u32 srq_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -08001013 __u32 reserved;
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001014 __aligned_u64 driver_data[];
Christopher Ferris49f525c2016-12-12 14:55:36 -08001015};
Christopher Ferris106b3a82016-08-24 12:15:38 -07001016struct ib_uverbs_query_srq_resp {
Christopher Ferris05d08e92016-02-04 13:16:38 -08001017 __u32 max_wr;
Tao Baod7db5942015-01-28 10:07:51 -08001018 __u32 max_sge;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001019 __u32 srq_limit;
Christopher Ferris106b3a82016-08-24 12:15:38 -07001020 __u32 reserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -08001021};
Ben Cheng655a7c02013-10-16 16:09:24 -07001022struct ib_uverbs_destroy_srq {
Christopher Ferris76a1d452018-06-27 14:12:29 -07001023 __aligned_u64 response;
Christopher Ferris106b3a82016-08-24 12:15:38 -07001024 __u32 srq_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -08001025 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -07001026};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001027struct ib_uverbs_destroy_srq_resp {
Christopher Ferris106b3a82016-08-24 12:15:38 -07001028 __u32 events_reported;
Christopher Ferris05d08e92016-02-04 13:16:38 -08001029};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001030struct ib_uverbs_ex_create_wq {
Christopher Ferris49f525c2016-12-12 14:55:36 -08001031 __u32 comp_mask;
1032 __u32 wq_type;
Christopher Ferris76a1d452018-06-27 14:12:29 -07001033 __aligned_u64 user_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001034 __u32 pd_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001035 __u32 cq_handle;
1036 __u32 max_wr;
1037 __u32 max_sge;
Christopher Ferris525ce912017-07-26 13:12:53 -07001038 __u32 create_flags;
1039 __u32 reserved;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001040};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001041struct ib_uverbs_ex_create_wq_resp {
1042 __u32 comp_mask;
1043 __u32 response_length;
1044 __u32 wq_handle;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001045 __u32 max_wr;
1046 __u32 max_sge;
1047 __u32 wqn;
1048};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001049struct ib_uverbs_ex_destroy_wq {
1050 __u32 comp_mask;
1051 __u32 wq_handle;
1052};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001053struct ib_uverbs_ex_destroy_wq_resp {
1054 __u32 comp_mask;
1055 __u32 response_length;
1056 __u32 events_reported;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001057 __u32 reserved;
1058};
1059struct ib_uverbs_ex_modify_wq {
1060 __u32 attr_mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001061 __u32 wq_handle;
1062 __u32 wq_state;
1063 __u32 curr_wq_state;
Christopher Ferris525ce912017-07-26 13:12:53 -07001064 __u32 flags;
1065 __u32 flags_mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001066};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001067#define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1068struct ib_uverbs_ex_create_rwq_ind_table {
1069 __u32 comp_mask;
1070 __u32 log_ind_tbl_size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001071 __u32 wq_handles[];
Christopher Ferris49f525c2016-12-12 14:55:36 -08001072};
1073struct ib_uverbs_ex_create_rwq_ind_table_resp {
1074 __u32 comp_mask;
Christopher Ferris49f525c2016-12-12 14:55:36 -08001075 __u32 response_length;
1076 __u32 ind_tbl_handle;
1077 __u32 ind_tbl_num;
1078};
Christopher Ferris49f525c2016-12-12 14:55:36 -08001079struct ib_uverbs_ex_destroy_rwq_ind_table {
1080 __u32 comp_mask;
1081 __u32 ind_tbl_handle;
1082};
Christopher Ferris934ec942018-01-31 15:29:16 -08001083struct ib_uverbs_cq_moderation {
1084 __u16 cq_count;
1085 __u16 cq_period;
1086};
1087struct ib_uverbs_ex_modify_cq {
1088 __u32 cq_handle;
1089 __u32 attr_mask;
1090 struct ib_uverbs_cq_moderation attr;
1091 __u32 reserved;
1092};
Christopher Ferris525ce912017-07-26 13:12:53 -07001093#define IB_DEVICE_NAME_MAX 64
Christopher Ferris80ae69d2022-08-02 16:32:21 -07001094enum ib_uverbs_device_cap_flags {
1095 IB_UVERBS_DEVICE_RESIZE_MAX_WR = 1 << 0,
1096 IB_UVERBS_DEVICE_BAD_PKEY_CNTR = 1 << 1,
1097 IB_UVERBS_DEVICE_BAD_QKEY_CNTR = 1 << 2,
1098 IB_UVERBS_DEVICE_RAW_MULTI = 1 << 3,
1099 IB_UVERBS_DEVICE_AUTO_PATH_MIG = 1 << 4,
1100 IB_UVERBS_DEVICE_CHANGE_PHY_PORT = 1 << 5,
1101 IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = 1 << 6,
1102 IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = 1 << 7,
1103 IB_UVERBS_DEVICE_SHUTDOWN_PORT = 1 << 8,
1104 IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = 1 << 10,
1105 IB_UVERBS_DEVICE_SYS_IMAGE_GUID = 1 << 11,
1106 IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = 1 << 12,
1107 IB_UVERBS_DEVICE_SRQ_RESIZE = 1 << 13,
1108 IB_UVERBS_DEVICE_N_NOTIFY_CQ = 1 << 14,
1109 IB_UVERBS_DEVICE_MEM_WINDOW = 1 << 17,
1110 IB_UVERBS_DEVICE_UD_IP_CSUM = 1 << 18,
1111 IB_UVERBS_DEVICE_XRC = 1 << 20,
1112 IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = 1 << 21,
1113 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = 1 << 23,
1114 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = 1 << 24,
1115 IB_UVERBS_DEVICE_RC_IP_CSUM = 1 << 25,
1116 IB_UVERBS_DEVICE_RAW_IP_CSUM = 1 << 26,
1117 IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = 1 << 29,
1118 IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34,
1119 IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -08001120 IB_UVERBS_DEVICE_FLUSH_GLOBAL = 1ULL << 38,
1121 IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39,
1122 IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40,
Christopher Ferris80ae69d2022-08-02 16:32:21 -07001123};
1124enum ib_uverbs_raw_packet_caps {
1125 IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
1126 IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
1127 IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
1128 IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
1129};
Ben Cheng655a7c02013-10-16 16:09:24 -07001130#endif