Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 3 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 4 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. |
Dotan Barak | 8bdb0e8 | 2006-02-13 16:31:57 -0800 | [diff] [blame] | 5 | * Copyright (c) 2006 Mellanox Technologies. All rights reserved. |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 6 | * |
| 7 | * This software is available to you under a choice of one of two |
| 8 | * licenses. You may choose to be licensed under the terms of the GNU |
| 9 | * General Public License (GPL) Version 2, available from the file |
| 10 | * COPYING in the main directory of this source tree, or the |
| 11 | * OpenIB.org BSD license below: |
| 12 | * |
| 13 | * Redistribution and use in source and binary forms, with or |
| 14 | * without modification, are permitted provided that the following |
| 15 | * conditions are met: |
| 16 | * |
| 17 | * - Redistributions of source code must retain the above |
| 18 | * copyright notice, this list of conditions and the following |
| 19 | * disclaimer. |
| 20 | * |
| 21 | * - Redistributions in binary form must reproduce the above |
| 22 | * copyright notice, this list of conditions and the following |
| 23 | * disclaimer in the documentation and/or other materials |
| 24 | * provided with the distribution. |
| 25 | * |
| 26 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 27 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 29 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 30 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 31 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 32 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 33 | * SOFTWARE. |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 34 | */ |
| 35 | |
| 36 | #ifndef IB_USER_VERBS_H |
| 37 | #define IB_USER_VERBS_H |
| 38 | |
| 39 | #include <linux/types.h> |
| 40 | |
| 41 | /* |
| 42 | * Increment this value if any changes that break userspace ABI |
| 43 | * compatibility are made. |
| 44 | */ |
Dotan Barak | ea88fd1 | 2006-02-23 12:36:18 -0800 | [diff] [blame] | 45 | #define IB_USER_VERBS_ABI_VERSION 6 |
Igor Ivanov | 400dbc9 | 2013-08-14 13:58:29 +0300 | [diff] [blame] | 46 | #define IB_USER_VERBS_CMD_THRESHOLD 50 |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 47 | |
| 48 | enum { |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 49 | IB_USER_VERBS_CMD_GET_CONTEXT, |
| 50 | IB_USER_VERBS_CMD_QUERY_DEVICE, |
| 51 | IB_USER_VERBS_CMD_QUERY_PORT, |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 52 | IB_USER_VERBS_CMD_ALLOC_PD, |
| 53 | IB_USER_VERBS_CMD_DEALLOC_PD, |
| 54 | IB_USER_VERBS_CMD_CREATE_AH, |
| 55 | IB_USER_VERBS_CMD_MODIFY_AH, |
| 56 | IB_USER_VERBS_CMD_QUERY_AH, |
| 57 | IB_USER_VERBS_CMD_DESTROY_AH, |
| 58 | IB_USER_VERBS_CMD_REG_MR, |
| 59 | IB_USER_VERBS_CMD_REG_SMR, |
| 60 | IB_USER_VERBS_CMD_REREG_MR, |
| 61 | IB_USER_VERBS_CMD_QUERY_MR, |
| 62 | IB_USER_VERBS_CMD_DEREG_MR, |
| 63 | IB_USER_VERBS_CMD_ALLOC_MW, |
| 64 | IB_USER_VERBS_CMD_BIND_MW, |
| 65 | IB_USER_VERBS_CMD_DEALLOC_MW, |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 66 | IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 67 | IB_USER_VERBS_CMD_CREATE_CQ, |
| 68 | IB_USER_VERBS_CMD_RESIZE_CQ, |
| 69 | IB_USER_VERBS_CMD_DESTROY_CQ, |
| 70 | IB_USER_VERBS_CMD_POLL_CQ, |
| 71 | IB_USER_VERBS_CMD_PEEK_CQ, |
| 72 | IB_USER_VERBS_CMD_REQ_NOTIFY_CQ, |
| 73 | IB_USER_VERBS_CMD_CREATE_QP, |
| 74 | IB_USER_VERBS_CMD_QUERY_QP, |
| 75 | IB_USER_VERBS_CMD_MODIFY_QP, |
| 76 | IB_USER_VERBS_CMD_DESTROY_QP, |
| 77 | IB_USER_VERBS_CMD_POST_SEND, |
| 78 | IB_USER_VERBS_CMD_POST_RECV, |
| 79 | IB_USER_VERBS_CMD_ATTACH_MCAST, |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 80 | IB_USER_VERBS_CMD_DETACH_MCAST, |
| 81 | IB_USER_VERBS_CMD_CREATE_SRQ, |
| 82 | IB_USER_VERBS_CMD_MODIFY_SRQ, |
| 83 | IB_USER_VERBS_CMD_QUERY_SRQ, |
| 84 | IB_USER_VERBS_CMD_DESTROY_SRQ, |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 85 | IB_USER_VERBS_CMD_POST_SRQ_RECV, |
| 86 | IB_USER_VERBS_CMD_OPEN_XRCD, |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 87 | IB_USER_VERBS_CMD_CLOSE_XRCD, |
Sean Hefty | 42849b2 | 2011-08-11 13:57:43 -0700 | [diff] [blame] | 88 | IB_USER_VERBS_CMD_CREATE_XSRQ, |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame^] | 89 | IB_USER_VERBS_CMD_OPEN_QP, |
| 90 | IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, |
| 91 | IB_USER_VERBS_CMD_DESTROY_FLOW |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | /* |
| 95 | * Make sure that all structs defined in this file remain laid out so |
| 96 | * that they pack the same way on 32-bit and 64-bit architectures (to |
| 97 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 98 | * Specifically: |
| 99 | * - Do not use pointer types -- pass pointers in __u64 instead. |
| 100 | * - Make sure that any structure larger than 4 bytes is padded to a |
| 101 | * multiple of 8 bytes. Otherwise the structure size will be |
| 102 | * different between 32-bit and 64-bit architectures. |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 103 | */ |
| 104 | |
| 105 | struct ib_uverbs_async_event_desc { |
| 106 | __u64 element; |
| 107 | __u32 event_type; /* enum ib_event_type */ |
| 108 | __u32 reserved; |
| 109 | }; |
| 110 | |
| 111 | struct ib_uverbs_comp_event_desc { |
| 112 | __u64 cq_handle; |
| 113 | }; |
| 114 | |
| 115 | /* |
| 116 | * All commands from userspace should start with a __u32 command field |
| 117 | * followed by __u16 in_words and out_words fields (which give the |
| 118 | * length of the command block and response buffer if any in 32-bit |
| 119 | * words). The kernel driver will read these fields first and read |
| 120 | * the rest of the command struct based on these value. |
| 121 | */ |
| 122 | |
| 123 | struct ib_uverbs_cmd_hdr { |
| 124 | __u32 command; |
| 125 | __u16 in_words; |
| 126 | __u16 out_words; |
| 127 | }; |
| 128 | |
Igor Ivanov | 400dbc9 | 2013-08-14 13:58:29 +0300 | [diff] [blame] | 129 | struct ib_uverbs_cmd_hdr_ex { |
| 130 | __u32 command; |
| 131 | __u16 in_words; |
| 132 | __u16 out_words; |
| 133 | __u16 provider_in_words; |
| 134 | __u16 provider_out_words; |
| 135 | __u32 cmd_hdr_reserved; |
| 136 | }; |
| 137 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 138 | struct ib_uverbs_get_context { |
| 139 | __u64 response; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 140 | __u64 driver_data[0]; |
| 141 | }; |
| 142 | |
| 143 | struct ib_uverbs_get_context_resp { |
| 144 | __u32 async_fd; |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 145 | __u32 num_comp_vectors; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 146 | }; |
| 147 | |
| 148 | struct ib_uverbs_query_device { |
| 149 | __u64 response; |
| 150 | __u64 driver_data[0]; |
| 151 | }; |
| 152 | |
| 153 | struct ib_uverbs_query_device_resp { |
| 154 | __u64 fw_ver; |
Sean Hefty | 97f52eb | 2005-08-13 21:05:57 -0700 | [diff] [blame] | 155 | __be64 node_guid; |
| 156 | __be64 sys_image_guid; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 157 | __u64 max_mr_size; |
| 158 | __u64 page_size_cap; |
| 159 | __u32 vendor_id; |
| 160 | __u32 vendor_part_id; |
| 161 | __u32 hw_ver; |
| 162 | __u32 max_qp; |
| 163 | __u32 max_qp_wr; |
| 164 | __u32 device_cap_flags; |
| 165 | __u32 max_sge; |
| 166 | __u32 max_sge_rd; |
| 167 | __u32 max_cq; |
| 168 | __u32 max_cqe; |
| 169 | __u32 max_mr; |
| 170 | __u32 max_pd; |
| 171 | __u32 max_qp_rd_atom; |
| 172 | __u32 max_ee_rd_atom; |
| 173 | __u32 max_res_rd_atom; |
| 174 | __u32 max_qp_init_rd_atom; |
| 175 | __u32 max_ee_init_rd_atom; |
| 176 | __u32 atomic_cap; |
| 177 | __u32 max_ee; |
| 178 | __u32 max_rdd; |
| 179 | __u32 max_mw; |
| 180 | __u32 max_raw_ipv6_qp; |
| 181 | __u32 max_raw_ethy_qp; |
| 182 | __u32 max_mcast_grp; |
| 183 | __u32 max_mcast_qp_attach; |
| 184 | __u32 max_total_mcast_qp_attach; |
| 185 | __u32 max_ah; |
| 186 | __u32 max_fmr; |
| 187 | __u32 max_map_per_fmr; |
| 188 | __u32 max_srq; |
| 189 | __u32 max_srq_wr; |
| 190 | __u32 max_srq_sge; |
| 191 | __u16 max_pkeys; |
| 192 | __u8 local_ca_ack_delay; |
| 193 | __u8 phys_port_cnt; |
| 194 | __u8 reserved[4]; |
| 195 | }; |
| 196 | |
| 197 | struct ib_uverbs_query_port { |
| 198 | __u64 response; |
| 199 | __u8 port_num; |
| 200 | __u8 reserved[7]; |
| 201 | __u64 driver_data[0]; |
| 202 | }; |
| 203 | |
| 204 | struct ib_uverbs_query_port_resp { |
| 205 | __u32 port_cap_flags; |
| 206 | __u32 max_msg_sz; |
| 207 | __u32 bad_pkey_cntr; |
| 208 | __u32 qkey_viol_cntr; |
| 209 | __u32 gid_tbl_len; |
| 210 | __u16 pkey_tbl_len; |
| 211 | __u16 lid; |
| 212 | __u16 sm_lid; |
| 213 | __u8 state; |
| 214 | __u8 max_mtu; |
| 215 | __u8 active_mtu; |
| 216 | __u8 lmc; |
| 217 | __u8 max_vl_num; |
| 218 | __u8 sm_sl; |
| 219 | __u8 subnet_timeout; |
| 220 | __u8 init_type_reply; |
| 221 | __u8 active_width; |
| 222 | __u8 active_speed; |
| 223 | __u8 phys_state; |
Eli Cohen | 2420b60 | 2010-10-18 14:45:20 -0700 | [diff] [blame] | 224 | __u8 link_layer; |
| 225 | __u8 reserved[2]; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 226 | }; |
| 227 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 228 | struct ib_uverbs_alloc_pd { |
| 229 | __u64 response; |
| 230 | __u64 driver_data[0]; |
| 231 | }; |
| 232 | |
| 233 | struct ib_uverbs_alloc_pd_resp { |
| 234 | __u32 pd_handle; |
| 235 | }; |
| 236 | |
| 237 | struct ib_uverbs_dealloc_pd { |
| 238 | __u32 pd_handle; |
| 239 | }; |
| 240 | |
Sean Hefty | 53d0bd1 | 2011-05-24 08:33:46 -0700 | [diff] [blame] | 241 | struct ib_uverbs_open_xrcd { |
| 242 | __u64 response; |
| 243 | __u32 fd; |
| 244 | __u32 oflags; |
| 245 | __u64 driver_data[0]; |
| 246 | }; |
| 247 | |
| 248 | struct ib_uverbs_open_xrcd_resp { |
| 249 | __u32 xrcd_handle; |
| 250 | }; |
| 251 | |
| 252 | struct ib_uverbs_close_xrcd { |
| 253 | __u32 xrcd_handle; |
| 254 | }; |
| 255 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 256 | struct ib_uverbs_reg_mr { |
| 257 | __u64 response; |
| 258 | __u64 start; |
| 259 | __u64 length; |
| 260 | __u64 hca_va; |
| 261 | __u32 pd_handle; |
| 262 | __u32 access_flags; |
| 263 | __u64 driver_data[0]; |
| 264 | }; |
| 265 | |
| 266 | struct ib_uverbs_reg_mr_resp { |
| 267 | __u32 mr_handle; |
| 268 | __u32 lkey; |
| 269 | __u32 rkey; |
| 270 | }; |
| 271 | |
| 272 | struct ib_uverbs_dereg_mr { |
| 273 | __u32 mr_handle; |
| 274 | }; |
| 275 | |
Shani Michaeli | 6b52a12 | 2013-02-06 16:19:13 +0000 | [diff] [blame] | 276 | struct ib_uverbs_alloc_mw { |
| 277 | __u64 response; |
| 278 | __u32 pd_handle; |
| 279 | __u8 mw_type; |
| 280 | __u8 reserved[3]; |
| 281 | }; |
| 282 | |
| 283 | struct ib_uverbs_alloc_mw_resp { |
| 284 | __u32 mw_handle; |
| 285 | __u32 rkey; |
| 286 | }; |
| 287 | |
| 288 | struct ib_uverbs_dealloc_mw { |
| 289 | __u32 mw_handle; |
| 290 | }; |
| 291 | |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 292 | struct ib_uverbs_create_comp_channel { |
| 293 | __u64 response; |
| 294 | }; |
| 295 | |
| 296 | struct ib_uverbs_create_comp_channel_resp { |
| 297 | __u32 fd; |
| 298 | }; |
| 299 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 300 | struct ib_uverbs_create_cq { |
| 301 | __u64 response; |
| 302 | __u64 user_handle; |
| 303 | __u32 cqe; |
Roland Dreier | 6b73597e | 2005-09-26 13:53:25 -0700 | [diff] [blame] | 304 | __u32 comp_vector; |
| 305 | __s32 comp_channel; |
| 306 | __u32 reserved; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 307 | __u64 driver_data[0]; |
| 308 | }; |
| 309 | |
| 310 | struct ib_uverbs_create_cq_resp { |
| 311 | __u32 cq_handle; |
| 312 | __u32 cqe; |
| 313 | }; |
| 314 | |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 315 | struct ib_uverbs_resize_cq { |
| 316 | __u64 response; |
| 317 | __u32 cq_handle; |
| 318 | __u32 cqe; |
| 319 | __u64 driver_data[0]; |
| 320 | }; |
| 321 | |
| 322 | struct ib_uverbs_resize_cq_resp { |
| 323 | __u32 cqe; |
Ralph Campbell | 64f817b | 2006-09-22 15:22:24 -0700 | [diff] [blame] | 324 | __u32 reserved; |
| 325 | __u64 driver_data[0]; |
Roland Dreier | 33b9b3e | 2006-01-30 14:29:21 -0800 | [diff] [blame] | 326 | }; |
| 327 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 328 | struct ib_uverbs_poll_cq { |
| 329 | __u64 response; |
| 330 | __u32 cq_handle; |
| 331 | __u32 ne; |
| 332 | }; |
| 333 | |
| 334 | struct ib_uverbs_wc { |
| 335 | __u64 wr_id; |
| 336 | __u32 status; |
| 337 | __u32 opcode; |
| 338 | __u32 vendor_err; |
| 339 | __u32 byte_len; |
Steve Wise | 00f7ec3 | 2008-07-14 23:48:45 -0700 | [diff] [blame] | 340 | union { |
| 341 | __u32 imm_data; |
| 342 | __u32 invalidate_rkey; |
| 343 | } ex; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 344 | __u32 qp_num; |
| 345 | __u32 src_qp; |
| 346 | __u32 wc_flags; |
| 347 | __u16 pkey_index; |
| 348 | __u16 slid; |
| 349 | __u8 sl; |
| 350 | __u8 dlid_path_bits; |
| 351 | __u8 port_num; |
| 352 | __u8 reserved; |
| 353 | }; |
| 354 | |
| 355 | struct ib_uverbs_poll_cq_resp { |
| 356 | __u32 count; |
| 357 | __u32 reserved; |
| 358 | struct ib_uverbs_wc wc[0]; |
| 359 | }; |
| 360 | |
| 361 | struct ib_uverbs_req_notify_cq { |
| 362 | __u32 cq_handle; |
| 363 | __u32 solicited_only; |
| 364 | }; |
| 365 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 366 | struct ib_uverbs_destroy_cq { |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 367 | __u64 response; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 368 | __u32 cq_handle; |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 369 | __u32 reserved; |
| 370 | }; |
| 371 | |
| 372 | struct ib_uverbs_destroy_cq_resp { |
| 373 | __u32 comp_events_reported; |
| 374 | __u32 async_events_reported; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 375 | }; |
| 376 | |
Sean Hefty | 6a9af2e | 2006-06-17 20:37:27 -0700 | [diff] [blame] | 377 | struct ib_uverbs_global_route { |
| 378 | __u8 dgid[16]; |
| 379 | __u32 flow_label; |
| 380 | __u8 sgid_index; |
| 381 | __u8 hop_limit; |
| 382 | __u8 traffic_class; |
| 383 | __u8 reserved; |
| 384 | }; |
| 385 | |
| 386 | struct ib_uverbs_ah_attr { |
| 387 | struct ib_uverbs_global_route grh; |
| 388 | __u16 dlid; |
| 389 | __u8 sl; |
| 390 | __u8 src_path_bits; |
| 391 | __u8 static_rate; |
| 392 | __u8 is_global; |
| 393 | __u8 port_num; |
| 394 | __u8 reserved; |
| 395 | }; |
| 396 | |
| 397 | struct ib_uverbs_qp_attr { |
| 398 | __u32 qp_attr_mask; |
| 399 | __u32 qp_state; |
| 400 | __u32 cur_qp_state; |
| 401 | __u32 path_mtu; |
| 402 | __u32 path_mig_state; |
| 403 | __u32 qkey; |
| 404 | __u32 rq_psn; |
| 405 | __u32 sq_psn; |
| 406 | __u32 dest_qp_num; |
| 407 | __u32 qp_access_flags; |
| 408 | |
| 409 | struct ib_uverbs_ah_attr ah_attr; |
| 410 | struct ib_uverbs_ah_attr alt_ah_attr; |
| 411 | |
| 412 | /* ib_qp_cap */ |
| 413 | __u32 max_send_wr; |
| 414 | __u32 max_recv_wr; |
| 415 | __u32 max_send_sge; |
| 416 | __u32 max_recv_sge; |
| 417 | __u32 max_inline_data; |
| 418 | |
| 419 | __u16 pkey_index; |
| 420 | __u16 alt_pkey_index; |
| 421 | __u8 en_sqd_async_notify; |
| 422 | __u8 sq_draining; |
| 423 | __u8 max_rd_atomic; |
| 424 | __u8 max_dest_rd_atomic; |
| 425 | __u8 min_rnr_timer; |
| 426 | __u8 port_num; |
| 427 | __u8 timeout; |
| 428 | __u8 retry_cnt; |
| 429 | __u8 rnr_retry; |
| 430 | __u8 alt_port_num; |
| 431 | __u8 alt_timeout; |
| 432 | __u8 reserved[5]; |
| 433 | }; |
| 434 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 435 | struct ib_uverbs_create_qp { |
| 436 | __u64 response; |
| 437 | __u64 user_handle; |
| 438 | __u32 pd_handle; |
| 439 | __u32 send_cq_handle; |
| 440 | __u32 recv_cq_handle; |
| 441 | __u32 srq_handle; |
| 442 | __u32 max_send_wr; |
| 443 | __u32 max_recv_wr; |
| 444 | __u32 max_send_sge; |
| 445 | __u32 max_recv_sge; |
| 446 | __u32 max_inline_data; |
| 447 | __u8 sq_sig_all; |
| 448 | __u8 qp_type; |
| 449 | __u8 is_srq; |
| 450 | __u8 reserved; |
| 451 | __u64 driver_data[0]; |
| 452 | }; |
| 453 | |
Sean Hefty | 42849b2 | 2011-08-11 13:57:43 -0700 | [diff] [blame] | 454 | struct ib_uverbs_open_qp { |
| 455 | __u64 response; |
| 456 | __u64 user_handle; |
| 457 | __u32 pd_handle; |
| 458 | __u32 qpn; |
| 459 | __u8 qp_type; |
| 460 | __u8 reserved[7]; |
| 461 | __u64 driver_data[0]; |
| 462 | }; |
| 463 | |
| 464 | /* also used for open response */ |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 465 | struct ib_uverbs_create_qp_resp { |
| 466 | __u32 qp_handle; |
| 467 | __u32 qpn; |
Jack Morgenstein | 77369ed | 2005-11-09 11:26:07 -0800 | [diff] [blame] | 468 | __u32 max_send_wr; |
| 469 | __u32 max_recv_wr; |
| 470 | __u32 max_send_sge; |
| 471 | __u32 max_recv_sge; |
| 472 | __u32 max_inline_data; |
Roland Dreier | 4d9781c | 2006-02-16 09:26:19 -0800 | [diff] [blame] | 473 | __u32 reserved; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 474 | }; |
| 475 | |
| 476 | /* |
| 477 | * This struct needs to remain a multiple of 8 bytes to keep the |
| 478 | * alignment of the modify QP parameters. |
| 479 | */ |
| 480 | struct ib_uverbs_qp_dest { |
| 481 | __u8 dgid[16]; |
| 482 | __u32 flow_label; |
| 483 | __u16 dlid; |
| 484 | __u16 reserved; |
| 485 | __u8 sgid_index; |
| 486 | __u8 hop_limit; |
| 487 | __u8 traffic_class; |
| 488 | __u8 sl; |
| 489 | __u8 src_path_bits; |
| 490 | __u8 static_rate; |
| 491 | __u8 is_global; |
| 492 | __u8 port_num; |
| 493 | }; |
| 494 | |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 495 | struct ib_uverbs_query_qp { |
| 496 | __u64 response; |
| 497 | __u32 qp_handle; |
| 498 | __u32 attr_mask; |
| 499 | __u64 driver_data[0]; |
| 500 | }; |
| 501 | |
| 502 | struct ib_uverbs_query_qp_resp { |
| 503 | struct ib_uverbs_qp_dest dest; |
| 504 | struct ib_uverbs_qp_dest alt_dest; |
| 505 | __u32 max_send_wr; |
| 506 | __u32 max_recv_wr; |
| 507 | __u32 max_send_sge; |
| 508 | __u32 max_recv_sge; |
| 509 | __u32 max_inline_data; |
| 510 | __u32 qkey; |
| 511 | __u32 rq_psn; |
| 512 | __u32 sq_psn; |
| 513 | __u32 dest_qp_num; |
| 514 | __u32 qp_access_flags; |
| 515 | __u16 pkey_index; |
| 516 | __u16 alt_pkey_index; |
| 517 | __u8 qp_state; |
| 518 | __u8 cur_qp_state; |
| 519 | __u8 path_mtu; |
| 520 | __u8 path_mig_state; |
Jack Morgenstein | 0b26c88 | 2006-10-25 12:54:20 +0200 | [diff] [blame] | 521 | __u8 sq_draining; |
Dotan Barak | 7ccc9a2 | 2006-02-13 16:31:25 -0800 | [diff] [blame] | 522 | __u8 max_rd_atomic; |
| 523 | __u8 max_dest_rd_atomic; |
| 524 | __u8 min_rnr_timer; |
| 525 | __u8 port_num; |
| 526 | __u8 timeout; |
| 527 | __u8 retry_cnt; |
| 528 | __u8 rnr_retry; |
| 529 | __u8 alt_port_num; |
| 530 | __u8 alt_timeout; |
| 531 | __u8 sq_sig_all; |
| 532 | __u8 reserved[5]; |
| 533 | __u64 driver_data[0]; |
| 534 | }; |
| 535 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 536 | struct ib_uverbs_modify_qp { |
| 537 | struct ib_uverbs_qp_dest dest; |
| 538 | struct ib_uverbs_qp_dest alt_dest; |
| 539 | __u32 qp_handle; |
| 540 | __u32 attr_mask; |
| 541 | __u32 qkey; |
| 542 | __u32 rq_psn; |
| 543 | __u32 sq_psn; |
| 544 | __u32 dest_qp_num; |
| 545 | __u32 qp_access_flags; |
| 546 | __u16 pkey_index; |
| 547 | __u16 alt_pkey_index; |
| 548 | __u8 qp_state; |
| 549 | __u8 cur_qp_state; |
| 550 | __u8 path_mtu; |
| 551 | __u8 path_mig_state; |
| 552 | __u8 en_sqd_async_notify; |
| 553 | __u8 max_rd_atomic; |
| 554 | __u8 max_dest_rd_atomic; |
| 555 | __u8 min_rnr_timer; |
| 556 | __u8 port_num; |
| 557 | __u8 timeout; |
| 558 | __u8 retry_cnt; |
| 559 | __u8 rnr_retry; |
| 560 | __u8 alt_port_num; |
| 561 | __u8 alt_timeout; |
| 562 | __u8 reserved[2]; |
| 563 | __u64 driver_data[0]; |
| 564 | }; |
| 565 | |
| 566 | struct ib_uverbs_modify_qp_resp { |
| 567 | }; |
| 568 | |
| 569 | struct ib_uverbs_destroy_qp { |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 570 | __u64 response; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 571 | __u32 qp_handle; |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 572 | __u32 reserved; |
| 573 | }; |
| 574 | |
| 575 | struct ib_uverbs_destroy_qp_resp { |
| 576 | __u32 events_reported; |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 577 | }; |
| 578 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 579 | /* |
| 580 | * The ib_uverbs_sge structure isn't used anywhere, since we assume |
| 581 | * the ib_sge structure is packed the same way on 32-bit and 64-bit |
| 582 | * architectures in both kernel and user space. It's just here to |
| 583 | * document the ABI. |
| 584 | */ |
| 585 | struct ib_uverbs_sge { |
| 586 | __u64 addr; |
| 587 | __u32 length; |
| 588 | __u32 lkey; |
| 589 | }; |
| 590 | |
| 591 | struct ib_uverbs_send_wr { |
Roland Dreier | a74cd4a | 2006-02-13 16:30:49 -0800 | [diff] [blame] | 592 | __u64 wr_id; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 593 | __u32 num_sge; |
| 594 | __u32 opcode; |
| 595 | __u32 send_flags; |
Roland Dreier | 0f39cf3 | 2008-04-16 21:09:32 -0700 | [diff] [blame] | 596 | union { |
| 597 | __u32 imm_data; |
| 598 | __u32 invalidate_rkey; |
| 599 | } ex; |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 600 | union { |
| 601 | struct { |
| 602 | __u64 remote_addr; |
| 603 | __u32 rkey; |
| 604 | __u32 reserved; |
| 605 | } rdma; |
| 606 | struct { |
| 607 | __u64 remote_addr; |
| 608 | __u64 compare_add; |
| 609 | __u64 swap; |
| 610 | __u32 rkey; |
| 611 | __u32 reserved; |
| 612 | } atomic; |
| 613 | struct { |
| 614 | __u32 ah; |
| 615 | __u32 remote_qpn; |
| 616 | __u32 remote_qkey; |
| 617 | __u32 reserved; |
| 618 | } ud; |
| 619 | } wr; |
| 620 | }; |
| 621 | |
| 622 | struct ib_uverbs_post_send { |
| 623 | __u64 response; |
| 624 | __u32 qp_handle; |
| 625 | __u32 wr_count; |
| 626 | __u32 sge_count; |
| 627 | __u32 wqe_size; |
| 628 | struct ib_uverbs_send_wr send_wr[0]; |
| 629 | }; |
| 630 | |
| 631 | struct ib_uverbs_post_send_resp { |
| 632 | __u32 bad_wr; |
| 633 | }; |
| 634 | |
| 635 | struct ib_uverbs_recv_wr { |
| 636 | __u64 wr_id; |
| 637 | __u32 num_sge; |
| 638 | __u32 reserved; |
| 639 | }; |
| 640 | |
| 641 | struct ib_uverbs_post_recv { |
| 642 | __u64 response; |
| 643 | __u32 qp_handle; |
| 644 | __u32 wr_count; |
| 645 | __u32 sge_count; |
| 646 | __u32 wqe_size; |
| 647 | struct ib_uverbs_recv_wr recv_wr[0]; |
| 648 | }; |
| 649 | |
| 650 | struct ib_uverbs_post_recv_resp { |
| 651 | __u32 bad_wr; |
| 652 | }; |
| 653 | |
| 654 | struct ib_uverbs_post_srq_recv { |
| 655 | __u64 response; |
| 656 | __u32 srq_handle; |
| 657 | __u32 wr_count; |
| 658 | __u32 sge_count; |
| 659 | __u32 wqe_size; |
| 660 | struct ib_uverbs_recv_wr recv[0]; |
| 661 | }; |
| 662 | |
| 663 | struct ib_uverbs_post_srq_recv_resp { |
| 664 | __u32 bad_wr; |
| 665 | }; |
| 666 | |
Roland Dreier | 91ecd4a | 2005-10-14 15:21:44 -0700 | [diff] [blame] | 667 | struct ib_uverbs_create_ah { |
| 668 | __u64 response; |
| 669 | __u64 user_handle; |
| 670 | __u32 pd_handle; |
| 671 | __u32 reserved; |
| 672 | struct ib_uverbs_ah_attr attr; |
| 673 | }; |
| 674 | |
| 675 | struct ib_uverbs_create_ah_resp { |
| 676 | __u32 ah_handle; |
| 677 | }; |
| 678 | |
| 679 | struct ib_uverbs_destroy_ah { |
| 680 | __u32 ah_handle; |
| 681 | }; |
| 682 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 683 | struct ib_uverbs_attach_mcast { |
| 684 | __u8 gid[16]; |
| 685 | __u32 qp_handle; |
| 686 | __u16 mlid; |
| 687 | __u16 reserved; |
| 688 | __u64 driver_data[0]; |
| 689 | }; |
| 690 | |
| 691 | struct ib_uverbs_detach_mcast { |
| 692 | __u8 gid[16]; |
| 693 | __u32 qp_handle; |
| 694 | __u16 mlid; |
| 695 | __u16 reserved; |
| 696 | __u64 driver_data[0]; |
| 697 | }; |
| 698 | |
Hadar Hen Zion | 436f2ad | 2013-08-14 13:58:30 +0300 | [diff] [blame^] | 699 | struct ib_kern_eth_filter { |
| 700 | __u8 dst_mac[6]; |
| 701 | __u8 src_mac[6]; |
| 702 | __be16 ether_type; |
| 703 | __be16 vlan_tag; |
| 704 | }; |
| 705 | |
| 706 | struct ib_kern_spec_eth { |
| 707 | __u32 type; |
| 708 | __u16 size; |
| 709 | __u16 reserved; |
| 710 | struct ib_kern_eth_filter val; |
| 711 | struct ib_kern_eth_filter mask; |
| 712 | }; |
| 713 | |
| 714 | struct ib_kern_ipv4_filter { |
| 715 | __be32 src_ip; |
| 716 | __be32 dst_ip; |
| 717 | }; |
| 718 | |
| 719 | struct ib_kern_spec_ipv4 { |
| 720 | __u32 type; |
| 721 | __u16 size; |
| 722 | __u16 reserved; |
| 723 | struct ib_kern_ipv4_filter val; |
| 724 | struct ib_kern_ipv4_filter mask; |
| 725 | }; |
| 726 | |
| 727 | struct ib_kern_tcp_udp_filter { |
| 728 | __be16 dst_port; |
| 729 | __be16 src_port; |
| 730 | }; |
| 731 | |
| 732 | struct ib_kern_spec_tcp_udp { |
| 733 | __u32 type; |
| 734 | __u16 size; |
| 735 | __u16 reserved; |
| 736 | struct ib_kern_tcp_udp_filter val; |
| 737 | struct ib_kern_tcp_udp_filter mask; |
| 738 | }; |
| 739 | |
| 740 | struct ib_kern_spec { |
| 741 | union { |
| 742 | struct { |
| 743 | __u32 type; |
| 744 | __u16 size; |
| 745 | __u16 reserved; |
| 746 | }; |
| 747 | struct ib_kern_spec_eth eth; |
| 748 | struct ib_kern_spec_ipv4 ipv4; |
| 749 | struct ib_kern_spec_tcp_udp tcp_udp; |
| 750 | }; |
| 751 | }; |
| 752 | |
| 753 | struct ib_kern_flow_attr { |
| 754 | __u32 type; |
| 755 | __u16 size; |
| 756 | __u16 priority; |
| 757 | __u8 num_of_specs; |
| 758 | __u8 reserved[2]; |
| 759 | __u8 port; |
| 760 | __u32 flags; |
| 761 | /* Following are the optional layers according to user request |
| 762 | * struct ib_flow_spec_xxx |
| 763 | * struct ib_flow_spec_yyy |
| 764 | */ |
| 765 | }; |
| 766 | |
| 767 | struct ib_uverbs_create_flow { |
| 768 | __u32 comp_mask; |
| 769 | __u64 response; |
| 770 | __u32 qp_handle; |
| 771 | struct ib_kern_flow_attr flow_attr; |
| 772 | }; |
| 773 | |
| 774 | struct ib_uverbs_create_flow_resp { |
| 775 | __u32 comp_mask; |
| 776 | __u32 flow_handle; |
| 777 | }; |
| 778 | |
| 779 | struct ib_uverbs_destroy_flow { |
| 780 | __u32 comp_mask; |
| 781 | __u32 flow_handle; |
| 782 | }; |
| 783 | |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 784 | struct ib_uverbs_create_srq { |
| 785 | __u64 response; |
| 786 | __u64 user_handle; |
| 787 | __u32 pd_handle; |
| 788 | __u32 max_wr; |
| 789 | __u32 max_sge; |
| 790 | __u32 srq_limit; |
| 791 | __u64 driver_data[0]; |
| 792 | }; |
| 793 | |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 794 | struct ib_uverbs_create_xsrq { |
| 795 | __u64 response; |
| 796 | __u64 user_handle; |
| 797 | __u32 srq_type; |
| 798 | __u32 pd_handle; |
| 799 | __u32 max_wr; |
| 800 | __u32 max_sge; |
| 801 | __u32 srq_limit; |
| 802 | __u32 reserved; |
| 803 | __u32 xrcd_handle; |
| 804 | __u32 cq_handle; |
| 805 | __u64 driver_data[0]; |
| 806 | }; |
| 807 | |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 808 | struct ib_uverbs_create_srq_resp { |
| 809 | __u32 srq_handle; |
Dotan Barak | ea88fd1 | 2006-02-23 12:36:18 -0800 | [diff] [blame] | 810 | __u32 max_wr; |
| 811 | __u32 max_sge; |
Sean Hefty | 8541f8d | 2011-05-25 17:08:38 -0700 | [diff] [blame] | 812 | __u32 srqn; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 813 | }; |
| 814 | |
| 815 | struct ib_uverbs_modify_srq { |
| 816 | __u32 srq_handle; |
| 817 | __u32 attr_mask; |
| 818 | __u32 max_wr; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 819 | __u32 srq_limit; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 820 | __u64 driver_data[0]; |
| 821 | }; |
| 822 | |
Dotan Barak | 8bdb0e8 | 2006-02-13 16:31:57 -0800 | [diff] [blame] | 823 | struct ib_uverbs_query_srq { |
| 824 | __u64 response; |
| 825 | __u32 srq_handle; |
| 826 | __u32 reserved; |
| 827 | __u64 driver_data[0]; |
| 828 | }; |
| 829 | |
| 830 | struct ib_uverbs_query_srq_resp { |
| 831 | __u32 max_wr; |
| 832 | __u32 max_sge; |
| 833 | __u32 srq_limit; |
| 834 | __u32 reserved; |
| 835 | }; |
| 836 | |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 837 | struct ib_uverbs_destroy_srq { |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 838 | __u64 response; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 839 | __u32 srq_handle; |
Roland Dreier | 63aaf64 | 2005-09-09 15:55:08 -0700 | [diff] [blame] | 840 | __u32 reserved; |
| 841 | }; |
| 842 | |
| 843 | struct ib_uverbs_destroy_srq_resp { |
| 844 | __u32 events_reported; |
Roland Dreier | f520ba5 | 2005-08-18 12:24:13 -0700 | [diff] [blame] | 845 | }; |
| 846 | |
Roland Dreier | 8a96b3f | 2005-07-07 17:57:12 -0700 | [diff] [blame] | 847 | #endif /* IB_USER_VERBS_H */ |