Jason Gunthorpe | d50e14a | 2018-04-20 09:49:10 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 4 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 5 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. |
Dotan Barak | 8bdb0e8 | 2006-02-13 16:31:57 -0800 | [diff] [blame] | 6 | * Copyright (c) 2006 Mellanox Technologies. All rights reserved. |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 7 | * |
| 8 | * This software is available to you under a choice of one of two |
| 9 | * licenses. You may choose to be licensed under the terms of the GNU |
| 10 | * General Public License (GPL) Version 2, available from the file |
| 11 | * COPYING in the main directory of this source tree, or the |
| 12 | * OpenIB.org BSD license below: |
| 13 | * |
| 14 | * Redistribution and use in source and binary forms, with or |
| 15 | * without modification, are permitted provided that the following |
| 16 | * conditions are met: |
| 17 | * |
| 18 | * - Redistributions of source code must retain the above |
| 19 | * copyright notice, this list of conditions and the following |
| 20 | * disclaimer. |
| 21 | * |
| 22 | * - Redistributions in binary form must reproduce the above |
| 23 | * copyright notice, this list of conditions and the following |
| 24 | * disclaimer in the documentation and/or other materials |
| 25 | * provided with the distribution. |
| 26 | * |
| 27 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 28 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 29 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 30 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 31 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 32 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 33 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 34 | * SOFTWARE. |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 35 | */ |
| 36 | |
| 37 | #ifndef IB_USER_VERBS_H |
| 38 | #define IB_USER_VERBS_H |
| 39 | |
| 40 | #include <linux/types.h> |
| 41 | |
| 42 | /* |
| 43 | * Increment this value if any changes that break userspace ABI |
| 44 | * compatibility are made. |
| 45 | */ |
Dotan Barak | ea88fd1 | 2006-02-23 12:36:18 -0800 | [diff] [blame] | 46 | #define IB_USER_VERBS_ABI_VERSION 6 |
Igor Ivanov | 400dbc9 | 2013-08-14 13:58:29 +0300 | [diff] [blame] | 47 | #define IB_USER_VERBS_CMD_THRESHOLD 50 |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 48 | |
Jason Gunthorpe | 4785860 | 2018-11-30 13:06:21 +0200 | [diff] [blame] | 49 | enum ib_uverbs_write_cmds { |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 50 | IB_USER_VERBS_CMD_GET_CONTEXT, |
| 51 | IB_USER_VERBS_CMD_QUERY_DEVICE, |
| 52 | IB_USER_VERBS_CMD_QUERY_PORT, |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 53 | IB_USER_VERBS_CMD_ALLOC_PD, |
| 54 | IB_USER_VERBS_CMD_DEALLOC_PD, |
| 55 | IB_USER_VERBS_CMD_CREATE_AH, |
| 56 | IB_USER_VERBS_CMD_MODIFY_AH, |
| 57 | IB_USER_VERBS_CMD_QUERY_AH, |
| 58 | IB_USER_VERBS_CMD_DESTROY_AH, |
| 59 | IB_USER_VERBS_CMD_REG_MR, |
| 60 | IB_USER_VERBS_CMD_REG_SMR, |
| 61 | IB_USER_VERBS_CMD_REREG_MR, |
| 62 | IB_USER_VERBS_CMD_QUERY_MR, |
| 63 | IB_USER_VERBS_CMD_DEREG_MR, |
| 64 | IB_USER_VERBS_CMD_ALLOC_MW, |
| 65 | IB_USER_VERBS_CMD_BIND_MW, |
| 66 | IB_USER_VERBS_CMD_DEALLOC_MW, |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 67 | IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 68 | IB_USER_VERBS_CMD_CREATE_CQ, |
| 69 | IB_USER_VERBS_CMD_RESIZE_CQ, |
| 70 | IB_USER_VERBS_CMD_DESTROY_CQ, |
| 71 | IB_USER_VERBS_CMD_POLL_CQ, |
| 72 | IB_USER_VERBS_CMD_PEEK_CQ, |
| 73 | IB_USER_VERBS_CMD_REQ_NOTIFY_CQ, |
| 74 | IB_USER_VERBS_CMD_CREATE_QP, |
| 75 | IB_USER_VERBS_CMD_QUERY_QP, |
| 76 | IB_USER_VERBS_CMD_MODIFY_QP, |
| 77 | IB_USER_VERBS_CMD_DESTROY_QP, |
| 78 | IB_USER_VERBS_CMD_POST_SEND, |
| 79 | IB_USER_VERBS_CMD_POST_RECV, |
| 80 | IB_USER_VERBS_CMD_ATTACH_MCAST, |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 81 | IB_USER_VERBS_CMD_DETACH_MCAST, |
| 82 | IB_USER_VERBS_CMD_CREATE_SRQ, |
| 83 | IB_USER_VERBS_CMD_MODIFY_SRQ, |
| 84 | IB_USER_VERBS_CMD_QUERY_SRQ, |
| 85 | IB_USER_VERBS_CMD_DESTROY_SRQ, |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 86 | IB_USER_VERBS_CMD_POST_SRQ_RECV, |
| 87 | IB_USER_VERBS_CMD_OPEN_XRCD, |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 88 | IB_USER_VERBS_CMD_CLOSE_XRCD, |
Sean Hefty | 42849b2 | 2011-08-11 13:57:43 -0700 | [diff] [blame] | 89 | IB_USER_VERBS_CMD_CREATE_XSRQ, |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 90 | IB_USER_VERBS_CMD_OPEN_QP, |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 91 | }; |
| 92 | |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 93 | enum { |
Eli Cohen | 02d1aa7 | 2015-02-08 13:28:50 +0200 | [diff] [blame] | 94 | IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE, |
Matan Barak | 565197d | 2015-06-11 16:35:23 +0300 | [diff] [blame] | 95 | IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ, |
Eran Ben Elisha | 6d8a749 | 2015-10-21 17:00:42 +0300 | [diff] [blame] | 96 | IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP, |
Bodong Wang | 189aba9 | 2016-12-01 13:43:15 +0200 | [diff] [blame] | 97 | IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP, |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 98 | IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, |
Eli Cohen | 5a77abf | 2014-12-11 17:04:15 +0200 | [diff] [blame] | 99 | IB_USER_VERBS_EX_CMD_DESTROY_FLOW, |
Yishai Hadas | f213c05 | 2016-05-23 15:20:49 +0300 | [diff] [blame] | 100 | IB_USER_VERBS_EX_CMD_CREATE_WQ, |
| 101 | IB_USER_VERBS_EX_CMD_MODIFY_WQ, |
| 102 | IB_USER_VERBS_EX_CMD_DESTROY_WQ, |
Yishai Hadas | de019a9 | 2016-05-23 15:20:52 +0300 | [diff] [blame] | 103 | IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL, |
Yonatan Cohen | 869ddcf | 2017-11-13 10:51:13 +0200 | [diff] [blame] | 104 | IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL, |
| 105 | IB_USER_VERBS_EX_CMD_MODIFY_CQ |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 106 | }; |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 107 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 108 | /* |
| 109 | * Make sure that all structs defined in this file remain laid out so |
| 110 | * that they pack the same way on 32-bit and 64-bit architectures (to |
| 111 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 112 | * Specifically: |
| 113 | * - Do not use pointer types -- pass pointers in __u64 instead. |
| 114 | * - Make sure that any structure larger than 4 bytes is padded to a |
| 115 | * multiple of 8 bytes. Otherwise the structure size will be |
| 116 | * different between 32-bit and 64-bit architectures. |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 117 | */ |
| 118 | |
| 119 | struct ib_uverbs_async_event_desc { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 120 | __aligned_u64 element; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 121 | __u32 event_type; /* enum ib_event_type */ |
| 122 | __u32 reserved; |
| 123 | }; |
| 124 | |
| 125 | struct ib_uverbs_comp_event_desc { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 126 | __aligned_u64 cq_handle; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 127 | }; |
| 128 | |
Yonatan Cohen | 18bd907 | 2017-11-13 10:51:16 +0200 | [diff] [blame] | 129 | struct ib_uverbs_cq_moderation_caps { |
| 130 | __u16 max_cq_moderation_count; |
| 131 | __u16 max_cq_moderation_period; |
| 132 | __u32 reserved; |
| 133 | }; |
| 134 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 135 | /* |
| 136 | * All commands from userspace should start with a __u32 command field |
| 137 | * followed by __u16 in_words and out_words fields (which give the |
| 138 | * length of the command block and response buffer if any in 32-bit |
| 139 | * words). The kernel driver will read these fields first and read |
| 140 | * the rest of the command struct based on these value. |
| 141 | */ |
| 142 | |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 143 | #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff |
Leon Romanovsky | 372e15c | 2018-02-21 18:12:43 +0200 | [diff] [blame] | 144 | #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 145 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 146 | struct ib_uverbs_cmd_hdr { |
| 147 | __u32 command; |
| 148 | __u16 in_words; |
| 149 | __u16 out_words; |
| 150 | }; |
| 151 | |
Yann Droneaud | f21519b | 2013-11-06 23:21:49 +0100 | [diff] [blame] | 152 | struct ib_uverbs_ex_cmd_hdr { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 153 | __aligned_u64 response; |
Igor Ivanov | 400dbc9 | 2013-08-14 13:58:29 +0300 | [diff] [blame] | 154 | __u16 provider_in_words; |
| 155 | __u16 provider_out_words; |
| 156 | __u32 cmd_hdr_reserved; |
| 157 | }; |
| 158 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 159 | struct ib_uverbs_get_context { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 160 | __aligned_u64 response; |
| 161 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 162 | }; |
| 163 | |
| 164 | struct ib_uverbs_get_context_resp { |
| 165 | __u32 async_fd; |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 166 | __u32 num_comp_vectors; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 167 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 168 | }; |
| 169 | |
| 170 | struct ib_uverbs_query_device { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 171 | __aligned_u64 response; |
| 172 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 173 | }; |
| 174 | |
| 175 | struct ib_uverbs_query_device_resp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 176 | __aligned_u64 fw_ver; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 177 | __be64 node_guid; |
| 178 | __be64 sys_image_guid; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 179 | __aligned_u64 max_mr_size; |
| 180 | __aligned_u64 page_size_cap; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 181 | __u32 vendor_id; |
| 182 | __u32 vendor_part_id; |
| 183 | __u32 hw_ver; |
| 184 | __u32 max_qp; |
| 185 | __u32 max_qp_wr; |
| 186 | __u32 device_cap_flags; |
| 187 | __u32 max_sge; |
| 188 | __u32 max_sge_rd; |
| 189 | __u32 max_cq; |
| 190 | __u32 max_cqe; |
| 191 | __u32 max_mr; |
| 192 | __u32 max_pd; |
| 193 | __u32 max_qp_rd_atom; |
| 194 | __u32 max_ee_rd_atom; |
| 195 | __u32 max_res_rd_atom; |
| 196 | __u32 max_qp_init_rd_atom; |
| 197 | __u32 max_ee_init_rd_atom; |
| 198 | __u32 atomic_cap; |
| 199 | __u32 max_ee; |
| 200 | __u32 max_rdd; |
| 201 | __u32 max_mw; |
| 202 | __u32 max_raw_ipv6_qp; |
| 203 | __u32 max_raw_ethy_qp; |
| 204 | __u32 max_mcast_grp; |
| 205 | __u32 max_mcast_qp_attach; |
| 206 | __u32 max_total_mcast_qp_attach; |
| 207 | __u32 max_ah; |
| 208 | __u32 max_fmr; |
| 209 | __u32 max_map_per_fmr; |
| 210 | __u32 max_srq; |
| 211 | __u32 max_srq_wr; |
| 212 | __u32 max_srq_sge; |
| 213 | __u16 max_pkeys; |
| 214 | __u8 local_ca_ack_delay; |
| 215 | __u8 phys_port_cnt; |
| 216 | __u8 reserved[4]; |
| 217 | }; |
| 218 | |
Eli Cohen | 02d1aa7 | 2015-02-08 13:28:50 +0200 | [diff] [blame] | 219 | struct ib_uverbs_ex_query_device { |
| 220 | __u32 comp_mask; |
| 221 | __u32 reserved; |
| 222 | }; |
| 223 | |
Haggai Eran | f4056bf | 2015-02-08 13:28:51 +0200 | [diff] [blame] | 224 | struct ib_uverbs_odp_caps { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 225 | __aligned_u64 general_caps; |
Haggai Eran | f4056bf | 2015-02-08 13:28:51 +0200 | [diff] [blame] | 226 | struct { |
| 227 | __u32 rc_odp_caps; |
| 228 | __u32 uc_odp_caps; |
| 229 | __u32 ud_odp_caps; |
| 230 | } per_transport_caps; |
| 231 | __u32 reserved; |
| 232 | }; |
| 233 | |
Yishai Hadas | 47adf2f | 2016-08-28 11:28:44 +0300 | [diff] [blame] | 234 | struct ib_uverbs_rss_caps { |
| 235 | /* Corresponding bit will be set if qp type from |
| 236 | * 'enum ib_qp_type' is supported, e.g. |
| 237 | * supported_qpts |= 1 << IB_QPT_UD |
| 238 | */ |
| 239 | __u32 supported_qpts; |
| 240 | __u32 max_rwq_indirection_tables; |
| 241 | __u32 max_rwq_indirection_table_size; |
| 242 | __u32 reserved; |
| 243 | }; |
| 244 | |
Artemy Kovalyov | 8d50505 | 2017-08-17 15:52:08 +0300 | [diff] [blame] | 245 | struct ib_uverbs_tm_caps { |
| 246 | /* Max size of rendezvous request message */ |
| 247 | __u32 max_rndv_hdr_size; |
| 248 | /* Max number of entries in tag matching list */ |
| 249 | __u32 max_num_tags; |
| 250 | /* TM flags */ |
| 251 | __u32 flags; |
| 252 | /* Max number of outstanding list operations */ |
| 253 | __u32 max_ops; |
| 254 | /* Max number of SGE in tag matching entry */ |
| 255 | __u32 max_sge; |
| 256 | __u32 reserved; |
| 257 | }; |
| 258 | |
Eli Cohen | 02d1aa7 | 2015-02-08 13:28:50 +0200 | [diff] [blame] | 259 | struct ib_uverbs_ex_query_device_resp { |
| 260 | struct ib_uverbs_query_device_resp base; |
| 261 | __u32 comp_mask; |
| 262 | __u32 response_length; |
Haggai Eran | f4056bf | 2015-02-08 13:28:51 +0200 | [diff] [blame] | 263 | struct ib_uverbs_odp_caps odp_caps; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 264 | __aligned_u64 timestamp_mask; |
| 265 | __aligned_u64 hca_core_clock; /* in KHZ */ |
| 266 | __aligned_u64 device_cap_flags_ex; |
Yishai Hadas | 47adf2f | 2016-08-28 11:28:44 +0300 | [diff] [blame] | 267 | struct ib_uverbs_rss_caps rss_caps; |
| 268 | __u32 max_wq_type_rq; |
Noa Osherovich | 5f23d42 | 2017-01-18 15:39:58 +0200 | [diff] [blame] | 269 | __u32 raw_packet_caps; |
Leon Romanovsky | 78b1beb | 2017-09-24 21:46:29 +0300 | [diff] [blame] | 270 | struct ib_uverbs_tm_caps tm_caps; |
Yonatan Cohen | 18bd907 | 2017-11-13 10:51:16 +0200 | [diff] [blame] | 271 | struct ib_uverbs_cq_moderation_caps cq_moderation_caps; |
Ariel Levkovich | d41c120 | 2018-04-05 18:53:22 +0300 | [diff] [blame] | 272 | __aligned_u64 max_dm_size; |
Moni Shoua | 52a72e2 | 2019-01-22 08:48:42 +0200 | [diff] [blame] | 273 | __u32 xrc_odp_caps; |
| 274 | __u32 reserved; |
Eli Cohen | 02d1aa7 | 2015-02-08 13:28:50 +0200 | [diff] [blame] | 275 | }; |
| 276 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 277 | struct ib_uverbs_query_port { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 278 | __aligned_u64 response; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 279 | __u8 port_num; |
| 280 | __u8 reserved[7]; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 281 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 282 | }; |
| 283 | |
| 284 | struct ib_uverbs_query_port_resp { |
Jason Gunthorpe | 2f944c0 | 2018-07-04 15:57:48 +0300 | [diff] [blame] | 285 | __u32 port_cap_flags; /* see ib_uverbs_query_port_cap_flags */ |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 286 | __u32 max_msg_sz; |
| 287 | __u32 bad_pkey_cntr; |
| 288 | __u32 qkey_viol_cntr; |
| 289 | __u32 gid_tbl_len; |
| 290 | __u16 pkey_tbl_len; |
| 291 | __u16 lid; |
| 292 | __u16 sm_lid; |
| 293 | __u8 state; |
| 294 | __u8 max_mtu; |
| 295 | __u8 active_mtu; |
| 296 | __u8 lmc; |
| 297 | __u8 max_vl_num; |
| 298 | __u8 sm_sl; |
| 299 | __u8 subnet_timeout; |
| 300 | __u8 init_type_reply; |
| 301 | __u8 active_width; |
| 302 | __u8 active_speed; |
| 303 | __u8 phys_state; |
Eli Cohen | 2420b60 | 2010-10-18 14:45:20 -0700 | [diff] [blame] | 304 | __u8 link_layer; |
Artemy Kovalyov | 8942ace | 2018-07-04 15:57:51 +0300 | [diff] [blame] | 305 | __u8 flags; /* see ib_uverbs_query_port_flags */ |
| 306 | __u8 reserved; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 307 | }; |
| 308 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 309 | struct ib_uverbs_alloc_pd { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 310 | __aligned_u64 response; |
| 311 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 312 | }; |
| 313 | |
| 314 | struct ib_uverbs_alloc_pd_resp { |
| 315 | __u32 pd_handle; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 316 | __u32 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 317 | }; |
| 318 | |
| 319 | struct ib_uverbs_dealloc_pd { |
| 320 | __u32 pd_handle; |
| 321 | }; |
| 322 | |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 323 | struct ib_uverbs_open_xrcd { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 324 | __aligned_u64 response; |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 325 | __u32 fd; |
| 326 | __u32 oflags; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 327 | __aligned_u64 driver_data[0]; |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 328 | }; |
| 329 | |
| 330 | struct ib_uverbs_open_xrcd_resp { |
| 331 | __u32 xrcd_handle; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 332 | __u32 driver_data[0]; |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 333 | }; |
| 334 | |
| 335 | struct ib_uverbs_close_xrcd { |
| 336 | __u32 xrcd_handle; |
| 337 | }; |
| 338 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 339 | struct ib_uverbs_reg_mr { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 340 | __aligned_u64 response; |
| 341 | __aligned_u64 start; |
| 342 | __aligned_u64 length; |
| 343 | __aligned_u64 hca_va; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 344 | __u32 pd_handle; |
| 345 | __u32 access_flags; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 346 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 347 | }; |
| 348 | |
| 349 | struct ib_uverbs_reg_mr_resp { |
| 350 | __u32 mr_handle; |
| 351 | __u32 lkey; |
| 352 | __u32 rkey; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 353 | __u32 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 354 | }; |
| 355 | |
Matan Barak | 7e6edb9 | 2014-07-31 11:01:28 +0300 | [diff] [blame] | 356 | struct ib_uverbs_rereg_mr { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 357 | __aligned_u64 response; |
Matan Barak | 7e6edb9 | 2014-07-31 11:01:28 +0300 | [diff] [blame] | 358 | __u32 mr_handle; |
| 359 | __u32 flags; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 360 | __aligned_u64 start; |
| 361 | __aligned_u64 length; |
| 362 | __aligned_u64 hca_va; |
Matan Barak | 7e6edb9 | 2014-07-31 11:01:28 +0300 | [diff] [blame] | 363 | __u32 pd_handle; |
| 364 | __u32 access_flags; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 365 | __aligned_u64 driver_data[0]; |
Matan Barak | 7e6edb9 | 2014-07-31 11:01:28 +0300 | [diff] [blame] | 366 | }; |
| 367 | |
| 368 | struct ib_uverbs_rereg_mr_resp { |
| 369 | __u32 lkey; |
| 370 | __u32 rkey; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 371 | __aligned_u64 driver_data[0]; |
Matan Barak | 7e6edb9 | 2014-07-31 11:01:28 +0300 | [diff] [blame] | 372 | }; |
| 373 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 374 | struct ib_uverbs_dereg_mr { |
| 375 | __u32 mr_handle; |
| 376 | }; |
| 377 | |
Shani Michaeli | 6b52a12 | 2013-02-06 16:19:13 +0000 | [diff] [blame] | 378 | struct ib_uverbs_alloc_mw { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 379 | __aligned_u64 response; |
Shani Michaeli | 6b52a12 | 2013-02-06 16:19:13 +0000 | [diff] [blame] | 380 | __u32 pd_handle; |
| 381 | __u8 mw_type; |
| 382 | __u8 reserved[3]; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 383 | __aligned_u64 driver_data[0]; |
Shani Michaeli | 6b52a12 | 2013-02-06 16:19:13 +0000 | [diff] [blame] | 384 | }; |
| 385 | |
| 386 | struct ib_uverbs_alloc_mw_resp { |
| 387 | __u32 mw_handle; |
| 388 | __u32 rkey; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 389 | __aligned_u64 driver_data[0]; |
Shani Michaeli | 6b52a12 | 2013-02-06 16:19:13 +0000 | [diff] [blame] | 390 | }; |
| 391 | |
| 392 | struct ib_uverbs_dealloc_mw { |
| 393 | __u32 mw_handle; |
| 394 | }; |
| 395 | |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 396 | struct ib_uverbs_create_comp_channel { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 397 | __aligned_u64 response; |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 398 | }; |
| 399 | |
| 400 | struct ib_uverbs_create_comp_channel_resp { |
| 401 | __u32 fd; |
| 402 | }; |
| 403 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 404 | struct ib_uverbs_create_cq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 405 | __aligned_u64 response; |
| 406 | __aligned_u64 user_handle; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 407 | __u32 cqe; |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 408 | __u32 comp_vector; |
| 409 | __s32 comp_channel; |
| 410 | __u32 reserved; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 411 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 412 | }; |
| 413 | |
Jason Gunthorpe | beb801a | 2018-01-26 15:16:46 -0700 | [diff] [blame] | 414 | enum ib_uverbs_ex_create_cq_flags { |
| 415 | IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0, |
| 416 | IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1, |
| 417 | }; |
| 418 | |
Matan Barak | 565197d | 2015-06-11 16:35:23 +0300 | [diff] [blame] | 419 | struct ib_uverbs_ex_create_cq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 420 | __aligned_u64 user_handle; |
Matan Barak | 565197d | 2015-06-11 16:35:23 +0300 | [diff] [blame] | 421 | __u32 cqe; |
| 422 | __u32 comp_vector; |
| 423 | __s32 comp_channel; |
| 424 | __u32 comp_mask; |
Jason Gunthorpe | beb801a | 2018-01-26 15:16:46 -0700 | [diff] [blame] | 425 | __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */ |
Matan Barak | 565197d | 2015-06-11 16:35:23 +0300 | [diff] [blame] | 426 | __u32 reserved; |
| 427 | }; |
| 428 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 429 | struct ib_uverbs_create_cq_resp { |
| 430 | __u32 cq_handle; |
| 431 | __u32 cqe; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 432 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 433 | }; |
| 434 | |
Matan Barak | 565197d | 2015-06-11 16:35:23 +0300 | [diff] [blame] | 435 | struct ib_uverbs_ex_create_cq_resp { |
| 436 | struct ib_uverbs_create_cq_resp base; |
| 437 | __u32 comp_mask; |
| 438 | __u32 response_length; |
| 439 | }; |
| 440 | |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 441 | struct ib_uverbs_resize_cq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 442 | __aligned_u64 response; |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 443 | __u32 cq_handle; |
| 444 | __u32 cqe; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 445 | __aligned_u64 driver_data[0]; |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 446 | }; |
| 447 | |
| 448 | struct ib_uverbs_resize_cq_resp { |
| 449 | __u32 cqe; |
Ralph Campbell | 64f817b | 2006-09-22 15:22:24 -0700 | [diff] [blame] | 450 | __u32 reserved; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 451 | __aligned_u64 driver_data[0]; |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 452 | }; |
| 453 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 454 | struct ib_uverbs_poll_cq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 455 | __aligned_u64 response; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 456 | __u32 cq_handle; |
| 457 | __u32 ne; |
| 458 | }; |
| 459 | |
| 460 | struct ib_uverbs_wc { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 461 | __aligned_u64 wr_id; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 462 | __u32 status; |
| 463 | __u32 opcode; |
| 464 | __u32 vendor_err; |
| 465 | __u32 byte_len; |
Steve Wise | 00f7ec3 | 2008-07-14 23:48:45 -0700 | [diff] [blame] | 466 | union { |
Jason Gunthorpe | c966ea1 | 2018-01-11 14:43:05 -0700 | [diff] [blame] | 467 | __be32 imm_data; |
Steve Wise | 00f7ec3 | 2008-07-14 23:48:45 -0700 | [diff] [blame] | 468 | __u32 invalidate_rkey; |
| 469 | } ex; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 470 | __u32 qp_num; |
| 471 | __u32 src_qp; |
| 472 | __u32 wc_flags; |
| 473 | __u16 pkey_index; |
| 474 | __u16 slid; |
| 475 | __u8 sl; |
| 476 | __u8 dlid_path_bits; |
| 477 | __u8 port_num; |
| 478 | __u8 reserved; |
| 479 | }; |
| 480 | |
| 481 | struct ib_uverbs_poll_cq_resp { |
| 482 | __u32 count; |
| 483 | __u32 reserved; |
| 484 | struct ib_uverbs_wc wc[0]; |
| 485 | }; |
| 486 | |
| 487 | struct ib_uverbs_req_notify_cq { |
| 488 | __u32 cq_handle; |
| 489 | __u32 solicited_only; |
| 490 | }; |
| 491 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 492 | struct ib_uverbs_destroy_cq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 493 | __aligned_u64 response; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 494 | __u32 cq_handle; |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 495 | __u32 reserved; |
| 496 | }; |
| 497 | |
| 498 | struct ib_uverbs_destroy_cq_resp { |
| 499 | __u32 comp_events_reported; |
| 500 | __u32 async_events_reported; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 501 | }; |
| 502 | |
Sean Hefty | 6a9af2e | 2006-06-17 20:37:27 -0700 | [diff] [blame] | 503 | struct ib_uverbs_global_route { |
| 504 | __u8 dgid[16]; |
| 505 | __u32 flow_label; |
| 506 | __u8 sgid_index; |
| 507 | __u8 hop_limit; |
| 508 | __u8 traffic_class; |
| 509 | __u8 reserved; |
| 510 | }; |
| 511 | |
| 512 | struct ib_uverbs_ah_attr { |
| 513 | struct ib_uverbs_global_route grh; |
| 514 | __u16 dlid; |
| 515 | __u8 sl; |
| 516 | __u8 src_path_bits; |
| 517 | __u8 static_rate; |
| 518 | __u8 is_global; |
| 519 | __u8 port_num; |
| 520 | __u8 reserved; |
| 521 | }; |
| 522 | |
| 523 | struct ib_uverbs_qp_attr { |
| 524 | __u32 qp_attr_mask; |
| 525 | __u32 qp_state; |
| 526 | __u32 cur_qp_state; |
| 527 | __u32 path_mtu; |
| 528 | __u32 path_mig_state; |
| 529 | __u32 qkey; |
| 530 | __u32 rq_psn; |
| 531 | __u32 sq_psn; |
| 532 | __u32 dest_qp_num; |
| 533 | __u32 qp_access_flags; |
| 534 | |
| 535 | struct ib_uverbs_ah_attr ah_attr; |
| 536 | struct ib_uverbs_ah_attr alt_ah_attr; |
| 537 | |
| 538 | /* ib_qp_cap */ |
| 539 | __u32 max_send_wr; |
| 540 | __u32 max_recv_wr; |
| 541 | __u32 max_send_sge; |
| 542 | __u32 max_recv_sge; |
| 543 | __u32 max_inline_data; |
| 544 | |
| 545 | __u16 pkey_index; |
| 546 | __u16 alt_pkey_index; |
| 547 | __u8 en_sqd_async_notify; |
| 548 | __u8 sq_draining; |
| 549 | __u8 max_rd_atomic; |
| 550 | __u8 max_dest_rd_atomic; |
| 551 | __u8 min_rnr_timer; |
| 552 | __u8 port_num; |
| 553 | __u8 timeout; |
| 554 | __u8 retry_cnt; |
| 555 | __u8 rnr_retry; |
| 556 | __u8 alt_port_num; |
| 557 | __u8 alt_timeout; |
| 558 | __u8 reserved[5]; |
| 559 | }; |
| 560 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 561 | struct ib_uverbs_create_qp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 562 | __aligned_u64 response; |
| 563 | __aligned_u64 user_handle; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 564 | __u32 pd_handle; |
| 565 | __u32 send_cq_handle; |
| 566 | __u32 recv_cq_handle; |
| 567 | __u32 srq_handle; |
| 568 | __u32 max_send_wr; |
| 569 | __u32 max_recv_wr; |
| 570 | __u32 max_send_sge; |
| 571 | __u32 max_recv_sge; |
| 572 | __u32 max_inline_data; |
| 573 | __u8 sq_sig_all; |
| 574 | __u8 qp_type; |
| 575 | __u8 is_srq; |
| 576 | __u8 reserved; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 577 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 578 | }; |
| 579 | |
Yishai Hadas | c70285f | 2016-05-23 15:20:55 +0300 | [diff] [blame] | 580 | enum ib_uverbs_create_qp_mask { |
| 581 | IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0, |
| 582 | }; |
| 583 | |
| 584 | enum { |
| 585 | IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE, |
| 586 | }; |
| 587 | |
Bodong Wang | 189aba9 | 2016-12-01 13:43:15 +0200 | [diff] [blame] | 588 | enum { |
Leon Romanovsky | 646ebd4 | 2017-02-08 17:04:09 +0200 | [diff] [blame] | 589 | /* |
| 590 | * This value is equal to IB_QP_DEST_QPN. |
| 591 | */ |
| 592 | IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20, |
Bodong Wang | 189aba9 | 2016-12-01 13:43:15 +0200 | [diff] [blame] | 593 | }; |
| 594 | |
| 595 | enum { |
Leon Romanovsky | 646ebd4 | 2017-02-08 17:04:09 +0200 | [diff] [blame] | 596 | /* |
| 597 | * This value is equal to IB_QP_RATE_LIMIT. |
| 598 | */ |
| 599 | IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25, |
Bodong Wang | 189aba9 | 2016-12-01 13:43:15 +0200 | [diff] [blame] | 600 | }; |
| 601 | |
Eran Ben Elisha | 6d8a749 | 2015-10-21 17:00:42 +0300 | [diff] [blame] | 602 | struct ib_uverbs_ex_create_qp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 603 | __aligned_u64 user_handle; |
Eran Ben Elisha | 6d8a749 | 2015-10-21 17:00:42 +0300 | [diff] [blame] | 604 | __u32 pd_handle; |
| 605 | __u32 send_cq_handle; |
| 606 | __u32 recv_cq_handle; |
| 607 | __u32 srq_handle; |
| 608 | __u32 max_send_wr; |
| 609 | __u32 max_recv_wr; |
| 610 | __u32 max_send_sge; |
| 611 | __u32 max_recv_sge; |
| 612 | __u32 max_inline_data; |
| 613 | __u8 sq_sig_all; |
| 614 | __u8 qp_type; |
| 615 | __u8 is_srq; |
| 616 | __u8 reserved; |
| 617 | __u32 comp_mask; |
| 618 | __u32 create_flags; |
Yishai Hadas | c70285f | 2016-05-23 15:20:55 +0300 | [diff] [blame] | 619 | __u32 rwq_ind_tbl_handle; |
Yishai Hadas | 2dee0e5 | 2017-06-08 16:15:07 +0300 | [diff] [blame] | 620 | __u32 source_qpn; |
Eran Ben Elisha | 6d8a749 | 2015-10-21 17:00:42 +0300 | [diff] [blame] | 621 | }; |
| 622 | |
Sean Hefty | 42849b2 | 2011-08-11 13:57:43 -0700 | [diff] [blame] | 623 | struct ib_uverbs_open_qp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 624 | __aligned_u64 response; |
| 625 | __aligned_u64 user_handle; |
Sean Hefty | 42849b2 | 2011-08-11 13:57:43 -0700 | [diff] [blame] | 626 | __u32 pd_handle; |
| 627 | __u32 qpn; |
| 628 | __u8 qp_type; |
| 629 | __u8 reserved[7]; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 630 | __aligned_u64 driver_data[0]; |
Sean Hefty | 42849b2 | 2011-08-11 13:57:43 -0700 | [diff] [blame] | 631 | }; |
| 632 | |
| 633 | /* also used for open response */ |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 634 | struct ib_uverbs_create_qp_resp { |
| 635 | __u32 qp_handle; |
| 636 | __u32 qpn; |
Jack Morgenstein | 77369ed | 2005-11-09 11:26:07 -0800 | [diff] [blame] | 637 | __u32 max_send_wr; |
| 638 | __u32 max_recv_wr; |
| 639 | __u32 max_send_sge; |
| 640 | __u32 max_recv_sge; |
| 641 | __u32 max_inline_data; |
Roland Dreier | 4d9781c | 2006-02-16 09:26:19 -0800 | [diff] [blame] | 642 | __u32 reserved; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 643 | __u32 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 644 | }; |
| 645 | |
Eran Ben Elisha | 6d8a749 | 2015-10-21 17:00:42 +0300 | [diff] [blame] | 646 | struct ib_uverbs_ex_create_qp_resp { |
| 647 | struct ib_uverbs_create_qp_resp base; |
| 648 | __u32 comp_mask; |
| 649 | __u32 response_length; |
| 650 | }; |
| 651 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 652 | /* |
| 653 | * This struct needs to remain a multiple of 8 bytes to keep the |
| 654 | * alignment of the modify QP parameters. |
| 655 | */ |
| 656 | struct ib_uverbs_qp_dest { |
| 657 | __u8 dgid[16]; |
| 658 | __u32 flow_label; |
| 659 | __u16 dlid; |
| 660 | __u16 reserved; |
| 661 | __u8 sgid_index; |
| 662 | __u8 hop_limit; |
| 663 | __u8 traffic_class; |
| 664 | __u8 sl; |
| 665 | __u8 src_path_bits; |
| 666 | __u8 static_rate; |
| 667 | __u8 is_global; |
| 668 | __u8 port_num; |
| 669 | }; |
| 670 | |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 671 | struct ib_uverbs_query_qp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 672 | __aligned_u64 response; |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 673 | __u32 qp_handle; |
| 674 | __u32 attr_mask; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 675 | __aligned_u64 driver_data[0]; |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 676 | }; |
| 677 | |
| 678 | struct ib_uverbs_query_qp_resp { |
| 679 | struct ib_uverbs_qp_dest dest; |
| 680 | struct ib_uverbs_qp_dest alt_dest; |
| 681 | __u32 max_send_wr; |
| 682 | __u32 max_recv_wr; |
| 683 | __u32 max_send_sge; |
| 684 | __u32 max_recv_sge; |
| 685 | __u32 max_inline_data; |
| 686 | __u32 qkey; |
| 687 | __u32 rq_psn; |
| 688 | __u32 sq_psn; |
| 689 | __u32 dest_qp_num; |
| 690 | __u32 qp_access_flags; |
| 691 | __u16 pkey_index; |
| 692 | __u16 alt_pkey_index; |
| 693 | __u8 qp_state; |
| 694 | __u8 cur_qp_state; |
| 695 | __u8 path_mtu; |
| 696 | __u8 path_mig_state; |
Jack Morgenstein | 0b26c88 | 2006-10-25 12:54:20 +0200 | [diff] [blame] | 697 | __u8 sq_draining; |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 698 | __u8 max_rd_atomic; |
| 699 | __u8 max_dest_rd_atomic; |
| 700 | __u8 min_rnr_timer; |
| 701 | __u8 port_num; |
| 702 | __u8 timeout; |
| 703 | __u8 retry_cnt; |
| 704 | __u8 rnr_retry; |
| 705 | __u8 alt_port_num; |
| 706 | __u8 alt_timeout; |
| 707 | __u8 sq_sig_all; |
| 708 | __u8 reserved[5]; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 709 | __aligned_u64 driver_data[0]; |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 710 | }; |
| 711 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 712 | struct ib_uverbs_modify_qp { |
| 713 | struct ib_uverbs_qp_dest dest; |
| 714 | struct ib_uverbs_qp_dest alt_dest; |
| 715 | __u32 qp_handle; |
| 716 | __u32 attr_mask; |
| 717 | __u32 qkey; |
| 718 | __u32 rq_psn; |
| 719 | __u32 sq_psn; |
| 720 | __u32 dest_qp_num; |
| 721 | __u32 qp_access_flags; |
| 722 | __u16 pkey_index; |
| 723 | __u16 alt_pkey_index; |
| 724 | __u8 qp_state; |
| 725 | __u8 cur_qp_state; |
| 726 | __u8 path_mtu; |
| 727 | __u8 path_mig_state; |
| 728 | __u8 en_sqd_async_notify; |
| 729 | __u8 max_rd_atomic; |
| 730 | __u8 max_dest_rd_atomic; |
| 731 | __u8 min_rnr_timer; |
| 732 | __u8 port_num; |
| 733 | __u8 timeout; |
| 734 | __u8 retry_cnt; |
| 735 | __u8 rnr_retry; |
| 736 | __u8 alt_port_num; |
| 737 | __u8 alt_timeout; |
| 738 | __u8 reserved[2]; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 739 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 740 | }; |
| 741 | |
Bodong Wang | 189aba9 | 2016-12-01 13:43:15 +0200 | [diff] [blame] | 742 | struct ib_uverbs_ex_modify_qp { |
| 743 | struct ib_uverbs_modify_qp base; |
| 744 | __u32 rate_limit; |
| 745 | __u32 reserved; |
| 746 | }; |
| 747 | |
Bodong Wang | 189aba9 | 2016-12-01 13:43:15 +0200 | [diff] [blame] | 748 | struct ib_uverbs_ex_modify_qp_resp { |
| 749 | __u32 comp_mask; |
| 750 | __u32 response_length; |
| 751 | }; |
| 752 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 753 | struct ib_uverbs_destroy_qp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 754 | __aligned_u64 response; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 755 | __u32 qp_handle; |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 756 | __u32 reserved; |
| 757 | }; |
| 758 | |
| 759 | struct ib_uverbs_destroy_qp_resp { |
| 760 | __u32 events_reported; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 761 | }; |
| 762 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 763 | /* |
| 764 | * The ib_uverbs_sge structure isn't used anywhere, since we assume |
| 765 | * the ib_sge structure is packed the same way on 32-bit and 64-bit |
| 766 | * architectures in both kernel and user space. It's just here to |
| 767 | * document the ABI. |
| 768 | */ |
| 769 | struct ib_uverbs_sge { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 770 | __aligned_u64 addr; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 771 | __u32 length; |
| 772 | __u32 lkey; |
| 773 | }; |
| 774 | |
Jason Gunthorpe | 9a59739 | 2018-08-14 15:33:02 -0700 | [diff] [blame] | 775 | enum ib_uverbs_wr_opcode { |
| 776 | IB_UVERBS_WR_RDMA_WRITE = 0, |
| 777 | IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1, |
| 778 | IB_UVERBS_WR_SEND = 2, |
| 779 | IB_UVERBS_WR_SEND_WITH_IMM = 3, |
| 780 | IB_UVERBS_WR_RDMA_READ = 4, |
| 781 | IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5, |
| 782 | IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6, |
| 783 | IB_UVERBS_WR_LOCAL_INV = 7, |
| 784 | IB_UVERBS_WR_BIND_MW = 8, |
| 785 | IB_UVERBS_WR_SEND_WITH_INV = 9, |
| 786 | IB_UVERBS_WR_TSO = 10, |
| 787 | IB_UVERBS_WR_RDMA_READ_WITH_INV = 11, |
| 788 | IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12, |
| 789 | IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13, |
| 790 | /* Review enum ib_wr_opcode before modifying this */ |
| 791 | }; |
| 792 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 793 | struct ib_uverbs_send_wr { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 794 | __aligned_u64 wr_id; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 795 | __u32 num_sge; |
Jason Gunthorpe | 9a59739 | 2018-08-14 15:33:02 -0700 | [diff] [blame] | 796 | __u32 opcode; /* see enum ib_uverbs_wr_opcode */ |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 797 | __u32 send_flags; |
Roland Dreier | 0f39cf3 | 2008-04-16 21:09:32 -0700 | [diff] [blame] | 798 | union { |
Jason Gunthorpe | c966ea1 | 2018-01-11 14:43:05 -0700 | [diff] [blame] | 799 | __be32 imm_data; |
Roland Dreier | 0f39cf3 | 2008-04-16 21:09:32 -0700 | [diff] [blame] | 800 | __u32 invalidate_rkey; |
| 801 | } ex; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 802 | union { |
| 803 | struct { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 804 | __aligned_u64 remote_addr; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 805 | __u32 rkey; |
| 806 | __u32 reserved; |
| 807 | } rdma; |
| 808 | struct { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 809 | __aligned_u64 remote_addr; |
| 810 | __aligned_u64 compare_add; |
| 811 | __aligned_u64 swap; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 812 | __u32 rkey; |
| 813 | __u32 reserved; |
| 814 | } atomic; |
| 815 | struct { |
| 816 | __u32 ah; |
| 817 | __u32 remote_qpn; |
| 818 | __u32 remote_qkey; |
| 819 | __u32 reserved; |
| 820 | } ud; |
| 821 | } wr; |
| 822 | }; |
| 823 | |
| 824 | struct ib_uverbs_post_send { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 825 | __aligned_u64 response; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 826 | __u32 qp_handle; |
| 827 | __u32 wr_count; |
| 828 | __u32 sge_count; |
| 829 | __u32 wqe_size; |
| 830 | struct ib_uverbs_send_wr send_wr[0]; |
| 831 | }; |
| 832 | |
| 833 | struct ib_uverbs_post_send_resp { |
| 834 | __u32 bad_wr; |
| 835 | }; |
| 836 | |
| 837 | struct ib_uverbs_recv_wr { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 838 | __aligned_u64 wr_id; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 839 | __u32 num_sge; |
| 840 | __u32 reserved; |
| 841 | }; |
| 842 | |
| 843 | struct ib_uverbs_post_recv { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 844 | __aligned_u64 response; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 845 | __u32 qp_handle; |
| 846 | __u32 wr_count; |
| 847 | __u32 sge_count; |
| 848 | __u32 wqe_size; |
| 849 | struct ib_uverbs_recv_wr recv_wr[0]; |
| 850 | }; |
| 851 | |
| 852 | struct ib_uverbs_post_recv_resp { |
| 853 | __u32 bad_wr; |
| 854 | }; |
| 855 | |
| 856 | struct ib_uverbs_post_srq_recv { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 857 | __aligned_u64 response; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 858 | __u32 srq_handle; |
| 859 | __u32 wr_count; |
| 860 | __u32 sge_count; |
| 861 | __u32 wqe_size; |
| 862 | struct ib_uverbs_recv_wr recv[0]; |
| 863 | }; |
| 864 | |
| 865 | struct ib_uverbs_post_srq_recv_resp { |
| 866 | __u32 bad_wr; |
| 867 | }; |
| 868 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 869 | struct ib_uverbs_create_ah { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 870 | __aligned_u64 response; |
| 871 | __aligned_u64 user_handle; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 872 | __u32 pd_handle; |
| 873 | __u32 reserved; |
| 874 | struct ib_uverbs_ah_attr attr; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 875 | __aligned_u64 driver_data[0]; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 876 | }; |
| 877 | |
| 878 | struct ib_uverbs_create_ah_resp { |
| 879 | __u32 ah_handle; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 880 | __u32 driver_data[0]; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 881 | }; |
| 882 | |
| 883 | struct ib_uverbs_destroy_ah { |
| 884 | __u32 ah_handle; |
| 885 | }; |
| 886 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 887 | struct ib_uverbs_attach_mcast { |
| 888 | __u8 gid[16]; |
| 889 | __u32 qp_handle; |
| 890 | __u16 mlid; |
| 891 | __u16 reserved; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 892 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 893 | }; |
| 894 | |
| 895 | struct ib_uverbs_detach_mcast { |
| 896 | __u8 gid[16]; |
| 897 | __u32 qp_handle; |
| 898 | __u16 mlid; |
| 899 | __u16 reserved; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 900 | __aligned_u64 driver_data[0]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 901 | }; |
| 902 | |
Yann Droneaud | 58913ef | 2013-11-06 23:21:47 +0100 | [diff] [blame] | 903 | struct ib_uverbs_flow_spec_hdr { |
| 904 | __u32 type; |
| 905 | __u16 size; |
| 906 | __u16 reserved; |
| 907 | /* followed by flow_spec */ |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 908 | __aligned_u64 flow_spec_data[0]; |
Yann Droneaud | 58913ef | 2013-11-06 23:21:47 +0100 | [diff] [blame] | 909 | }; |
| 910 | |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 911 | struct ib_uverbs_flow_eth_filter { |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 912 | __u8 dst_mac[6]; |
| 913 | __u8 src_mac[6]; |
| 914 | __be16 ether_type; |
| 915 | __be16 vlan_tag; |
| 916 | }; |
| 917 | |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 918 | struct ib_uverbs_flow_spec_eth { |
Yann Droneaud | 58913ef | 2013-11-06 23:21:47 +0100 | [diff] [blame] | 919 | union { |
| 920 | struct ib_uverbs_flow_spec_hdr hdr; |
| 921 | struct { |
| 922 | __u32 type; |
| 923 | __u16 size; |
| 924 | __u16 reserved; |
| 925 | }; |
| 926 | }; |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 927 | struct ib_uverbs_flow_eth_filter val; |
| 928 | struct ib_uverbs_flow_eth_filter mask; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 929 | }; |
| 930 | |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 931 | struct ib_uverbs_flow_ipv4_filter { |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 932 | __be32 src_ip; |
| 933 | __be32 dst_ip; |
Maor Gottlieb | 989a3a8 | 2016-08-30 16:58:33 +0300 | [diff] [blame] | 934 | __u8 proto; |
| 935 | __u8 tos; |
| 936 | __u8 ttl; |
| 937 | __u8 flags; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 938 | }; |
| 939 | |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 940 | struct ib_uverbs_flow_spec_ipv4 { |
Yann Droneaud | 58913ef | 2013-11-06 23:21:47 +0100 | [diff] [blame] | 941 | union { |
| 942 | struct ib_uverbs_flow_spec_hdr hdr; |
| 943 | struct { |
| 944 | __u32 type; |
| 945 | __u16 size; |
| 946 | __u16 reserved; |
| 947 | }; |
| 948 | }; |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 949 | struct ib_uverbs_flow_ipv4_filter val; |
| 950 | struct ib_uverbs_flow_ipv4_filter mask; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 951 | }; |
| 952 | |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 953 | struct ib_uverbs_flow_tcp_udp_filter { |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 954 | __be16 dst_port; |
| 955 | __be16 src_port; |
| 956 | }; |
| 957 | |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 958 | struct ib_uverbs_flow_spec_tcp_udp { |
Yann Droneaud | 58913ef | 2013-11-06 23:21:47 +0100 | [diff] [blame] | 959 | union { |
| 960 | struct ib_uverbs_flow_spec_hdr hdr; |
| 961 | struct { |
| 962 | __u32 type; |
| 963 | __u16 size; |
| 964 | __u16 reserved; |
| 965 | }; |
| 966 | }; |
Yann Droneaud | b68c956 | 2013-11-06 23:21:46 +0100 | [diff] [blame] | 967 | struct ib_uverbs_flow_tcp_udp_filter val; |
| 968 | struct ib_uverbs_flow_tcp_udp_filter mask; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 969 | }; |
| 970 | |
Maor Gottlieb | 4c2aae7 | 2016-06-17 15:14:50 +0300 | [diff] [blame] | 971 | struct ib_uverbs_flow_ipv6_filter { |
Maor Gottlieb | a72c6a2 | 2016-08-30 16:58:34 +0300 | [diff] [blame] | 972 | __u8 src_ip[16]; |
| 973 | __u8 dst_ip[16]; |
| 974 | __be32 flow_label; |
| 975 | __u8 next_hdr; |
| 976 | __u8 traffic_class; |
| 977 | __u8 hop_limit; |
| 978 | __u8 reserved; |
Maor Gottlieb | 4c2aae7 | 2016-06-17 15:14:50 +0300 | [diff] [blame] | 979 | }; |
| 980 | |
| 981 | struct ib_uverbs_flow_spec_ipv6 { |
| 982 | union { |
| 983 | struct ib_uverbs_flow_spec_hdr hdr; |
| 984 | struct { |
| 985 | __u32 type; |
| 986 | __u16 size; |
| 987 | __u16 reserved; |
| 988 | }; |
| 989 | }; |
| 990 | struct ib_uverbs_flow_ipv6_filter val; |
| 991 | struct ib_uverbs_flow_ipv6_filter mask; |
| 992 | }; |
| 993 | |
Moses Reuben | 94e03f1 | 2017-01-18 14:59:49 +0200 | [diff] [blame] | 994 | struct ib_uverbs_flow_spec_action_tag { |
| 995 | union { |
| 996 | struct ib_uverbs_flow_spec_hdr hdr; |
| 997 | struct { |
| 998 | __u32 type; |
| 999 | __u16 size; |
| 1000 | __u16 reserved; |
| 1001 | }; |
| 1002 | }; |
| 1003 | __u32 tag_id; |
| 1004 | __u32 reserved1; |
| 1005 | }; |
| 1006 | |
Slava Shwartsman | 483a396 | 2017-04-03 13:13:51 +0300 | [diff] [blame] | 1007 | struct ib_uverbs_flow_spec_action_drop { |
| 1008 | union { |
| 1009 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1010 | struct { |
| 1011 | __u32 type; |
| 1012 | __u16 size; |
| 1013 | __u16 reserved; |
| 1014 | }; |
| 1015 | }; |
| 1016 | }; |
| 1017 | |
Matan Barak | 9b82844 | 2018-03-28 09:27:46 +0300 | [diff] [blame] | 1018 | struct ib_uverbs_flow_spec_action_handle { |
| 1019 | union { |
| 1020 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1021 | struct { |
| 1022 | __u32 type; |
| 1023 | __u16 size; |
| 1024 | __u16 reserved; |
| 1025 | }; |
| 1026 | }; |
| 1027 | __u32 handle; |
| 1028 | __u32 reserved1; |
| 1029 | }; |
| 1030 | |
Raed Salem | b6ba4a9 | 2018-05-31 16:43:37 +0300 | [diff] [blame] | 1031 | struct ib_uverbs_flow_spec_action_count { |
| 1032 | union { |
| 1033 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1034 | struct { |
| 1035 | __u32 type; |
| 1036 | __u16 size; |
| 1037 | __u16 reserved; |
| 1038 | }; |
| 1039 | }; |
| 1040 | __u32 handle; |
| 1041 | __u32 reserved1; |
| 1042 | }; |
| 1043 | |
Moses Reuben | a0cb4c7 | 2016-11-14 19:04:49 +0200 | [diff] [blame] | 1044 | struct ib_uverbs_flow_tunnel_filter { |
| 1045 | __be32 tunnel_id; |
| 1046 | }; |
| 1047 | |
| 1048 | struct ib_uverbs_flow_spec_tunnel { |
| 1049 | union { |
| 1050 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1051 | struct { |
| 1052 | __u32 type; |
| 1053 | __u16 size; |
| 1054 | __u16 reserved; |
| 1055 | }; |
| 1056 | }; |
| 1057 | struct ib_uverbs_flow_tunnel_filter val; |
| 1058 | struct ib_uverbs_flow_tunnel_filter mask; |
| 1059 | }; |
| 1060 | |
Matan Barak | 56ab0b3 | 2018-03-28 09:27:49 +0300 | [diff] [blame] | 1061 | struct ib_uverbs_flow_spec_esp_filter { |
| 1062 | __u32 spi; |
| 1063 | __u32 seq; |
| 1064 | }; |
| 1065 | |
| 1066 | struct ib_uverbs_flow_spec_esp { |
| 1067 | union { |
| 1068 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1069 | struct { |
| 1070 | __u32 type; |
| 1071 | __u16 size; |
| 1072 | __u16 reserved; |
| 1073 | }; |
| 1074 | }; |
| 1075 | struct ib_uverbs_flow_spec_esp_filter val; |
| 1076 | struct ib_uverbs_flow_spec_esp_filter mask; |
| 1077 | }; |
| 1078 | |
Ariel Levkovich | 20b6563 | 2018-05-13 14:33:29 +0300 | [diff] [blame] | 1079 | struct ib_uverbs_flow_gre_filter { |
| 1080 | /* c_ks_res0_ver field is bits 0-15 in offset 0 of a standard GRE header: |
| 1081 | * bit 0 - C - checksum bit. |
| 1082 | * bit 1 - reserved. set to 0. |
| 1083 | * bit 2 - key bit. |
| 1084 | * bit 3 - sequence number bit. |
| 1085 | * bits 4:12 - reserved. set to 0. |
| 1086 | * bits 13:15 - GRE version. |
| 1087 | */ |
| 1088 | __be16 c_ks_res0_ver; |
| 1089 | __be16 protocol; |
| 1090 | __be32 key; |
| 1091 | }; |
| 1092 | |
| 1093 | struct ib_uverbs_flow_spec_gre { |
| 1094 | union { |
| 1095 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1096 | struct { |
| 1097 | __u32 type; |
| 1098 | __u16 size; |
| 1099 | __u16 reserved; |
| 1100 | }; |
| 1101 | }; |
| 1102 | struct ib_uverbs_flow_gre_filter val; |
| 1103 | struct ib_uverbs_flow_gre_filter mask; |
| 1104 | }; |
| 1105 | |
Ariel Levkovich | 0d86bbe | 2018-05-13 14:33:31 +0300 | [diff] [blame] | 1106 | struct ib_uverbs_flow_mpls_filter { |
| 1107 | /* The field includes the entire MPLS label: |
| 1108 | * bits 0:19 - label field. |
| 1109 | * bits 20:22 - traffic class field. |
| 1110 | * bits 23 - bottom of stack bit. |
| 1111 | * bits 24:31 - ttl field. |
| 1112 | */ |
| 1113 | __be32 label; |
| 1114 | }; |
| 1115 | |
| 1116 | struct ib_uverbs_flow_spec_mpls { |
| 1117 | union { |
| 1118 | struct ib_uverbs_flow_spec_hdr hdr; |
| 1119 | struct { |
| 1120 | __u32 type; |
| 1121 | __u16 size; |
| 1122 | __u16 reserved; |
| 1123 | }; |
| 1124 | }; |
| 1125 | struct ib_uverbs_flow_mpls_filter val; |
| 1126 | struct ib_uverbs_flow_mpls_filter mask; |
| 1127 | }; |
| 1128 | |
Yann Droneaud | d82693d | 2013-11-06 23:21:45 +0100 | [diff] [blame] | 1129 | struct ib_uverbs_flow_attr { |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 1130 | __u32 type; |
| 1131 | __u16 size; |
| 1132 | __u16 priority; |
| 1133 | __u8 num_of_specs; |
| 1134 | __u8 reserved[2]; |
| 1135 | __u8 port; |
| 1136 | __u32 flags; |
| 1137 | /* Following are the optional layers according to user request |
| 1138 | * struct ib_flow_spec_xxx |
| 1139 | * struct ib_flow_spec_yyy |
| 1140 | */ |
Yann Droneaud | 58913ef | 2013-11-06 23:21:47 +0100 | [diff] [blame] | 1141 | struct ib_uverbs_flow_spec_hdr flow_specs[0]; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 1142 | }; |
| 1143 | |
| 1144 | struct ib_uverbs_create_flow { |
| 1145 | __u32 comp_mask; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 1146 | __u32 qp_handle; |
Yann Droneaud | d82693d | 2013-11-06 23:21:45 +0100 | [diff] [blame] | 1147 | struct ib_uverbs_flow_attr flow_attr; |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame] | 1148 | }; |
| 1149 | |
| 1150 | struct ib_uverbs_create_flow_resp { |
| 1151 | __u32 comp_mask; |
| 1152 | __u32 flow_handle; |
| 1153 | }; |
| 1154 | |
| 1155 | struct ib_uverbs_destroy_flow { |
| 1156 | __u32 comp_mask; |
| 1157 | __u32 flow_handle; |
| 1158 | }; |
| 1159 | |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1160 | struct ib_uverbs_create_srq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1161 | __aligned_u64 response; |
| 1162 | __aligned_u64 user_handle; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1163 | __u32 pd_handle; |
| 1164 | __u32 max_wr; |
| 1165 | __u32 max_sge; |
| 1166 | __u32 srq_limit; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1167 | __aligned_u64 driver_data[0]; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1168 | }; |
| 1169 | |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 1170 | struct ib_uverbs_create_xsrq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1171 | __aligned_u64 response; |
| 1172 | __aligned_u64 user_handle; |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 1173 | __u32 srq_type; |
| 1174 | __u32 pd_handle; |
| 1175 | __u32 max_wr; |
| 1176 | __u32 max_sge; |
| 1177 | __u32 srq_limit; |
Artemy Kovalyov | 9382d4e | 2017-08-17 15:52:06 +0300 | [diff] [blame] | 1178 | __u32 max_num_tags; |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 1179 | __u32 xrcd_handle; |
| 1180 | __u32 cq_handle; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1181 | __aligned_u64 driver_data[0]; |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 1182 | }; |
| 1183 | |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1184 | struct ib_uverbs_create_srq_resp { |
| 1185 | __u32 srq_handle; |
Dotan Barak | ea88fd1 | 2006-02-23 12:36:18 -0800 | [diff] [blame] | 1186 | __u32 max_wr; |
| 1187 | __u32 max_sge; |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 1188 | __u32 srqn; |
Jason Gunthorpe | 1b09577 | 2018-11-25 20:51:12 +0200 | [diff] [blame] | 1189 | __u32 driver_data[0]; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1190 | }; |
| 1191 | |
| 1192 | struct ib_uverbs_modify_srq { |
| 1193 | __u32 srq_handle; |
| 1194 | __u32 attr_mask; |
| 1195 | __u32 max_wr; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1196 | __u32 srq_limit; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1197 | __aligned_u64 driver_data[0]; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1198 | }; |
| 1199 | |
Dotan Barak | 8bdb0e8 | 2006-02-13 16:31:57 -0800 | [diff] [blame] | 1200 | struct ib_uverbs_query_srq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1201 | __aligned_u64 response; |
Dotan Barak | 8bdb0e8 | 2006-02-13 16:31:57 -0800 | [diff] [blame] | 1202 | __u32 srq_handle; |
| 1203 | __u32 reserved; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1204 | __aligned_u64 driver_data[0]; |
Dotan Barak | 8bdb0e8 | 2006-02-13 16:31:57 -0800 | [diff] [blame] | 1205 | }; |
| 1206 | |
| 1207 | struct ib_uverbs_query_srq_resp { |
| 1208 | __u32 max_wr; |
| 1209 | __u32 max_sge; |
| 1210 | __u32 srq_limit; |
| 1211 | __u32 reserved; |
| 1212 | }; |
| 1213 | |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1214 | struct ib_uverbs_destroy_srq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1215 | __aligned_u64 response; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1216 | __u32 srq_handle; |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 1217 | __u32 reserved; |
| 1218 | }; |
| 1219 | |
| 1220 | struct ib_uverbs_destroy_srq_resp { |
| 1221 | __u32 events_reported; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 1222 | }; |
| 1223 | |
Yishai Hadas | f213c05 | 2016-05-23 15:20:49 +0300 | [diff] [blame] | 1224 | struct ib_uverbs_ex_create_wq { |
| 1225 | __u32 comp_mask; |
| 1226 | __u32 wq_type; |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 1227 | __aligned_u64 user_handle; |
Yishai Hadas | f213c05 | 2016-05-23 15:20:49 +0300 | [diff] [blame] | 1228 | __u32 pd_handle; |
| 1229 | __u32 cq_handle; |
| 1230 | __u32 max_wr; |
| 1231 | __u32 max_sge; |
Noa Osherovich | af1cb95 | 2017-01-18 15:39:59 +0200 | [diff] [blame] | 1232 | __u32 create_flags; /* Use enum ib_wq_flags */ |
| 1233 | __u32 reserved; |
Yishai Hadas | f213c05 | 2016-05-23 15:20:49 +0300 | [diff] [blame] | 1234 | }; |
| 1235 | |
| 1236 | struct ib_uverbs_ex_create_wq_resp { |
| 1237 | __u32 comp_mask; |
| 1238 | __u32 response_length; |
| 1239 | __u32 wq_handle; |
| 1240 | __u32 max_wr; |
| 1241 | __u32 max_sge; |
| 1242 | __u32 wqn; |
| 1243 | }; |
| 1244 | |
| 1245 | struct ib_uverbs_ex_destroy_wq { |
| 1246 | __u32 comp_mask; |
| 1247 | __u32 wq_handle; |
| 1248 | }; |
| 1249 | |
| 1250 | struct ib_uverbs_ex_destroy_wq_resp { |
| 1251 | __u32 comp_mask; |
| 1252 | __u32 response_length; |
| 1253 | __u32 events_reported; |
| 1254 | __u32 reserved; |
| 1255 | }; |
| 1256 | |
| 1257 | struct ib_uverbs_ex_modify_wq { |
| 1258 | __u32 attr_mask; |
| 1259 | __u32 wq_handle; |
| 1260 | __u32 wq_state; |
| 1261 | __u32 curr_wq_state; |
Noa Osherovich | af1cb95 | 2017-01-18 15:39:59 +0200 | [diff] [blame] | 1262 | __u32 flags; /* Use enum ib_wq_flags */ |
| 1263 | __u32 flags_mask; /* Use enum ib_wq_flags */ |
Yishai Hadas | f213c05 | 2016-05-23 15:20:49 +0300 | [diff] [blame] | 1264 | }; |
| 1265 | |
Yishai Hadas | de019a9 | 2016-05-23 15:20:52 +0300 | [diff] [blame] | 1266 | /* Prevent memory allocation rather than max expected size */ |
| 1267 | #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d |
| 1268 | struct ib_uverbs_ex_create_rwq_ind_table { |
| 1269 | __u32 comp_mask; |
| 1270 | __u32 log_ind_tbl_size; |
| 1271 | /* Following are the wq handles according to log_ind_tbl_size |
| 1272 | * wq_handle1 |
| 1273 | * wq_handle2 |
| 1274 | */ |
| 1275 | __u32 wq_handles[0]; |
| 1276 | }; |
| 1277 | |
| 1278 | struct ib_uverbs_ex_create_rwq_ind_table_resp { |
| 1279 | __u32 comp_mask; |
| 1280 | __u32 response_length; |
| 1281 | __u32 ind_tbl_handle; |
| 1282 | __u32 ind_tbl_num; |
| 1283 | }; |
| 1284 | |
| 1285 | struct ib_uverbs_ex_destroy_rwq_ind_table { |
| 1286 | __u32 comp_mask; |
| 1287 | __u32 ind_tbl_handle; |
| 1288 | }; |
| 1289 | |
Yonatan Cohen | 869ddcf | 2017-11-13 10:51:13 +0200 | [diff] [blame] | 1290 | struct ib_uverbs_cq_moderation { |
| 1291 | __u16 cq_count; |
| 1292 | __u16 cq_period; |
| 1293 | }; |
| 1294 | |
| 1295 | struct ib_uverbs_ex_modify_cq { |
| 1296 | __u32 cq_handle; |
| 1297 | __u32 attr_mask; |
| 1298 | struct ib_uverbs_cq_moderation attr; |
| 1299 | __u32 reserved; |
| 1300 | }; |
| 1301 | |
Nicolas Dichtel | ea6819e | 2017-03-27 14:20:14 +0200 | [diff] [blame] | 1302 | #define IB_DEVICE_NAME_MAX 64 |
| 1303 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 1304 | #endif /* IB_USER_VERBS_H */ |