xref: /freebsd/sys/ofed/include/uapi/rdma/ib_user_verbs.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
109938b21SHans Petter Selasky /*-
209938b21SHans Petter Selasky  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
309938b21SHans Petter Selasky  *
49f715dc1SHans Petter Selasky  * Copyright (c) 2005 Topspin Communications.  All rights reserved.
59f715dc1SHans Petter Selasky  * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
69f715dc1SHans Petter Selasky  * Copyright (c) 2005 PathScale, Inc.  All rights reserved.
79f715dc1SHans Petter Selasky  * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
89f715dc1SHans Petter Selasky  *
99f715dc1SHans Petter Selasky  * This software is available to you under a choice of one of two
109f715dc1SHans Petter Selasky  * licenses.  You may choose to be licensed under the terms of the GNU
119f715dc1SHans Petter Selasky  * General Public License (GPL) Version 2, available from the file
129f715dc1SHans Petter Selasky  * COPYING in the main directory of this source tree, or the
139f715dc1SHans Petter Selasky  * OpenIB.org BSD license below:
149f715dc1SHans Petter Selasky  *
159f715dc1SHans Petter Selasky  *     Redistribution and use in source and binary forms, with or
169f715dc1SHans Petter Selasky  *     without modification, are permitted provided that the following
179f715dc1SHans Petter Selasky  *     conditions are met:
189f715dc1SHans Petter Selasky  *
199f715dc1SHans Petter Selasky  *      - Redistributions of source code must retain the above
209f715dc1SHans Petter Selasky  *        copyright notice, this list of conditions and the following
219f715dc1SHans Petter Selasky  *        disclaimer.
229f715dc1SHans Petter Selasky  *
239f715dc1SHans Petter Selasky  *      - Redistributions in binary form must reproduce the above
249f715dc1SHans Petter Selasky  *        copyright notice, this list of conditions and the following
259f715dc1SHans Petter Selasky  *        disclaimer in the documentation and/or other materials
269f715dc1SHans Petter Selasky  *        provided with the distribution.
279f715dc1SHans Petter Selasky  *
289f715dc1SHans Petter Selasky  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
299f715dc1SHans Petter Selasky  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
309f715dc1SHans Petter Selasky  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
319f715dc1SHans Petter Selasky  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
329f715dc1SHans Petter Selasky  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
339f715dc1SHans Petter Selasky  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
349f715dc1SHans Petter Selasky  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
359f715dc1SHans Petter Selasky  * SOFTWARE.
369f715dc1SHans Petter Selasky  */
379f715dc1SHans Petter Selasky 
389f715dc1SHans Petter Selasky #ifndef IB_USER_VERBS_H
399f715dc1SHans Petter Selasky #define IB_USER_VERBS_H
409f715dc1SHans Petter Selasky 
419f715dc1SHans Petter Selasky #ifdef _KERNEL
429f715dc1SHans Petter Selasky #include <linux/types.h>
439f715dc1SHans Petter Selasky #else
449f715dc1SHans Petter Selasky #include <infiniband/types.h>
459f715dc1SHans Petter Selasky #endif
469f715dc1SHans Petter Selasky 
479f715dc1SHans Petter Selasky /*
489f715dc1SHans Petter Selasky  * Increment this value if any changes that break userspace ABI
499f715dc1SHans Petter Selasky  * compatibility are made.
509f715dc1SHans Petter Selasky  */
519f715dc1SHans Petter Selasky #define IB_USER_VERBS_ABI_VERSION	6
529f715dc1SHans Petter Selasky #define IB_USER_VERBS_CMD_THRESHOLD    50
539f715dc1SHans Petter Selasky 
54*b633e08cSHans Petter Selasky enum ib_uverbs_write_cmds {
559f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_GET_CONTEXT,
569f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_QUERY_DEVICE,
579f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_QUERY_PORT,
589f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_ALLOC_PD,
599f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DEALLOC_PD,
609f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CREATE_AH,
619f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_MODIFY_AH,
629f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_QUERY_AH,
639f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DESTROY_AH,
649f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_REG_MR,
659f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_REG_SMR,
669f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_REREG_MR,
679f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_QUERY_MR,
689f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DEREG_MR,
699f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_ALLOC_MW,
709f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_BIND_MW,
719f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DEALLOC_MW,
729f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
739f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CREATE_CQ,
749f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_RESIZE_CQ,
759f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DESTROY_CQ,
769f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_POLL_CQ,
779f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_PEEK_CQ,
789f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
799f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CREATE_QP,
809f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_QUERY_QP,
819f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_MODIFY_QP,
829f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DESTROY_QP,
839f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_POST_SEND,
849f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_POST_RECV,
859f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_ATTACH_MCAST,
869f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DETACH_MCAST,
879f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CREATE_SRQ,
889f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_MODIFY_SRQ,
899f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_QUERY_SRQ,
909f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_DESTROY_SRQ,
919f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_POST_SRQ_RECV,
929f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_OPEN_XRCD,
939f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CLOSE_XRCD,
949f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_CREATE_XSRQ,
959f715dc1SHans Petter Selasky 	IB_USER_VERBS_CMD_OPEN_QP,
969f715dc1SHans Petter Selasky };
979f715dc1SHans Petter Selasky 
989f715dc1SHans Petter Selasky enum {
999f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
1009f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
1019f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
102*b633e08cSHans Petter Selasky 	IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
1039f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
1049f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
1059f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_CREATE_WQ,
1069f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_MODIFY_WQ,
1079f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_DESTROY_WQ,
1089f715dc1SHans Petter Selasky 	IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL,
109*b633e08cSHans Petter Selasky 	IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL,
110*b633e08cSHans Petter Selasky 	IB_USER_VERBS_EX_CMD_MODIFY_CQ
1119f715dc1SHans Petter Selasky };
1129f715dc1SHans Petter Selasky 
1139f715dc1SHans Petter Selasky /*
1149f715dc1SHans Petter Selasky  * Make sure that all structs defined in this file remain laid out so
1159f715dc1SHans Petter Selasky  * that they pack the same way on 32-bit and 64-bit architectures (to
1169f715dc1SHans Petter Selasky  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
1179f715dc1SHans Petter Selasky  * Specifically:
1189f715dc1SHans Petter Selasky  *  - Do not use pointer types -- pass pointers in __u64 instead.
1199f715dc1SHans Petter Selasky  *  - Make sure that any structure larger than 4 bytes is padded to a
1209f715dc1SHans Petter Selasky  *    multiple of 8 bytes.  Otherwise the structure size will be
1219f715dc1SHans Petter Selasky  *    different between 32-bit and 64-bit architectures.
1229f715dc1SHans Petter Selasky  */
1239f715dc1SHans Petter Selasky 
1249f715dc1SHans Petter Selasky struct ib_uverbs_async_event_desc {
125*b633e08cSHans Petter Selasky 	__aligned_u64 element;
1269f715dc1SHans Petter Selasky 	__u32 event_type;	/* enum ib_event_type */
1279f715dc1SHans Petter Selasky 	__u32 reserved;
1289f715dc1SHans Petter Selasky };
1299f715dc1SHans Petter Selasky 
1309f715dc1SHans Petter Selasky struct ib_uverbs_comp_event_desc {
131*b633e08cSHans Petter Selasky 	__aligned_u64 cq_handle;
132*b633e08cSHans Petter Selasky };
133*b633e08cSHans Petter Selasky 
134*b633e08cSHans Petter Selasky struct ib_uverbs_cq_moderation_caps {
135*b633e08cSHans Petter Selasky 	__u16     max_cq_moderation_count;
136*b633e08cSHans Petter Selasky 	__u16     max_cq_moderation_period;
137*b633e08cSHans Petter Selasky 	__u32     reserved;
1389f715dc1SHans Petter Selasky };
1399f715dc1SHans Petter Selasky 
1409f715dc1SHans Petter Selasky /*
1419f715dc1SHans Petter Selasky  * All commands from userspace should start with a __u32 command field
1429f715dc1SHans Petter Selasky  * followed by __u16 in_words and out_words fields (which give the
1439f715dc1SHans Petter Selasky  * length of the command block and response buffer if any in 32-bit
1449f715dc1SHans Petter Selasky  * words).  The kernel driver will read these fields first and read
1459f715dc1SHans Petter Selasky  * the rest of the command struct based on these value.
1469f715dc1SHans Petter Selasky  */
1479f715dc1SHans Petter Selasky 
1489f715dc1SHans Petter Selasky #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
149*b633e08cSHans Petter Selasky #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
1509f715dc1SHans Petter Selasky 
1519f715dc1SHans Petter Selasky struct ib_uverbs_cmd_hdr {
1529f715dc1SHans Petter Selasky 	__u32 command;
1539f715dc1SHans Petter Selasky 	__u16 in_words;
1549f715dc1SHans Petter Selasky 	__u16 out_words;
1559f715dc1SHans Petter Selasky };
1569f715dc1SHans Petter Selasky 
1579f715dc1SHans Petter Selasky struct ib_uverbs_ex_cmd_hdr {
158*b633e08cSHans Petter Selasky 	__aligned_u64 response;
1599f715dc1SHans Petter Selasky 	__u16 provider_in_words;
1609f715dc1SHans Petter Selasky 	__u16 provider_out_words;
1619f715dc1SHans Petter Selasky 	__u32 cmd_hdr_reserved;
1629f715dc1SHans Petter Selasky };
1639f715dc1SHans Petter Selasky 
1649f715dc1SHans Petter Selasky struct ib_uverbs_get_context {
165*b633e08cSHans Petter Selasky 	__aligned_u64 response;
166*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
1679f715dc1SHans Petter Selasky };
1689f715dc1SHans Petter Selasky 
1699f715dc1SHans Petter Selasky struct ib_uverbs_get_context_resp {
1709f715dc1SHans Petter Selasky 	__u32 async_fd;
1719f715dc1SHans Petter Selasky 	__u32 num_comp_vectors;
172*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
1739f715dc1SHans Petter Selasky };
1749f715dc1SHans Petter Selasky 
1759f715dc1SHans Petter Selasky struct ib_uverbs_query_device {
176*b633e08cSHans Petter Selasky 	__aligned_u64 response;
177*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
1789f715dc1SHans Petter Selasky };
1799f715dc1SHans Petter Selasky 
1809f715dc1SHans Petter Selasky struct ib_uverbs_query_device_resp {
181*b633e08cSHans Petter Selasky 	__aligned_u64 fw_ver;
1829f715dc1SHans Petter Selasky 	__be64 node_guid;
1839f715dc1SHans Petter Selasky 	__be64 sys_image_guid;
184*b633e08cSHans Petter Selasky 	__aligned_u64 max_mr_size;
185*b633e08cSHans Petter Selasky 	__aligned_u64 page_size_cap;
1869f715dc1SHans Petter Selasky 	__u32 vendor_id;
1879f715dc1SHans Petter Selasky 	__u32 vendor_part_id;
1889f715dc1SHans Petter Selasky 	__u32 hw_ver;
1899f715dc1SHans Petter Selasky 	__u32 max_qp;
1909f715dc1SHans Petter Selasky 	__u32 max_qp_wr;
1919f715dc1SHans Petter Selasky 	__u32 device_cap_flags;
1929f715dc1SHans Petter Selasky 	__u32 max_sge;
1939f715dc1SHans Petter Selasky 	__u32 max_sge_rd;
1949f715dc1SHans Petter Selasky 	__u32 max_cq;
1959f715dc1SHans Petter Selasky 	__u32 max_cqe;
1969f715dc1SHans Petter Selasky 	__u32 max_mr;
1979f715dc1SHans Petter Selasky 	__u32 max_pd;
1989f715dc1SHans Petter Selasky 	__u32 max_qp_rd_atom;
1999f715dc1SHans Petter Selasky 	__u32 max_ee_rd_atom;
2009f715dc1SHans Petter Selasky 	__u32 max_res_rd_atom;
2019f715dc1SHans Petter Selasky 	__u32 max_qp_init_rd_atom;
2029f715dc1SHans Petter Selasky 	__u32 max_ee_init_rd_atom;
2039f715dc1SHans Petter Selasky 	__u32 atomic_cap;
2049f715dc1SHans Petter Selasky 	__u32 max_ee;
2059f715dc1SHans Petter Selasky 	__u32 max_rdd;
2069f715dc1SHans Petter Selasky 	__u32 max_mw;
2079f715dc1SHans Petter Selasky 	__u32 max_raw_ipv6_qp;
2089f715dc1SHans Petter Selasky 	__u32 max_raw_ethy_qp;
2099f715dc1SHans Petter Selasky 	__u32 max_mcast_grp;
2109f715dc1SHans Petter Selasky 	__u32 max_mcast_qp_attach;
2119f715dc1SHans Petter Selasky 	__u32 max_total_mcast_qp_attach;
2129f715dc1SHans Petter Selasky 	__u32 max_ah;
2139f715dc1SHans Petter Selasky 	__u32 max_fmr;
2149f715dc1SHans Petter Selasky 	__u32 max_map_per_fmr;
2159f715dc1SHans Petter Selasky 	__u32 max_srq;
2169f715dc1SHans Petter Selasky 	__u32 max_srq_wr;
2179f715dc1SHans Petter Selasky 	__u32 max_srq_sge;
2189f715dc1SHans Petter Selasky 	__u16 max_pkeys;
2199f715dc1SHans Petter Selasky 	__u8  local_ca_ack_delay;
2209f715dc1SHans Petter Selasky 	__u8  phys_port_cnt;
2219f715dc1SHans Petter Selasky 	__u8  reserved[4];
2229f715dc1SHans Petter Selasky };
2239f715dc1SHans Petter Selasky 
2249f715dc1SHans Petter Selasky struct ib_uverbs_ex_query_device {
2259f715dc1SHans Petter Selasky 	__u32 comp_mask;
2269f715dc1SHans Petter Selasky 	__u32 reserved;
2279f715dc1SHans Petter Selasky };
2289f715dc1SHans Petter Selasky 
2299f715dc1SHans Petter Selasky struct ib_uverbs_odp_caps {
230*b633e08cSHans Petter Selasky 	__aligned_u64 general_caps;
2319f715dc1SHans Petter Selasky 	struct {
2329f715dc1SHans Petter Selasky 		__u32 rc_odp_caps;
2339f715dc1SHans Petter Selasky 		__u32 uc_odp_caps;
2349f715dc1SHans Petter Selasky 		__u32 ud_odp_caps;
2359f715dc1SHans Petter Selasky 	} per_transport_caps;
2369f715dc1SHans Petter Selasky 	__u32 reserved;
2379f715dc1SHans Petter Selasky };
2389f715dc1SHans Petter Selasky 
2399f715dc1SHans Petter Selasky struct ib_uverbs_rss_caps {
2409f715dc1SHans Petter Selasky 	/* Corresponding bit will be set if qp type from
2419f715dc1SHans Petter Selasky 	 * 'enum ib_qp_type' is supported, e.g.
2429f715dc1SHans Petter Selasky 	 * supported_qpts |= 1 << IB_QPT_UD
2439f715dc1SHans Petter Selasky 	 */
2449f715dc1SHans Petter Selasky 	__u32 supported_qpts;
2459f715dc1SHans Petter Selasky 	__u32 max_rwq_indirection_tables;
2469f715dc1SHans Petter Selasky 	__u32 max_rwq_indirection_table_size;
2479f715dc1SHans Petter Selasky 	__u32 reserved;
2489f715dc1SHans Petter Selasky };
2499f715dc1SHans Petter Selasky 
250*b633e08cSHans Petter Selasky struct ib_uverbs_tm_caps {
251*b633e08cSHans Petter Selasky 	/* Max size of rendezvous request message */
252*b633e08cSHans Petter Selasky 	__u32 max_rndv_hdr_size;
253*b633e08cSHans Petter Selasky 	/* Max number of entries in tag matching list */
254*b633e08cSHans Petter Selasky 	__u32 max_num_tags;
255*b633e08cSHans Petter Selasky 	/* TM flags */
256*b633e08cSHans Petter Selasky 	__u32 flags;
257*b633e08cSHans Petter Selasky 	/* Max number of outstanding list operations */
258*b633e08cSHans Petter Selasky 	__u32 max_ops;
259*b633e08cSHans Petter Selasky 	/* Max number of SGE in tag matching entry */
260*b633e08cSHans Petter Selasky 	__u32 max_sge;
261*b633e08cSHans Petter Selasky 	__u32 reserved;
262*b633e08cSHans Petter Selasky };
263*b633e08cSHans Petter Selasky 
2649f715dc1SHans Petter Selasky struct ib_uverbs_ex_query_device_resp {
2659f715dc1SHans Petter Selasky 	struct ib_uverbs_query_device_resp base;
2669f715dc1SHans Petter Selasky 	__u32 comp_mask;
2679f715dc1SHans Petter Selasky 	__u32 response_length;
2689f715dc1SHans Petter Selasky 	struct ib_uverbs_odp_caps odp_caps;
269*b633e08cSHans Petter Selasky 	__aligned_u64 timestamp_mask;
270*b633e08cSHans Petter Selasky 	__aligned_u64 hca_core_clock; /* in KHZ */
271*b633e08cSHans Petter Selasky 	__aligned_u64 device_cap_flags_ex;
2729f715dc1SHans Petter Selasky 	struct ib_uverbs_rss_caps rss_caps;
2739f715dc1SHans Petter Selasky 	__u32  max_wq_type_rq;
274*b633e08cSHans Petter Selasky 	__u32 raw_packet_caps;
275*b633e08cSHans Petter Selasky 	struct ib_uverbs_tm_caps tm_caps;
276*b633e08cSHans Petter Selasky 	struct ib_uverbs_cq_moderation_caps cq_moderation_caps;
277*b633e08cSHans Petter Selasky 	__aligned_u64 max_dm_size;
278*b633e08cSHans Petter Selasky 	__u32 xrc_odp_caps;
2799f715dc1SHans Petter Selasky 	__u32 reserved;
2809f715dc1SHans Petter Selasky };
2819f715dc1SHans Petter Selasky 
2829f715dc1SHans Petter Selasky struct ib_uverbs_query_port {
283*b633e08cSHans Petter Selasky 	__aligned_u64 response;
2849f715dc1SHans Petter Selasky 	__u8  port_num;
2859f715dc1SHans Petter Selasky 	__u8  reserved[7];
286*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
2879f715dc1SHans Petter Selasky };
2889f715dc1SHans Petter Selasky 
2899f715dc1SHans Petter Selasky struct ib_uverbs_query_port_resp {
290*b633e08cSHans Petter Selasky 	__u32 port_cap_flags;		/* see ib_uverbs_query_port_cap_flags */
2919f715dc1SHans Petter Selasky 	__u32 max_msg_sz;
2929f715dc1SHans Petter Selasky 	__u32 bad_pkey_cntr;
2939f715dc1SHans Petter Selasky 	__u32 qkey_viol_cntr;
2949f715dc1SHans Petter Selasky 	__u32 gid_tbl_len;
2959f715dc1SHans Petter Selasky 	__u16 pkey_tbl_len;
2969f715dc1SHans Petter Selasky 	__u16 lid;
2979f715dc1SHans Petter Selasky 	__u16 sm_lid;
2989f715dc1SHans Petter Selasky 	__u8  state;
2999f715dc1SHans Petter Selasky 	__u8  max_mtu;
3009f715dc1SHans Petter Selasky 	__u8  active_mtu;
3019f715dc1SHans Petter Selasky 	__u8  lmc;
3029f715dc1SHans Petter Selasky 	__u8  max_vl_num;
3039f715dc1SHans Petter Selasky 	__u8  sm_sl;
3049f715dc1SHans Petter Selasky 	__u8  subnet_timeout;
3059f715dc1SHans Petter Selasky 	__u8  init_type_reply;
3069f715dc1SHans Petter Selasky 	__u8  active_width;
3079f715dc1SHans Petter Selasky 	__u8  active_speed;
3089f715dc1SHans Petter Selasky 	__u8  phys_state;
3099f715dc1SHans Petter Selasky 	__u8  link_layer;
310*b633e08cSHans Petter Selasky 	__u8  flags;			/* see ib_uverbs_query_port_flags */
311*b633e08cSHans Petter Selasky 	__u8  reserved;
3129f715dc1SHans Petter Selasky };
3139f715dc1SHans Petter Selasky 
3149f715dc1SHans Petter Selasky struct ib_uverbs_alloc_pd {
315*b633e08cSHans Petter Selasky 	__aligned_u64 response;
316*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3179f715dc1SHans Petter Selasky };
3189f715dc1SHans Petter Selasky 
3199f715dc1SHans Petter Selasky struct ib_uverbs_alloc_pd_resp {
3209f715dc1SHans Petter Selasky 	__u32 pd_handle;
321*b633e08cSHans Petter Selasky 	__u32 driver_data[0];
3229f715dc1SHans Petter Selasky };
3239f715dc1SHans Petter Selasky 
3249f715dc1SHans Petter Selasky struct ib_uverbs_dealloc_pd {
3259f715dc1SHans Petter Selasky 	__u32 pd_handle;
3269f715dc1SHans Petter Selasky };
3279f715dc1SHans Petter Selasky 
3289f715dc1SHans Petter Selasky struct ib_uverbs_open_xrcd {
329*b633e08cSHans Petter Selasky 	__aligned_u64 response;
3309f715dc1SHans Petter Selasky 	__u32 fd;
3319f715dc1SHans Petter Selasky 	__u32 oflags;
332*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3339f715dc1SHans Petter Selasky };
3349f715dc1SHans Petter Selasky 
3359f715dc1SHans Petter Selasky struct ib_uverbs_open_xrcd_resp {
3369f715dc1SHans Petter Selasky 	__u32 xrcd_handle;
337*b633e08cSHans Petter Selasky 	__u32 driver_data[0];
3389f715dc1SHans Petter Selasky };
3399f715dc1SHans Petter Selasky 
3409f715dc1SHans Petter Selasky struct ib_uverbs_close_xrcd {
3419f715dc1SHans Petter Selasky 	__u32 xrcd_handle;
3429f715dc1SHans Petter Selasky };
3439f715dc1SHans Petter Selasky 
3449f715dc1SHans Petter Selasky struct ib_uverbs_reg_mr {
345*b633e08cSHans Petter Selasky 	__aligned_u64 response;
346*b633e08cSHans Petter Selasky 	__aligned_u64 start;
347*b633e08cSHans Petter Selasky 	__aligned_u64 length;
348*b633e08cSHans Petter Selasky 	__aligned_u64 hca_va;
3499f715dc1SHans Petter Selasky 	__u32 pd_handle;
3509f715dc1SHans Petter Selasky 	__u32 access_flags;
351*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3529f715dc1SHans Petter Selasky };
3539f715dc1SHans Petter Selasky 
3549f715dc1SHans Petter Selasky struct ib_uverbs_reg_mr_resp {
3559f715dc1SHans Petter Selasky 	__u32 mr_handle;
3569f715dc1SHans Petter Selasky 	__u32 lkey;
3579f715dc1SHans Petter Selasky 	__u32 rkey;
358*b633e08cSHans Petter Selasky 	__u32 driver_data[0];
3599f715dc1SHans Petter Selasky };
3609f715dc1SHans Petter Selasky 
3619f715dc1SHans Petter Selasky struct ib_uverbs_rereg_mr {
362*b633e08cSHans Petter Selasky 	__aligned_u64 response;
3639f715dc1SHans Petter Selasky 	__u32 mr_handle;
3649f715dc1SHans Petter Selasky 	__u32 flags;
365*b633e08cSHans Petter Selasky 	__aligned_u64 start;
366*b633e08cSHans Petter Selasky 	__aligned_u64 length;
367*b633e08cSHans Petter Selasky 	__aligned_u64 hca_va;
3689f715dc1SHans Petter Selasky 	__u32 pd_handle;
3699f715dc1SHans Petter Selasky 	__u32 access_flags;
370*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3719f715dc1SHans Petter Selasky };
3729f715dc1SHans Petter Selasky 
3739f715dc1SHans Petter Selasky struct ib_uverbs_rereg_mr_resp {
3749f715dc1SHans Petter Selasky 	__u32 lkey;
3759f715dc1SHans Petter Selasky 	__u32 rkey;
376*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3779f715dc1SHans Petter Selasky };
3789f715dc1SHans Petter Selasky 
3799f715dc1SHans Petter Selasky struct ib_uverbs_dereg_mr {
3809f715dc1SHans Petter Selasky 	__u32 mr_handle;
3819f715dc1SHans Petter Selasky };
3829f715dc1SHans Petter Selasky 
3839f715dc1SHans Petter Selasky struct ib_uverbs_alloc_mw {
384*b633e08cSHans Petter Selasky 	__aligned_u64 response;
3859f715dc1SHans Petter Selasky 	__u32 pd_handle;
3869f715dc1SHans Petter Selasky 	__u8  mw_type;
3879f715dc1SHans Petter Selasky 	__u8  reserved[3];
388*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3899f715dc1SHans Petter Selasky };
3909f715dc1SHans Petter Selasky 
3919f715dc1SHans Petter Selasky struct ib_uverbs_alloc_mw_resp {
3929f715dc1SHans Petter Selasky 	__u32 mw_handle;
3939f715dc1SHans Petter Selasky 	__u32 rkey;
394*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
3959f715dc1SHans Petter Selasky };
3969f715dc1SHans Petter Selasky 
3979f715dc1SHans Petter Selasky struct ib_uverbs_dealloc_mw {
3989f715dc1SHans Petter Selasky 	__u32 mw_handle;
3999f715dc1SHans Petter Selasky };
4009f715dc1SHans Petter Selasky 
4019f715dc1SHans Petter Selasky struct ib_uverbs_create_comp_channel {
402*b633e08cSHans Petter Selasky 	__aligned_u64 response;
4039f715dc1SHans Petter Selasky };
4049f715dc1SHans Petter Selasky 
4059f715dc1SHans Petter Selasky struct ib_uverbs_create_comp_channel_resp {
4069f715dc1SHans Petter Selasky 	__u32 fd;
4079f715dc1SHans Petter Selasky };
4089f715dc1SHans Petter Selasky 
4099f715dc1SHans Petter Selasky struct ib_uverbs_create_cq {
410*b633e08cSHans Petter Selasky 	__aligned_u64 response;
411*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
4129f715dc1SHans Petter Selasky 	__u32 cqe;
4139f715dc1SHans Petter Selasky 	__u32 comp_vector;
4149f715dc1SHans Petter Selasky 	__s32 comp_channel;
4159f715dc1SHans Petter Selasky 	__u32 reserved;
416*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
417*b633e08cSHans Petter Selasky };
418*b633e08cSHans Petter Selasky 
419*b633e08cSHans Petter Selasky enum ib_uverbs_ex_create_cq_flags {
420*b633e08cSHans Petter Selasky 	IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
421*b633e08cSHans Petter Selasky 	IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
4229f715dc1SHans Petter Selasky };
4239f715dc1SHans Petter Selasky 
4249f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_cq {
425*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
4269f715dc1SHans Petter Selasky 	__u32 cqe;
4279f715dc1SHans Petter Selasky 	__u32 comp_vector;
4289f715dc1SHans Petter Selasky 	__s32 comp_channel;
4299f715dc1SHans Petter Selasky 	__u32 comp_mask;
430*b633e08cSHans Petter Selasky 	__u32 flags;  /* bitmask of ib_uverbs_ex_create_cq_flags */
4319f715dc1SHans Petter Selasky 	__u32 reserved;
4329f715dc1SHans Petter Selasky };
4339f715dc1SHans Petter Selasky 
4349f715dc1SHans Petter Selasky struct ib_uverbs_create_cq_resp {
4359f715dc1SHans Petter Selasky 	__u32 cq_handle;
4369f715dc1SHans Petter Selasky 	__u32 cqe;
437*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
4389f715dc1SHans Petter Selasky };
4399f715dc1SHans Petter Selasky 
4409f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_cq_resp {
4419f715dc1SHans Petter Selasky 	struct ib_uverbs_create_cq_resp base;
4429f715dc1SHans Petter Selasky 	__u32 comp_mask;
4439f715dc1SHans Petter Selasky 	__u32 response_length;
4449f715dc1SHans Petter Selasky };
4459f715dc1SHans Petter Selasky 
4469f715dc1SHans Petter Selasky struct ib_uverbs_resize_cq {
447*b633e08cSHans Petter Selasky 	__aligned_u64 response;
4489f715dc1SHans Petter Selasky 	__u32 cq_handle;
4499f715dc1SHans Petter Selasky 	__u32 cqe;
450*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
4519f715dc1SHans Petter Selasky };
4529f715dc1SHans Petter Selasky 
4539f715dc1SHans Petter Selasky struct ib_uverbs_resize_cq_resp {
4549f715dc1SHans Petter Selasky 	__u32 cqe;
4559f715dc1SHans Petter Selasky 	__u32 reserved;
456*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
4579f715dc1SHans Petter Selasky };
4589f715dc1SHans Petter Selasky 
4599f715dc1SHans Petter Selasky struct ib_uverbs_poll_cq {
460*b633e08cSHans Petter Selasky 	__aligned_u64 response;
4619f715dc1SHans Petter Selasky 	__u32 cq_handle;
4629f715dc1SHans Petter Selasky 	__u32 ne;
4639f715dc1SHans Petter Selasky };
4649f715dc1SHans Petter Selasky 
4659f715dc1SHans Petter Selasky struct ib_uverbs_wc {
466*b633e08cSHans Petter Selasky 	__aligned_u64 wr_id;
4679f715dc1SHans Petter Selasky 	__u32 status;
4689f715dc1SHans Petter Selasky 	__u32 opcode;
4699f715dc1SHans Petter Selasky 	__u32 vendor_err;
4709f715dc1SHans Petter Selasky 	__u32 byte_len;
4719f715dc1SHans Petter Selasky 	union {
472*b633e08cSHans Petter Selasky 		__be32 imm_data;
4739f715dc1SHans Petter Selasky 		__u32 invalidate_rkey;
4749f715dc1SHans Petter Selasky 	} ex;
4759f715dc1SHans Petter Selasky 	__u32 qp_num;
4769f715dc1SHans Petter Selasky 	__u32 src_qp;
4779f715dc1SHans Petter Selasky 	__u32 wc_flags;
4789f715dc1SHans Petter Selasky 	__u16 pkey_index;
4799f715dc1SHans Petter Selasky 	__u16 slid;
4809f715dc1SHans Petter Selasky 	__u8 sl;
4819f715dc1SHans Petter Selasky 	__u8 dlid_path_bits;
4829f715dc1SHans Petter Selasky 	__u8 port_num;
4839f715dc1SHans Petter Selasky 	__u8 reserved;
4849f715dc1SHans Petter Selasky };
4859f715dc1SHans Petter Selasky 
4869f715dc1SHans Petter Selasky struct ib_uverbs_poll_cq_resp {
4879f715dc1SHans Petter Selasky 	__u32 count;
4889f715dc1SHans Petter Selasky 	__u32 reserved;
4899f715dc1SHans Petter Selasky 	struct ib_uverbs_wc wc[0];
4909f715dc1SHans Petter Selasky };
4919f715dc1SHans Petter Selasky 
4929f715dc1SHans Petter Selasky struct ib_uverbs_req_notify_cq {
4939f715dc1SHans Petter Selasky 	__u32 cq_handle;
4949f715dc1SHans Petter Selasky 	__u32 solicited_only;
4959f715dc1SHans Petter Selasky };
4969f715dc1SHans Petter Selasky 
4979f715dc1SHans Petter Selasky struct ib_uverbs_destroy_cq {
498*b633e08cSHans Petter Selasky 	__aligned_u64 response;
4999f715dc1SHans Petter Selasky 	__u32 cq_handle;
5009f715dc1SHans Petter Selasky 	__u32 reserved;
5019f715dc1SHans Petter Selasky };
5029f715dc1SHans Petter Selasky 
5039f715dc1SHans Petter Selasky struct ib_uverbs_destroy_cq_resp {
5049f715dc1SHans Petter Selasky 	__u32 comp_events_reported;
5059f715dc1SHans Petter Selasky 	__u32 async_events_reported;
5069f715dc1SHans Petter Selasky };
5079f715dc1SHans Petter Selasky 
5089f715dc1SHans Petter Selasky struct ib_uverbs_global_route {
5099f715dc1SHans Petter Selasky 	__u8  dgid[16];
5109f715dc1SHans Petter Selasky 	__u32 flow_label;
5119f715dc1SHans Petter Selasky 	__u8  sgid_index;
5129f715dc1SHans Petter Selasky 	__u8  hop_limit;
5139f715dc1SHans Petter Selasky 	__u8  traffic_class;
5149f715dc1SHans Petter Selasky 	__u8  reserved;
5159f715dc1SHans Petter Selasky };
5169f715dc1SHans Petter Selasky 
5179f715dc1SHans Petter Selasky struct ib_uverbs_ah_attr {
5189f715dc1SHans Petter Selasky 	struct ib_uverbs_global_route grh;
5199f715dc1SHans Petter Selasky 	__u16 dlid;
5209f715dc1SHans Petter Selasky 	__u8  sl;
5219f715dc1SHans Petter Selasky 	__u8  src_path_bits;
5229f715dc1SHans Petter Selasky 	__u8  static_rate;
5239f715dc1SHans Petter Selasky 	__u8  is_global;
5249f715dc1SHans Petter Selasky 	__u8  port_num;
5259f715dc1SHans Petter Selasky 	__u8  reserved;
5269f715dc1SHans Petter Selasky };
5279f715dc1SHans Petter Selasky 
5289f715dc1SHans Petter Selasky struct ib_uverbs_qp_attr {
5299f715dc1SHans Petter Selasky 	__u32	qp_attr_mask;
5309f715dc1SHans Petter Selasky 	__u32	qp_state;
5319f715dc1SHans Petter Selasky 	__u32	cur_qp_state;
5329f715dc1SHans Petter Selasky 	__u32	path_mtu;
5339f715dc1SHans Petter Selasky 	__u32	path_mig_state;
5349f715dc1SHans Petter Selasky 	__u32	qkey;
5359f715dc1SHans Petter Selasky 	__u32	rq_psn;
5369f715dc1SHans Petter Selasky 	__u32	sq_psn;
5379f715dc1SHans Petter Selasky 	__u32	dest_qp_num;
5389f715dc1SHans Petter Selasky 	__u32	qp_access_flags;
5399f715dc1SHans Petter Selasky 
5409f715dc1SHans Petter Selasky 	struct ib_uverbs_ah_attr ah_attr;
5419f715dc1SHans Petter Selasky 	struct ib_uverbs_ah_attr alt_ah_attr;
5429f715dc1SHans Petter Selasky 
5439f715dc1SHans Petter Selasky 	/* ib_qp_cap */
5449f715dc1SHans Petter Selasky 	__u32	max_send_wr;
5459f715dc1SHans Petter Selasky 	__u32	max_recv_wr;
5469f715dc1SHans Petter Selasky 	__u32	max_send_sge;
5479f715dc1SHans Petter Selasky 	__u32	max_recv_sge;
5489f715dc1SHans Petter Selasky 	__u32	max_inline_data;
5499f715dc1SHans Petter Selasky 
5509f715dc1SHans Petter Selasky 	__u16	pkey_index;
5519f715dc1SHans Petter Selasky 	__u16	alt_pkey_index;
5529f715dc1SHans Petter Selasky 	__u8	en_sqd_async_notify;
5539f715dc1SHans Petter Selasky 	__u8	sq_draining;
5549f715dc1SHans Petter Selasky 	__u8	max_rd_atomic;
5559f715dc1SHans Petter Selasky 	__u8	max_dest_rd_atomic;
5569f715dc1SHans Petter Selasky 	__u8	min_rnr_timer;
5579f715dc1SHans Petter Selasky 	__u8	port_num;
5589f715dc1SHans Petter Selasky 	__u8	timeout;
5599f715dc1SHans Petter Selasky 	__u8	retry_cnt;
5609f715dc1SHans Petter Selasky 	__u8	rnr_retry;
5619f715dc1SHans Petter Selasky 	__u8	alt_port_num;
5629f715dc1SHans Petter Selasky 	__u8	alt_timeout;
5639f715dc1SHans Petter Selasky 	__u8	reserved[5];
5649f715dc1SHans Petter Selasky };
5659f715dc1SHans Petter Selasky 
5669f715dc1SHans Petter Selasky struct ib_uverbs_create_qp {
567*b633e08cSHans Petter Selasky 	__aligned_u64 response;
568*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
5699f715dc1SHans Petter Selasky 	__u32 pd_handle;
5709f715dc1SHans Petter Selasky 	__u32 send_cq_handle;
5719f715dc1SHans Petter Selasky 	__u32 recv_cq_handle;
5729f715dc1SHans Petter Selasky 	__u32 srq_handle;
5739f715dc1SHans Petter Selasky 	__u32 max_send_wr;
5749f715dc1SHans Petter Selasky 	__u32 max_recv_wr;
5759f715dc1SHans Petter Selasky 	__u32 max_send_sge;
5769f715dc1SHans Petter Selasky 	__u32 max_recv_sge;
5779f715dc1SHans Petter Selasky 	__u32 max_inline_data;
5789f715dc1SHans Petter Selasky 	__u8  sq_sig_all;
5799f715dc1SHans Petter Selasky 	__u8  qp_type;
5809f715dc1SHans Petter Selasky 	__u8  is_srq;
5819f715dc1SHans Petter Selasky 	__u8  reserved;
582*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
5839f715dc1SHans Petter Selasky };
5849f715dc1SHans Petter Selasky 
5859f715dc1SHans Petter Selasky enum ib_uverbs_create_qp_mask {
5869f715dc1SHans Petter Selasky 	IB_UVERBS_CREATE_QP_MASK_IND_TABLE = 1UL << 0,
5879f715dc1SHans Petter Selasky };
5889f715dc1SHans Petter Selasky 
5899f715dc1SHans Petter Selasky enum {
5909f715dc1SHans Petter Selasky 	IB_UVERBS_CREATE_QP_SUP_COMP_MASK = IB_UVERBS_CREATE_QP_MASK_IND_TABLE,
5919f715dc1SHans Petter Selasky };
5929f715dc1SHans Petter Selasky 
593*b633e08cSHans Petter Selasky enum {
594*b633e08cSHans Petter Selasky 	/*
595*b633e08cSHans Petter Selasky 	 * This value is equal to IB_QP_DEST_QPN.
596*b633e08cSHans Petter Selasky 	 */
597*b633e08cSHans Petter Selasky 	IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
598*b633e08cSHans Petter Selasky };
599*b633e08cSHans Petter Selasky 
600*b633e08cSHans Petter Selasky enum {
601*b633e08cSHans Petter Selasky 	/*
602*b633e08cSHans Petter Selasky 	 * This value is equal to IB_QP_RATE_LIMIT.
603*b633e08cSHans Petter Selasky 	 */
604*b633e08cSHans Petter Selasky 	IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
605*b633e08cSHans Petter Selasky };
606*b633e08cSHans Petter Selasky 
6079f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_qp {
608*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
6099f715dc1SHans Petter Selasky 	__u32 pd_handle;
6109f715dc1SHans Petter Selasky 	__u32 send_cq_handle;
6119f715dc1SHans Petter Selasky 	__u32 recv_cq_handle;
6129f715dc1SHans Petter Selasky 	__u32 srq_handle;
6139f715dc1SHans Petter Selasky 	__u32 max_send_wr;
6149f715dc1SHans Petter Selasky 	__u32 max_recv_wr;
6159f715dc1SHans Petter Selasky 	__u32 max_send_sge;
6169f715dc1SHans Petter Selasky 	__u32 max_recv_sge;
6179f715dc1SHans Petter Selasky 	__u32 max_inline_data;
6189f715dc1SHans Petter Selasky 	__u8  sq_sig_all;
6199f715dc1SHans Petter Selasky 	__u8  qp_type;
6209f715dc1SHans Petter Selasky 	__u8  is_srq;
6219f715dc1SHans Petter Selasky 	__u8 reserved;
6229f715dc1SHans Petter Selasky 	__u32 comp_mask;
6239f715dc1SHans Petter Selasky 	__u32 create_flags;
6249f715dc1SHans Petter Selasky 	__u32 rwq_ind_tbl_handle;
625*b633e08cSHans Petter Selasky 	__u32  source_qpn;
6269f715dc1SHans Petter Selasky };
6279f715dc1SHans Petter Selasky 
6289f715dc1SHans Petter Selasky struct ib_uverbs_open_qp {
629*b633e08cSHans Petter Selasky 	__aligned_u64 response;
630*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
6319f715dc1SHans Petter Selasky 	__u32 pd_handle;
6329f715dc1SHans Petter Selasky 	__u32 qpn;
6339f715dc1SHans Petter Selasky 	__u8  qp_type;
6349f715dc1SHans Petter Selasky 	__u8  reserved[7];
635*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
6369f715dc1SHans Petter Selasky };
6379f715dc1SHans Petter Selasky 
6389f715dc1SHans Petter Selasky /* also used for open response */
6399f715dc1SHans Petter Selasky struct ib_uverbs_create_qp_resp {
6409f715dc1SHans Petter Selasky 	__u32 qp_handle;
6419f715dc1SHans Petter Selasky 	__u32 qpn;
6429f715dc1SHans Petter Selasky 	__u32 max_send_wr;
6439f715dc1SHans Petter Selasky 	__u32 max_recv_wr;
6449f715dc1SHans Petter Selasky 	__u32 max_send_sge;
6459f715dc1SHans Petter Selasky 	__u32 max_recv_sge;
6469f715dc1SHans Petter Selasky 	__u32 max_inline_data;
6479f715dc1SHans Petter Selasky 	__u32 reserved;
648*b633e08cSHans Petter Selasky 	__u32 driver_data[0];
6499f715dc1SHans Petter Selasky };
6509f715dc1SHans Petter Selasky 
6519f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_qp_resp {
6529f715dc1SHans Petter Selasky 	struct ib_uverbs_create_qp_resp base;
6539f715dc1SHans Petter Selasky 	__u32 comp_mask;
6549f715dc1SHans Petter Selasky 	__u32 response_length;
6559f715dc1SHans Petter Selasky };
6569f715dc1SHans Petter Selasky 
6579f715dc1SHans Petter Selasky /*
6589f715dc1SHans Petter Selasky  * This struct needs to remain a multiple of 8 bytes to keep the
6599f715dc1SHans Petter Selasky  * alignment of the modify QP parameters.
6609f715dc1SHans Petter Selasky  */
6619f715dc1SHans Petter Selasky struct ib_uverbs_qp_dest {
6629f715dc1SHans Petter Selasky 	__u8  dgid[16];
6639f715dc1SHans Petter Selasky 	__u32 flow_label;
6649f715dc1SHans Petter Selasky 	__u16 dlid;
6659f715dc1SHans Petter Selasky 	__u16 reserved;
6669f715dc1SHans Petter Selasky 	__u8  sgid_index;
6679f715dc1SHans Petter Selasky 	__u8  hop_limit;
6689f715dc1SHans Petter Selasky 	__u8  traffic_class;
6699f715dc1SHans Petter Selasky 	__u8  sl;
6709f715dc1SHans Petter Selasky 	__u8  src_path_bits;
6719f715dc1SHans Petter Selasky 	__u8  static_rate;
6729f715dc1SHans Petter Selasky 	__u8  is_global;
6739f715dc1SHans Petter Selasky 	__u8  port_num;
6749f715dc1SHans Petter Selasky };
6759f715dc1SHans Petter Selasky 
6769f715dc1SHans Petter Selasky struct ib_uverbs_query_qp {
677*b633e08cSHans Petter Selasky 	__aligned_u64 response;
6789f715dc1SHans Petter Selasky 	__u32 qp_handle;
6799f715dc1SHans Petter Selasky 	__u32 attr_mask;
680*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
6819f715dc1SHans Petter Selasky };
6829f715dc1SHans Petter Selasky 
6839f715dc1SHans Petter Selasky struct ib_uverbs_query_qp_resp {
6849f715dc1SHans Petter Selasky 	struct ib_uverbs_qp_dest dest;
6859f715dc1SHans Petter Selasky 	struct ib_uverbs_qp_dest alt_dest;
6869f715dc1SHans Petter Selasky 	__u32 max_send_wr;
6879f715dc1SHans Petter Selasky 	__u32 max_recv_wr;
6889f715dc1SHans Petter Selasky 	__u32 max_send_sge;
6899f715dc1SHans Petter Selasky 	__u32 max_recv_sge;
6909f715dc1SHans Petter Selasky 	__u32 max_inline_data;
6919f715dc1SHans Petter Selasky 	__u32 qkey;
6929f715dc1SHans Petter Selasky 	__u32 rq_psn;
6939f715dc1SHans Petter Selasky 	__u32 sq_psn;
6949f715dc1SHans Petter Selasky 	__u32 dest_qp_num;
6959f715dc1SHans Petter Selasky 	__u32 qp_access_flags;
6969f715dc1SHans Petter Selasky 	__u16 pkey_index;
6979f715dc1SHans Petter Selasky 	__u16 alt_pkey_index;
6989f715dc1SHans Petter Selasky 	__u8  qp_state;
6999f715dc1SHans Petter Selasky 	__u8  cur_qp_state;
7009f715dc1SHans Petter Selasky 	__u8  path_mtu;
7019f715dc1SHans Petter Selasky 	__u8  path_mig_state;
7029f715dc1SHans Petter Selasky 	__u8  sq_draining;
7039f715dc1SHans Petter Selasky 	__u8  max_rd_atomic;
7049f715dc1SHans Petter Selasky 	__u8  max_dest_rd_atomic;
7059f715dc1SHans Petter Selasky 	__u8  min_rnr_timer;
7069f715dc1SHans Petter Selasky 	__u8  port_num;
7079f715dc1SHans Petter Selasky 	__u8  timeout;
7089f715dc1SHans Petter Selasky 	__u8  retry_cnt;
7099f715dc1SHans Petter Selasky 	__u8  rnr_retry;
7109f715dc1SHans Petter Selasky 	__u8  alt_port_num;
7119f715dc1SHans Petter Selasky 	__u8  alt_timeout;
7129f715dc1SHans Petter Selasky 	__u8  sq_sig_all;
7139f715dc1SHans Petter Selasky 	__u8  reserved[5];
714*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
7159f715dc1SHans Petter Selasky };
7169f715dc1SHans Petter Selasky 
7179f715dc1SHans Petter Selasky struct ib_uverbs_modify_qp {
7189f715dc1SHans Petter Selasky 	struct ib_uverbs_qp_dest dest;
7199f715dc1SHans Petter Selasky 	struct ib_uverbs_qp_dest alt_dest;
7209f715dc1SHans Petter Selasky 	__u32 qp_handle;
7219f715dc1SHans Petter Selasky 	__u32 attr_mask;
7229f715dc1SHans Petter Selasky 	__u32 qkey;
7239f715dc1SHans Petter Selasky 	__u32 rq_psn;
7249f715dc1SHans Petter Selasky 	__u32 sq_psn;
7259f715dc1SHans Petter Selasky 	__u32 dest_qp_num;
7269f715dc1SHans Petter Selasky 	__u32 qp_access_flags;
7279f715dc1SHans Petter Selasky 	__u16 pkey_index;
7289f715dc1SHans Petter Selasky 	__u16 alt_pkey_index;
7299f715dc1SHans Petter Selasky 	__u8  qp_state;
7309f715dc1SHans Petter Selasky 	__u8  cur_qp_state;
7319f715dc1SHans Petter Selasky 	__u8  path_mtu;
7329f715dc1SHans Petter Selasky 	__u8  path_mig_state;
7339f715dc1SHans Petter Selasky 	__u8  en_sqd_async_notify;
7349f715dc1SHans Petter Selasky 	__u8  max_rd_atomic;
7359f715dc1SHans Petter Selasky 	__u8  max_dest_rd_atomic;
7369f715dc1SHans Petter Selasky 	__u8  min_rnr_timer;
7379f715dc1SHans Petter Selasky 	__u8  port_num;
7389f715dc1SHans Petter Selasky 	__u8  timeout;
7399f715dc1SHans Petter Selasky 	__u8  retry_cnt;
7409f715dc1SHans Petter Selasky 	__u8  rnr_retry;
7419f715dc1SHans Petter Selasky 	__u8  alt_port_num;
7429f715dc1SHans Petter Selasky 	__u8  alt_timeout;
7439f715dc1SHans Petter Selasky 	__u8  reserved[2];
744*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
7459f715dc1SHans Petter Selasky };
7469f715dc1SHans Petter Selasky 
747*b633e08cSHans Petter Selasky struct ib_uverbs_ex_modify_qp {
748*b633e08cSHans Petter Selasky 	struct ib_uverbs_modify_qp base;
749*b633e08cSHans Petter Selasky 	__u32	rate_limit;
750*b633e08cSHans Petter Selasky 	__u32	reserved;
751*b633e08cSHans Petter Selasky };
752*b633e08cSHans Petter Selasky 
753*b633e08cSHans Petter Selasky struct ib_uverbs_ex_modify_qp_resp {
754*b633e08cSHans Petter Selasky 	__u32  comp_mask;
755*b633e08cSHans Petter Selasky 	__u32  response_length;
7569f715dc1SHans Petter Selasky };
7579f715dc1SHans Petter Selasky 
7589f715dc1SHans Petter Selasky struct ib_uverbs_destroy_qp {
759*b633e08cSHans Petter Selasky 	__aligned_u64 response;
7609f715dc1SHans Petter Selasky 	__u32 qp_handle;
7619f715dc1SHans Petter Selasky 	__u32 reserved;
7629f715dc1SHans Petter Selasky };
7639f715dc1SHans Petter Selasky 
7649f715dc1SHans Petter Selasky struct ib_uverbs_destroy_qp_resp {
7659f715dc1SHans Petter Selasky 	__u32 events_reported;
7669f715dc1SHans Petter Selasky };
7679f715dc1SHans Petter Selasky 
7689f715dc1SHans Petter Selasky /*
7699f715dc1SHans Petter Selasky  * The ib_uverbs_sge structure isn't used anywhere, since we assume
7709f715dc1SHans Petter Selasky  * the ib_sge structure is packed the same way on 32-bit and 64-bit
7719f715dc1SHans Petter Selasky  * architectures in both kernel and user space.  It's just here to
7729f715dc1SHans Petter Selasky  * document the ABI.
7739f715dc1SHans Petter Selasky  */
7749f715dc1SHans Petter Selasky struct ib_uverbs_sge {
775*b633e08cSHans Petter Selasky 	__aligned_u64 addr;
7769f715dc1SHans Petter Selasky 	__u32 length;
7779f715dc1SHans Petter Selasky 	__u32 lkey;
7789f715dc1SHans Petter Selasky };
7799f715dc1SHans Petter Selasky 
780*b633e08cSHans Petter Selasky enum ib_uverbs_wr_opcode {
781*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_RDMA_WRITE = 0,
782*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
783*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_SEND = 2,
784*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_SEND_WITH_IMM = 3,
785*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_RDMA_READ = 4,
786*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
787*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
788*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_LOCAL_INV = 7,
789*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_BIND_MW = 8,
790*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_SEND_WITH_INV = 9,
791*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_TSO = 10,
792*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
793*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
794*b633e08cSHans Petter Selasky 	IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
795*b633e08cSHans Petter Selasky 	/* Review enum ib_wr_opcode before modifying this */
796*b633e08cSHans Petter Selasky };
797*b633e08cSHans Petter Selasky 
7989f715dc1SHans Petter Selasky struct ib_uverbs_send_wr {
799*b633e08cSHans Petter Selasky 	__aligned_u64 wr_id;
8009f715dc1SHans Petter Selasky 	__u32 num_sge;
801*b633e08cSHans Petter Selasky 	__u32 opcode;		/* see enum ib_uverbs_wr_opcode */
8029f715dc1SHans Petter Selasky 	__u32 send_flags;
8039f715dc1SHans Petter Selasky 	union {
804*b633e08cSHans Petter Selasky 		__be32 imm_data;
8059f715dc1SHans Petter Selasky 		__u32 invalidate_rkey;
8069f715dc1SHans Petter Selasky 	} ex;
8079f715dc1SHans Petter Selasky 	union {
8089f715dc1SHans Petter Selasky 		struct {
809*b633e08cSHans Petter Selasky 			__aligned_u64 remote_addr;
8109f715dc1SHans Petter Selasky 			__u32 rkey;
8119f715dc1SHans Petter Selasky 			__u32 reserved;
8129f715dc1SHans Petter Selasky 		} rdma;
8139f715dc1SHans Petter Selasky 		struct {
814*b633e08cSHans Petter Selasky 			__aligned_u64 remote_addr;
815*b633e08cSHans Petter Selasky 			__aligned_u64 compare_add;
816*b633e08cSHans Petter Selasky 			__aligned_u64 swap;
8179f715dc1SHans Petter Selasky 			__u32 rkey;
8189f715dc1SHans Petter Selasky 			__u32 reserved;
8199f715dc1SHans Petter Selasky 		} atomic;
8209f715dc1SHans Petter Selasky 		struct {
8219f715dc1SHans Petter Selasky 			__u32 ah;
8229f715dc1SHans Petter Selasky 			__u32 remote_qpn;
8239f715dc1SHans Petter Selasky 			__u32 remote_qkey;
8249f715dc1SHans Petter Selasky 			__u32 reserved;
8259f715dc1SHans Petter Selasky 		} ud;
8269f715dc1SHans Petter Selasky 	} wr;
8279f715dc1SHans Petter Selasky };
8289f715dc1SHans Petter Selasky 
8299f715dc1SHans Petter Selasky struct ib_uverbs_post_send {
830*b633e08cSHans Petter Selasky 	__aligned_u64 response;
8319f715dc1SHans Petter Selasky 	__u32 qp_handle;
8329f715dc1SHans Petter Selasky 	__u32 wr_count;
8339f715dc1SHans Petter Selasky 	__u32 sge_count;
8349f715dc1SHans Petter Selasky 	__u32 wqe_size;
8359f715dc1SHans Petter Selasky 	struct ib_uverbs_send_wr send_wr[0];
8369f715dc1SHans Petter Selasky };
8379f715dc1SHans Petter Selasky 
8389f715dc1SHans Petter Selasky struct ib_uverbs_post_send_resp {
8399f715dc1SHans Petter Selasky 	__u32 bad_wr;
8409f715dc1SHans Petter Selasky };
8419f715dc1SHans Petter Selasky 
8429f715dc1SHans Petter Selasky struct ib_uverbs_recv_wr {
843*b633e08cSHans Petter Selasky 	__aligned_u64 wr_id;
8449f715dc1SHans Petter Selasky 	__u32 num_sge;
8459f715dc1SHans Petter Selasky 	__u32 reserved;
8469f715dc1SHans Petter Selasky };
8479f715dc1SHans Petter Selasky 
8489f715dc1SHans Petter Selasky struct ib_uverbs_post_recv {
849*b633e08cSHans Petter Selasky 	__aligned_u64 response;
8509f715dc1SHans Petter Selasky 	__u32 qp_handle;
8519f715dc1SHans Petter Selasky 	__u32 wr_count;
8529f715dc1SHans Petter Selasky 	__u32 sge_count;
8539f715dc1SHans Petter Selasky 	__u32 wqe_size;
8549f715dc1SHans Petter Selasky 	struct ib_uverbs_recv_wr recv_wr[0];
8559f715dc1SHans Petter Selasky };
8569f715dc1SHans Petter Selasky 
8579f715dc1SHans Petter Selasky struct ib_uverbs_post_recv_resp {
8589f715dc1SHans Petter Selasky 	__u32 bad_wr;
8599f715dc1SHans Petter Selasky };
8609f715dc1SHans Petter Selasky 
8619f715dc1SHans Petter Selasky struct ib_uverbs_post_srq_recv {
862*b633e08cSHans Petter Selasky 	__aligned_u64 response;
8639f715dc1SHans Petter Selasky 	__u32 srq_handle;
8649f715dc1SHans Petter Selasky 	__u32 wr_count;
8659f715dc1SHans Petter Selasky 	__u32 sge_count;
8669f715dc1SHans Petter Selasky 	__u32 wqe_size;
8679f715dc1SHans Petter Selasky 	struct ib_uverbs_recv_wr recv[0];
8689f715dc1SHans Petter Selasky };
8699f715dc1SHans Petter Selasky 
8709f715dc1SHans Petter Selasky struct ib_uverbs_post_srq_recv_resp {
8719f715dc1SHans Petter Selasky 	__u32 bad_wr;
8729f715dc1SHans Petter Selasky };
8739f715dc1SHans Petter Selasky 
8749f715dc1SHans Petter Selasky struct ib_uverbs_create_ah {
875*b633e08cSHans Petter Selasky 	__aligned_u64 response;
876*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
8779f715dc1SHans Petter Selasky 	__u32 pd_handle;
8789f715dc1SHans Petter Selasky 	__u32 reserved;
8799f715dc1SHans Petter Selasky 	struct ib_uverbs_ah_attr attr;
880*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
8819f715dc1SHans Petter Selasky };
8829f715dc1SHans Petter Selasky 
8839f715dc1SHans Petter Selasky struct ib_uverbs_create_ah_resp {
8849f715dc1SHans Petter Selasky 	__u32 ah_handle;
885*b633e08cSHans Petter Selasky 	__u32 driver_data[0];
8869f715dc1SHans Petter Selasky };
8879f715dc1SHans Petter Selasky 
8889f715dc1SHans Petter Selasky struct ib_uverbs_destroy_ah {
8899f715dc1SHans Petter Selasky 	__u32 ah_handle;
8909f715dc1SHans Petter Selasky };
8919f715dc1SHans Petter Selasky 
8929f715dc1SHans Petter Selasky struct ib_uverbs_attach_mcast {
8939f715dc1SHans Petter Selasky 	__u8  gid[16];
8949f715dc1SHans Petter Selasky 	__u32 qp_handle;
8959f715dc1SHans Petter Selasky 	__u16 mlid;
8969f715dc1SHans Petter Selasky 	__u16 reserved;
897*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
8989f715dc1SHans Petter Selasky };
8999f715dc1SHans Petter Selasky 
9009f715dc1SHans Petter Selasky struct ib_uverbs_detach_mcast {
9019f715dc1SHans Petter Selasky 	__u8  gid[16];
9029f715dc1SHans Petter Selasky 	__u32 qp_handle;
9039f715dc1SHans Petter Selasky 	__u16 mlid;
9049f715dc1SHans Petter Selasky 	__u16 reserved;
905*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
9069f715dc1SHans Petter Selasky };
9079f715dc1SHans Petter Selasky 
9089f715dc1SHans Petter Selasky struct ib_uverbs_flow_spec_hdr {
9099f715dc1SHans Petter Selasky 	__u32 type;
9109f715dc1SHans Petter Selasky 	__u16 size;
9119f715dc1SHans Petter Selasky 	__u16 reserved;
9129f715dc1SHans Petter Selasky 	/* followed by flow_spec */
913*b633e08cSHans Petter Selasky 	__aligned_u64 flow_spec_data[0];
9149f715dc1SHans Petter Selasky };
9159f715dc1SHans Petter Selasky 
9169f715dc1SHans Petter Selasky struct ib_uverbs_flow_eth_filter {
9179f715dc1SHans Petter Selasky 	__u8  dst_mac[6];
9189f715dc1SHans Petter Selasky 	__u8  src_mac[6];
9199f715dc1SHans Petter Selasky 	__be16 ether_type;
9209f715dc1SHans Petter Selasky 	__be16 vlan_tag;
9219f715dc1SHans Petter Selasky };
9229f715dc1SHans Petter Selasky 
9239f715dc1SHans Petter Selasky struct ib_uverbs_flow_spec_eth {
9249f715dc1SHans Petter Selasky 	union {
9259f715dc1SHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
9269f715dc1SHans Petter Selasky 		struct {
9279f715dc1SHans Petter Selasky 			__u32 type;
9289f715dc1SHans Petter Selasky 			__u16 size;
9299f715dc1SHans Petter Selasky 			__u16 reserved;
9309f715dc1SHans Petter Selasky 		};
9319f715dc1SHans Petter Selasky 	};
9329f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_eth_filter val;
9339f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_eth_filter mask;
9349f715dc1SHans Petter Selasky };
9359f715dc1SHans Petter Selasky 
9369f715dc1SHans Petter Selasky struct ib_uverbs_flow_ipv4_filter {
9379f715dc1SHans Petter Selasky 	__be32 src_ip;
9389f715dc1SHans Petter Selasky 	__be32 dst_ip;
9399f715dc1SHans Petter Selasky 	__u8	proto;
9409f715dc1SHans Petter Selasky 	__u8	tos;
9419f715dc1SHans Petter Selasky 	__u8	ttl;
9429f715dc1SHans Petter Selasky 	__u8	flags;
9439f715dc1SHans Petter Selasky };
9449f715dc1SHans Petter Selasky 
9459f715dc1SHans Petter Selasky struct ib_uverbs_flow_spec_ipv4 {
9469f715dc1SHans Petter Selasky 	union {
9479f715dc1SHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
9489f715dc1SHans Petter Selasky 		struct {
9499f715dc1SHans Petter Selasky 			__u32 type;
9509f715dc1SHans Petter Selasky 			__u16 size;
9519f715dc1SHans Petter Selasky 			__u16 reserved;
9529f715dc1SHans Petter Selasky 		};
9539f715dc1SHans Petter Selasky 	};
9549f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_ipv4_filter val;
9559f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_ipv4_filter mask;
9569f715dc1SHans Petter Selasky };
9579f715dc1SHans Petter Selasky 
9589f715dc1SHans Petter Selasky struct ib_uverbs_flow_tcp_udp_filter {
9599f715dc1SHans Petter Selasky 	__be16 dst_port;
9609f715dc1SHans Petter Selasky 	__be16 src_port;
9619f715dc1SHans Petter Selasky };
9629f715dc1SHans Petter Selasky 
9639f715dc1SHans Petter Selasky struct ib_uverbs_flow_spec_tcp_udp {
9649f715dc1SHans Petter Selasky 	union {
9659f715dc1SHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
9669f715dc1SHans Petter Selasky 		struct {
9679f715dc1SHans Petter Selasky 			__u32 type;
9689f715dc1SHans Petter Selasky 			__u16 size;
9699f715dc1SHans Petter Selasky 			__u16 reserved;
9709f715dc1SHans Petter Selasky 		};
9719f715dc1SHans Petter Selasky 	};
9729f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_tcp_udp_filter val;
9739f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_tcp_udp_filter mask;
9749f715dc1SHans Petter Selasky };
9759f715dc1SHans Petter Selasky 
9769f715dc1SHans Petter Selasky struct ib_uverbs_flow_ipv6_filter {
9779f715dc1SHans Petter Selasky 	__u8    src_ip[16];
9789f715dc1SHans Petter Selasky 	__u8    dst_ip[16];
9799f715dc1SHans Petter Selasky 	__be32	flow_label;
9809f715dc1SHans Petter Selasky 	__u8	next_hdr;
9819f715dc1SHans Petter Selasky 	__u8	traffic_class;
9829f715dc1SHans Petter Selasky 	__u8	hop_limit;
9839f715dc1SHans Petter Selasky 	__u8	reserved;
9849f715dc1SHans Petter Selasky };
9859f715dc1SHans Petter Selasky 
9869f715dc1SHans Petter Selasky struct ib_uverbs_flow_spec_ipv6 {
9879f715dc1SHans Petter Selasky 	union {
9889f715dc1SHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
9899f715dc1SHans Petter Selasky 		struct {
9909f715dc1SHans Petter Selasky 			__u32 type;
9919f715dc1SHans Petter Selasky 			__u16 size;
9929f715dc1SHans Petter Selasky 			__u16 reserved;
9939f715dc1SHans Petter Selasky 		};
9949f715dc1SHans Petter Selasky 	};
9959f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_ipv6_filter val;
9969f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_ipv6_filter mask;
9979f715dc1SHans Petter Selasky };
9989f715dc1SHans Petter Selasky 
999*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_action_tag {
1000*b633e08cSHans Petter Selasky 	union {
1001*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1002*b633e08cSHans Petter Selasky 		struct {
1003*b633e08cSHans Petter Selasky 			__u32 type;
1004*b633e08cSHans Petter Selasky 			__u16 size;
1005*b633e08cSHans Petter Selasky 			__u16 reserved;
1006*b633e08cSHans Petter Selasky 		};
1007*b633e08cSHans Petter Selasky 	};
1008*b633e08cSHans Petter Selasky 	__u32			      tag_id;
1009*b633e08cSHans Petter Selasky 	__u32			      reserved1;
1010*b633e08cSHans Petter Selasky };
1011*b633e08cSHans Petter Selasky 
1012*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_action_drop {
1013*b633e08cSHans Petter Selasky 	union {
1014*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1015*b633e08cSHans Petter Selasky 		struct {
1016*b633e08cSHans Petter Selasky 			__u32 type;
1017*b633e08cSHans Petter Selasky 			__u16 size;
1018*b633e08cSHans Petter Selasky 			__u16 reserved;
1019*b633e08cSHans Petter Selasky 		};
1020*b633e08cSHans Petter Selasky 	};
1021*b633e08cSHans Petter Selasky };
1022*b633e08cSHans Petter Selasky 
1023*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_action_handle {
1024*b633e08cSHans Petter Selasky 	union {
1025*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1026*b633e08cSHans Petter Selasky 		struct {
1027*b633e08cSHans Petter Selasky 			__u32 type;
1028*b633e08cSHans Petter Selasky 			__u16 size;
1029*b633e08cSHans Petter Selasky 			__u16 reserved;
1030*b633e08cSHans Petter Selasky 		};
1031*b633e08cSHans Petter Selasky 	};
1032*b633e08cSHans Petter Selasky 	__u32			      handle;
1033*b633e08cSHans Petter Selasky 	__u32			      reserved1;
1034*b633e08cSHans Petter Selasky };
1035*b633e08cSHans Petter Selasky 
1036*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_action_count {
1037*b633e08cSHans Petter Selasky 	union {
1038*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1039*b633e08cSHans Petter Selasky 		struct {
1040*b633e08cSHans Petter Selasky 			__u32 type;
1041*b633e08cSHans Petter Selasky 			__u16 size;
1042*b633e08cSHans Petter Selasky 			__u16 reserved;
1043*b633e08cSHans Petter Selasky 		};
1044*b633e08cSHans Petter Selasky 	};
1045*b633e08cSHans Petter Selasky 	__u32			      handle;
1046*b633e08cSHans Petter Selasky 	__u32			      reserved1;
1047*b633e08cSHans Petter Selasky };
1048*b633e08cSHans Petter Selasky 
1049*b633e08cSHans Petter Selasky struct ib_uverbs_flow_tunnel_filter {
1050*b633e08cSHans Petter Selasky 	__be32 tunnel_id;
1051*b633e08cSHans Petter Selasky };
1052*b633e08cSHans Petter Selasky 
1053*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_tunnel {
1054*b633e08cSHans Petter Selasky 	union {
1055*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1056*b633e08cSHans Petter Selasky 		struct {
1057*b633e08cSHans Petter Selasky 			__u32 type;
1058*b633e08cSHans Petter Selasky 			__u16 size;
1059*b633e08cSHans Petter Selasky 			__u16 reserved;
1060*b633e08cSHans Petter Selasky 		};
1061*b633e08cSHans Petter Selasky 	};
1062*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_tunnel_filter val;
1063*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_tunnel_filter mask;
1064*b633e08cSHans Petter Selasky };
1065*b633e08cSHans Petter Selasky 
1066*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_esp_filter {
1067*b633e08cSHans Petter Selasky 	__u32 spi;
1068*b633e08cSHans Petter Selasky 	__u32 seq;
1069*b633e08cSHans Petter Selasky };
1070*b633e08cSHans Petter Selasky 
1071*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_esp {
1072*b633e08cSHans Petter Selasky 	union {
1073*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1074*b633e08cSHans Petter Selasky 		struct {
1075*b633e08cSHans Petter Selasky 			__u32 type;
1076*b633e08cSHans Petter Selasky 			__u16 size;
1077*b633e08cSHans Petter Selasky 			__u16 reserved;
1078*b633e08cSHans Petter Selasky 		};
1079*b633e08cSHans Petter Selasky 	};
1080*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_spec_esp_filter val;
1081*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_spec_esp_filter mask;
1082*b633e08cSHans Petter Selasky };
1083*b633e08cSHans Petter Selasky 
1084*b633e08cSHans Petter Selasky struct ib_uverbs_flow_gre_filter {
1085*b633e08cSHans Petter Selasky 	/* c_ks_res0_ver field is bits 0-15 in offset 0 of a standard GRE header:
1086*b633e08cSHans Petter Selasky 	 * bit 0 - C - checksum bit.
1087*b633e08cSHans Petter Selasky 	 * bit 1 - reserved. set to 0.
1088*b633e08cSHans Petter Selasky 	 * bit 2 - key bit.
1089*b633e08cSHans Petter Selasky 	 * bit 3 - sequence number bit.
1090*b633e08cSHans Petter Selasky 	 * bits 4:12 - reserved. set to 0.
1091*b633e08cSHans Petter Selasky 	 * bits 13:15 - GRE version.
1092*b633e08cSHans Petter Selasky 	 */
1093*b633e08cSHans Petter Selasky 	__be16 c_ks_res0_ver;
1094*b633e08cSHans Petter Selasky 	__be16 protocol;
1095*b633e08cSHans Petter Selasky 	__be32 key;
1096*b633e08cSHans Petter Selasky };
1097*b633e08cSHans Petter Selasky 
1098*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_gre {
1099*b633e08cSHans Petter Selasky 	union {
1100*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1101*b633e08cSHans Petter Selasky 		struct {
1102*b633e08cSHans Petter Selasky 			__u32 type;
1103*b633e08cSHans Petter Selasky 			__u16 size;
1104*b633e08cSHans Petter Selasky 			__u16 reserved;
1105*b633e08cSHans Petter Selasky 		};
1106*b633e08cSHans Petter Selasky 	};
1107*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_gre_filter     val;
1108*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_gre_filter     mask;
1109*b633e08cSHans Petter Selasky };
1110*b633e08cSHans Petter Selasky 
1111*b633e08cSHans Petter Selasky struct ib_uverbs_flow_mpls_filter {
1112*b633e08cSHans Petter Selasky 	/* The field includes the entire MPLS label:
1113*b633e08cSHans Petter Selasky 	 * bits 0:19 - label field.
1114*b633e08cSHans Petter Selasky 	 * bits 20:22 - traffic class field.
1115*b633e08cSHans Petter Selasky 	 * bits 23 - bottom of stack bit.
1116*b633e08cSHans Petter Selasky 	 * bits 24:31 - ttl field.
1117*b633e08cSHans Petter Selasky 	 */
1118*b633e08cSHans Petter Selasky 	__be32 label;
1119*b633e08cSHans Petter Selasky };
1120*b633e08cSHans Petter Selasky 
1121*b633e08cSHans Petter Selasky struct ib_uverbs_flow_spec_mpls {
1122*b633e08cSHans Petter Selasky 	union {
1123*b633e08cSHans Petter Selasky 		struct ib_uverbs_flow_spec_hdr hdr;
1124*b633e08cSHans Petter Selasky 		struct {
1125*b633e08cSHans Petter Selasky 			__u32 type;
1126*b633e08cSHans Petter Selasky 			__u16 size;
1127*b633e08cSHans Petter Selasky 			__u16 reserved;
1128*b633e08cSHans Petter Selasky 		};
1129*b633e08cSHans Petter Selasky 	};
1130*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_mpls_filter     val;
1131*b633e08cSHans Petter Selasky 	struct ib_uverbs_flow_mpls_filter     mask;
1132*b633e08cSHans Petter Selasky };
1133*b633e08cSHans Petter Selasky 
11349f715dc1SHans Petter Selasky struct ib_uverbs_flow_attr {
11359f715dc1SHans Petter Selasky 	__u32 type;
11369f715dc1SHans Petter Selasky 	__u16 size;
11379f715dc1SHans Petter Selasky 	__u16 priority;
11389f715dc1SHans Petter Selasky 	__u8  num_of_specs;
11399f715dc1SHans Petter Selasky 	__u8  reserved[2];
11409f715dc1SHans Petter Selasky 	__u8  port;
11419f715dc1SHans Petter Selasky 	__u32 flags;
11429f715dc1SHans Petter Selasky 	/* Following are the optional layers according to user request
11439f715dc1SHans Petter Selasky 	 * struct ib_flow_spec_xxx
11449f715dc1SHans Petter Selasky 	 * struct ib_flow_spec_yyy
11459f715dc1SHans Petter Selasky 	 */
11469f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_spec_hdr flow_specs[0];
11479f715dc1SHans Petter Selasky };
11489f715dc1SHans Petter Selasky 
11499f715dc1SHans Petter Selasky struct ib_uverbs_create_flow  {
11509f715dc1SHans Petter Selasky 	__u32 comp_mask;
11519f715dc1SHans Petter Selasky 	__u32 qp_handle;
11529f715dc1SHans Petter Selasky 	struct ib_uverbs_flow_attr flow_attr;
11539f715dc1SHans Petter Selasky };
11549f715dc1SHans Petter Selasky 
11559f715dc1SHans Petter Selasky struct ib_uverbs_create_flow_resp {
11569f715dc1SHans Petter Selasky 	__u32 comp_mask;
11579f715dc1SHans Petter Selasky 	__u32 flow_handle;
11589f715dc1SHans Petter Selasky };
11599f715dc1SHans Petter Selasky 
11609f715dc1SHans Petter Selasky struct ib_uverbs_destroy_flow  {
11619f715dc1SHans Petter Selasky 	__u32 comp_mask;
11629f715dc1SHans Petter Selasky 	__u32 flow_handle;
11639f715dc1SHans Petter Selasky };
11649f715dc1SHans Petter Selasky 
11659f715dc1SHans Petter Selasky struct ib_uverbs_create_srq {
1166*b633e08cSHans Petter Selasky 	__aligned_u64 response;
1167*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
11689f715dc1SHans Petter Selasky 	__u32 pd_handle;
11699f715dc1SHans Petter Selasky 	__u32 max_wr;
11709f715dc1SHans Petter Selasky 	__u32 max_sge;
11719f715dc1SHans Petter Selasky 	__u32 srq_limit;
1172*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
11739f715dc1SHans Petter Selasky };
11749f715dc1SHans Petter Selasky 
11759f715dc1SHans Petter Selasky struct ib_uverbs_create_xsrq {
1176*b633e08cSHans Petter Selasky 	__aligned_u64 response;
1177*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
11789f715dc1SHans Petter Selasky 	__u32 srq_type;
11799f715dc1SHans Petter Selasky 	__u32 pd_handle;
11809f715dc1SHans Petter Selasky 	__u32 max_wr;
11819f715dc1SHans Petter Selasky 	__u32 max_sge;
11829f715dc1SHans Petter Selasky 	__u32 srq_limit;
1183*b633e08cSHans Petter Selasky 	__u32 max_num_tags;
11849f715dc1SHans Petter Selasky 	__u32 xrcd_handle;
11859f715dc1SHans Petter Selasky 	__u32 cq_handle;
1186*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
11879f715dc1SHans Petter Selasky };
11889f715dc1SHans Petter Selasky 
11899f715dc1SHans Petter Selasky struct ib_uverbs_create_srq_resp {
11909f715dc1SHans Petter Selasky 	__u32 srq_handle;
11919f715dc1SHans Petter Selasky 	__u32 max_wr;
11929f715dc1SHans Petter Selasky 	__u32 max_sge;
11939f715dc1SHans Petter Selasky 	__u32 srqn;
1194*b633e08cSHans Petter Selasky 	__u32 driver_data[0];
11959f715dc1SHans Petter Selasky };
11969f715dc1SHans Petter Selasky 
11979f715dc1SHans Petter Selasky struct ib_uverbs_modify_srq {
11989f715dc1SHans Petter Selasky 	__u32 srq_handle;
11999f715dc1SHans Petter Selasky 	__u32 attr_mask;
12009f715dc1SHans Petter Selasky 	__u32 max_wr;
12019f715dc1SHans Petter Selasky 	__u32 srq_limit;
1202*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
12039f715dc1SHans Petter Selasky };
12049f715dc1SHans Petter Selasky 
12059f715dc1SHans Petter Selasky struct ib_uverbs_query_srq {
1206*b633e08cSHans Petter Selasky 	__aligned_u64 response;
12079f715dc1SHans Petter Selasky 	__u32 srq_handle;
12089f715dc1SHans Petter Selasky 	__u32 reserved;
1209*b633e08cSHans Petter Selasky 	__aligned_u64 driver_data[0];
12109f715dc1SHans Petter Selasky };
12119f715dc1SHans Petter Selasky 
12129f715dc1SHans Petter Selasky struct ib_uverbs_query_srq_resp {
12139f715dc1SHans Petter Selasky 	__u32 max_wr;
12149f715dc1SHans Petter Selasky 	__u32 max_sge;
12159f715dc1SHans Petter Selasky 	__u32 srq_limit;
12169f715dc1SHans Petter Selasky 	__u32 reserved;
12179f715dc1SHans Petter Selasky };
12189f715dc1SHans Petter Selasky 
12199f715dc1SHans Petter Selasky struct ib_uverbs_destroy_srq {
1220*b633e08cSHans Petter Selasky 	__aligned_u64 response;
12219f715dc1SHans Petter Selasky 	__u32 srq_handle;
12229f715dc1SHans Petter Selasky 	__u32 reserved;
12239f715dc1SHans Petter Selasky };
12249f715dc1SHans Petter Selasky 
12259f715dc1SHans Petter Selasky struct ib_uverbs_destroy_srq_resp {
12269f715dc1SHans Petter Selasky 	__u32 events_reported;
12279f715dc1SHans Petter Selasky };
12289f715dc1SHans Petter Selasky 
12299f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_wq  {
12309f715dc1SHans Petter Selasky 	__u32 comp_mask;
12319f715dc1SHans Petter Selasky 	__u32 wq_type;
1232*b633e08cSHans Petter Selasky 	__aligned_u64 user_handle;
12339f715dc1SHans Petter Selasky 	__u32 pd_handle;
12349f715dc1SHans Petter Selasky 	__u32 cq_handle;
12359f715dc1SHans Petter Selasky 	__u32 max_wr;
12369f715dc1SHans Petter Selasky 	__u32 max_sge;
1237*b633e08cSHans Petter Selasky 	__u32 create_flags; /* Use enum ib_wq_flags */
1238*b633e08cSHans Petter Selasky 	__u32 reserved;
12399f715dc1SHans Petter Selasky };
12409f715dc1SHans Petter Selasky 
12419f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_wq_resp {
12429f715dc1SHans Petter Selasky 	__u32 comp_mask;
12439f715dc1SHans Petter Selasky 	__u32 response_length;
12449f715dc1SHans Petter Selasky 	__u32 wq_handle;
12459f715dc1SHans Petter Selasky 	__u32 max_wr;
12469f715dc1SHans Petter Selasky 	__u32 max_sge;
12479f715dc1SHans Petter Selasky 	__u32 wqn;
12489f715dc1SHans Petter Selasky };
12499f715dc1SHans Petter Selasky 
12509f715dc1SHans Petter Selasky struct ib_uverbs_ex_destroy_wq  {
12519f715dc1SHans Petter Selasky 	__u32 comp_mask;
12529f715dc1SHans Petter Selasky 	__u32 wq_handle;
12539f715dc1SHans Petter Selasky };
12549f715dc1SHans Petter Selasky 
12559f715dc1SHans Petter Selasky struct ib_uverbs_ex_destroy_wq_resp {
12569f715dc1SHans Petter Selasky 	__u32 comp_mask;
12579f715dc1SHans Petter Selasky 	__u32 response_length;
12589f715dc1SHans Petter Selasky 	__u32 events_reported;
12599f715dc1SHans Petter Selasky 	__u32 reserved;
12609f715dc1SHans Petter Selasky };
12619f715dc1SHans Petter Selasky 
12629f715dc1SHans Petter Selasky struct ib_uverbs_ex_modify_wq  {
12639f715dc1SHans Petter Selasky 	__u32 attr_mask;
12649f715dc1SHans Petter Selasky 	__u32 wq_handle;
12659f715dc1SHans Petter Selasky 	__u32 wq_state;
12669f715dc1SHans Petter Selasky 	__u32 curr_wq_state;
1267*b633e08cSHans Petter Selasky 	__u32 flags; /* Use enum ib_wq_flags */
1268*b633e08cSHans Petter Selasky 	__u32 flags_mask; /* Use enum ib_wq_flags */
12699f715dc1SHans Petter Selasky };
12709f715dc1SHans Petter Selasky 
12719f715dc1SHans Petter Selasky /* Prevent memory allocation rather than max expected size */
12729f715dc1SHans Petter Selasky #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
12739f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_rwq_ind_table  {
12749f715dc1SHans Petter Selasky 	__u32 comp_mask;
12759f715dc1SHans Petter Selasky 	__u32 log_ind_tbl_size;
12769f715dc1SHans Petter Selasky 	/* Following are the wq handles according to log_ind_tbl_size
12779f715dc1SHans Petter Selasky 	 * wq_handle1
12789f715dc1SHans Petter Selasky 	 * wq_handle2
12799f715dc1SHans Petter Selasky 	 */
12809f715dc1SHans Petter Selasky 	__u32 wq_handles[0];
12819f715dc1SHans Petter Selasky };
12829f715dc1SHans Petter Selasky 
12839f715dc1SHans Petter Selasky struct ib_uverbs_ex_create_rwq_ind_table_resp {
12849f715dc1SHans Petter Selasky 	__u32 comp_mask;
12859f715dc1SHans Petter Selasky 	__u32 response_length;
12869f715dc1SHans Petter Selasky 	__u32 ind_tbl_handle;
12879f715dc1SHans Petter Selasky 	__u32 ind_tbl_num;
12889f715dc1SHans Petter Selasky };
12899f715dc1SHans Petter Selasky 
12909f715dc1SHans Petter Selasky struct ib_uverbs_ex_destroy_rwq_ind_table  {
12919f715dc1SHans Petter Selasky 	__u32 comp_mask;
12929f715dc1SHans Petter Selasky 	__u32 ind_tbl_handle;
12939f715dc1SHans Petter Selasky };
12949f715dc1SHans Petter Selasky 
1295*b633e08cSHans Petter Selasky struct ib_uverbs_cq_moderation {
1296*b633e08cSHans Petter Selasky 	__u16 cq_count;
1297*b633e08cSHans Petter Selasky 	__u16 cq_period;
1298*b633e08cSHans Petter Selasky };
1299*b633e08cSHans Petter Selasky 
1300*b633e08cSHans Petter Selasky struct ib_uverbs_ex_modify_cq {
1301*b633e08cSHans Petter Selasky 	__u32 cq_handle;
1302*b633e08cSHans Petter Selasky 	__u32 attr_mask;
1303*b633e08cSHans Petter Selasky 	struct ib_uverbs_cq_moderation attr;
1304*b633e08cSHans Petter Selasky 	__u32 reserved;
1305*b633e08cSHans Petter Selasky };
1306*b633e08cSHans Petter Selasky 
1307*b633e08cSHans Petter Selasky #define IB_DEVICE_NAME_MAX 64
1308*b633e08cSHans Petter Selasky 
13099f715dc1SHans Petter Selasky #endif /* IB_USER_VERBS_H */
1310