1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef MLX5_USER_IOCTL_CMDS_H
8 #define MLX5_USER_IOCTL_CMDS_H
9 #include <linux/types.h>
10 #include <rdma/ib_user_ioctl_cmds.h>
11 enum mlx5_ib_create_flow_action_attrs {
12   MLX5_IB_ATTR_CREATE_FLOW_ACTION_FLAGS = (1U << UVERBS_ID_NS_SHIFT),
13 };
14 enum mlx5_ib_dm_methods {
15   MLX5_IB_METHOD_DM_MAP_OP_ADDR = (1U << UVERBS_ID_NS_SHIFT),
16   MLX5_IB_METHOD_DM_QUERY,
17 };
18 enum mlx5_ib_dm_map_op_addr_attrs {
19   MLX5_IB_ATTR_DM_MAP_OP_ADDR_REQ_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
20   MLX5_IB_ATTR_DM_MAP_OP_ADDR_REQ_OP,
21   MLX5_IB_ATTR_DM_MAP_OP_ADDR_RESP_START_OFFSET,
22   MLX5_IB_ATTR_DM_MAP_OP_ADDR_RESP_PAGE_INDEX,
23 };
24 enum mlx5_ib_query_dm_attrs {
25   MLX5_IB_ATTR_QUERY_DM_REQ_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
26   MLX5_IB_ATTR_QUERY_DM_RESP_START_OFFSET,
27   MLX5_IB_ATTR_QUERY_DM_RESP_PAGE_INDEX,
28   MLX5_IB_ATTR_QUERY_DM_RESP_LENGTH,
29 };
30 enum mlx5_ib_alloc_dm_attrs {
31   MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET = (1U << UVERBS_ID_NS_SHIFT),
32   MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,
33   MLX5_IB_ATTR_ALLOC_DM_REQ_TYPE,
34 };
35 enum mlx5_ib_devx_methods {
36   MLX5_IB_METHOD_DEVX_OTHER = (1U << UVERBS_ID_NS_SHIFT),
37   MLX5_IB_METHOD_DEVX_QUERY_UAR,
38   MLX5_IB_METHOD_DEVX_QUERY_EQN,
39   MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT,
40 };
41 enum mlx5_ib_devx_other_attrs {
42   MLX5_IB_ATTR_DEVX_OTHER_CMD_IN = (1U << UVERBS_ID_NS_SHIFT),
43   MLX5_IB_ATTR_DEVX_OTHER_CMD_OUT,
44 };
45 enum mlx5_ib_devx_obj_create_attrs {
46   MLX5_IB_ATTR_DEVX_OBJ_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
47   MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_IN,
48   MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_OUT,
49 };
50 enum mlx5_ib_devx_query_uar_attrs {
51   MLX5_IB_ATTR_DEVX_QUERY_UAR_USER_IDX = (1U << UVERBS_ID_NS_SHIFT),
52   MLX5_IB_ATTR_DEVX_QUERY_UAR_DEV_IDX,
53 };
54 enum mlx5_ib_devx_obj_destroy_attrs {
55   MLX5_IB_ATTR_DEVX_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
56 };
57 enum mlx5_ib_devx_obj_modify_attrs {
58   MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
59   MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
60   MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_OUT,
61 };
62 enum mlx5_ib_devx_obj_query_attrs {
63   MLX5_IB_ATTR_DEVX_OBJ_QUERY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
64   MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_IN,
65   MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_OUT,
66 };
67 enum mlx5_ib_devx_obj_query_async_attrs {
68   MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
69   MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_CMD_IN,
70   MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_FD,
71   MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_WR_ID,
72   MLX5_IB_ATTR_DEVX_OBJ_QUERY_ASYNC_OUT_LEN,
73 };
74 enum mlx5_ib_devx_subscribe_event_attrs {
75   MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_FD_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
76   MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_OBJ_HANDLE,
77   MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_TYPE_NUM_LIST,
78   MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_FD_NUM,
79   MLX5_IB_ATTR_DEVX_SUBSCRIBE_EVENT_COOKIE,
80 };
81 enum mlx5_ib_devx_query_eqn_attrs {
82   MLX5_IB_ATTR_DEVX_QUERY_EQN_USER_VEC = (1U << UVERBS_ID_NS_SHIFT),
83   MLX5_IB_ATTR_DEVX_QUERY_EQN_DEV_EQN,
84 };
85 enum mlx5_ib_devx_obj_methods {
86   MLX5_IB_METHOD_DEVX_OBJ_CREATE = (1U << UVERBS_ID_NS_SHIFT),
87   MLX5_IB_METHOD_DEVX_OBJ_DESTROY,
88   MLX5_IB_METHOD_DEVX_OBJ_MODIFY,
89   MLX5_IB_METHOD_DEVX_OBJ_QUERY,
90   MLX5_IB_METHOD_DEVX_OBJ_ASYNC_QUERY,
91 };
92 enum mlx5_ib_var_alloc_attrs {
93   MLX5_IB_ATTR_VAR_OBJ_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
94   MLX5_IB_ATTR_VAR_OBJ_ALLOC_MMAP_OFFSET,
95   MLX5_IB_ATTR_VAR_OBJ_ALLOC_MMAP_LENGTH,
96   MLX5_IB_ATTR_VAR_OBJ_ALLOC_PAGE_ID,
97 };
98 enum mlx5_ib_var_obj_destroy_attrs {
99   MLX5_IB_ATTR_VAR_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
100 };
101 enum mlx5_ib_var_obj_methods {
102   MLX5_IB_METHOD_VAR_OBJ_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
103   MLX5_IB_METHOD_VAR_OBJ_DESTROY,
104 };
105 enum mlx5_ib_uar_alloc_attrs {
106   MLX5_IB_ATTR_UAR_OBJ_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
107   MLX5_IB_ATTR_UAR_OBJ_ALLOC_TYPE,
108   MLX5_IB_ATTR_UAR_OBJ_ALLOC_MMAP_OFFSET,
109   MLX5_IB_ATTR_UAR_OBJ_ALLOC_MMAP_LENGTH,
110   MLX5_IB_ATTR_UAR_OBJ_ALLOC_PAGE_ID,
111 };
112 enum mlx5_ib_uar_obj_destroy_attrs {
113   MLX5_IB_ATTR_UAR_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
114 };
115 enum mlx5_ib_uar_obj_methods {
116   MLX5_IB_METHOD_UAR_OBJ_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
117   MLX5_IB_METHOD_UAR_OBJ_DESTROY,
118 };
119 enum mlx5_ib_devx_umem_reg_attrs {
120   MLX5_IB_ATTR_DEVX_UMEM_REG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
121   MLX5_IB_ATTR_DEVX_UMEM_REG_ADDR,
122   MLX5_IB_ATTR_DEVX_UMEM_REG_LEN,
123   MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
124   MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,
125   MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP,
126   MLX5_IB_ATTR_DEVX_UMEM_REG_DMABUF_FD,
127 };
128 enum mlx5_ib_devx_umem_dereg_attrs {
129   MLX5_IB_ATTR_DEVX_UMEM_DEREG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
130 };
131 enum mlx5_ib_pp_obj_methods {
132   MLX5_IB_METHOD_PP_OBJ_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
133   MLX5_IB_METHOD_PP_OBJ_DESTROY,
134 };
135 enum mlx5_ib_pp_alloc_attrs {
136   MLX5_IB_ATTR_PP_OBJ_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
137   MLX5_IB_ATTR_PP_OBJ_ALLOC_CTX,
138   MLX5_IB_ATTR_PP_OBJ_ALLOC_FLAGS,
139   MLX5_IB_ATTR_PP_OBJ_ALLOC_INDEX,
140 };
141 enum mlx5_ib_pp_obj_destroy_attrs {
142   MLX5_IB_ATTR_PP_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
143 };
144 enum mlx5_ib_devx_umem_methods {
145   MLX5_IB_METHOD_DEVX_UMEM_REG = (1U << UVERBS_ID_NS_SHIFT),
146   MLX5_IB_METHOD_DEVX_UMEM_DEREG,
147 };
148 enum mlx5_ib_devx_async_cmd_fd_alloc_attrs {
149   MLX5_IB_ATTR_DEVX_ASYNC_CMD_FD_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
150 };
151 enum mlx5_ib_devx_async_event_fd_alloc_attrs {
152   MLX5_IB_ATTR_DEVX_ASYNC_EVENT_FD_ALLOC_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
153   MLX5_IB_ATTR_DEVX_ASYNC_EVENT_FD_ALLOC_FLAGS,
154 };
155 enum mlx5_ib_devx_async_cmd_fd_methods {
156   MLX5_IB_METHOD_DEVX_ASYNC_CMD_FD_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
157 };
158 enum mlx5_ib_devx_async_event_fd_methods {
159   MLX5_IB_METHOD_DEVX_ASYNC_EVENT_FD_ALLOC = (1U << UVERBS_ID_NS_SHIFT),
160 };
161 enum mlx5_ib_objects {
162   MLX5_IB_OBJECT_DEVX = (1U << UVERBS_ID_NS_SHIFT),
163   MLX5_IB_OBJECT_DEVX_OBJ,
164   MLX5_IB_OBJECT_DEVX_UMEM,
165   MLX5_IB_OBJECT_FLOW_MATCHER,
166   MLX5_IB_OBJECT_DEVX_ASYNC_CMD_FD,
167   MLX5_IB_OBJECT_DEVX_ASYNC_EVENT_FD,
168   MLX5_IB_OBJECT_VAR,
169   MLX5_IB_OBJECT_PP,
170   MLX5_IB_OBJECT_UAR,
171   MLX5_IB_OBJECT_STEERING_ANCHOR,
172 };
173 enum mlx5_ib_flow_matcher_create_attrs {
174   MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
175   MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK,
176   MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
177   MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
178   MLX5_IB_ATTR_FLOW_MATCHER_FLOW_FLAGS,
179   MLX5_IB_ATTR_FLOW_MATCHER_FT_TYPE,
180 };
181 enum mlx5_ib_flow_matcher_destroy_attrs {
182   MLX5_IB_ATTR_FLOW_MATCHER_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
183 };
184 enum mlx5_ib_flow_matcher_methods {
185   MLX5_IB_METHOD_FLOW_MATCHER_CREATE = (1U << UVERBS_ID_NS_SHIFT),
186   MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
187 };
188 enum mlx5_ib_flow_steering_anchor_create_attrs {
189   MLX5_IB_ATTR_STEERING_ANCHOR_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
190   MLX5_IB_ATTR_STEERING_ANCHOR_FT_TYPE,
191   MLX5_IB_ATTR_STEERING_ANCHOR_PRIORITY,
192   MLX5_IB_ATTR_STEERING_ANCHOR_FT_ID,
193 };
194 enum mlx5_ib_flow_steering_anchor_destroy_attrs {
195   MLX5_IB_ATTR_STEERING_ANCHOR_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
196 };
197 enum mlx5_ib_steering_anchor_methods {
198   MLX5_IB_METHOD_STEERING_ANCHOR_CREATE = (1U << UVERBS_ID_NS_SHIFT),
199   MLX5_IB_METHOD_STEERING_ANCHOR_DESTROY,
200 };
201 enum mlx5_ib_device_query_context_attrs {
202   MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),
203 };
204 #define MLX5_IB_DW_MATCH_PARAM 0xA0
205 struct mlx5_ib_match_params {
206   __u32 match_params[MLX5_IB_DW_MATCH_PARAM];
207 };
208 enum mlx5_ib_flow_type {
209   MLX5_IB_FLOW_TYPE_NORMAL,
210   MLX5_IB_FLOW_TYPE_SNIFFER,
211   MLX5_IB_FLOW_TYPE_ALL_DEFAULT,
212   MLX5_IB_FLOW_TYPE_MC_DEFAULT,
213 };
214 enum mlx5_ib_create_flow_flags {
215   MLX5_IB_ATTR_CREATE_FLOW_FLAGS_DEFAULT_MISS = 1 << 0,
216   MLX5_IB_ATTR_CREATE_FLOW_FLAGS_DROP = 1 << 1,
217 };
218 enum mlx5_ib_create_flow_attrs {
219   MLX5_IB_ATTR_CREATE_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
220   MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE,
221   MLX5_IB_ATTR_CREATE_FLOW_DEST_QP,
222   MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX,
223   MLX5_IB_ATTR_CREATE_FLOW_MATCHER,
224   MLX5_IB_ATTR_CREATE_FLOW_ARR_FLOW_ACTIONS,
225   MLX5_IB_ATTR_CREATE_FLOW_TAG,
226   MLX5_IB_ATTR_CREATE_FLOW_ARR_COUNTERS_DEVX,
227   MLX5_IB_ATTR_CREATE_FLOW_ARR_COUNTERS_DEVX_OFFSET,
228   MLX5_IB_ATTR_CREATE_FLOW_FLAGS,
229 };
230 enum mlx5_ib_destroy_flow_attrs {
231   MLX5_IB_ATTR_DESTROY_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
232 };
233 enum mlx5_ib_flow_methods {
234   MLX5_IB_METHOD_CREATE_FLOW = (1U << UVERBS_ID_NS_SHIFT),
235   MLX5_IB_METHOD_DESTROY_FLOW,
236 };
237 enum mlx5_ib_flow_action_methods {
238   MLX5_IB_METHOD_FLOW_ACTION_CREATE_MODIFY_HEADER = (1U << UVERBS_ID_NS_SHIFT),
239   MLX5_IB_METHOD_FLOW_ACTION_CREATE_PACKET_REFORMAT,
240 };
241 enum mlx5_ib_create_flow_action_create_modify_header_attrs {
242   MLX5_IB_ATTR_CREATE_MODIFY_HEADER_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
243   MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM,
244   MLX5_IB_ATTR_CREATE_MODIFY_HEADER_FT_TYPE,
245 };
246 enum mlx5_ib_create_flow_action_create_packet_reformat_attrs {
247   MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
248   MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_TYPE,
249   MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_FT_TYPE,
250   MLX5_IB_ATTR_CREATE_PACKET_REFORMAT_DATA_BUF,
251 };
252 enum mlx5_ib_query_pd_attrs {
253   MLX5_IB_ATTR_QUERY_PD_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
254   MLX5_IB_ATTR_QUERY_PD_RESP_PDN,
255 };
256 enum mlx5_ib_pd_methods {
257   MLX5_IB_METHOD_PD_QUERY = (1U << UVERBS_ID_NS_SHIFT),
258 };
259 enum mlx5_ib_device_methods {
260   MLX5_IB_METHOD_QUERY_PORT = (1U << UVERBS_ID_NS_SHIFT),
261 };
262 enum mlx5_ib_query_port_attrs {
263   MLX5_IB_ATTR_QUERY_PORT_PORT_NUM = (1U << UVERBS_ID_NS_SHIFT),
264   MLX5_IB_ATTR_QUERY_PORT,
265 };
266 #endif
267