1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
3 * Copyright (c) 2005 Topspin Communications. All rights reserved.
4 * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved.
5 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
6 * Copyright (c) 2006 Mellanox Technologies. All rights reserved.
8 * This software is available to you under a choice of one of two
9 * licenses. You may choose to be licensed under the terms of the GNU
10 * General Public License (GPL) Version 2, available from the file
11 * COPYING in the main directory of this source tree, or the
12 * OpenIB.org BSD license below:
14 * Redistribution and use in source and binary forms, with or
15 * without modification, are permitted provided that the following
18 * - Redistributions of source code must retain the above
19 * copyright notice, this list of conditions and the following
22 * - Redistributions in binary form must reproduce the above
23 * copyright notice, this list of conditions and the following
24 * disclaimer in the documentation and/or other materials
25 * provided with the distribution.
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
31 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
32 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
33 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 #ifndef IB_USER_VERBS_H
38 #define IB_USER_VERBS_H
40 #include <linux/types.h>
43 * Increment this value if any changes that break userspace ABI
44 * compatibility are made.
46 #define IB_USER_VERBS_ABI_VERSION 6
47 #define IB_USER_VERBS_CMD_THRESHOLD 50
49 enum ib_uverbs_write_cmds
{
50 IB_USER_VERBS_CMD_GET_CONTEXT
,
51 IB_USER_VERBS_CMD_QUERY_DEVICE
,
52 IB_USER_VERBS_CMD_QUERY_PORT
,
53 IB_USER_VERBS_CMD_ALLOC_PD
,
54 IB_USER_VERBS_CMD_DEALLOC_PD
,
55 IB_USER_VERBS_CMD_CREATE_AH
,
56 IB_USER_VERBS_CMD_MODIFY_AH
,
57 IB_USER_VERBS_CMD_QUERY_AH
,
58 IB_USER_VERBS_CMD_DESTROY_AH
,
59 IB_USER_VERBS_CMD_REG_MR
,
60 IB_USER_VERBS_CMD_REG_SMR
,
61 IB_USER_VERBS_CMD_REREG_MR
,
62 IB_USER_VERBS_CMD_QUERY_MR
,
63 IB_USER_VERBS_CMD_DEREG_MR
,
64 IB_USER_VERBS_CMD_ALLOC_MW
,
65 IB_USER_VERBS_CMD_BIND_MW
,
66 IB_USER_VERBS_CMD_DEALLOC_MW
,
67 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL
,
68 IB_USER_VERBS_CMD_CREATE_CQ
,
69 IB_USER_VERBS_CMD_RESIZE_CQ
,
70 IB_USER_VERBS_CMD_DESTROY_CQ
,
71 IB_USER_VERBS_CMD_POLL_CQ
,
72 IB_USER_VERBS_CMD_PEEK_CQ
,
73 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ
,
74 IB_USER_VERBS_CMD_CREATE_QP
,
75 IB_USER_VERBS_CMD_QUERY_QP
,
76 IB_USER_VERBS_CMD_MODIFY_QP
,
77 IB_USER_VERBS_CMD_DESTROY_QP
,
78 IB_USER_VERBS_CMD_POST_SEND
,
79 IB_USER_VERBS_CMD_POST_RECV
,
80 IB_USER_VERBS_CMD_ATTACH_MCAST
,
81 IB_USER_VERBS_CMD_DETACH_MCAST
,
82 IB_USER_VERBS_CMD_CREATE_SRQ
,
83 IB_USER_VERBS_CMD_MODIFY_SRQ
,
84 IB_USER_VERBS_CMD_QUERY_SRQ
,
85 IB_USER_VERBS_CMD_DESTROY_SRQ
,
86 IB_USER_VERBS_CMD_POST_SRQ_RECV
,
87 IB_USER_VERBS_CMD_OPEN_XRCD
,
88 IB_USER_VERBS_CMD_CLOSE_XRCD
,
89 IB_USER_VERBS_CMD_CREATE_XSRQ
,
90 IB_USER_VERBS_CMD_OPEN_QP
,
94 IB_USER_VERBS_EX_CMD_QUERY_DEVICE
= IB_USER_VERBS_CMD_QUERY_DEVICE
,
95 IB_USER_VERBS_EX_CMD_CREATE_CQ
= IB_USER_VERBS_CMD_CREATE_CQ
,
96 IB_USER_VERBS_EX_CMD_CREATE_QP
= IB_USER_VERBS_CMD_CREATE_QP
,
97 IB_USER_VERBS_EX_CMD_MODIFY_QP
= IB_USER_VERBS_CMD_MODIFY_QP
,
98 IB_USER_VERBS_EX_CMD_CREATE_FLOW
= IB_USER_VERBS_CMD_THRESHOLD
,
99 IB_USER_VERBS_EX_CMD_DESTROY_FLOW
,
100 IB_USER_VERBS_EX_CMD_CREATE_WQ
,
101 IB_USER_VERBS_EX_CMD_MODIFY_WQ
,
102 IB_USER_VERBS_EX_CMD_DESTROY_WQ
,
103 IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL
,
104 IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL
,
105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
108 /* see IBA A19.4.1.1 Placement Types */
109 enum ib_placement_type
{
110 IB_FLUSH_GLOBAL
= 1U << 0,
111 IB_FLUSH_PERSISTENT
= 1U << 1,
114 /* see IBA A19.4.1.2 Selectivity Level */
115 enum ib_selectivity_level
{
121 * Make sure that all structs defined in this file remain laid out so
122 * that they pack the same way on 32-bit and 64-bit architectures (to
123 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
125 * - Do not use pointer types -- pass pointers in __u64 instead.
126 * - Make sure that any structure larger than 4 bytes is padded to a
127 * multiple of 8 bytes. Otherwise the structure size will be
128 * different between 32-bit and 64-bit architectures.
131 struct ib_uverbs_async_event_desc
{
132 __aligned_u64 element
;
133 __u32 event_type
; /* enum ib_event_type */
137 struct ib_uverbs_comp_event_desc
{
138 __aligned_u64 cq_handle
;
141 struct ib_uverbs_cq_moderation_caps
{
142 __u16 max_cq_moderation_count
;
143 __u16 max_cq_moderation_period
;
148 * All commands from userspace should start with a __u32 command field
149 * followed by __u16 in_words and out_words fields (which give the
150 * length of the command block and response buffer if any in 32-bit
151 * words). The kernel driver will read these fields first and read
152 * the rest of the command struct based on these value.
155 #define IB_USER_VERBS_CMD_COMMAND_MASK 0xff
156 #define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
158 struct ib_uverbs_cmd_hdr
{
164 struct ib_uverbs_ex_cmd_hdr
{
165 __aligned_u64 response
;
166 __u16 provider_in_words
;
167 __u16 provider_out_words
;
168 __u32 cmd_hdr_reserved
;
171 struct ib_uverbs_get_context
{
172 __aligned_u64 response
;
173 __aligned_u64 driver_data
[];
176 struct ib_uverbs_get_context_resp
{
178 __u32 num_comp_vectors
;
179 __aligned_u64 driver_data
[];
182 struct ib_uverbs_query_device
{
183 __aligned_u64 response
;
184 __aligned_u64 driver_data
[];
187 struct ib_uverbs_query_device_resp
{
188 __aligned_u64 fw_ver
;
190 __be64 sys_image_guid
;
191 __aligned_u64 max_mr_size
;
192 __aligned_u64 page_size_cap
;
194 __u32 vendor_part_id
;
198 __u32 device_cap_flags
;
205 __u32 max_qp_rd_atom
;
206 __u32 max_ee_rd_atom
;
207 __u32 max_res_rd_atom
;
208 __u32 max_qp_init_rd_atom
;
209 __u32 max_ee_init_rd_atom
;
214 __u32 max_raw_ipv6_qp
;
215 __u32 max_raw_ethy_qp
;
217 __u32 max_mcast_qp_attach
;
218 __u32 max_total_mcast_qp_attach
;
221 __u32 max_map_per_fmr
;
226 __u8 local_ca_ack_delay
;
231 struct ib_uverbs_ex_query_device
{
236 struct ib_uverbs_odp_caps
{
237 __aligned_u64 general_caps
;
242 } per_transport_caps
;
246 struct ib_uverbs_rss_caps
{
247 /* Corresponding bit will be set if qp type from
248 * 'enum ib_qp_type' is supported, e.g.
249 * supported_qpts |= 1 << IB_QPT_UD
251 __u32 supported_qpts
;
252 __u32 max_rwq_indirection_tables
;
253 __u32 max_rwq_indirection_table_size
;
257 struct ib_uverbs_tm_caps
{
258 /* Max size of rendezvous request message */
259 __u32 max_rndv_hdr_size
;
260 /* Max number of entries in tag matching list */
264 /* Max number of outstanding list operations */
266 /* Max number of SGE in tag matching entry */
271 struct ib_uverbs_ex_query_device_resp
{
272 struct ib_uverbs_query_device_resp base
;
274 __u32 response_length
;
275 struct ib_uverbs_odp_caps odp_caps
;
276 __aligned_u64 timestamp_mask
;
277 __aligned_u64 hca_core_clock
; /* in KHZ */
278 __aligned_u64 device_cap_flags_ex
;
279 struct ib_uverbs_rss_caps rss_caps
;
280 __u32 max_wq_type_rq
;
281 __u32 raw_packet_caps
;
282 struct ib_uverbs_tm_caps tm_caps
;
283 struct ib_uverbs_cq_moderation_caps cq_moderation_caps
;
284 __aligned_u64 max_dm_size
;
289 struct ib_uverbs_query_port
{
290 __aligned_u64 response
;
293 __aligned_u64 driver_data
[];
296 struct ib_uverbs_query_port_resp
{
297 __u32 port_cap_flags
; /* see ib_uverbs_query_port_cap_flags */
300 __u32 qkey_viol_cntr
;
312 __u8 init_type_reply
;
317 __u8 flags
; /* see ib_uverbs_query_port_flags */
321 struct ib_uverbs_alloc_pd
{
322 __aligned_u64 response
;
323 __aligned_u64 driver_data
[];
326 struct ib_uverbs_alloc_pd_resp
{
331 struct ib_uverbs_dealloc_pd
{
335 struct ib_uverbs_open_xrcd
{
336 __aligned_u64 response
;
339 __aligned_u64 driver_data
[];
342 struct ib_uverbs_open_xrcd_resp
{
347 struct ib_uverbs_close_xrcd
{
351 struct ib_uverbs_reg_mr
{
352 __aligned_u64 response
;
354 __aligned_u64 length
;
355 __aligned_u64 hca_va
;
358 __aligned_u64 driver_data
[];
361 struct ib_uverbs_reg_mr_resp
{
368 struct ib_uverbs_rereg_mr
{
369 __aligned_u64 response
;
373 __aligned_u64 length
;
374 __aligned_u64 hca_va
;
377 __aligned_u64 driver_data
[];
380 struct ib_uverbs_rereg_mr_resp
{
383 __aligned_u64 driver_data
[];
386 struct ib_uverbs_dereg_mr
{
390 struct ib_uverbs_alloc_mw
{
391 __aligned_u64 response
;
395 __aligned_u64 driver_data
[];
398 struct ib_uverbs_alloc_mw_resp
{
401 __aligned_u64 driver_data
[];
404 struct ib_uverbs_dealloc_mw
{
408 struct ib_uverbs_create_comp_channel
{
409 __aligned_u64 response
;
412 struct ib_uverbs_create_comp_channel_resp
{
416 struct ib_uverbs_create_cq
{
417 __aligned_u64 response
;
418 __aligned_u64 user_handle
;
423 __aligned_u64 driver_data
[];
426 enum ib_uverbs_ex_create_cq_flags
{
427 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION
= 1 << 0,
428 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN
= 1 << 1,
431 struct ib_uverbs_ex_create_cq
{
432 __aligned_u64 user_handle
;
437 __u32 flags
; /* bitmask of ib_uverbs_ex_create_cq_flags */
441 struct ib_uverbs_create_cq_resp
{
444 __aligned_u64 driver_data
[0];
447 struct ib_uverbs_ex_create_cq_resp
{
448 struct ib_uverbs_create_cq_resp base
;
450 __u32 response_length
;
453 struct ib_uverbs_resize_cq
{
454 __aligned_u64 response
;
457 __aligned_u64 driver_data
[];
460 struct ib_uverbs_resize_cq_resp
{
463 __aligned_u64 driver_data
[];
466 struct ib_uverbs_poll_cq
{
467 __aligned_u64 response
;
472 enum ib_uverbs_wc_opcode
{
473 IB_UVERBS_WC_SEND
= 0,
474 IB_UVERBS_WC_RDMA_WRITE
= 1,
475 IB_UVERBS_WC_RDMA_READ
= 2,
476 IB_UVERBS_WC_COMP_SWAP
= 3,
477 IB_UVERBS_WC_FETCH_ADD
= 4,
478 IB_UVERBS_WC_BIND_MW
= 5,
479 IB_UVERBS_WC_LOCAL_INV
= 6,
480 IB_UVERBS_WC_TSO
= 7,
481 IB_UVERBS_WC_FLUSH
= 8,
482 IB_UVERBS_WC_ATOMIC_WRITE
= 9,
485 struct ib_uverbs_wc
{
493 __u32 invalidate_rkey
;
506 struct ib_uverbs_poll_cq_resp
{
509 struct ib_uverbs_wc wc
[];
512 struct ib_uverbs_req_notify_cq
{
514 __u32 solicited_only
;
517 struct ib_uverbs_destroy_cq
{
518 __aligned_u64 response
;
523 struct ib_uverbs_destroy_cq_resp
{
524 __u32 comp_events_reported
;
525 __u32 async_events_reported
;
528 struct ib_uverbs_global_route
{
537 struct ib_uverbs_ah_attr
{
538 struct ib_uverbs_global_route grh
;
548 struct ib_uverbs_qp_attr
{
553 __u32 path_mig_state
;
558 __u32 qp_access_flags
;
560 struct ib_uverbs_ah_attr ah_attr
;
561 struct ib_uverbs_ah_attr alt_ah_attr
;
568 __u32 max_inline_data
;
571 __u16 alt_pkey_index
;
572 __u8 en_sqd_async_notify
;
575 __u8 max_dest_rd_atomic
;
586 struct ib_uverbs_create_qp
{
587 __aligned_u64 response
;
588 __aligned_u64 user_handle
;
590 __u32 send_cq_handle
;
591 __u32 recv_cq_handle
;
597 __u32 max_inline_data
;
602 __aligned_u64 driver_data
[];
605 enum ib_uverbs_create_qp_mask
{
606 IB_UVERBS_CREATE_QP_MASK_IND_TABLE
= 1UL << 0,
610 IB_UVERBS_CREATE_QP_SUP_COMP_MASK
= IB_UVERBS_CREATE_QP_MASK_IND_TABLE
,
613 struct ib_uverbs_ex_create_qp
{
614 __aligned_u64 user_handle
;
616 __u32 send_cq_handle
;
617 __u32 recv_cq_handle
;
623 __u32 max_inline_data
;
630 __u32 rwq_ind_tbl_handle
;
634 struct ib_uverbs_open_qp
{
635 __aligned_u64 response
;
636 __aligned_u64 user_handle
;
641 __aligned_u64 driver_data
[];
644 /* also used for open response */
645 struct ib_uverbs_create_qp_resp
{
652 __u32 max_inline_data
;
654 __u32 driver_data
[0];
657 struct ib_uverbs_ex_create_qp_resp
{
658 struct ib_uverbs_create_qp_resp base
;
660 __u32 response_length
;
664 * This struct needs to remain a multiple of 8 bytes to keep the
665 * alignment of the modify QP parameters.
667 struct ib_uverbs_qp_dest
{
682 struct ib_uverbs_query_qp
{
683 __aligned_u64 response
;
686 __aligned_u64 driver_data
[];
689 struct ib_uverbs_query_qp_resp
{
690 struct ib_uverbs_qp_dest dest
;
691 struct ib_uverbs_qp_dest alt_dest
;
696 __u32 max_inline_data
;
701 __u32 qp_access_flags
;
703 __u16 alt_pkey_index
;
710 __u8 max_dest_rd_atomic
;
720 __aligned_u64 driver_data
[];
723 struct ib_uverbs_modify_qp
{
724 struct ib_uverbs_qp_dest dest
;
725 struct ib_uverbs_qp_dest alt_dest
;
732 __u32 qp_access_flags
;
734 __u16 alt_pkey_index
;
739 __u8 en_sqd_async_notify
;
741 __u8 max_dest_rd_atomic
;
750 __aligned_u64 driver_data
[0];
753 struct ib_uverbs_ex_modify_qp
{
754 struct ib_uverbs_modify_qp base
;
759 struct ib_uverbs_ex_modify_qp_resp
{
761 __u32 response_length
;
764 struct ib_uverbs_destroy_qp
{
765 __aligned_u64 response
;
770 struct ib_uverbs_destroy_qp_resp
{
771 __u32 events_reported
;
775 * The ib_uverbs_sge structure isn't used anywhere, since we assume
776 * the ib_sge structure is packed the same way on 32-bit and 64-bit
777 * architectures in both kernel and user space. It's just here to
780 struct ib_uverbs_sge
{
786 enum ib_uverbs_wr_opcode
{
787 IB_UVERBS_WR_RDMA_WRITE
= 0,
788 IB_UVERBS_WR_RDMA_WRITE_WITH_IMM
= 1,
789 IB_UVERBS_WR_SEND
= 2,
790 IB_UVERBS_WR_SEND_WITH_IMM
= 3,
791 IB_UVERBS_WR_RDMA_READ
= 4,
792 IB_UVERBS_WR_ATOMIC_CMP_AND_SWP
= 5,
793 IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD
= 6,
794 IB_UVERBS_WR_LOCAL_INV
= 7,
795 IB_UVERBS_WR_BIND_MW
= 8,
796 IB_UVERBS_WR_SEND_WITH_INV
= 9,
797 IB_UVERBS_WR_TSO
= 10,
798 IB_UVERBS_WR_RDMA_READ_WITH_INV
= 11,
799 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP
= 12,
800 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD
= 13,
801 IB_UVERBS_WR_FLUSH
= 14,
802 IB_UVERBS_WR_ATOMIC_WRITE
= 15,
803 /* Review enum ib_wr_opcode before modifying this */
806 struct ib_uverbs_send_wr
{
809 __u32 opcode
; /* see enum ib_uverbs_wr_opcode */
813 __u32 invalidate_rkey
;
817 __aligned_u64 remote_addr
;
822 __aligned_u64 remote_addr
;
823 __aligned_u64 compare_add
;
837 struct ib_uverbs_post_send
{
838 __aligned_u64 response
;
843 struct ib_uverbs_send_wr send_wr
[];
846 struct ib_uverbs_post_send_resp
{
850 struct ib_uverbs_recv_wr
{
856 struct ib_uverbs_post_recv
{
857 __aligned_u64 response
;
862 struct ib_uverbs_recv_wr recv_wr
[];
865 struct ib_uverbs_post_recv_resp
{
869 struct ib_uverbs_post_srq_recv
{
870 __aligned_u64 response
;
875 struct ib_uverbs_recv_wr recv
[];
878 struct ib_uverbs_post_srq_recv_resp
{
882 struct ib_uverbs_create_ah
{
883 __aligned_u64 response
;
884 __aligned_u64 user_handle
;
887 struct ib_uverbs_ah_attr attr
;
888 __aligned_u64 driver_data
[];
891 struct ib_uverbs_create_ah_resp
{
896 struct ib_uverbs_destroy_ah
{
900 struct ib_uverbs_attach_mcast
{
905 __aligned_u64 driver_data
[];
908 struct ib_uverbs_detach_mcast
{
913 __aligned_u64 driver_data
[];
916 struct ib_uverbs_flow_spec_hdr
{
920 /* followed by flow_spec */
921 __aligned_u64 flow_spec_data
[0];
924 struct ib_uverbs_flow_eth_filter
{
931 struct ib_uverbs_flow_spec_eth
{
933 struct ib_uverbs_flow_spec_hdr hdr
;
940 struct ib_uverbs_flow_eth_filter val
;
941 struct ib_uverbs_flow_eth_filter mask
;
944 struct ib_uverbs_flow_ipv4_filter
{
953 struct ib_uverbs_flow_spec_ipv4
{
955 struct ib_uverbs_flow_spec_hdr hdr
;
962 struct ib_uverbs_flow_ipv4_filter val
;
963 struct ib_uverbs_flow_ipv4_filter mask
;
966 struct ib_uverbs_flow_tcp_udp_filter
{
971 struct ib_uverbs_flow_spec_tcp_udp
{
973 struct ib_uverbs_flow_spec_hdr hdr
;
980 struct ib_uverbs_flow_tcp_udp_filter val
;
981 struct ib_uverbs_flow_tcp_udp_filter mask
;
984 struct ib_uverbs_flow_ipv6_filter
{
994 struct ib_uverbs_flow_spec_ipv6
{
996 struct ib_uverbs_flow_spec_hdr hdr
;
1003 struct ib_uverbs_flow_ipv6_filter val
;
1004 struct ib_uverbs_flow_ipv6_filter mask
;
1007 struct ib_uverbs_flow_spec_action_tag
{
1009 struct ib_uverbs_flow_spec_hdr hdr
;
1020 struct ib_uverbs_flow_spec_action_drop
{
1022 struct ib_uverbs_flow_spec_hdr hdr
;
1031 struct ib_uverbs_flow_spec_action_handle
{
1033 struct ib_uverbs_flow_spec_hdr hdr
;
1044 struct ib_uverbs_flow_spec_action_count
{
1046 struct ib_uverbs_flow_spec_hdr hdr
;
1057 struct ib_uverbs_flow_tunnel_filter
{
1061 struct ib_uverbs_flow_spec_tunnel
{
1063 struct ib_uverbs_flow_spec_hdr hdr
;
1070 struct ib_uverbs_flow_tunnel_filter val
;
1071 struct ib_uverbs_flow_tunnel_filter mask
;
1074 struct ib_uverbs_flow_spec_esp_filter
{
1079 struct ib_uverbs_flow_spec_esp
{
1081 struct ib_uverbs_flow_spec_hdr hdr
;
1088 struct ib_uverbs_flow_spec_esp_filter val
;
1089 struct ib_uverbs_flow_spec_esp_filter mask
;
1092 struct ib_uverbs_flow_gre_filter
{
1093 /* c_ks_res0_ver field is bits 0-15 in offset 0 of a standard GRE header:
1094 * bit 0 - C - checksum bit.
1095 * bit 1 - reserved. set to 0.
1097 * bit 3 - sequence number bit.
1098 * bits 4:12 - reserved. set to 0.
1099 * bits 13:15 - GRE version.
1101 __be16 c_ks_res0_ver
;
1106 struct ib_uverbs_flow_spec_gre
{
1108 struct ib_uverbs_flow_spec_hdr hdr
;
1115 struct ib_uverbs_flow_gre_filter val
;
1116 struct ib_uverbs_flow_gre_filter mask
;
1119 struct ib_uverbs_flow_mpls_filter
{
1120 /* The field includes the entire MPLS label:
1121 * bits 0:19 - label field.
1122 * bits 20:22 - traffic class field.
1123 * bits 23 - bottom of stack bit.
1124 * bits 24:31 - ttl field.
1129 struct ib_uverbs_flow_spec_mpls
{
1131 struct ib_uverbs_flow_spec_hdr hdr
;
1138 struct ib_uverbs_flow_mpls_filter val
;
1139 struct ib_uverbs_flow_mpls_filter mask
;
1142 struct ib_uverbs_flow_attr
{
1150 /* Following are the optional layers according to user request
1151 * struct ib_flow_spec_xxx
1152 * struct ib_flow_spec_yyy
1154 struct ib_uverbs_flow_spec_hdr flow_specs
[];
1157 struct ib_uverbs_create_flow
{
1160 struct ib_uverbs_flow_attr flow_attr
;
1163 struct ib_uverbs_create_flow_resp
{
1168 struct ib_uverbs_destroy_flow
{
1173 struct ib_uverbs_create_srq
{
1174 __aligned_u64 response
;
1175 __aligned_u64 user_handle
;
1180 __aligned_u64 driver_data
[];
1183 struct ib_uverbs_create_xsrq
{
1184 __aligned_u64 response
;
1185 __aligned_u64 user_handle
;
1194 __aligned_u64 driver_data
[];
1197 struct ib_uverbs_create_srq_resp
{
1202 __u32 driver_data
[];
1205 struct ib_uverbs_modify_srq
{
1210 __aligned_u64 driver_data
[];
1213 struct ib_uverbs_query_srq
{
1214 __aligned_u64 response
;
1217 __aligned_u64 driver_data
[];
1220 struct ib_uverbs_query_srq_resp
{
1227 struct ib_uverbs_destroy_srq
{
1228 __aligned_u64 response
;
1233 struct ib_uverbs_destroy_srq_resp
{
1234 __u32 events_reported
;
1237 struct ib_uverbs_ex_create_wq
{
1240 __aligned_u64 user_handle
;
1245 __u32 create_flags
; /* Use enum ib_wq_flags */
1249 struct ib_uverbs_ex_create_wq_resp
{
1251 __u32 response_length
;
1258 struct ib_uverbs_ex_destroy_wq
{
1263 struct ib_uverbs_ex_destroy_wq_resp
{
1265 __u32 response_length
;
1266 __u32 events_reported
;
1270 struct ib_uverbs_ex_modify_wq
{
1274 __u32 curr_wq_state
;
1275 __u32 flags
; /* Use enum ib_wq_flags */
1276 __u32 flags_mask
; /* Use enum ib_wq_flags */
1279 /* Prevent memory allocation rather than max expected size */
1280 #define IB_USER_VERBS_MAX_LOG_IND_TBL_SIZE 0x0d
1281 struct ib_uverbs_ex_create_rwq_ind_table
{
1283 __u32 log_ind_tbl_size
;
1284 /* Following are the wq handles according to log_ind_tbl_size
1291 struct ib_uverbs_ex_create_rwq_ind_table_resp
{
1293 __u32 response_length
;
1294 __u32 ind_tbl_handle
;
1298 struct ib_uverbs_ex_destroy_rwq_ind_table
{
1300 __u32 ind_tbl_handle
;
1303 struct ib_uverbs_cq_moderation
{
1308 struct ib_uverbs_ex_modify_cq
{
1311 struct ib_uverbs_cq_moderation attr
;
1315 #define IB_DEVICE_NAME_MAX 64
1318 * bits 9, 15, 16, 19, 22, 27, 30, 31, 32, 33, 35 and 37 may be set by old
1319 * kernels and should not be used.
1321 enum ib_uverbs_device_cap_flags
{
1322 IB_UVERBS_DEVICE_RESIZE_MAX_WR
= 1 << 0,
1323 IB_UVERBS_DEVICE_BAD_PKEY_CNTR
= 1 << 1,
1324 IB_UVERBS_DEVICE_BAD_QKEY_CNTR
= 1 << 2,
1325 IB_UVERBS_DEVICE_RAW_MULTI
= 1 << 3,
1326 IB_UVERBS_DEVICE_AUTO_PATH_MIG
= 1 << 4,
1327 IB_UVERBS_DEVICE_CHANGE_PHY_PORT
= 1 << 5,
1328 IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE
= 1 << 6,
1329 IB_UVERBS_DEVICE_CURR_QP_STATE_MOD
= 1 << 7,
1330 IB_UVERBS_DEVICE_SHUTDOWN_PORT
= 1 << 8,
1331 /* IB_UVERBS_DEVICE_INIT_TYPE = 1 << 9, (not in use) */
1332 IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT
= 1 << 10,
1333 IB_UVERBS_DEVICE_SYS_IMAGE_GUID
= 1 << 11,
1334 IB_UVERBS_DEVICE_RC_RNR_NAK_GEN
= 1 << 12,
1335 IB_UVERBS_DEVICE_SRQ_RESIZE
= 1 << 13,
1336 IB_UVERBS_DEVICE_N_NOTIFY_CQ
= 1 << 14,
1337 IB_UVERBS_DEVICE_MEM_WINDOW
= 1 << 17,
1338 IB_UVERBS_DEVICE_UD_IP_CSUM
= 1 << 18,
1339 IB_UVERBS_DEVICE_XRC
= 1 << 20,
1340 IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS
= 1 << 21,
1341 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A
= 1 << 23,
1342 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B
= 1 << 24,
1343 IB_UVERBS_DEVICE_RC_IP_CSUM
= 1 << 25,
1344 /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_IP_CSUM. */
1345 IB_UVERBS_DEVICE_RAW_IP_CSUM
= 1 << 26,
1346 IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING
= 1 << 29,
1347 /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */
1348 IB_UVERBS_DEVICE_RAW_SCATTER_FCS
= 1ULL << 34,
1349 IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING
= 1ULL << 36,
1350 /* Flush placement types */
1351 IB_UVERBS_DEVICE_FLUSH_GLOBAL
= 1ULL << 38,
1352 IB_UVERBS_DEVICE_FLUSH_PERSISTENT
= 1ULL << 39,
1353 /* Atomic write attributes */
1354 IB_UVERBS_DEVICE_ATOMIC_WRITE
= 1ULL << 40,
1357 enum ib_uverbs_raw_packet_caps
{
1358 IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING
= 1 << 0,
1359 IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS
= 1 << 1,
1360 IB_UVERBS_RAW_PACKET_CAP_IP_CSUM
= 1 << 2,
1361 IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP
= 1 << 3,
1364 #endif /* IB_USER_VERBS_H */