Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright 2016 6WIND S.A.
3 : : * Copyright 2016 Mellanox Technologies, Ltd
4 : : */
5 : :
6 : : #ifndef RTE_PMD_MLX5_PRM_H_
7 : : #define RTE_PMD_MLX5_PRM_H_
8 : :
9 : : #include <unistd.h>
10 : :
11 : : #include <rte_vect.h>
12 : : #include <rte_byteorder.h>
13 : :
14 : : #include <mlx5_glue.h>
15 : : #include "mlx5_autoconf.h"
16 : :
17 : : /* RSS hash key size. */
18 : : #define MLX5_RSS_HASH_KEY_LEN 40
19 : :
20 : : /* Get CQE owner bit. */
21 : : #define MLX5_CQE_OWNER(op_own) ((op_own) & MLX5_CQE_OWNER_MASK)
22 : :
23 : : /* Get CQE format. */
24 : : #define MLX5_CQE_FORMAT(op_own) (((op_own) & MLX5E_CQE_FORMAT_MASK) >> 2)
25 : :
26 : : /* Get CQE opcode. */
27 : : #define MLX5_CQE_OPCODE(op_own) (((op_own) & 0xf0) >> 4)
28 : :
29 : : /* Get CQE number of mini CQEs. */
30 : : #define MLX5_CQE_NUM_MINIS(op_own) (((op_own) & 0xf0) >> 4)
31 : :
32 : : /* Get CQE solicited event. */
33 : : #define MLX5_CQE_SE(op_own) (((op_own) >> 1) & 1)
34 : :
35 : : /* Invalidate a CQE. */
36 : : #define MLX5_CQE_INVALIDATE (MLX5_CQE_INVALID << 4)
37 : :
38 : : /* Initialize CQE validity iteration count. */
39 : : #define MLX5_CQE_VIC_INIT 0xffu
40 : :
41 : : /* Hardware index widths. */
42 : : #define MLX5_CQ_INDEX_WIDTH 24
43 : : #define MLX5_WQ_INDEX_WIDTH 16
44 : :
45 : : /* WQE Segment sizes in bytes. */
46 : : #define MLX5_WSEG_SIZE 16u
47 : : #define MLX5_WQE_CSEG_SIZE sizeof(struct mlx5_wqe_cseg)
48 : : #define MLX5_WQE_DSEG_SIZE sizeof(struct mlx5_wqe_dseg)
49 : : #define MLX5_WQE_ESEG_SIZE sizeof(struct mlx5_wqe_eseg)
50 : :
51 : : /* WQE/WQEBB size in bytes. */
52 : : #define MLX5_WQE_SIZE sizeof(struct mlx5_wqe)
53 : :
54 : : /*
55 : : * Max size of a WQE session.
56 : : * Absolute maximum size is 63 (MLX5_DSEG_MAX) segments,
57 : : * the WQE size field in Control Segment is 6 bits wide.
58 : : */
59 : : #define MLX5_WQE_SIZE_MAX (60 * MLX5_WSEG_SIZE)
60 : :
61 : : /*
62 : : * Default minimum number of Tx queues for inlining packets.
63 : : * If there are less queues as specified we assume we have
64 : : * no enough CPU resources (cycles) to perform inlining,
65 : : * the PCIe throughput is not supposed as bottleneck and
66 : : * inlining is disabled.
67 : : */
68 : : #define MLX5_INLINE_MAX_TXQS 8u
69 : : #define MLX5_INLINE_MAX_TXQS_BLUEFIELD 16u
70 : :
71 : : /*
72 : : * Default packet length threshold to be inlined with
73 : : * enhanced MPW. If packet length exceeds the threshold
74 : : * the data are not inlined. Should be aligned in WQEBB
75 : : * boundary with accounting the title Control and Ethernet
76 : : * segments.
77 : : */
78 : : #define MLX5_EMPW_DEF_INLINE_LEN (4u * MLX5_WQE_SIZE + \
79 : : MLX5_DSEG_MIN_INLINE_SIZE)
80 : : /*
81 : : * Maximal inline data length sent with enhanced MPW.
82 : : * Is based on maximal WQE size.
83 : : */
84 : : #define MLX5_EMPW_MAX_INLINE_LEN (MLX5_WQE_SIZE_MAX - \
85 : : MLX5_WQE_CSEG_SIZE - \
86 : : MLX5_WQE_ESEG_SIZE - \
87 : : MLX5_WQE_DSEG_SIZE + \
88 : : MLX5_DSEG_MIN_INLINE_SIZE)
89 : : /*
90 : : * Minimal amount of packets to be sent with EMPW.
91 : : * This limits the minimal required size of sent EMPW.
92 : : * If there are no enough resources to built minimal
93 : : * EMPW the sending loop exits.
94 : : */
95 : : #define MLX5_EMPW_MIN_PACKETS (2u + 3u * 4u)
96 : : /*
97 : : * Maximal amount of packets to be sent with EMPW.
98 : : * This value is not recommended to exceed MLX5_TX_COMP_THRESH,
99 : : * otherwise there might be up to MLX5_EMPW_MAX_PACKETS mbufs
100 : : * without CQE generation request, being multiplied by
101 : : * MLX5_TX_COMP_MAX_CQE it may cause significant latency
102 : : * in tx burst routine at the moment of freeing multiple mbufs.
103 : : */
104 : : #define MLX5_EMPW_MAX_PACKETS MLX5_TX_COMP_THRESH
105 : : #define MLX5_MPW_MAX_PACKETS 6
106 : : #define MLX5_MPW_INLINE_MAX_PACKETS 6
107 : :
108 : : /*
109 : : * Default packet length threshold to be inlined with
110 : : * ordinary SEND. Inlining saves the MR key search
111 : : * and extra PCIe data fetch transaction, but eats the
112 : : * CPU cycles.
113 : : */
114 : : #define MLX5_SEND_DEF_INLINE_LEN (5U * MLX5_WQE_SIZE + \
115 : : MLX5_ESEG_MIN_INLINE_SIZE - \
116 : : MLX5_WQE_CSEG_SIZE - \
117 : : MLX5_WQE_ESEG_SIZE - \
118 : : MLX5_WQE_DSEG_SIZE)
119 : : /*
120 : : * Maximal inline data length sent with ordinary SEND.
121 : : * Is based on maximal WQE size.
122 : : */
123 : : #define MLX5_SEND_MAX_INLINE_LEN (MLX5_WQE_SIZE_MAX - \
124 : : MLX5_WQE_CSEG_SIZE - \
125 : : MLX5_WQE_ESEG_SIZE - \
126 : : MLX5_WQE_DSEG_SIZE + \
127 : : MLX5_ESEG_MIN_INLINE_SIZE)
128 : :
129 : : /* Missed in mlx5dv.h, should define here. */
130 : : #ifndef HAVE_MLX5_OPCODE_ENHANCED_MPSW
131 : : #define MLX5_OPCODE_ENHANCED_MPSW 0x29u
132 : : #endif
133 : :
134 : : #ifndef HAVE_MLX5_OPCODE_SEND_EN
135 : : #define MLX5_OPCODE_SEND_EN 0x17u
136 : : #endif
137 : :
138 : : #ifndef HAVE_MLX5_OPCODE_WAIT
139 : : #define MLX5_OPCODE_WAIT 0x0fu
140 : : #endif
141 : :
142 : : #define MLX5_OPC_MOD_WAIT_CQ_PI 0u
143 : : #define MLX5_OPC_MOD_WAIT_DATA 1u
144 : : #define MLX5_OPC_MOD_WAIT_TIME 2u
145 : :
146 : :
147 : : #define MLX5_WAIT_COND_INVERT 0x10u
148 : : #define MLX5_WAIT_COND_ALWAYS_TRUE 0u
149 : : #define MLX5_WAIT_COND_EQUAL 1u
150 : : #define MLX5_WAIT_COND_BIGGER 2u
151 : : #define MLX5_WAIT_COND_SMALLER 3u
152 : : #define MLX5_WAIT_COND_CYCLIC_BIGGER 4u
153 : : #define MLX5_WAIT_COND_CYCLIC_SMALLER 5u
154 : :
155 : : #ifndef HAVE_MLX5_OPCODE_ACCESS_ASO
156 : : #define MLX5_OPCODE_ACCESS_ASO 0x2du
157 : : #endif
158 : :
159 : : /* CQE value to inform that VLAN is stripped. */
160 : : #define MLX5_CQE_VLAN_STRIPPED (1u << 0)
161 : :
162 : : /* IPv4 options. */
163 : : #define MLX5_CQE_RX_IP_EXT_OPTS_PACKET (1u << 1)
164 : :
165 : : /* IPv6 packet. */
166 : : #define MLX5_CQE_RX_IPV6_PACKET (1u << 2)
167 : :
168 : : /* IPv4 packet. */
169 : : #define MLX5_CQE_RX_IPV4_PACKET (1u << 3)
170 : :
171 : : /* TCP packet. */
172 : : #define MLX5_CQE_RX_TCP_PACKET (1u << 4)
173 : :
174 : : /* UDP packet. */
175 : : #define MLX5_CQE_RX_UDP_PACKET (1u << 5)
176 : :
177 : : /* IP is fragmented. */
178 : : #define MLX5_CQE_RX_IP_FRAG_PACKET (1u << 7)
179 : :
180 : : /* L2 header is valid. */
181 : : #define MLX5_CQE_RX_L2_HDR_VALID (1u << 8)
182 : :
183 : : /* L3 header is valid. */
184 : : #define MLX5_CQE_RX_L3_HDR_VALID (1u << 9)
185 : :
186 : : /* L4 header is valid. */
187 : : #define MLX5_CQE_RX_L4_HDR_VALID (1u << 10)
188 : :
189 : : /* Outer packet, 0 IPv4, 1 IPv6. */
190 : : #define MLX5_CQE_RX_OUTER_PACKET (1u << 1)
191 : :
192 : : /* Tunnel packet bit in the CQE. */
193 : : #define MLX5_CQE_RX_TUNNEL_PACKET (1u << 0)
194 : :
195 : : /* Mask for LRO push flag in the CQE lro_tcppsh_abort_dupack field. */
196 : : #define MLX5_CQE_LRO_PUSH_MASK 0x40
197 : :
198 : : /* Mask for L4 type in the CQE hdr_type_etc field. */
199 : : #define MLX5_CQE_L4_TYPE_MASK 0x70
200 : :
201 : : /* The bit index of L4 type in CQE hdr_type_etc field. */
202 : : #define MLX5_CQE_L4_TYPE_SHIFT 0x4
203 : :
204 : : /* L4 type to indicate TCP packet without acknowledgment. */
205 : : #define MLX5_L4_HDR_TYPE_TCP_EMPTY_ACK 0x3
206 : :
207 : : /* L4 type to indicate TCP packet with acknowledgment. */
208 : : #define MLX5_L4_HDR_TYPE_TCP_WITH_ACL 0x4
209 : :
210 : : /* Inner L3 checksum offload (Tunneled packets only). */
211 : : #define MLX5_ETH_WQE_L3_INNER_CSUM (1u << 4)
212 : :
213 : : /* Inner L4 checksum offload (Tunneled packets only). */
214 : : #define MLX5_ETH_WQE_L4_INNER_CSUM (1u << 5)
215 : :
216 : : /* Outer L4 type is TCP. */
217 : : #define MLX5_ETH_WQE_L4_OUTER_TCP (0u << 5)
218 : :
219 : : /* Outer L4 type is UDP. */
220 : : #define MLX5_ETH_WQE_L4_OUTER_UDP (1u << 5)
221 : :
222 : : /* Outer L3 type is IPV4. */
223 : : #define MLX5_ETH_WQE_L3_OUTER_IPV4 (0u << 4)
224 : :
225 : : /* Outer L3 type is IPV6. */
226 : : #define MLX5_ETH_WQE_L3_OUTER_IPV6 (1u << 4)
227 : :
228 : : /* Inner L4 type is TCP. */
229 : : #define MLX5_ETH_WQE_L4_INNER_TCP (0u << 1)
230 : :
231 : : /* Inner L4 type is UDP. */
232 : : #define MLX5_ETH_WQE_L4_INNER_UDP (1u << 1)
233 : :
234 : : /* Inner L3 type is IPV4. */
235 : : #define MLX5_ETH_WQE_L3_INNER_IPV4 (0u << 0)
236 : :
237 : : /* Inner L3 type is IPV6. */
238 : : #define MLX5_ETH_WQE_L3_INNER_IPV6 (1u << 0)
239 : :
240 : : /* VLAN insertion flag. */
241 : : #define MLX5_ETH_WQE_VLAN_INSERT (1u << 31)
242 : :
243 : : /* Data inline segment flag. */
244 : : #define MLX5_ETH_WQE_DATA_INLINE (1u << 31)
245 : :
246 : : /* Is flow mark valid. */
247 : : #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
248 : : #define MLX5_FLOW_MARK_IS_VALID(val) ((val) & 0xffffff00)
249 : : #else
250 : : #define MLX5_FLOW_MARK_IS_VALID(val) ((val) & 0xffffff)
251 : : #endif
252 : :
253 : : /* INVALID is used by packets matching no flow rules. */
254 : : #define MLX5_FLOW_MARK_INVALID 0
255 : :
256 : : /* Maximum allowed value to mark a packet. */
257 : : #define MLX5_FLOW_MARK_MAX 0xfffff0
258 : :
259 : : /* Default mark value used when none is provided. */
260 : : #define MLX5_FLOW_MARK_DEFAULT 0xffffff
261 : :
262 : : /* Default mark mask for metadata legacy mode. */
263 : : #define MLX5_FLOW_MARK_MASK 0xffffff
264 : :
265 : : /* Byte length mask when mark is enable in miniCQE */
266 : : #define MLX5_LEN_WITH_MARK_MASK 0xffffff00
267 : :
268 : : /* Maximum number of DS in WQE. Limited by 6-bit field. */
269 : : #define MLX5_DSEG_MAX 63
270 : :
271 : : /* The 32 bit syndrome offset in struct mlx5_err_cqe. */
272 : : #define MLX5_ERROR_CQE_SYNDROME_OFFSET 52
273 : :
274 : : /* The completion mode offset in the WQE control segment line 2. */
275 : : #define MLX5_COMP_MODE_OFFSET 2
276 : :
277 : : /* Amount of data bytes in minimal inline data segment. */
278 : : #define MLX5_DSEG_MIN_INLINE_SIZE 12u
279 : :
280 : : /* Amount of data bytes in minimal inline eth segment. */
281 : : #define MLX5_ESEG_MIN_INLINE_SIZE 18u
282 : :
283 : : /* Amount of data bytes after eth data segment. */
284 : : #define MLX5_ESEG_EXTRA_DATA_SIZE 32u
285 : :
286 : : /* The maximum log value of segments per RQ WQE. */
287 : : #define MLX5_MAX_LOG_RQ_SEGS 5u
288 : :
289 : : /* Log 2 of the default size of a WQE for Multi-Packet RQ. */
290 : : #define MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE 14U
291 : :
292 : : /* The alignment needed for WQ buffer. */
293 : : #define MLX5_WQE_BUF_ALIGNMENT rte_mem_page_size()
294 : :
295 : : /* The alignment needed for CQ buffer. */
296 : : #define MLX5_CQE_BUF_ALIGNMENT rte_mem_page_size()
297 : :
298 : : #define MAX_ACTIONS_DATA_IN_HEADER_MODIFY 512
299 : :
300 : : /* Alias FT id passed to the ALLOW_OTHER_VHCA_ACCESS & CREATE_GENERAL_OBJECT
301 : : * commands should have the following format:
302 : : * {table_type: 8bits, table_id: 24bits}.
303 : : */
304 : : #define FT_ID_FT_TYPE_OFFSET 24
305 : :
306 : : /* Completion mode. */
307 : : enum mlx5_completion_mode {
308 : : MLX5_COMP_ONLY_ERR = 0x0,
309 : : MLX5_COMP_ONLY_FIRST_ERR = 0x1,
310 : : MLX5_COMP_ALWAYS = 0x2,
311 : : MLX5_COMP_CQE_AND_EQE = 0x3,
312 : : };
313 : :
314 : : /* MPW mode. */
315 : : enum mlx5_mpw_mode {
316 : : MLX5_MPW_DISABLED,
317 : : MLX5_MPW,
318 : : MLX5_MPW_ENHANCED, /* Enhanced Multi-Packet Send WQE, a.k.a MPWv2. */
319 : : };
320 : :
321 : : /* WQE Control segment. */
322 : : struct mlx5_wqe_cseg {
323 : : uint32_t opcode;
324 : : uint32_t sq_ds;
325 : : uint32_t flags;
326 : : uint32_t misc;
327 : : } __rte_packed __rte_aligned(MLX5_WSEG_SIZE);
328 : :
329 : : /*
330 : : * WQE CSEG opcode field size is 32 bits, divided:
331 : : * Bits 31:24 OPC_MOD
332 : : * Bits 23:8 wqe_index
333 : : * Bits 7:0 OPCODE
334 : : */
335 : : #define WQE_CSEG_OPC_MOD_OFFSET 24
336 : : #define WQE_CSEG_WQE_INDEX_OFFSET 8
337 : :
338 : : /* Header of data segment. Minimal size Data Segment */
339 : : struct mlx5_wqe_dseg {
340 : : uint32_t bcount;
341 : : union {
342 : : uint8_t inline_data[MLX5_DSEG_MIN_INLINE_SIZE];
343 : : struct {
344 : : uint32_t lkey;
345 : : uint64_t pbuf;
346 : : } __rte_packed;
347 : : };
348 : : } __rte_packed;
349 : :
350 : : /* Subset of struct WQE Ethernet Segment. */
351 : : struct mlx5_wqe_eseg {
352 : : union {
353 : : struct {
354 : : uint32_t swp_offs;
355 : : uint8_t cs_flags;
356 : : uint8_t swp_flags;
357 : : uint16_t mss;
358 : : uint32_t metadata;
359 : : uint16_t inline_hdr_sz;
360 : : union {
361 : : uint16_t inline_data;
362 : : uint16_t vlan_tag;
363 : : };
364 : : } __rte_packed;
365 : : struct {
366 : : uint32_t offsets;
367 : : uint32_t flags;
368 : : uint32_t flow_metadata;
369 : : uint32_t inline_hdr;
370 : : } __rte_packed;
371 : : };
372 : : } __rte_packed;
373 : :
374 : : struct mlx5_wqe_qseg {
375 : : uint32_t reserved0;
376 : : uint32_t reserved1;
377 : : uint32_t max_index;
378 : : uint32_t qpn_cqn;
379 : : } __rte_packed;
380 : :
381 : : struct mlx5_wqe_wseg {
382 : : uint32_t operation;
383 : : uint32_t lkey;
384 : : uint32_t va_high;
385 : : uint32_t va_low;
386 : : uint64_t value;
387 : : uint64_t mask;
388 : : } __rte_packed;
389 : :
390 : : /* The title WQEBB, header of WQE. */
391 : : struct mlx5_wqe {
392 : : union {
393 : : struct mlx5_wqe_cseg cseg;
394 : : uint32_t ctrl[4];
395 : : };
396 : : struct mlx5_wqe_eseg eseg;
397 : : union {
398 : : struct mlx5_wqe_dseg dseg[2];
399 : : uint8_t data[MLX5_ESEG_EXTRA_DATA_SIZE];
400 : : };
401 : : } __rte_packed;
402 : :
403 : : /* WQE for Multi-Packet RQ. */
404 : : struct mlx5_wqe_mprq {
405 : : struct mlx5_wqe_srq_next_seg next_seg;
406 : : struct mlx5_wqe_data_seg dseg;
407 : : };
408 : :
409 : : #define MLX5_MPRQ_LEN_MASK 0x000ffff
410 : : #define MLX5_MPRQ_LEN_SHIFT 0
411 : : #define MLX5_MPRQ_STRIDE_NUM_MASK 0x3fff0000
412 : : #define MLX5_MPRQ_STRIDE_NUM_SHIFT 16
413 : : #define MLX5_MPRQ_FILLER_MASK 0x80000000
414 : : #define MLX5_MPRQ_FILLER_SHIFT 31
415 : :
416 : : #define MLX5_MPRQ_STRIDE_SHIFT_BYTE 2
417 : :
418 : : /* CQ element structure - should be equal to the cache line size */
419 : : struct mlx5_cqe {
420 : : #if (RTE_CACHE_LINE_SIZE == 128)
421 : : uint8_t padding[64];
422 : : #endif
423 : : uint8_t pkt_info;
424 : : uint8_t rsvd0;
425 : : uint16_t wqe_id;
426 : : uint8_t lro_tcppsh_abort_dupack;
427 : : uint8_t lro_min_ttl;
428 : : uint16_t lro_tcp_win;
429 : : uint32_t lro_ack_seq_num;
430 : : uint32_t rx_hash_res;
431 : : uint8_t rx_hash_type;
432 : : uint8_t rsvd1[3];
433 : : uint16_t csum;
434 : : uint8_t rsvd2[6];
435 : : uint16_t hdr_type_etc;
436 : : uint16_t vlan_info;
437 : : uint8_t lro_num_seg;
438 : : union {
439 : : uint8_t user_index_bytes[3];
440 : : struct {
441 : : uint8_t user_index_hi;
442 : : uint16_t user_index_low;
443 : : } __rte_packed;
444 : : };
445 : : uint32_t flow_table_metadata;
446 : : uint8_t rsvd4[4];
447 : : uint32_t byte_cnt;
448 : : uint64_t timestamp;
449 : : uint32_t sop_drop_qpn;
450 : : uint16_t wqe_counter;
451 : : uint8_t validity_iteration_count;
452 : : uint8_t op_own;
453 : : };
454 : :
455 : : struct mlx5_cqe_ts {
456 : : uint64_t timestamp;
457 : : uint32_t sop_drop_qpn;
458 : : uint16_t wqe_counter;
459 : : uint8_t validity_iteration_count;
460 : : uint8_t op_own;
461 : : };
462 : :
463 : : struct mlx5_wqe_rseg {
464 : : uint64_t raddr;
465 : : uint32_t rkey;
466 : : uint32_t reserved;
467 : : } __rte_packed;
468 : :
469 : : #define MLX5_UMRC_IF_OFFSET 31u
470 : : #define MLX5_UMRC_KO_OFFSET 16u
471 : : #define MLX5_UMRC_TO_BS_OFFSET 0u
472 : :
473 : : /*
474 : : * As PRM describes, the address of the UMR pointer must be
475 : : * aligned to 2KB.
476 : : */
477 : : #define MLX5_UMR_KLM_PTR_ALIGN (1 << 11)
478 : :
479 : : #define MLX5_UMR_KLM_NUM_ALIGN \
480 : : (MLX5_UMR_KLM_PTR_ALIGN / sizeof(struct mlx5_klm))
481 : :
482 : : struct mlx5_wqe_umr_cseg {
483 : : uint32_t if_cf_toe_cq_res;
484 : : uint32_t ko_to_bs;
485 : : uint64_t mkey_mask;
486 : : uint32_t rsvd1[8];
487 : : } __rte_packed;
488 : :
489 : : struct mlx5_wqe_mkey_cseg {
490 : : uint32_t fr_res_af_sf;
491 : : uint32_t qpn_mkey;
492 : : uint32_t reserved2;
493 : : uint32_t flags_pd;
494 : : uint64_t start_addr;
495 : : uint64_t len;
496 : : uint32_t bsf_octword_size;
497 : : uint32_t reserved3[4];
498 : : uint32_t translations_octword_size;
499 : : uint32_t res4_lps;
500 : : uint32_t reserved;
501 : : } __rte_packed;
502 : :
503 : : enum {
504 : : MLX5_BSF_SIZE_16B = 0x0,
505 : : MLX5_BSF_SIZE_32B = 0x1,
506 : : MLX5_BSF_SIZE_64B = 0x2,
507 : : MLX5_BSF_SIZE_128B = 0x3,
508 : : };
509 : :
510 : : enum {
511 : : MLX5_BSF_P_TYPE_SIGNATURE = 0x0,
512 : : MLX5_BSF_P_TYPE_CRYPTO = 0x1,
513 : : };
514 : :
515 : : enum {
516 : : MLX5_ENCRYPTION_ORDER_ENCRYPTED_WIRE_SIGNATURE = 0x0,
517 : : MLX5_ENCRYPTION_ORDER_ENCRYPTED_MEMORY_SIGNATURE = 0x1,
518 : : MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_WIRE = 0x2,
519 : : MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_MEMORY = 0x3,
520 : : };
521 : :
522 : : enum {
523 : : MLX5_ENCRYPTION_STANDARD_AES_XTS = 0x0,
524 : : };
525 : :
526 : : enum {
527 : : MLX5_BLOCK_SIZE_512B = 0x1,
528 : : MLX5_BLOCK_SIZE_520B = 0x2,
529 : : MLX5_BLOCK_SIZE_4096B = 0x3,
530 : : MLX5_BLOCK_SIZE_4160B = 0x4,
531 : : MLX5_BLOCK_SIZE_1MB = 0x5,
532 : : MLX5_BLOCK_SIZE_4048B = 0x6,
533 : : };
534 : :
535 : : enum {
536 : : MLX5_ENCRYPTION_TYPE_AES_GCM = 0x3,
537 : : };
538 : :
539 : : enum {
540 : : MLX5_CRYPTO_OP_TYPE_ENCRYPTION = 0x0,
541 : : MLX5_CRYPTO_OP_TYPE_DECRYPTION = 0x1,
542 : : };
543 : :
544 : : #define MLX5_BSF_SIZE_OFFSET 30
545 : : #define MLX5_BSF_P_TYPE_OFFSET 24
546 : : #define MLX5_ENCRYPTION_ORDER_OFFSET 16
547 : : #define MLX5_BLOCK_SIZE_OFFSET 24
548 : :
549 : : #define MLX5_CRYPTO_MMO_TYPE_OFFSET 24
550 : : #define MLX5_CRYPTO_MMO_OP_OFFSET 20
551 : :
552 : : struct mlx5_wqe_umr_bsf_seg {
553 : : /*
554 : : * bs_bpt_eo_es contains:
555 : : * bs bsf_size 2 bits at MLX5_BSF_SIZE_OFFSET
556 : : * bpt bsf_p_type 2 bits at MLX5_BSF_P_TYPE_OFFSET
557 : : * eo encryption_order 4 bits at MLX5_ENCRYPTION_ORDER_OFFSET
558 : : * es encryption_standard 4 bits at offset 0
559 : : */
560 : : uint32_t bs_bpt_eo_es;
561 : : uint32_t raw_data_size;
562 : : /*
563 : : * bsp_res contains:
564 : : * bsp crypto_block_size_pointer 8 bits at MLX5_BLOCK_SIZE_OFFSET
565 : : * res reserved 24 bits
566 : : */
567 : : uint32_t bsp_res;
568 : : uint32_t reserved0;
569 : : uint8_t xts_initial_tweak[16];
570 : : /*
571 : : * res_dp contains:
572 : : * res reserved 8 bits
573 : : * dp dek_pointer 24 bits at offset 0
574 : : */
575 : : uint32_t res_dp;
576 : : uint32_t reserved1;
577 : : uint64_t keytag;
578 : : uint32_t reserved2[4];
579 : : } __rte_packed;
580 : :
581 : : #ifdef PEDANTIC
582 : : #pragma GCC diagnostic ignored "-Wpedantic"
583 : : #endif
584 : :
585 : : struct mlx5_umr_wqe {
586 : : struct mlx5_wqe_cseg ctr;
587 : : struct mlx5_wqe_umr_cseg ucseg;
588 : : struct mlx5_wqe_mkey_cseg mkc;
589 : : union {
590 : : struct mlx5_wqe_dseg kseg[0];
591 : : struct mlx5_wqe_umr_bsf_seg bsf[0];
592 : : };
593 : : } __rte_packed;
594 : :
595 : : struct mlx5_rdma_write_wqe {
596 : : struct mlx5_wqe_cseg ctr;
597 : : struct mlx5_wqe_rseg rseg;
598 : : struct mlx5_wqe_dseg dseg[];
599 : : } __rte_packed;
600 : :
601 : : struct mlx5_wqe_send_en_seg {
602 : : uint32_t reserve[2];
603 : : uint32_t sqnpc;
604 : : uint32_t qpn;
605 : : } __rte_packed;
606 : :
607 : : struct mlx5_wqe_send_en_wqe {
608 : : struct mlx5_wqe_cseg ctr;
609 : : struct mlx5_wqe_send_en_seg sseg;
610 : : } __rte_packed;
611 : :
612 : : #ifdef PEDANTIC
613 : : #pragma GCC diagnostic error "-Wpedantic"
614 : : #endif
615 : :
616 : : /* GGA */
617 : : /* MMO metadata segment */
618 : :
619 : : #define MLX5_OPCODE_MMO 0x2fu
620 : : #define MLX5_OPC_MOD_MMO_CRYPTO 0x6u
621 : : #define MLX5_OPC_MOD_MMO_REGEX 0x4u
622 : : #define MLX5_OPC_MOD_MMO_COMP 0x2u
623 : : #define MLX5_OPC_MOD_MMO_DECOMP 0x3u
624 : : #define MLX5_OPC_MOD_MMO_DMA 0x1u
625 : :
626 : : #define WQE_GGA_DECOMP_DEFLATE 0x0u
627 : : #define WQE_GGA_DECOMP_LZ4 0x2u
628 : :
629 : : #define MLX5_GGA_DECOMP_LZ4_BLOCK_WITHOUT_CHECKSUM 0x1u
630 : : #define MLX5_GGA_DECOMP_LZ4_BLOCK_WITH_CHECKSUM 0x2u
631 : :
632 : : #define WQE_GGA_COMP_WIN_SIZE_OFFSET 12u
633 : : #define WQE_GGA_COMP_BLOCK_SIZE_OFFSET 16u
634 : : #define WQE_GGA_COMP_DYNAMIC_SIZE_OFFSET 20u
635 : : #define WQE_GGA_DECOMP_PARAMS_OFFSET 20u
636 : : #define WQE_GGA_DECOMP_TYPE_OFFSET 8u
637 : : #define WQE_GGA_DECOMP_BLOCK_INDEPENDENT_OFFSET 22u
638 : :
639 : : #define MLX5_GGA_COMP_WIN_SIZE_UNITS 1024u
640 : : #define MLX5_GGA_COMP_WIN_SIZE_MAX (32u * MLX5_GGA_COMP_WIN_SIZE_UNITS)
641 : : #define MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX 15u
642 : : #define MLX5_GGA_COMP_LOG_DYNAMIC_SIZE_MAX 15u
643 : : #define MLX5_GGA_COMP_LOG_DYNAMIC_SIZE_MIN 0u
644 : : #define MLX5_GGA_COMP_OUT_OF_SPACE_SYNDROME_BE 0x29D0084
645 : : #define MLX5_GGA_COMP_MISSING_BFINAL_SYNDROME_BE 0x29D0011
646 : :
647 : : struct mlx5_wqe_metadata_seg {
648 : : uint32_t mmo_control_31_0; /* mmo_control_63_32 is in ctrl_seg.imm */
649 : : uint32_t lkey;
650 : : uint64_t addr;
651 : : };
652 : :
653 : : struct mlx5_gga_wqe {
654 : : uint32_t opcode;
655 : : uint32_t sq_ds;
656 : : uint32_t flags;
657 : : uint32_t gga_ctrl1;
658 : : uint32_t gga_ctrl2;
659 : : uint32_t opaque_lkey;
660 : : uint64_t opaque_vaddr;
661 : : struct mlx5_wqe_dseg gather;
662 : : struct mlx5_wqe_dseg scatter;
663 : : } __rte_packed;
664 : :
665 : : union mlx5_gga_compress_opaque {
666 : : struct {
667 : : uint32_t syndrome;
668 : : uint32_t reserved0;
669 : : uint32_t scattered_length;
670 : : union {
671 : : struct {
672 : : uint32_t reserved1[5];
673 : : uint32_t crc32;
674 : : uint32_t adler32;
675 : : } v1 __rte_packed;
676 : : struct {
677 : : uint32_t crc32;
678 : : uint32_t adler32;
679 : : uint32_t crc32c;
680 : : uint32_t xxh32;
681 : : } v2 __rte_packed;
682 : : };
683 : : } __rte_packed;
684 : : uint32_t data[64];
685 : : };
686 : :
687 : : union mlx5_gga_crypto_opaque {
688 : : struct {
689 : : uint32_t syndrome;
690 : : uint32_t reserved0[2];
691 : : struct {
692 : : uint32_t iv[3];
693 : : uint32_t tag_size;
694 : : uint32_t aad_size;
695 : : } cp __rte_packed;
696 : : } __rte_packed;
697 : : uint8_t data[64];
698 : : };
699 : :
700 : : struct mlx5_ifc_regexp_mmo_control_bits {
701 : : uint8_t reserved_at_31[0x2];
702 : : uint8_t le[0x1];
703 : : uint8_t reserved_at_28[0x1];
704 : : uint8_t subset_id_0[0xc];
705 : : uint8_t reserved_at_16[0x4];
706 : : uint8_t subset_id_1[0xc];
707 : : uint8_t ctrl[0x4];
708 : : uint8_t subset_id_2[0xc];
709 : : uint8_t reserved_at_16_1[0x4];
710 : : uint8_t subset_id_3[0xc];
711 : : };
712 : :
713 : : struct mlx5_ifc_regexp_metadata_bits {
714 : : uint8_t rof_version[0x10];
715 : : uint8_t latency_count[0x10];
716 : : uint8_t instruction_count[0x10];
717 : : uint8_t primary_thread_count[0x10];
718 : : uint8_t match_count[0x8];
719 : : uint8_t detected_match_count[0x8];
720 : : uint8_t status[0x10];
721 : : uint8_t job_id[0x20];
722 : : uint8_t reserved[0x80];
723 : : };
724 : :
725 : : struct mlx5_ifc_regexp_match_tuple_bits {
726 : : uint8_t length[0x10];
727 : : uint8_t start_ptr[0x10];
728 : : uint8_t rule_id[0x20];
729 : : };
730 : :
731 : : /* Adding direct verbs to data-path. */
732 : :
733 : : /* CQ sequence number mask. */
734 : : #define MLX5_CQ_SQN_MASK 0x3
735 : :
736 : : /* CQ sequence number index. */
737 : : #define MLX5_CQ_SQN_OFFSET 28
738 : :
739 : : /* CQ doorbell index mask. */
740 : : #define MLX5_CI_MASK 0xffffff
741 : :
742 : : /* CQ doorbell offset. */
743 : : #define MLX5_CQ_ARM_DB 1
744 : :
745 : : /* CQ doorbell offset*/
746 : : #define MLX5_CQ_DOORBELL 0x20
747 : :
748 : : /* CQE format value. */
749 : : #define MLX5_COMPRESSED 0x3
750 : :
751 : : /* CQ doorbell cmd types. */
752 : : #define MLX5_CQ_DBR_CMD_SOL_ONLY (1 << 24)
753 : : #define MLX5_CQ_DBR_CMD_ALL (0 << 24)
754 : :
755 : : /* Action type of header modification. */
756 : : enum {
757 : : MLX5_MODIFICATION_TYPE_SET = 0x1,
758 : : MLX5_MODIFICATION_TYPE_ADD = 0x2,
759 : : MLX5_MODIFICATION_TYPE_COPY = 0x3,
760 : : MLX5_MODIFICATION_TYPE_INSERT = 0x4,
761 : : MLX5_MODIFICATION_TYPE_REMOVE = 0x5,
762 : : MLX5_MODIFICATION_TYPE_NOP = 0x6,
763 : : MLX5_MODIFICATION_TYPE_REMOVE_WORDS = 0x7,
764 : : MLX5_MODIFICATION_TYPE_ADD_FIELD = 0x8,
765 : : MLX5_MODIFICATION_TYPE_MAX,
766 : : };
767 : :
768 : : /* The field of packet to be modified. */
769 : : enum mlx5_modification_field {
770 : : MLX5_MODI_OUT_NONE = -1,
771 : : MLX5_MODI_OUT_SMAC_47_16 = 1,
772 : : MLX5_MODI_OUT_SMAC_15_0,
773 : : MLX5_MODI_OUT_ETHERTYPE,
774 : : MLX5_MODI_OUT_DMAC_47_16,
775 : : MLX5_MODI_OUT_DMAC_15_0,
776 : : MLX5_MODI_OUT_IP_DSCP,
777 : : MLX5_MODI_OUT_TCP_FLAGS,
778 : : MLX5_MODI_OUT_TCP_SPORT,
779 : : MLX5_MODI_OUT_TCP_DPORT,
780 : : MLX5_MODI_OUT_IPV4_TTL,
781 : : MLX5_MODI_OUT_UDP_SPORT,
782 : : MLX5_MODI_OUT_UDP_DPORT,
783 : : MLX5_MODI_OUT_SIPV6_127_96,
784 : : MLX5_MODI_OUT_SIPV6_95_64,
785 : : MLX5_MODI_OUT_SIPV6_63_32,
786 : : MLX5_MODI_OUT_SIPV6_31_0,
787 : : MLX5_MODI_OUT_DIPV6_127_96,
788 : : MLX5_MODI_OUT_DIPV6_95_64,
789 : : MLX5_MODI_OUT_DIPV6_63_32,
790 : : MLX5_MODI_OUT_DIPV6_31_0,
791 : : MLX5_MODI_OUT_SIPV4,
792 : : MLX5_MODI_OUT_DIPV4,
793 : : MLX5_MODI_OUT_FIRST_VID,
794 : : MLX5_MODI_IN_SMAC_47_16 = 0x31,
795 : : MLX5_MODI_IN_SMAC_15_0,
796 : : MLX5_MODI_IN_ETHERTYPE,
797 : : MLX5_MODI_IN_DMAC_47_16,
798 : : MLX5_MODI_IN_DMAC_15_0,
799 : : MLX5_MODI_IN_IP_DSCP,
800 : : MLX5_MODI_IN_TCP_FLAGS,
801 : : MLX5_MODI_IN_TCP_SPORT,
802 : : MLX5_MODI_IN_TCP_DPORT,
803 : : MLX5_MODI_IN_IPV4_TTL,
804 : : MLX5_MODI_IN_UDP_SPORT,
805 : : MLX5_MODI_IN_UDP_DPORT,
806 : : MLX5_MODI_IN_SIPV6_127_96,
807 : : MLX5_MODI_IN_SIPV6_95_64,
808 : : MLX5_MODI_IN_SIPV6_63_32,
809 : : MLX5_MODI_IN_SIPV6_31_0,
810 : : MLX5_MODI_IN_DIPV6_127_96,
811 : : MLX5_MODI_IN_DIPV6_95_64,
812 : : MLX5_MODI_IN_DIPV6_63_32,
813 : : MLX5_MODI_IN_DIPV6_31_0,
814 : : MLX5_MODI_IN_SIPV4,
815 : : MLX5_MODI_IN_DIPV4,
816 : : MLX5_MODI_OUT_IPV6_HOPLIMIT,
817 : : MLX5_MODI_IN_IPV6_HOPLIMIT,
818 : : MLX5_MODI_META_DATA_REG_A,
819 : : MLX5_MODI_OUT_IP_PROTOCOL,
820 : : MLX5_MODI_META_DATA_REG_B = 0x50,
821 : : MLX5_MODI_META_REG_C_0,
822 : : MLX5_MODI_META_REG_C_1,
823 : : MLX5_MODI_META_REG_C_2,
824 : : MLX5_MODI_META_REG_C_3,
825 : : MLX5_MODI_META_REG_C_4,
826 : : MLX5_MODI_META_REG_C_5,
827 : : MLX5_MODI_META_REG_C_6,
828 : : MLX5_MODI_META_REG_C_7,
829 : : MLX5_MODI_OUT_TCP_SEQ_NUM,
830 : : MLX5_MODI_IN_TCP_SEQ_NUM,
831 : : MLX5_MODI_OUT_TCP_ACK_NUM,
832 : : MLX5_MODI_IN_TCP_ACK_NUM,
833 : : MLX5_MODI_OUT_ESP_SPI = 0x5E,
834 : : MLX5_MODI_IN_ESP_SPI,
835 : : MLX5_MODI_GTP_TEID = 0x6E,
836 : : MLX5_MODI_OUT_IP_ECN = 0x73,
837 : : MLX5_MODI_IN_IP_ECN,
838 : : MLX5_MODI_TUNNEL_HDR_DW_1,
839 : : MLX5_MODI_GTPU_FIRST_EXT_DW_0,
840 : : MLX5_MODI_HASH_RESULT = 0x81,
841 : : MLX5_MODI_OUT_ESP_SEQ_NUM,
842 : : MLX5_MODI_IN_ESP_SEQ_NUM,
843 : : MLX5_MODI_IN_MPLS_LABEL_0 = 0x8a,
844 : : MLX5_MODI_IN_MPLS_LABEL_1,
845 : : MLX5_MODI_IN_MPLS_LABEL_2,
846 : : MLX5_MODI_IN_MPLS_LABEL_3,
847 : : MLX5_MODI_IN_MPLS_LABEL_4,
848 : : MLX5_MODI_META_REG_C_8,
849 : : MLX5_MODI_META_REG_C_9,
850 : : MLX5_MODI_META_REG_C_10,
851 : : MLX5_MODI_META_REG_C_11,
852 : : MLX5_MODI_META_REG_C_12,
853 : : MLX5_MODI_META_REG_C_13,
854 : : MLX5_MODI_META_REG_C_14,
855 : : MLX5_MODI_META_REG_C_15,
856 : : MLX5_MODI_OUT_IPV6_TRAFFIC_CLASS = 0x11C,
857 : : MLX5_MODI_OUT_IPV4_TOTAL_LEN,
858 : : MLX5_MODI_OUT_IPV6_PAYLOAD_LEN,
859 : : MLX5_MODI_OUT_IPV4_IHL,
860 : : MLX5_MODI_OUT_TCP_DATA_OFFSET,
861 : : MLX5_MODI_IN_IPV6_TRAFFIC_CLASS,
862 : : MLX5_MODI_IN_IPV4_TOTAL_LEN,
863 : : MLX5_MODI_IN_IPV6_PAYLOAD_LEN,
864 : : MLX5_MODI_IN_IPV4_IHL,
865 : : MLX5_MODI_IN_TCP_DATA_OFFSET,
866 : : MLX5_MODI_OUT_IPSEC_NEXT_HDR,
867 : : MLX5_MODI_OUT_IPV6_FLOW_LABEL,
868 : : MLX5_MODI_IN_IPV6_FLOW_LABEL,
869 : : MLX5_MODI_INVALID = INT_MAX,
870 : : };
871 : :
872 : : /* Total number of metadata reg_c's. */
873 : : #define MLX5_MREG_C_NUM (MLX5_MODI_META_REG_C_7 - MLX5_MODI_META_REG_C_0 + 1)
874 : :
875 : : enum modify_reg {
876 : : REG_NON = 0,
877 : : REG_A,
878 : : REG_B,
879 : : REG_C_0,
880 : : REG_C_1,
881 : : REG_C_2,
882 : : REG_C_3,
883 : : REG_C_4,
884 : : REG_C_5,
885 : : REG_C_6,
886 : : REG_C_7,
887 : : REG_C_8,
888 : : REG_C_9,
889 : : REG_C_10,
890 : : REG_C_11,
891 : : };
892 : :
893 : : static __rte_always_inline uint8_t
894 : : mlx5_regc_index(enum modify_reg regc_val)
895 : : {
896 : 0 : return (uint8_t)(regc_val - REG_C_0);
897 : : }
898 : :
899 : : static __rte_always_inline enum modify_reg
900 : : mlx5_regc_value(uint8_t regc_ix)
901 : : {
902 : 0 : return REG_C_0 + regc_ix;
903 : : }
904 : :
905 : : /* Modification sub command. */
906 : : struct mlx5_modification_cmd {
907 : : union {
908 : : uint32_t data0;
909 : : struct {
910 : : unsigned int length:5;
911 : : unsigned int rsvd0:3;
912 : : unsigned int offset:5;
913 : : unsigned int rsvd1:3;
914 : : unsigned int field:12;
915 : : unsigned int action_type:4;
916 : : };
917 : : };
918 : : union {
919 : : uint32_t data1;
920 : : uint8_t data[4];
921 : : struct {
922 : : unsigned int rsvd2:8;
923 : : unsigned int dst_offset:5;
924 : : unsigned int rsvd3:3;
925 : : unsigned int dst_field:12;
926 : : unsigned int rsvd4:4;
927 : : };
928 : : };
929 : : };
930 : :
931 : : typedef uint64_t u64;
932 : : typedef uint32_t u32;
933 : : typedef uint16_t u16;
934 : : typedef uint8_t u8;
935 : :
936 : : #define __mlx5_nullp(typ) ((struct mlx5_ifc_##typ##_bits *)0)
937 : : #define __mlx5_bit_sz(typ, fld) sizeof(__mlx5_nullp(typ)->fld)
938 : : #define __mlx5_bit_off(typ, fld) ((unsigned int)(uintptr_t) \
939 : : (&(__mlx5_nullp(typ)->fld)))
940 : : #define __mlx5_dw_bit_off(typ, fld) (32 - __mlx5_bit_sz(typ, fld) - \
941 : : (__mlx5_bit_off(typ, fld) & 0x1f))
942 : : #define __mlx5_dw_off(typ, fld) (__mlx5_bit_off(typ, fld) / 32)
943 : : #define __mlx5_64_off(typ, fld) (__mlx5_bit_off(typ, fld) / 64)
944 : : #define __mlx5_dw_mask(typ, fld) (__mlx5_mask(typ, fld) << \
945 : : __mlx5_dw_bit_off(typ, fld))
946 : : #define __mlx5_mask(typ, fld) ((u32)((1ull << __mlx5_bit_sz(typ, fld)) - 1))
947 : : #define __mlx5_16_off(typ, fld) (__mlx5_bit_off(typ, fld) / 16)
948 : : #define __mlx5_16_bit_off(typ, fld) (16 - __mlx5_bit_sz(typ, fld) - \
949 : : (__mlx5_bit_off(typ, fld) & 0xf))
950 : : #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1))
951 : : #define __mlx5_16_mask(typ, fld) (__mlx5_mask16(typ, fld) << \
952 : : __mlx5_16_bit_off(typ, fld))
953 : : #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
954 : : #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32)
955 : : #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
956 : : #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
957 : :
958 : : /* insert a value to a struct */
959 : : #define MLX5_SET(typ, p, fld, v) \
960 : : do { \
961 : : u32 _v = v; \
962 : : *((rte_be32_t *)(p) + __mlx5_dw_off(typ, fld)) = \
963 : : rte_cpu_to_be_32((rte_be_to_cpu_32(*((u32 *)(p) + \
964 : : __mlx5_dw_off(typ, fld))) & \
965 : : (~__mlx5_dw_mask(typ, fld))) | \
966 : : (((_v) & __mlx5_mask(typ, fld)) << \
967 : : __mlx5_dw_bit_off(typ, fld))); \
968 : : } while (0)
969 : :
970 : : #define MLX5_SET64(typ, p, fld, v) \
971 : : do { \
972 : : MLX5_ASSERT(__mlx5_bit_sz(typ, fld) == 64); \
973 : : *((rte_be64_t *)(p) + __mlx5_64_off(typ, fld)) = \
974 : : rte_cpu_to_be_64(v); \
975 : : } while (0)
976 : :
977 : : #define MLX5_SET16(typ, p, fld, v) \
978 : : do { \
979 : : u16 _v = v; \
980 : : *((rte_be16_t *)(p) + __mlx5_16_off(typ, fld)) = \
981 : : rte_cpu_to_be_16((rte_be_to_cpu_16(*((rte_be16_t *)(p) + \
982 : : __mlx5_16_off(typ, fld))) & \
983 : : (~__mlx5_16_mask(typ, fld))) | \
984 : : (((_v) & __mlx5_mask16(typ, fld)) << \
985 : : __mlx5_16_bit_off(typ, fld))); \
986 : : } while (0)
987 : :
988 : : #define MLX5_GET_VOLATILE(typ, p, fld) \
989 : : ((rte_be_to_cpu_32(*((volatile __be32 *)(p) +\
990 : : __mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \
991 : : __mlx5_mask(typ, fld))
992 : : #define MLX5_GET(typ, p, fld) \
993 : : ((rte_be_to_cpu_32(*((rte_be32_t *)(p) +\
994 : : __mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \
995 : : __mlx5_mask(typ, fld))
996 : : #define MLX5_GET16(typ, p, fld) \
997 : : ((rte_be_to_cpu_16(*((rte_be16_t *)(p) + \
998 : : __mlx5_16_off(typ, fld))) >> __mlx5_16_bit_off(typ, fld)) & \
999 : : __mlx5_mask16(typ, fld))
1000 : : #define MLX5_GET64(typ, p, fld) rte_be_to_cpu_64(*((rte_be64_t *)(p) + \
1001 : : __mlx5_64_off(typ, fld)))
1002 : : #define MLX5_FLD_SZ_BYTES(typ, fld) (__mlx5_bit_sz(typ, fld) / 8)
1003 : : #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8)
1004 : :
1005 : : struct mlx5_ifc_fte_match_set_misc_bits {
1006 : : u8 gre_c_present[0x1];
1007 : : u8 reserved_at_1[0x1];
1008 : : u8 gre_k_present[0x1];
1009 : : u8 gre_s_present[0x1];
1010 : : u8 source_vhci_port[0x4];
1011 : : u8 source_sqn[0x18];
1012 : : u8 reserved_at_20[0x10];
1013 : : u8 source_port[0x10];
1014 : : u8 outer_second_prio[0x3];
1015 : : u8 outer_second_cfi[0x1];
1016 : : u8 outer_second_vid[0xc];
1017 : : u8 inner_second_prio[0x3];
1018 : : u8 inner_second_cfi[0x1];
1019 : : u8 inner_second_vid[0xc];
1020 : : u8 outer_second_cvlan_tag[0x1];
1021 : : u8 inner_second_cvlan_tag[0x1];
1022 : : u8 outer_second_svlan_tag[0x1];
1023 : : u8 inner_second_svlan_tag[0x1];
1024 : : u8 reserved_at_64[0xc];
1025 : : u8 gre_protocol[0x10];
1026 : : u8 gre_key_h[0x18];
1027 : : u8 gre_key_l[0x8];
1028 : : u8 vxlan_vni[0x18];
1029 : : u8 bth_opcode[0x8];
1030 : : u8 geneve_vni[0x18];
1031 : : u8 lag_rx_port_affinity[0x4];
1032 : : u8 reserved_at_e8[0x2];
1033 : : u8 geneve_tlv_option_0_exist[0x1];
1034 : : u8 geneve_oam[0x1];
1035 : : u8 reserved_at_e0[0xc];
1036 : : u8 outer_ipv6_flow_label[0x14];
1037 : : u8 reserved_at_100[0xc];
1038 : : u8 inner_ipv6_flow_label[0x14];
1039 : : u8 reserved_at_120[0xa];
1040 : : u8 geneve_opt_len[0x6];
1041 : : u8 geneve_protocol_type[0x10];
1042 : : u8 reserved_at_140[0x8];
1043 : : u8 bth_dst_qp[0x18];
1044 : : u8 inner_esp_spi[0x20];
1045 : : u8 outer_esp_spi[0x20];
1046 : : u8 reserved_at_1a0[0x60];
1047 : : };
1048 : :
1049 : : struct mlx5_ifc_ipv4_layout_bits {
1050 : : u8 reserved_at_0[0x60];
1051 : : u8 ipv4[0x20];
1052 : : };
1053 : :
1054 : : struct mlx5_ifc_ipv6_layout_bits {
1055 : : u8 ipv6[16][0x8];
1056 : : };
1057 : :
1058 : : union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits {
1059 : : struct mlx5_ifc_ipv6_layout_bits ipv6_layout;
1060 : : struct mlx5_ifc_ipv4_layout_bits ipv4_layout;
1061 : : u8 reserved_at_0[0x80];
1062 : : };
1063 : :
1064 : : struct mlx5_ifc_fte_match_set_lyr_2_4_bits {
1065 : : u8 smac_47_16[0x20];
1066 : : u8 smac_15_0[0x10];
1067 : : u8 ethertype[0x10];
1068 : : u8 dmac_47_16[0x20];
1069 : : u8 dmac_15_0[0x10];
1070 : : u8 first_prio[0x3];
1071 : : u8 first_cfi[0x1];
1072 : : u8 first_vid[0xc];
1073 : : u8 ip_protocol[0x8];
1074 : : u8 ip_dscp[0x6];
1075 : : u8 ip_ecn[0x2];
1076 : : u8 cvlan_tag[0x1];
1077 : : u8 svlan_tag[0x1];
1078 : : u8 frag[0x1];
1079 : : u8 ip_version[0x4];
1080 : : u8 tcp_flags[0x9];
1081 : : u8 tcp_sport[0x10];
1082 : : u8 tcp_dport[0x10];
1083 : : u8 reserved_at_c0[0x10];
1084 : : u8 ipv4_ihl[0x4];
1085 : : u8 l3_ok[0x1];
1086 : : u8 l4_ok[0x1];
1087 : : u8 ipv4_checksum_ok[0x1];
1088 : : u8 l4_checksum_ok[0x1];
1089 : : u8 ip_ttl_hoplimit[0x8];
1090 : : u8 udp_sport[0x10];
1091 : : u8 udp_dport[0x10];
1092 : : union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits src_ipv4_src_ipv6;
1093 : : union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits dst_ipv4_dst_ipv6;
1094 : : };
1095 : :
1096 : : struct mlx5_ifc_fte_match_mpls_bits {
1097 : : u8 mpls_label[0x14];
1098 : : u8 mpls_exp[0x3];
1099 : : u8 mpls_s_bos[0x1];
1100 : : u8 mpls_ttl[0x8];
1101 : : };
1102 : :
1103 : : struct mlx5_ifc_fte_match_set_misc2_bits {
1104 : : struct mlx5_ifc_fte_match_mpls_bits outer_first_mpls;
1105 : : struct mlx5_ifc_fte_match_mpls_bits inner_first_mpls;
1106 : : struct mlx5_ifc_fte_match_mpls_bits outer_first_mpls_over_gre;
1107 : : struct mlx5_ifc_fte_match_mpls_bits outer_first_mpls_over_udp;
1108 : : u8 metadata_reg_c_7[0x20];
1109 : : u8 metadata_reg_c_6[0x20];
1110 : : u8 metadata_reg_c_5[0x20];
1111 : : u8 metadata_reg_c_4[0x20];
1112 : : u8 metadata_reg_c_3[0x20];
1113 : : u8 metadata_reg_c_2[0x20];
1114 : : u8 metadata_reg_c_1[0x20];
1115 : : u8 metadata_reg_c_0[0x20];
1116 : : u8 metadata_reg_a[0x20];
1117 : : u8 metadata_reg_b[0x20];
1118 : : u8 reserved_at_1c0[0x40];
1119 : : };
1120 : :
1121 : : struct mlx5_ifc_fte_match_set_misc3_bits {
1122 : : u8 inner_tcp_seq_num[0x20];
1123 : : u8 outer_tcp_seq_num[0x20];
1124 : : u8 inner_tcp_ack_num[0x20];
1125 : : u8 outer_tcp_ack_num[0x20];
1126 : : u8 reserved_at_auto1[0x8];
1127 : : u8 outer_vxlan_gpe_vni[0x18];
1128 : : u8 outer_vxlan_gpe_next_protocol[0x8];
1129 : : u8 outer_vxlan_gpe_flags[0x8];
1130 : : u8 reserved_at_a8[0x10];
1131 : : u8 icmp_header_data[0x20];
1132 : : u8 icmpv6_header_data[0x20];
1133 : : u8 icmp_type[0x8];
1134 : : u8 icmp_code[0x8];
1135 : : u8 icmpv6_type[0x8];
1136 : : u8 icmpv6_code[0x8];
1137 : : u8 geneve_tlv_option_0_data[0x20];
1138 : : u8 gtpu_teid[0x20];
1139 : : u8 gtpu_msg_type[0x08];
1140 : : u8 gtpu_msg_flags[0x08];
1141 : : u8 reserved_at_170[0x10];
1142 : : u8 gtpu_dw_2[0x20];
1143 : : u8 gtpu_first_ext_dw_0[0x20];
1144 : : u8 gtpu_dw_0[0x20];
1145 : : u8 reserved_at_240[0x20];
1146 : :
1147 : : };
1148 : :
1149 : : struct mlx5_ifc_fte_match_set_misc4_bits {
1150 : : u8 prog_sample_field_value_0[0x20];
1151 : : u8 prog_sample_field_id_0[0x20];
1152 : : u8 prog_sample_field_value_1[0x20];
1153 : : u8 prog_sample_field_id_1[0x20];
1154 : : u8 prog_sample_field_value_2[0x20];
1155 : : u8 prog_sample_field_id_2[0x20];
1156 : : u8 prog_sample_field_value_3[0x20];
1157 : : u8 prog_sample_field_id_3[0x20];
1158 : : u8 prog_sample_field_value_4[0x20];
1159 : : u8 prog_sample_field_id_4[0x20];
1160 : : u8 prog_sample_field_value_5[0x20];
1161 : : u8 prog_sample_field_id_5[0x20];
1162 : : u8 prog_sample_field_value_6[0x20];
1163 : : u8 prog_sample_field_id_6[0x20];
1164 : : u8 prog_sample_field_value_7[0x20];
1165 : : u8 prog_sample_field_id_7[0x20];
1166 : : };
1167 : :
1168 : : struct mlx5_ifc_fte_match_set_misc5_bits {
1169 : : u8 macsec_tag_0[0x20];
1170 : : u8 macsec_tag_1[0x20];
1171 : : u8 macsec_tag_2[0x20];
1172 : : u8 macsec_tag_3[0x20];
1173 : : u8 tunnel_header_0[0x20];
1174 : : u8 tunnel_header_1[0x20];
1175 : : u8 tunnel_header_2[0x20];
1176 : : u8 tunnel_header_3[0x20];
1177 : : u8 reserved[0x100];
1178 : : };
1179 : :
1180 : : /* Flow matcher. */
1181 : : struct mlx5_ifc_fte_match_param_bits {
1182 : : struct mlx5_ifc_fte_match_set_lyr_2_4_bits outer_headers;
1183 : : struct mlx5_ifc_fte_match_set_misc_bits misc_parameters;
1184 : : struct mlx5_ifc_fte_match_set_lyr_2_4_bits inner_headers;
1185 : : struct mlx5_ifc_fte_match_set_misc2_bits misc_parameters_2;
1186 : : struct mlx5_ifc_fte_match_set_misc3_bits misc_parameters_3;
1187 : : struct mlx5_ifc_fte_match_set_misc4_bits misc_parameters_4;
1188 : : struct mlx5_ifc_fte_match_set_misc5_bits misc_parameters_5;
1189 : : /*
1190 : : * Add reserved bit to match the struct size with the size defined in PRM.
1191 : : * This extension is not required in Linux.
1192 : : */
1193 : : #ifndef HAVE_INFINIBAND_VERBS_H
1194 : : u8 reserved_0[0x200];
1195 : : #endif
1196 : : };
1197 : :
1198 : : struct mlx5_ifc_dest_format_struct_bits {
1199 : : u8 destination_type[0x8];
1200 : : u8 destination_id[0x18];
1201 : : u8 reserved_0[0x20];
1202 : : };
1203 : :
1204 : : enum {
1205 : : MLX5_MATCH_CRITERIA_ENABLE_OUTER_BIT,
1206 : : MLX5_MATCH_CRITERIA_ENABLE_MISC_BIT,
1207 : : MLX5_MATCH_CRITERIA_ENABLE_INNER_BIT,
1208 : : MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT,
1209 : : MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT,
1210 : : MLX5_MATCH_CRITERIA_ENABLE_MISC4_BIT,
1211 : : MLX5_MATCH_CRITERIA_ENABLE_MISC5_BIT,
1212 : : };
1213 : :
1214 : : enum {
1215 : : MLX5_CMD_OP_QUERY_HCA_CAP = 0x100,
1216 : : MLX5_CMD_OP_CREATE_MKEY = 0x200,
1217 : : MLX5_CMD_OP_CREATE_CQ = 0x400,
1218 : : MLX5_CMD_OP_CREATE_QP = 0x500,
1219 : : MLX5_CMD_OP_RST2INIT_QP = 0x502,
1220 : : MLX5_CMD_OP_INIT2RTR_QP = 0x503,
1221 : : MLX5_CMD_OP_RTR2RTS_QP = 0x504,
1222 : : MLX5_CMD_OP_RTS2RTS_QP = 0x505,
1223 : : MLX5_CMD_OP_SQERR2RTS_QP = 0x506,
1224 : : MLX5_CMD_OP_QP_2ERR = 0x507,
1225 : : MLX5_CMD_OP_QP_2RST = 0x50A,
1226 : : MLX5_CMD_OP_QUERY_QP = 0x50B,
1227 : : MLX5_CMD_OP_SQD2RTS_QP = 0x50C,
1228 : : MLX5_CMD_OP_INIT2INIT_QP = 0x50E,
1229 : : MLX5_CMD_OP_SUSPEND_QP = 0x50F,
1230 : : MLX5_CMD_OP_RESUME_QP = 0x510,
1231 : : MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT = 0x754,
1232 : : MLX5_CMD_OP_ALLOC_Q_COUNTER = 0x771,
1233 : : MLX5_CMD_OP_QUERY_Q_COUNTER = 0x773,
1234 : : MLX5_CMD_OP_ALLOC_PD = 0x800,
1235 : : MLX5_CMD_OP_DEALLOC_PD = 0x801,
1236 : : MLX5_CMD_OP_ACCESS_REGISTER = 0x805,
1237 : : MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN = 0x816,
1238 : : MLX5_CMD_OP_QUERY_LAG = 0x842,
1239 : : MLX5_CMD_OP_CREATE_TIR = 0x900,
1240 : : MLX5_CMD_OP_MODIFY_TIR = 0x901,
1241 : : MLX5_CMD_OP_CREATE_SQ = 0X904,
1242 : : MLX5_CMD_OP_MODIFY_SQ = 0X905,
1243 : : MLX5_CMD_OP_CREATE_RQ = 0x908,
1244 : : MLX5_CMD_OP_MODIFY_RQ = 0x909,
1245 : : MLX5_CMD_OP_QUERY_RQ = 0x90b,
1246 : : MLX5_CMD_OP_CREATE_RMP = 0x90c,
1247 : : MLX5_CMD_OP_MODIFY_RMP = 0x90d,
1248 : : MLX5_CMD_OP_DESTROY_RMP = 0x90e,
1249 : : MLX5_CMD_OP_QUERY_RMP = 0x90f,
1250 : : MLX5_CMD_OP_CREATE_TIS = 0x912,
1251 : : MLX5_CMD_OP_QUERY_TIS = 0x915,
1252 : : MLX5_CMD_OP_CREATE_RQT = 0x916,
1253 : : MLX5_CMD_OP_MODIFY_RQT = 0x917,
1254 : : MLX5_CMD_OP_CREATE_FLOW_TABLE = 0x930,
1255 : : MLX5_CMD_OP_QUERY_FLOW_TABLE = 0x932,
1256 : : MLX5_CMD_OP_CREATE_FLOW_GROUP = 0x933,
1257 : : MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY = 0x936,
1258 : : MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c,
1259 : : MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT = 0x93d,
1260 : : MLX5_CMD_OP_DEALLOC_PACKET_REFORMAT_CONTEXT = 0x93e,
1261 : : MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939,
1262 : : MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b,
1263 : : MLX5_CMD_OP_CREATE_GENERAL_OBJECT = 0xa00,
1264 : : MLX5_CMD_OP_MODIFY_GENERAL_OBJECT = 0xa01,
1265 : : MLX5_CMD_OP_QUERY_GENERAL_OBJECT = 0xa02,
1266 : : MLX5_CMD_SET_REGEX_PARAMS = 0xb04,
1267 : : MLX5_CMD_QUERY_REGEX_PARAMS = 0xb05,
1268 : : MLX5_CMD_SET_REGEX_REGISTERS = 0xb06,
1269 : : MLX5_CMD_QUERY_REGEX_REGISTERS = 0xb07,
1270 : : MLX5_CMD_OP_ACCESS_REGISTER_USER = 0xb0c,
1271 : : MLX5_CMD_OP_QUERY_MATCH_SAMPLE_INFO = 0xb13,
1272 : : MLX5_CMD_OP_ALLOW_OTHER_VHCA_ACCESS = 0xb16,
1273 : : MLX5_CMD_OP_GENERATE_WQE = 0xb17,
1274 : : };
1275 : :
1276 : : enum {
1277 : : MLX5_MKC_ACCESS_MODE_MTT = 0x1,
1278 : : MLX5_MKC_ACCESS_MODE_KLM = 0x2,
1279 : : MLX5_MKC_ACCESS_MODE_KLM_FBS = 0x3,
1280 : : };
1281 : :
1282 : : #define MLX5_ADAPTER_PAGE_SHIFT 12
1283 : : #define MLX5_LOG_RQ_STRIDE_SHIFT 4
1284 : : /**
1285 : : * The batch counter dcs id starts from 0x800000 and none batch counter
1286 : : * starts from 0. As currently, the counter is changed to be indexed by
1287 : : * pool index and the offset of the counter in the pool counters_raw array.
1288 : : * It means now the counter index is same for batch and none batch counter.
1289 : : * Add the 0x800000 batch counter offset to the batch counter index helps
1290 : : * indicate the counter index is from batch or none batch container pool.
1291 : : */
1292 : : #define MLX5_CNT_BATCH_OFFSET 0x800000
1293 : :
1294 : : /* The counter batch query requires ID align with 4. */
1295 : : #define MLX5_CNT_BATCH_QUERY_ID_ALIGNMENT 4
1296 : :
1297 : : /* Flow counters. */
1298 : : struct mlx5_ifc_alloc_flow_counter_out_bits {
1299 : : u8 status[0x8];
1300 : : u8 reserved_at_8[0x18];
1301 : : u8 syndrome[0x20];
1302 : : u8 flow_counter_id[0x20];
1303 : : u8 reserved_at_60[0x20];
1304 : : };
1305 : :
1306 : : struct mlx5_ifc_alloc_flow_counter_in_bits {
1307 : : u8 opcode[0x10];
1308 : : u8 reserved_at_10[0x10];
1309 : : u8 reserved_at_20[0x10];
1310 : : u8 op_mod[0x10];
1311 : : u8 reserved_at_40[0x8];
1312 : : u8 pd[0x18];
1313 : : u8 reserved_at_60[0x13];
1314 : : u8 flow_counter_bulk_log_size[0x5];
1315 : : u8 flow_counter_bulk[0x8];
1316 : : };
1317 : :
1318 : : struct mlx5_ifc_dealloc_flow_counter_out_bits {
1319 : : u8 status[0x8];
1320 : : u8 reserved_at_8[0x18];
1321 : : u8 syndrome[0x20];
1322 : : u8 reserved_at_40[0x40];
1323 : : };
1324 : :
1325 : : struct mlx5_ifc_dealloc_flow_counter_in_bits {
1326 : : u8 opcode[0x10];
1327 : : u8 reserved_at_10[0x10];
1328 : : u8 reserved_at_20[0x10];
1329 : : u8 op_mod[0x10];
1330 : : u8 flow_counter_id[0x20];
1331 : : u8 reserved_at_60[0x20];
1332 : : };
1333 : :
1334 : : struct mlx5_ifc_traffic_counter_bits {
1335 : : u8 packets[0x40];
1336 : : u8 octets[0x40];
1337 : : };
1338 : :
1339 : : struct mlx5_ifc_query_flow_counter_out_bits {
1340 : : u8 status[0x8];
1341 : : u8 reserved_at_8[0x18];
1342 : : u8 syndrome[0x20];
1343 : : u8 reserved_at_40[0x40];
1344 : : struct mlx5_ifc_traffic_counter_bits flow_statistics[];
1345 : : };
1346 : :
1347 : : struct mlx5_ifc_query_flow_counter_in_bits {
1348 : : u8 opcode[0x10];
1349 : : u8 reserved_at_10[0x10];
1350 : : u8 reserved_at_20[0x10];
1351 : : u8 op_mod[0x10];
1352 : : u8 reserved_at_40[0x20];
1353 : : u8 mkey[0x20];
1354 : : u8 address[0x40];
1355 : : u8 clear[0x1];
1356 : : u8 dump_to_memory[0x1];
1357 : : u8 num_of_counters[0x1e];
1358 : : u8 flow_counter_id[0x20];
1359 : : };
1360 : :
1361 : : struct mlx5_ifc_query_match_sample_info_out_bits {
1362 : : u8 status[0x8];
1363 : : u8 reserved_at_8[0x18];
1364 : : u8 syndrome[0x20];
1365 : : u8 reserved_at_40[0x40];
1366 : : u8 reserved_at_80[0x4];
1367 : : u8 modify_field_id[0xc];
1368 : : u8 ok_bit_format_select_dw[0x8];
1369 : : u8 field_format_select_dw[0x8];
1370 : : u8 reserved_at_a0[0x3];
1371 : : u8 ok_bit_offset[0x5];
1372 : : u8 reserved_at_a8[0x18];
1373 : : u8 reserved_at_c0[0x40];
1374 : : };
1375 : :
1376 : : struct mlx5_ifc_query_match_sample_info_in_bits {
1377 : : u8 opcode[0x10];
1378 : : u8 uid[0x10];
1379 : : u8 reserved_at_20[0x10];
1380 : : u8 op_mod[0x10];
1381 : : u8 reserved_at_40[0x60];
1382 : : u8 sample_field_id[0x20];
1383 : : u8 reserved_at_c0[0x140];
1384 : : };
1385 : :
1386 : : #define MLX5_MAX_KLM_BYTE_COUNT 0x80000000u
1387 : : #define MLX5_MIN_KLM_FIXED_BUFFER_SIZE 0x1000u
1388 : :
1389 : : struct mlx5_ifc_klm_bits {
1390 : : u8 byte_count[0x20];
1391 : : u8 mkey[0x20];
1392 : : u8 address[0x40];
1393 : : };
1394 : :
1395 : : struct mlx5_ifc_mkc_bits {
1396 : : u8 reserved_at_0[0x1];
1397 : : u8 free[0x1];
1398 : : u8 reserved_at_2[0x1];
1399 : : u8 access_mode_4_2[0x3];
1400 : : u8 reserved_at_6[0x7];
1401 : : u8 relaxed_ordering_write[0x1];
1402 : : u8 reserved_at_e[0x1];
1403 : : u8 small_fence_on_rdma_read_response[0x1];
1404 : : u8 umr_en[0x1];
1405 : : u8 a[0x1];
1406 : : u8 rw[0x1];
1407 : : u8 rr[0x1];
1408 : : u8 lw[0x1];
1409 : : u8 lr[0x1];
1410 : : u8 access_mode_1_0[0x2];
1411 : : u8 reserved_at_18[0x8];
1412 : : u8 qpn[0x18];
1413 : : u8 mkey_7_0[0x8];
1414 : : u8 reserved_at_40[0x20];
1415 : : u8 length64[0x1];
1416 : : u8 bsf_en[0x1];
1417 : : u8 sync_umr[0x1];
1418 : : u8 reserved_at_63[0x2];
1419 : : u8 expected_sigerr_count[0x1];
1420 : : u8 reserved_at_66[0x1];
1421 : : u8 en_rinval[0x1];
1422 : : u8 pd[0x18];
1423 : : u8 start_addr[0x40];
1424 : : u8 len[0x40];
1425 : : u8 bsf_octword_size[0x20];
1426 : : u8 reserved_at_120[0x80];
1427 : : u8 translations_octword_size[0x20];
1428 : : u8 reserved_at_1c0[0x19];
1429 : : u8 relaxed_ordering_read[0x1];
1430 : : u8 reserved_at_1da[0x1];
1431 : : u8 log_page_size[0x5];
1432 : : u8 reserved_at_1e0[0x3];
1433 : : u8 crypto_en[0x2];
1434 : : u8 reserved_at_1e5[0x1b];
1435 : : };
1436 : :
1437 : : /* Range of values for MKEY context crypto_en field. */
1438 : : enum {
1439 : : MLX5_MKEY_CRYPTO_DISABLED = 0x0,
1440 : : MLX5_MKEY_CRYPTO_ENABLED = 0x1,
1441 : : };
1442 : :
1443 : : struct mlx5_ifc_create_mkey_out_bits {
1444 : : u8 status[0x8];
1445 : : u8 reserved_at_8[0x18];
1446 : : u8 syndrome[0x20];
1447 : : u8 reserved_at_40[0x8];
1448 : : u8 mkey_index[0x18];
1449 : : u8 reserved_at_60[0x20];
1450 : : };
1451 : :
1452 : : struct mlx5_ifc_create_mkey_in_bits {
1453 : : u8 opcode[0x10];
1454 : : u8 reserved_at_10[0x10];
1455 : : u8 reserved_at_20[0x10];
1456 : : u8 op_mod[0x10];
1457 : : u8 reserved_at_40[0x20];
1458 : : u8 pg_access[0x1];
1459 : : u8 reserved_at_61[0x1f];
1460 : : struct mlx5_ifc_mkc_bits memory_key_mkey_entry;
1461 : : u8 reserved_at_280[0x80];
1462 : : u8 translations_octword_actual_size[0x20];
1463 : : u8 mkey_umem_id[0x20];
1464 : : u8 mkey_umem_offset[0x40];
1465 : : u8 reserved_at_380[0x500];
1466 : : u8 klm_pas_mtt[][0x20];
1467 : : };
1468 : :
1469 : : enum {
1470 : : MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0 << 1,
1471 : : MLX5_GET_HCA_CAP_OP_MOD_ETHERNET_OFFLOAD_CAPS = 0x1 << 1,
1472 : : MLX5_GET_HCA_CAP_OP_MOD_QOS_CAP = 0xc << 1,
1473 : : MLX5_GET_HCA_CAP_OP_MOD_ROCE = 0x4 << 1,
1474 : : MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE = 0x7 << 1,
1475 : : MLX5_GET_HCA_CAP_OP_MOD_ESW_FLOW_TABLE = 0x8 << 1,
1476 : : MLX5_SET_HCA_CAP_OP_MOD_ESW = 0x9 << 1,
1477 : : MLX5_GET_HCA_CAP_OP_MOD_VDPA_EMULATION = 0x13 << 1,
1478 : : MLX5_GET_HCA_CAP_OP_MOD_CRYPTO = 0x1A << 1,
1479 : : MLX5_GET_HCA_CAP_OP_MOD_WQE_BASED_FLOW_TABLE = 0x1B << 1,
1480 : : MLX5_GET_HCA_CAP_OP_MOD_PARSE_GRAPH_NODE_CAP = 0x1C << 1,
1481 : : MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE_2 = 0x20 << 1,
1482 : : };
1483 : :
1484 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q \
1485 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_VIRTQ)
1486 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_Q_COUNTERS \
1487 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_VIRTIO_Q_COUNTERS)
1488 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_PARSE_GRAPH_FLEX_NODE \
1489 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_FLEX_PARSE_GRAPH)
1490 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_HIT_ASO \
1491 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_FLOW_HIT_ASO)
1492 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_METER_ASO \
1493 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_FLOW_METER_ASO)
1494 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_GENEVE_TLV_OPT \
1495 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_GENEVE_TLV_OPT)
1496 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_CONN_TRACK_OFFLOAD \
1497 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_CONN_TRACK_OFFLOAD)
1498 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_DEFINER \
1499 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_DEFINER)
1500 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_DEK \
1501 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_DEK)
1502 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_IMPORT_KEK \
1503 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_IMPORT_KEK)
1504 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_CREDENTIAL \
1505 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_CREDENTIAL)
1506 : : #define MLX5_GENERAL_OBJ_TYPES_CAP_CRYPTO_LOGIN \
1507 : : (1ULL << MLX5_GENERAL_OBJ_TYPE_CRYPTO_LOGIN)
1508 : :
1509 : : enum {
1510 : : MLX5_HCA_CAP_OPMOD_GET_MAX = 0,
1511 : : MLX5_HCA_CAP_OPMOD_GET_CUR = 1,
1512 : : };
1513 : :
1514 : : enum {
1515 : : MLX5_CAP_INLINE_MODE_L2,
1516 : : MLX5_CAP_INLINE_MODE_VPORT_CONTEXT,
1517 : : MLX5_CAP_INLINE_MODE_NOT_REQUIRED,
1518 : : };
1519 : :
1520 : : enum {
1521 : : MLX5_INLINE_MODE_NONE,
1522 : : MLX5_INLINE_MODE_L2,
1523 : : MLX5_INLINE_MODE_IP,
1524 : : MLX5_INLINE_MODE_TCP_UDP,
1525 : : MLX5_INLINE_MODE_RESERVED4,
1526 : : MLX5_INLINE_MODE_INNER_L2,
1527 : : MLX5_INLINE_MODE_INNER_IP,
1528 : : MLX5_INLINE_MODE_INNER_TCP_UDP,
1529 : : };
1530 : :
1531 : : /* The supported timestamp formats reported in HCA attributes. */
1532 : : enum {
1533 : : MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR = 0x0,
1534 : : MLX5_HCA_CAP_TIMESTAMP_FORMAT_RT = 0x1,
1535 : : MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR_RT = 0x2,
1536 : : };
1537 : :
1538 : : /* The timestamp format attributes to configure queues (RQ/SQ/QP). */
1539 : : enum {
1540 : : MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING = 0x0,
1541 : : MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT = 0x1,
1542 : : MLX5_QPC_TIMESTAMP_FORMAT_REAL_TIME = 0x2,
1543 : : };
1544 : :
1545 : : /* HCA bit masks indicating which Flex parser protocols are already enabled. */
1546 : : #define MLX5_HCA_FLEX_IPV4_OVER_VXLAN_ENABLED (1UL << 0)
1547 : : #define MLX5_HCA_FLEX_IPV6_OVER_VXLAN_ENABLED (1UL << 1)
1548 : : #define MLX5_HCA_FLEX_IPV6_OVER_IP_ENABLED (1UL << 2)
1549 : : #define MLX5_HCA_FLEX_GENEVE_ENABLED (1UL << 3)
1550 : : #define MLX5_HCA_FLEX_CW_MPLS_OVER_GRE_ENABLED (1UL << 4)
1551 : : #define MLX5_HCA_FLEX_CW_MPLS_OVER_UDP_ENABLED (1UL << 5)
1552 : : #define MLX5_HCA_FLEX_P_BIT_VXLAN_GPE_ENABLED (1UL << 6)
1553 : : #define MLX5_HCA_FLEX_VXLAN_GPE_ENABLED (1UL << 7)
1554 : : #define MLX5_HCA_FLEX_ICMP_ENABLED (1UL << 8)
1555 : : #define MLX5_HCA_FLEX_ICMPV6_ENABLED (1UL << 9)
1556 : : #define MLX5_HCA_FLEX_GTPU_ENABLED (1UL << 11)
1557 : : #define MLX5_HCA_FLEX_GTPU_DW_2_ENABLED (1UL << 16)
1558 : : #define MLX5_HCA_FLEX_GTPU_FIRST_EXT_DW_0_ENABLED (1UL << 17)
1559 : : #define MLX5_HCA_FLEX_GTPU_DW_0_ENABLED (1UL << 18)
1560 : : #define MLX5_HCA_FLEX_GTPU_TEID_ENABLED (1UL << 19)
1561 : :
1562 : : /* The device steering logic format. */
1563 : : #define MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5 0x0
1564 : : #define MLX5_STEERING_LOGIC_FORMAT_CONNECTX_6DX 0x1
1565 : :
1566 : : struct mlx5_ifc_cmd_hca_cap_bits {
1567 : : u8 access_other_hca_roce[0x1];
1568 : : u8 alloc_flow_counter_pd[0x1];
1569 : : u8 flow_counter_access_aso[0x1];
1570 : : u8 query_match_sample_info[0x1];
1571 : : u8 reserved_at_4[0x4];
1572 : : u8 flow_access_aso_opc_mod[0x8];
1573 : : u8 reserved_at_10[0xf];
1574 : : u8 vhca_resource_manager[0x1];
1575 : : u8 hca_cap_2[0x1];
1576 : : u8 reserved_at_21[0xf];
1577 : : u8 vhca_id[0x10];
1578 : : u8 reserved_at_40[0x20];
1579 : : u8 reserved_at_60[0x3];
1580 : : u8 log_regexp_scatter_gather_size[0x5];
1581 : : u8 reserved_at_68[0x3];
1582 : : u8 log_dma_mmo_size[0x5];
1583 : : u8 reserved_at_70[0x3];
1584 : : u8 log_compress_mmo_size[0x5];
1585 : : u8 decompress_lz4_data_only_v2[0x1];
1586 : : u8 decompress_lz4_no_checksum_v2[0x1];
1587 : : u8 decompress_lz4_checksum_v2[0x1];
1588 : : u8 log_decompress_mmo_size[0x5];
1589 : : u8 log_max_srq_sz[0x8];
1590 : : u8 log_max_qp_sz[0x8];
1591 : : u8 reserved_at_90[0x9];
1592 : : u8 wqe_index_ignore_cap[0x1];
1593 : : u8 dynamic_qp_allocation[0x1];
1594 : : u8 log_max_qp[0x5];
1595 : : u8 reserved_at_a0[0x4];
1596 : : u8 regexp_num_of_engines[0x4];
1597 : : u8 reserved_at_a8[0x1];
1598 : : u8 reg_c_preserve[0x1];
1599 : : u8 reserved_at_aa[0x1];
1600 : : u8 log_max_srq[0x5];
1601 : : u8 reserved_at_b0[0xb];
1602 : : u8 scatter_fcs_w_decap_disable[0x1];
1603 : : u8 reserved_at_bc[0x4];
1604 : : u8 reserved_at_c0[0x8];
1605 : : u8 log_max_cq_sz[0x8];
1606 : : u8 reserved_at_d0[0x2];
1607 : : u8 access_register_user[0x1];
1608 : : u8 reserved_at_d3[0x8];
1609 : : u8 log_max_cq[0x5];
1610 : : u8 log_max_eq_sz[0x8];
1611 : : u8 relaxed_ordering_write[0x1];
1612 : : u8 relaxed_ordering_read[0x1];
1613 : : u8 log_max_mkey[0x6];
1614 : : u8 reserved_at_f0[0x8];
1615 : : u8 dump_fill_mkey[0x1];
1616 : : u8 reserved_at_f9[0x3];
1617 : : u8 log_max_eq[0x4];
1618 : : u8 max_indirection[0x8];
1619 : : u8 fixed_buffer_size[0x1];
1620 : : u8 log_max_mrw_sz[0x7];
1621 : : u8 force_teardown[0x1];
1622 : : u8 reserved_at_111[0x1];
1623 : : u8 log_max_bsf_list_size[0x6];
1624 : : u8 umr_extended_translation_offset[0x1];
1625 : : u8 null_mkey[0x1];
1626 : : u8 log_maxklm_list_size[0x6];
1627 : : u8 non_wire_sq[0x1];
1628 : : u8 reserved_at_121[0x9];
1629 : : u8 log_max_ra_req_dc[0x6];
1630 : : u8 reserved_at_130[0x3];
1631 : : u8 log_max_static_sq_wq[0x5];
1632 : : u8 reserved_at_138[0x2];
1633 : : u8 log_max_ra_res_dc[0x6];
1634 : : u8 reserved_at_140[0xa];
1635 : : u8 log_max_ra_req_qp[0x6];
1636 : : u8 rtr2rts_qp_counters_set_id[0x1];
1637 : : u8 rts2rts_udp_sport[0x1];
1638 : : u8 rts2rts_lag_tx_port_affinity[0x1];
1639 : : u8 dma_mmo_sq[0x1];
1640 : : u8 compress_min_block_size[0x4];
1641 : : u8 compress_mmo_sq[0x1];
1642 : : u8 decompress_mmo_sq[0x1];
1643 : : u8 log_max_ra_res_qp[0x6];
1644 : : u8 end_pad[0x1];
1645 : : u8 cc_query_allowed[0x1];
1646 : : u8 cc_modify_allowed[0x1];
1647 : : u8 start_pad[0x1];
1648 : : u8 cache_line_128byte[0x1];
1649 : : u8 reserved_at_165[0xa];
1650 : : u8 qcam_reg[0x1];
1651 : : u8 gid_table_size[0x10];
1652 : : u8 out_of_seq_cnt[0x1];
1653 : : u8 vport_counters[0x1];
1654 : : u8 retransmission_q_counters[0x1];
1655 : : u8 debug[0x1];
1656 : : u8 modify_rq_counter_set_id[0x1];
1657 : : u8 rq_delay_drop[0x1];
1658 : : u8 max_qp_cnt[0xa];
1659 : : u8 pkey_table_size[0x10];
1660 : : u8 vport_group_manager[0x1];
1661 : : u8 vhca_group_manager[0x1];
1662 : : u8 ib_virt[0x1];
1663 : : u8 eth_virt[0x1];
1664 : : u8 vnic_env_queue_counters[0x1];
1665 : : u8 ets[0x1];
1666 : : u8 nic_flow_table[0x1];
1667 : : u8 eswitch_manager[0x1];
1668 : : u8 device_memory[0x1];
1669 : : u8 mcam_reg[0x1];
1670 : : u8 pcam_reg[0x1];
1671 : : u8 local_ca_ack_delay[0x5];
1672 : : u8 port_module_event[0x1];
1673 : : u8 enhanced_error_q_counters[0x1];
1674 : : u8 ports_check[0x1];
1675 : : u8 reserved_at_1b3[0x1];
1676 : : u8 disable_link_up[0x1];
1677 : : u8 beacon_led[0x1];
1678 : : u8 port_type[0x2];
1679 : : u8 num_ports[0x8];
1680 : : u8 reserved_at_1c0[0x1];
1681 : : u8 pps[0x1];
1682 : : u8 pps_modify[0x1];
1683 : : u8 log_max_msg[0x5];
1684 : : u8 reserved_at_1c8[0x4];
1685 : : u8 max_tc[0x4];
1686 : : u8 temp_warn_event[0x1];
1687 : : u8 dcbx[0x1];
1688 : : u8 general_notification_event[0x1];
1689 : : u8 reserved_at_1d3[0x2];
1690 : : u8 fpga[0x1];
1691 : : u8 rol_s[0x1];
1692 : : u8 rol_g[0x1];
1693 : : u8 reserved_at_1d8[0x1];
1694 : : u8 wol_s[0x1];
1695 : : u8 wol_g[0x1];
1696 : : u8 wol_a[0x1];
1697 : : u8 wol_b[0x1];
1698 : : u8 wol_m[0x1];
1699 : : u8 wol_u[0x1];
1700 : : u8 wol_p[0x1];
1701 : : u8 stat_rate_support[0x10];
1702 : : u8 reserved_at_1ef[0xb];
1703 : : u8 wqe_based_flow_table_update_cap[0x1];
1704 : : u8 cqe_version[0x4];
1705 : : u8 compact_address_vector[0x1];
1706 : : u8 striding_rq[0x1];
1707 : : u8 reserved_at_202[0x1];
1708 : : u8 ipoib_enhanced_offloads[0x1];
1709 : : u8 ipoib_basic_offloads[0x1];
1710 : : u8 reserved_at_205[0x1];
1711 : : u8 repeated_block_disabled[0x1];
1712 : : u8 umr_modify_entity_size_disabled[0x1];
1713 : : u8 umr_modify_atomic_disabled[0x1];
1714 : : u8 umr_indirect_mkey_disabled[0x1];
1715 : : u8 umr_fence[0x2];
1716 : : u8 reserved_at_20c[0x3];
1717 : : u8 drain_sigerr[0x1];
1718 : : u8 cmdif_checksum[0x2];
1719 : : u8 sigerr_cqe[0x1];
1720 : : u8 reserved_at_213[0x1];
1721 : : u8 wq_signature[0x1];
1722 : : u8 sctr_data_cqe[0x1];
1723 : : u8 reserved_at_216[0x1];
1724 : : u8 sho[0x1];
1725 : : u8 tph[0x1];
1726 : : u8 rf[0x1];
1727 : : u8 dct[0x1];
1728 : : u8 qos[0x1];
1729 : : u8 eth_net_offloads[0x1];
1730 : : u8 roce[0x1];
1731 : : u8 atomic[0x1];
1732 : : u8 reserved_at_21f[0x1];
1733 : : u8 cq_oi[0x1];
1734 : : u8 cq_resize[0x1];
1735 : : u8 cq_moderation[0x1];
1736 : : u8 reserved_at_223[0x3];
1737 : : u8 cq_eq_remap[0x1];
1738 : : u8 pg[0x1];
1739 : : u8 block_lb_mc[0x1];
1740 : : u8 reserved_at_229[0x1];
1741 : : u8 scqe_break_moderation[0x1];
1742 : : u8 cq_period_start_from_cqe[0x1];
1743 : : u8 cd[0x1];
1744 : : u8 reserved_at_22d[0x1];
1745 : : u8 apm[0x1];
1746 : : u8 vector_calc[0x1];
1747 : : u8 umr_ptr_rlky[0x1];
1748 : : u8 imaicl[0x1];
1749 : : u8 reserved_at_232[0x4];
1750 : : u8 qkv[0x1];
1751 : : u8 pkv[0x1];
1752 : : u8 set_deth_sqpn[0x1];
1753 : : u8 reserved_at_239[0x3];
1754 : : u8 xrc[0x1];
1755 : : u8 ud[0x1];
1756 : : u8 uc[0x1];
1757 : : u8 rc[0x1];
1758 : : u8 uar_4k[0x1];
1759 : : u8 reserved_at_241[0x8];
1760 : : u8 regexp_params[0x1];
1761 : : u8 uar_sz[0x6];
1762 : : u8 port_selection_cap[0x1];
1763 : : u8 reserved_at_251[0x7];
1764 : : u8 log_pg_sz[0x8];
1765 : : u8 bf[0x1];
1766 : : u8 driver_version[0x1];
1767 : : u8 pad_tx_eth_packet[0x1];
1768 : : u8 reserved_at_263[0x8];
1769 : : u8 log_bf_reg_size[0x5];
1770 : : u8 reserved_at_270[0xb];
1771 : : u8 lag_master[0x1];
1772 : : u8 num_lag_ports[0x4];
1773 : : u8 reserved_at_280[0x10];
1774 : : u8 max_wqe_sz_sq[0x10];
1775 : : u8 reserved_at_2a0[0xc];
1776 : : u8 regexp_mmo_sq[0x1];
1777 : : u8 regexp_version[0x3];
1778 : : u8 max_wqe_sz_rq[0x10];
1779 : : u8 max_flow_counter_31_16[0x10];
1780 : : u8 max_wqe_sz_sq_dc[0x10];
1781 : : u8 reserved_at_2e0[0x7];
1782 : : u8 max_qp_mcg[0x19];
1783 : : u8 reserved_at_300[0x10];
1784 : : u8 flow_counter_bulk_alloc[0x08];
1785 : : u8 log_max_mcg[0x8];
1786 : : u8 reserved_at_320[0x3];
1787 : : u8 log_max_transport_domain[0x5];
1788 : : u8 reserved_at_328[0x3];
1789 : : u8 log_max_pd[0x5];
1790 : : u8 reserved_at_330[0xb];
1791 : : u8 log_max_xrcd[0x5];
1792 : : u8 nic_receive_steering_discard[0x1];
1793 : : u8 receive_discard_vport_down[0x1];
1794 : : u8 transmit_discard_vport_down[0x1];
1795 : : u8 reserved_at_343[0x5];
1796 : : u8 log_max_flow_counter_bulk[0x8];
1797 : : u8 max_flow_counter_15_0[0x10];
1798 : : u8 modify_tis[0x1];
1799 : : u8 flow_counters_dump[0x1];
1800 : : u8 reserved_at_360[0x1];
1801 : : u8 log_max_rq[0x5];
1802 : : u8 reserved_at_368[0x3];
1803 : : u8 log_max_sq[0x5];
1804 : : u8 reserved_at_370[0x3];
1805 : : u8 log_max_tir[0x5];
1806 : : u8 reserved_at_378[0x3];
1807 : : u8 log_max_tis[0x5];
1808 : : u8 basic_cyclic_rcv_wqe[0x1];
1809 : : u8 reserved_at_381[0x1];
1810 : : u8 mem_rq_rmp[0x1];
1811 : : u8 log_max_rmp[0x5];
1812 : : u8 reserved_at_388[0x3];
1813 : : u8 log_max_rqt[0x5];
1814 : : u8 reserved_at_390[0x3];
1815 : : u8 log_max_rqt_size[0x5];
1816 : : u8 reserved_at_398[0x3];
1817 : : u8 log_max_tis_per_sq[0x5];
1818 : : u8 ext_stride_num_range[0x1];
1819 : : u8 reserved_at_3a1[0x2];
1820 : : u8 log_max_stride_sz_rq[0x5];
1821 : : u8 reserved_at_3a8[0x3];
1822 : : u8 log_min_stride_sz_rq[0x5];
1823 : : u8 reserved_at_3b0[0x3];
1824 : : u8 log_max_stride_sz_sq[0x5];
1825 : : u8 reserved_at_3b8[0x3];
1826 : : u8 log_min_stride_sz_sq[0x5];
1827 : : u8 hairpin[0x1];
1828 : : u8 reserved_at_3c1[0x2];
1829 : : u8 log_max_hairpin_queues[0x5];
1830 : : u8 reserved_at_3c8[0x3];
1831 : : u8 log_max_hairpin_wq_data_sz[0x5];
1832 : : u8 reserved_at_3d0[0x3];
1833 : : u8 log_max_hairpin_num_packets[0x5];
1834 : : u8 reserved_at_3d8[0x3];
1835 : : u8 log_max_wq_sz[0x5];
1836 : : u8 nic_vport_change_event[0x1];
1837 : : u8 disable_local_lb_uc[0x1];
1838 : : u8 disable_local_lb_mc[0x1];
1839 : : u8 log_min_hairpin_wq_data_sz[0x5];
1840 : : u8 reserved_at_3e8[0x3];
1841 : : u8 log_max_vlan_list[0x5];
1842 : : u8 reserved_at_3f0[0x1];
1843 : : u8 aes_xts_single_block_le_tweak[1];
1844 : : u8 aes_xts_multi_block_be_tweak[1];
1845 : : u8 log_max_current_mc_list[0x5];
1846 : : u8 reserved_at_3f8[0x3];
1847 : : u8 log_max_current_uc_list[0x5];
1848 : : u8 general_obj_types[0x40];
1849 : : u8 sq_ts_format[0x2];
1850 : : u8 rq_ts_format[0x2];
1851 : : u8 steering_format_version[0x4];
1852 : : u8 reserved_at_448[0x18];
1853 : : u8 reserved_at_460[0x8];
1854 : : u8 aes_xts[0x1];
1855 : : u8 crypto[0x1];
1856 : : u8 ipsec_offload[0x1];
1857 : : u8 reserved_at_46b[0x5];
1858 : : u8 max_num_eqs[0x10];
1859 : : u8 reserved_at_480[0x3];
1860 : : u8 log_max_l2_table[0x5];
1861 : : u8 reserved_at_488[0x8];
1862 : : u8 log_uar_page_sz[0x10];
1863 : : u8 reserved_at_4a0[0x20];
1864 : : u8 device_frequency_mhz[0x20];
1865 : : u8 device_frequency_khz[0x20];
1866 : : u8 reserved_at_500[0x20];
1867 : : u8 num_of_uars_per_page[0x20];
1868 : : u8 flex_parser_protocols[0x20];
1869 : : u8 max_geneve_tlv_options[0x8];
1870 : : u8 geneve_tlv_sample[0x1];
1871 : : u8 geneve_tlv_option_offset[0x1];
1872 : : u8 reserved_at_56a[0x1];
1873 : : u8 max_geneve_tlv_option_data_len[0x5];
1874 : : u8 flex_parser_header_modify[0x1];
1875 : : u8 reserved_at_571[0x2];
1876 : : u8 log_max_guaranteed_connections[0x5];
1877 : : u8 driver_version_before_init_hca[0x1];
1878 : : u8 adv_virtualization[0x1];
1879 : : u8 reserved_at_57a[0x1];
1880 : : u8 log_max_dct_connections[0x5];
1881 : : u8 log_max_atomic_size_qp[0x8];
1882 : : u8 reserved_at_587[0x3];
1883 : : u8 log_max_dci_stream_channels[0x5];
1884 : : u8 reserved_at_58f[0x3];
1885 : : u8 log_max_dci_errored_streams[0x5];
1886 : : u8 log_max_atomic_dize_dc[0x8];
1887 : : u8 max_multi_user_ggroup_size[0x10];
1888 : : u8 enhanced_cqe_compression[0x1];
1889 : : u8 reserved_at_5b0[0x1];
1890 : : u8 crossing_vhca_mkey[0x1];
1891 : : u8 log_max_dek[0x5];
1892 : : u8 reserved_at_5b7[0x1];
1893 : : u8 mini_cqe_resp_l3_l4_tag[0x1];
1894 : : u8 mini_cqe_resp_flow_tag[0x1];
1895 : : u8 reserved_at_5ba[0x1];
1896 : : u8 mini_cqe_resp_stride_index[0x1];
1897 : : u8 cqe_128_always[0x1];
1898 : : u8 cqe_compression_128[0x1];
1899 : : u8 cqe_compression[0x1];
1900 : : u8 cqe_compression_timeout[0x10];
1901 : : u8 cqe_compression_max_num[0x10];
1902 : : u8 reserved_at_5e0[0x8];
1903 : : u8 flex_parser_id_gtpu_dw_0[0x4];
1904 : : u8 reserved_at_5ec[0x4];
1905 : : u8 tag_matching[0x1];
1906 : : u8 rndv_offload_rc[0x1];
1907 : : u8 rndv_offload_dc[0x1];
1908 : : u8 log_tag_matching_list_sz[0x5];
1909 : : u8 reserved_at_5f8[0x3];
1910 : : u8 log_max_xrq[0x5];
1911 : : u8 affiliate_nic_vport_criteria[0x8];
1912 : : u8 native_port_num[0x8];
1913 : : u8 num_vhca_ports[0x8];
1914 : : u8 flex_parser_id_gtpu_teid[0x4];
1915 : : u8 reserved_at_61c[0x2];
1916 : : u8 sw_owner_id[0x1];
1917 : : u8 reserved_at_61f[0x6C];
1918 : : u8 wait_on_data[0x1];
1919 : : u8 wait_on_time[0x1];
1920 : : u8 reserved_at_68d[0x37];
1921 : : u8 flex_parser_id_geneve_opt_0[0x4];
1922 : : u8 flex_parser_id_icmp_dw1[0x4];
1923 : : u8 flex_parser_id_icmp_dw0[0x4];
1924 : : u8 flex_parser_id_icmpv6_dw1[0x4];
1925 : : u8 flex_parser_id_icmpv6_dw0[0x4];
1926 : : u8 flex_parser_id_outer_first_mpls_over_gre[0x4];
1927 : : u8 flex_parser_id_outer_first_mpls_over_udp_label[0x4];
1928 : : u8 reserved_at_6e0[0x20];
1929 : : u8 flex_parser_id_gtpu_dw_2[0x4];
1930 : : u8 flex_parser_id_gtpu_first_ext_dw_0[0x4];
1931 : : u8 reserved_at_708[0x40];
1932 : : u8 dma_mmo_qp[0x1];
1933 : : u8 regexp_mmo_qp[0x1];
1934 : : u8 compress_mmo_qp[0x1];
1935 : : u8 decompress_deflate_v1[0x1];
1936 : : u8 reserved_at_74c[0x4];
1937 : : u8 decompress_deflate_v2[0x1];
1938 : : u8 reserved_at_751[0xf];
1939 : : u8 reserved_at_760[0x3];
1940 : : u8 log_max_num_header_modify_argument[0x5];
1941 : : u8 log_header_modify_argument_granularity_offset[0x4];
1942 : : u8 log_header_modify_argument_granularity[0x4];
1943 : : u8 reserved_at_770[0x3];
1944 : : u8 log_header_modify_argument_max_alloc[0x5];
1945 : : u8 reserved_at_778[0x8];
1946 : : u8 reserved_at_780[0x40];
1947 : : u8 match_definer_format_supported[0x40];
1948 : : };
1949 : :
1950 : : struct mlx5_ifc_qos_cap_bits {
1951 : : u8 packet_pacing[0x1];
1952 : : u8 esw_scheduling[0x1];
1953 : : u8 esw_bw_share[0x1];
1954 : : u8 esw_rate_limit[0x1];
1955 : : u8 reserved_at_4[0x1];
1956 : : u8 packet_pacing_burst_bound[0x1];
1957 : : u8 packet_pacing_typical_size[0x1];
1958 : : u8 flow_meter_old[0x1];
1959 : : u8 reserved_at_8[0x8];
1960 : : u8 log_max_flow_meter[0x8];
1961 : : u8 flow_meter_reg_id[0x8];
1962 : : u8 wqe_rate_pp[0x1];
1963 : : u8 reserved_at_25[0x7];
1964 : : u8 flow_meter[0x1];
1965 : : u8 reserved_at_2e[0x17];
1966 : : u8 packet_pacing_max_rate[0x20];
1967 : : u8 packet_pacing_min_rate[0x20];
1968 : : u8 reserved_at_80[0x10];
1969 : : u8 packet_pacing_rate_table_size[0x10];
1970 : : u8 esw_element_type[0x10];
1971 : : u8 esw_tsar_type[0x10];
1972 : : u8 reserved_at_c0[0x10];
1973 : : u8 max_qos_para_vport[0x10];
1974 : : u8 max_tsar_bw_share[0x20];
1975 : : u8 nic_element_type[0x10];
1976 : : u8 nic_tsar_type[0x10];
1977 : : u8 reserved_at_120[0x3];
1978 : : u8 log_meter_aso_granularity[0x5];
1979 : : u8 reserved_at_128[0x3];
1980 : : u8 log_meter_aso_max_alloc[0x5];
1981 : : u8 reserved_at_130[0x3];
1982 : : u8 log_max_num_meter_aso[0x5];
1983 : : u8 reserved_at_138[0x6b0];
1984 : : };
1985 : :
1986 : : struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
1987 : : u8 csum_cap[0x1];
1988 : : u8 vlan_cap[0x1];
1989 : : u8 lro_cap[0x1];
1990 : : u8 lro_psh_flag[0x1];
1991 : : u8 lro_time_stamp[0x1];
1992 : : u8 lro_max_msg_sz_mode[0x2];
1993 : : u8 wqe_vlan_insert[0x1];
1994 : : u8 self_lb_en_modifiable[0x1];
1995 : : u8 self_lb_mc[0x1];
1996 : : u8 self_lb_uc[0x1];
1997 : : u8 max_lso_cap[0x5];
1998 : : u8 multi_pkt_send_wqe[0x2];
1999 : : u8 wqe_inline_mode[0x2];
2000 : : u8 rss_ind_tbl_cap[0x4];
2001 : : u8 reg_umr_sq[0x1];
2002 : : u8 scatter_fcs[0x1];
2003 : : u8 enhanced_multi_pkt_send_wqe[0x1];
2004 : : u8 tunnel_lso_const_out_ip_id[0x1];
2005 : : u8 tunnel_lro_gre[0x1];
2006 : : u8 tunnel_lro_vxlan[0x1];
2007 : : u8 tunnel_stateless_gre[0x1];
2008 : : u8 tunnel_stateless_vxlan[0x1];
2009 : : u8 swp[0x1];
2010 : : u8 swp_csum[0x1];
2011 : : u8 swp_lso[0x1];
2012 : : u8 reserved_at_23[0x8];
2013 : : u8 tunnel_stateless_gtp[0x1];
2014 : : u8 reserved_at_25[0x2];
2015 : : u8 tunnel_stateless_vxlan_gpe_nsh[0x1];
2016 : : u8 reserved_at_28[0x1];
2017 : : u8 max_vxlan_udp_ports[0x8];
2018 : : u8 reserved_at_38[0x6];
2019 : : u8 max_geneve_opt_len[0x1];
2020 : : u8 tunnel_stateless_geneve_rx[0x1];
2021 : : u8 reserved_at_40[0x10];
2022 : : u8 lro_min_mss_size[0x10];
2023 : : u8 reserved_at_60[0x120];
2024 : : u8 lro_timer_supported_periods[4][0x20];
2025 : : u8 reserved_at_200[0x600];
2026 : : };
2027 : :
2028 : : enum {
2029 : : MLX5_VIRTQ_TYPE_SPLIT = 0,
2030 : : MLX5_VIRTQ_TYPE_PACKED = 1,
2031 : : };
2032 : :
2033 : : enum {
2034 : : MLX5_VIRTQ_EVENT_MODE_NO_MSIX = 0,
2035 : : MLX5_VIRTQ_EVENT_MODE_QP = 1,
2036 : : MLX5_VIRTQ_EVENT_MODE_MSIX = 2,
2037 : : };
2038 : :
2039 : : struct mlx5_ifc_virtio_emulation_cap_bits {
2040 : : u8 desc_tunnel_offload_type[0x1];
2041 : : u8 eth_frame_offload_type[0x1];
2042 : : u8 virtio_version_1_0[0x1];
2043 : : u8 tso_ipv4[0x1];
2044 : : u8 tso_ipv6[0x1];
2045 : : u8 tx_csum[0x1];
2046 : : u8 rx_csum[0x1];
2047 : : u8 reserved_at_7[0x1][0x9];
2048 : : u8 event_mode[0x8];
2049 : : u8 virtio_queue_type[0x8];
2050 : : u8 reserved_at_20[0x13];
2051 : : u8 log_doorbell_stride[0x5];
2052 : : u8 vnet_modify_ext[0x1];
2053 : : u8 virtio_net_q_addr_modify[0x1];
2054 : : u8 virtio_q_index_modify[0x1];
2055 : : u8 log_doorbell_bar_size[0x5];
2056 : : u8 doorbell_bar_offset[0x40];
2057 : : u8 reserved_at_80[0x8];
2058 : : u8 max_num_virtio_queues[0x18];
2059 : : u8 reserved_at_a0[0x60];
2060 : : u8 umem_1_buffer_param_a[0x20];
2061 : : u8 umem_1_buffer_param_b[0x20];
2062 : : u8 umem_2_buffer_param_a[0x20];
2063 : : u8 umem_2_buffer_param_b[0x20];
2064 : : u8 umem_3_buffer_param_a[0x20];
2065 : : u8 umem_3_buffer_param_b[0x20];
2066 : : u8 reserved_at_1c0[0x620];
2067 : : };
2068 : :
2069 : : /**
2070 : : * PARSE_GRAPH_NODE Capabilities Field Descriptions
2071 : : */
2072 : : struct mlx5_ifc_parse_graph_node_cap_bits {
2073 : : u8 node_in[0x20];
2074 : : u8 node_out[0x20];
2075 : : u8 header_length_mode[0x10];
2076 : : u8 sample_offset_mode[0x10];
2077 : : u8 max_num_arc_in[0x08];
2078 : : u8 max_num_arc_out[0x08];
2079 : : u8 max_num_sample[0x08];
2080 : : u8 reserved_at_78[0x03];
2081 : : u8 parse_graph_anchor[0x1];
2082 : : u8 reserved_at_7c[0x01];
2083 : : u8 sample_tunnel_inner2[0x1];
2084 : : u8 zero_size_supported[0x1];
2085 : : u8 sample_id_in_out[0x1];
2086 : : u8 max_base_header_length[0x10];
2087 : : u8 reserved_at_90[0x08];
2088 : : u8 max_sample_base_offset[0x08];
2089 : : u8 max_next_header_offset[0x10];
2090 : : u8 reserved_at_b0[0x08];
2091 : : u8 header_length_mask_width[0x08];
2092 : : };
2093 : :
2094 : : struct mlx5_ifc_flow_table_prop_layout_bits {
2095 : : u8 ft_support[0x1];
2096 : : u8 flow_tag[0x1];
2097 : : u8 flow_counter[0x1];
2098 : : u8 flow_modify_en[0x1];
2099 : : u8 modify_root[0x1];
2100 : : u8 identified_miss_table[0x1];
2101 : : u8 flow_table_modify[0x1];
2102 : : u8 reformat[0x1];
2103 : : u8 decap[0x1];
2104 : : u8 reset_root_to_default[0x1];
2105 : : u8 pop_vlan[0x1];
2106 : : u8 push_vlan[0x1];
2107 : : u8 fpga_vendor_acceleration[0x1];
2108 : : u8 pop_vlan_2[0x1];
2109 : : u8 push_vlan_2[0x1];
2110 : : u8 reformat_and_vlan_action[0x1];
2111 : : u8 modify_and_vlan_action[0x1];
2112 : : u8 sw_owner[0x1];
2113 : : u8 reformat_l3_tunnel_to_l2[0x1];
2114 : : u8 reformat_l2_to_l3_tunnel[0x1];
2115 : : u8 reformat_and_modify_action[0x1];
2116 : : u8 reserved_at_15[0x9];
2117 : : u8 sw_owner_v2[0x1];
2118 : : u8 reserved_at_1f[0x1];
2119 : : u8 reserved_at_20[0x2];
2120 : : u8 log_max_ft_size[0x6];
2121 : : u8 log_max_modify_header_context[0x8];
2122 : : u8 max_modify_header_actions[0x8];
2123 : : u8 max_ft_level[0x8];
2124 : : u8 reserved_at_40[0x8];
2125 : : u8 log_max_ft_sampler_num[8];
2126 : : u8 metadata_reg_b_width[0x8];
2127 : : u8 metadata_reg_a_width[0x8];
2128 : : u8 reserved_at_60[0xa];
2129 : : u8 reparse[0x1];
2130 : : u8 reserved_at_6b[0x1];
2131 : : u8 cross_vhca_object[0x1];
2132 : : u8 reformat_l2_to_l3_audp_tunnel[0x1];
2133 : : u8 reformat_l3_audp_tunnel_to_l2[0x1];
2134 : : u8 ignore_flow_level_rtc_valid[0x1];
2135 : : u8 reserved_at_70[0x8];
2136 : : u8 log_max_ft_num[0x8];
2137 : : u8 reserved_at_80[0x10];
2138 : : u8 log_max_flow_counter[0x8];
2139 : : u8 log_max_destination[0x8];
2140 : : u8 reserved_at_a0[0x18];
2141 : : u8 log_max_flow[0x8];
2142 : : u8 reserved_at_c0[0x140];
2143 : : };
2144 : :
2145 : : struct mlx5_ifc_roce_caps_bits {
2146 : : u8 reserved_0[0x1e];
2147 : : u8 qp_ts_format[0x2];
2148 : : u8 reserved_at_20[0xa0];
2149 : : u8 r_roce_max_src_udp_port[0x10];
2150 : : u8 r_roce_min_src_udp_port[0x10];
2151 : : u8 reserved_at_e0[0x720];
2152 : : };
2153 : :
2154 : : struct mlx5_ifc_ft_fields_support_bits {
2155 : : /* set_action_field_support */
2156 : : u8 outer_dmac[0x1];
2157 : : u8 outer_smac[0x1];
2158 : : u8 outer_ether_type[0x1];
2159 : : u8 reserved_at_3[0x1];
2160 : : u8 outer_first_prio[0x1];
2161 : : u8 outer_first_cfi[0x1];
2162 : : u8 outer_first_vid[0x1];
2163 : : u8 reserved_at_7[0x1];
2164 : : u8 outer_second_prio[0x1];
2165 : : u8 outer_second_cfi[0x1];
2166 : : u8 outer_second_vid[0x1];
2167 : : u8 reserved_at_b[0x1];
2168 : : u8 outer_sip[0x1];
2169 : : u8 outer_dip[0x1];
2170 : : u8 outer_frag[0x1];
2171 : : u8 outer_ip_protocol[0x1];
2172 : : u8 outer_ip_ecn[0x1];
2173 : : u8 outer_ip_dscp[0x1];
2174 : : u8 outer_udp_sport[0x1];
2175 : : u8 outer_udp_dport[0x1];
2176 : : u8 outer_tcp_sport[0x1];
2177 : : u8 outer_tcp_dport[0x1];
2178 : : u8 outer_tcp_flags[0x1];
2179 : : u8 outer_gre_protocol[0x1];
2180 : : u8 outer_gre_key[0x1];
2181 : : u8 outer_vxlan_vni[0x1];
2182 : : u8 reserved_at_1a[0x5];
2183 : : u8 source_eswitch_port[0x1]; /* end of DW0 */
2184 : : u8 inner_dmac[0x1];
2185 : : u8 inner_smac[0x1];
2186 : : u8 inner_ether_type[0x1];
2187 : : u8 reserved_at_23[0x1];
2188 : : u8 inner_first_prio[0x1];
2189 : : u8 inner_first_cfi[0x1];
2190 : : u8 inner_first_vid[0x1];
2191 : : u8 reserved_at_27[0x1];
2192 : : u8 inner_second_prio[0x1];
2193 : : u8 inner_second_cfi[0x1];
2194 : : u8 inner_second_vid[0x1];
2195 : : u8 reserved_at_2b[0x1];
2196 : : u8 inner_sip[0x1];
2197 : : u8 inner_dip[0x1];
2198 : : u8 inner_frag[0x1];
2199 : : u8 inner_ip_protocol[0x1];
2200 : : u8 inner_ip_ecn[0x1];
2201 : : u8 inner_ip_dscp[0x1];
2202 : : u8 inner_udp_sport[0x1];
2203 : : u8 inner_udp_dport[0x1];
2204 : : u8 inner_tcp_sport[0x1];
2205 : : u8 inner_tcp_dport[0x1];
2206 : : u8 inner_tcp_flags[0x1];
2207 : : u8 reserved_at_37[0x9]; /* end of DW1 */
2208 : : u8 reserved_at_40[0x20]; /* end of DW2 */
2209 : : u8 reserved_at_60[0x18];
2210 : : union {
2211 : : struct {
2212 : : u8 metadata_reg_c_7[0x1];
2213 : : u8 metadata_reg_c_6[0x1];
2214 : : u8 metadata_reg_c_5[0x1];
2215 : : u8 metadata_reg_c_4[0x1];
2216 : : u8 metadata_reg_c_3[0x1];
2217 : : u8 metadata_reg_c_2[0x1];
2218 : : u8 metadata_reg_c_1[0x1];
2219 : : u8 metadata_reg_c_0[0x1];
2220 : : };
2221 : : u8 metadata_reg_c_x[0x8];
2222 : : }; /* end of DW3 */
2223 : : /* set_action_field_support_2 */
2224 : : u8 reserved_at_80[0x37];
2225 : : u8 outer_ipv6_traffic_class[0x1];
2226 : : u8 reserved_at_B8[0x48];
2227 : : /* add_action_field_support */
2228 : : u8 reserved_at_100[0x80];
2229 : : /* add_action_field_support_2 */
2230 : : u8 reserved_at_180[0x80];
2231 : : /* copy_action_field_support */
2232 : : u8 reserved_at_200[0x80];
2233 : : /* copy_action_field_support_2 */
2234 : : u8 reserved_at_280[0x80];
2235 : : u8 reserved_at_300[0x100];
2236 : : };
2237 : :
2238 : : /*
2239 : : * Table 1872 - Flow Table Fields Supported 2 Format
2240 : : */
2241 : : struct mlx5_ifc_ft_fields_support_2_bits {
2242 : : u8 reserved_at_0[0xa];
2243 : : u8 lag_rx_port_affinity[0x1];
2244 : : u8 reserved_at_c[0x2];
2245 : : u8 hash_result[0x1];
2246 : : u8 reserved_at_e[0x1];
2247 : : u8 tunnel_header_2_3[0x1];
2248 : : u8 tunnel_header_0_1[0x1];
2249 : : u8 macsec_syndrome[0x1];
2250 : : u8 macsec_tag[0x1];
2251 : : u8 outer_lrh_sl[0x1];
2252 : : u8 inner_ipv4_ihl[0x1];
2253 : : u8 outer_ipv4_ihl[0x1];
2254 : : u8 psp_syndrome[0x1];
2255 : : u8 inner_l3_ok[0x1];
2256 : : u8 inner_l4_ok[0x1];
2257 : : u8 outer_l3_ok[0x1];
2258 : : u8 outer_l4_ok[0x1];
2259 : : u8 psp_header[0x1];
2260 : : u8 inner_ipv4_checksum_ok[0x1];
2261 : : u8 inner_l4_checksum_ok[0x1];
2262 : : u8 outer_ipv4_checksum_ok[0x1];
2263 : : u8 outer_l4_checksum_ok[0x1]; /* end of DW0 */
2264 : : u8 reserved_at_20[0x17];
2265 : : u8 outer_ipv6_traffic_class[0x1];
2266 : : union {
2267 : : struct {
2268 : : u8 metadata_reg_c_15[0x1];
2269 : : u8 metadata_reg_c_14[0x1];
2270 : : u8 metadata_reg_c_13[0x1];
2271 : : u8 metadata_reg_c_12[0x1];
2272 : : u8 metadata_reg_c_11[0x1];
2273 : : u8 metadata_reg_c_10[0x1];
2274 : : u8 metadata_reg_c_9[0x1];
2275 : : u8 metadata_reg_c_8[0x1];
2276 : : };
2277 : : u8 metadata_reg_c_8_15[0x8];
2278 : : }; /* end of DW1 */
2279 : : u8 reserved_at_40[0x40];
2280 : : };
2281 : :
2282 : : struct mlx5_ifc_flow_table_nic_cap_bits {
2283 : : u8 reserved_at_0[0x200];
2284 : : struct mlx5_ifc_flow_table_prop_layout_bits
2285 : : flow_table_properties_nic_receive;
2286 : : struct mlx5_ifc_flow_table_prop_layout_bits
2287 : : flow_table_properties_nic_receive_rdma;
2288 : : struct mlx5_ifc_flow_table_prop_layout_bits
2289 : : flow_table_properties_nic_receive_sniffer;
2290 : : struct mlx5_ifc_flow_table_prop_layout_bits
2291 : : flow_table_properties_nic_transmit;
2292 : : struct mlx5_ifc_flow_table_prop_layout_bits
2293 : : flow_table_properties_nic_transmit_rdma;
2294 : : struct mlx5_ifc_flow_table_prop_layout_bits
2295 : : flow_table_properties_nic_transmit_sniffer;
2296 : : u8 reserved_at_e00[0x200];
2297 : : struct mlx5_ifc_ft_fields_support_bits
2298 : : ft_header_modify_nic_receive;
2299 : : struct mlx5_ifc_ft_fields_support_2_bits
2300 : : ft_field_support_2_nic_receive;
2301 : : u8 reserved_at_1480[0x280];
2302 : : struct mlx5_ifc_ft_fields_support_2_bits
2303 : : ft_field_support_2_nic_transmit;
2304 : : u8 reserved_at_1780[0x480];
2305 : : struct mlx5_ifc_ft_fields_support_bits
2306 : : ft_header_modify_nic_transmit;
2307 : : u8 reserved_at_2000[0x6000];
2308 : : };
2309 : :
2310 : : struct mlx5_ifc_flow_table_esw_cap_bits {
2311 : : u8 reserved_at_0[0x800];
2312 : : struct mlx5_ifc_ft_fields_support_bits ft_header_modify_esw_fdb;
2313 : : u8 reserved_at_C00[0x800];
2314 : : struct mlx5_ifc_ft_fields_support_2_bits
2315 : : ft_field_support_2_esw_fdb;
2316 : : u8 reserved_at_1480[0x6b80];
2317 : : };
2318 : :
2319 : : enum mlx5_ifc_cross_vhca_object_to_object_supported_types {
2320 : : MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_TIR = 1 << 10,
2321 : : MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_FT = 1 << 11,
2322 : : MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_FT = 1 << 12,
2323 : : MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_RTC = 1 << 13,
2324 : : };
2325 : :
2326 : : enum mlx5_ifc_cross_vhca_allowed_objects_types {
2327 : : MLX5_CROSS_VHCA_ALLOWED_OBJS_TIR = 1 << 0x8,
2328 : : MLX5_CROSS_VHCA_ALLOWED_OBJS_FT = 1 << 0x9,
2329 : : MLX5_CROSS_VHCA_ALLOWED_OBJS_RTC = 1 << 0xa,
2330 : : };
2331 : :
2332 : : enum {
2333 : : MLX5_GENERATE_WQE_TYPE_FLOW_UPDATE = 1 << 1,
2334 : : };
2335 : :
2336 : : enum {
2337 : : MLX5_FLOW_TABLE_HASH_TYPE_CRC32,
2338 : : };
2339 : : /*
2340 : : * HCA Capabilities 2
2341 : : */
2342 : : struct mlx5_ifc_cmd_hca_cap_2_bits {
2343 : : u8 reserved_at_0[0x80]; /* End of DW4. */
2344 : : u8 reserved_at_80[0x3];
2345 : : u8 max_num_prog_sample_field[0x5];
2346 : : u8 reserved_at_88[0x3];
2347 : : u8 log_max_num_reserved_qpn[0x5];
2348 : : u8 reserved_at_90[0x3];
2349 : : u8 log_reserved_qpn_granularity[0x5];
2350 : : u8 reserved_at_98[0x3];
2351 : : u8 log_reserved_qpn_max_alloc[0x5]; /* End of DW5. */
2352 : : u8 max_reformat_insert_size[0x8];
2353 : : u8 max_reformat_insert_offset[0x8];
2354 : : u8 max_reformat_remove_size[0x8];
2355 : : u8 max_reformat_remove_offset[0x8]; /* End of DW6. */
2356 : : u8 reserved_at_c0[0x3];
2357 : : u8 log_min_stride_wqe_sz[0x5];
2358 : : u8 reserved_at_c8[0x3];
2359 : : u8 log_conn_track_granularity[0x5];
2360 : : u8 reserved_at_d0[0x3];
2361 : : u8 log_conn_track_max_alloc[0x5];
2362 : : u8 reserved_at_d8[0x3];
2363 : : u8 log_max_conn_track_offload[0x5];
2364 : : u8 cross_vhca_object_to_object_supported[0x20]; /* End of DW7. */
2365 : : u8 allowed_object_for_other_vhca_access_high[0x20];
2366 : : u8 allowed_object_for_other_vhca_access[0x20];
2367 : : u8 reserved_at_140[0x20];
2368 : : u8 reserved_at_160[0x3];
2369 : : u8 hairpin_sq_wqe_bb_size[0x5];
2370 : : u8 hairpin_sq_wq_in_host_mem[0x1];
2371 : : u8 hairpin_data_buffer_locked[0x1];
2372 : : u8 reserved_at_16a[0x16];
2373 : : u8 reserved_at_180[0x20];
2374 : : u8 reserved_at_1a0[0xa];
2375 : : u8 format_select_dw_8_6_ext[0x1];
2376 : : u8 reserved_at_1ac[0x15];
2377 : : u8 general_obj_types_127_64[0x40];
2378 : : u8 reserved_at_200[0x53];
2379 : : u8 flow_counter_bulk_log_max_alloc[0x5];
2380 : : u8 reserved_at_258[0x3];
2381 : : u8 flow_counter_bulk_log_granularity[0x5];
2382 : : u8 reserved_at_260[0x20];
2383 : : u8 format_select_dw_gtpu_dw_0[0x8];
2384 : : u8 format_select_dw_gtpu_dw_1[0x8];
2385 : : u8 format_select_dw_gtpu_dw_2[0x8];
2386 : : u8 format_select_dw_gtpu_first_ext_dw_0[0x8];
2387 : : u8 generate_wqe_type[0x20];
2388 : : u8 reserved_at_2c0[0x160];
2389 : : u8 reserved_at_420[0x18];
2390 : : u8 encap_entropy_hash_type[0x4];
2391 : : u8 flow_table_hash_type[0x4];
2392 : : u8 reserved_at_440[0x3c0];
2393 : : };
2394 : :
2395 : : struct mlx5_ifc_esw_cap_bits {
2396 : : u8 reserved_at_0[0x1d];
2397 : : u8 merged_eswitch[0x1];
2398 : : u8 reserved_at_1e[0x2];
2399 : :
2400 : : u8 reserved_at_20[0x40];
2401 : :
2402 : : u8 esw_manager_vport_number_valid[0x1];
2403 : : u8 reserved_at_61[0xf];
2404 : : u8 esw_manager_vport_number[0x10];
2405 : :
2406 : : u8 reserved_at_80[0x780];
2407 : : };
2408 : :
2409 : : struct mlx5_ifc_wqe_based_flow_table_cap_bits {
2410 : : u8 reserved_at_0[0x3];
2411 : : u8 log_max_num_ste[0x5];
2412 : : u8 reserved_at_8[0x3];
2413 : : u8 log_max_num_stc[0x5];
2414 : : u8 reserved_at_10[0x3];
2415 : : u8 log_max_num_rtc[0x5];
2416 : : u8 reserved_at_18[0x3];
2417 : : u8 log_max_num_header_modify_pattern[0x5];
2418 : : u8 rtc_hash_split_table[0x1];
2419 : : u8 rtc_linear_lookup_table[0x1];
2420 : : u8 reserved_at_22[0x1];
2421 : : u8 stc_alloc_log_granularity[0x5];
2422 : : u8 reserved_at_28[0x3];
2423 : : u8 stc_alloc_log_max[0x5];
2424 : : u8 reserved_at_30[0x3];
2425 : : u8 ste_alloc_log_granularity[0x5];
2426 : : u8 reserved_at_38[0x3];
2427 : : u8 ste_alloc_log_max[0x5];
2428 : : u8 reserved_at_40[0xb];
2429 : : u8 rtc_reparse_mode[0x5];
2430 : : u8 reserved_at_50[0x3];
2431 : : u8 rtc_index_mode[0x5];
2432 : : u8 reserved_at_58[0x3];
2433 : : u8 rtc_log_depth_max[0x5];
2434 : : u8 reserved_at_60[0x8];
2435 : : u8 max_header_modify_pattern_length[0x8];
2436 : : u8 ste_format[0x10];
2437 : : u8 stc_action_type[0x80];
2438 : : u8 header_insert_type[0x10];
2439 : : u8 header_remove_type[0x10];
2440 : : u8 trivial_match_definer[0x20];
2441 : : u8 reserved_at_140[0x1b];
2442 : : u8 rtc_max_num_hash_definer_gen_wqe[0x5];
2443 : : u8 reserved_at_160[0x18];
2444 : : u8 access_index_mode[0x8];
2445 : : u8 reserved_at_180[0x10];
2446 : : u8 ste_format_gen_wqe[0x10];
2447 : : u8 linear_match_definer_reg_c3[0x20];
2448 : : u8 fdb_jump_to_tir_stc[0x1];
2449 : : u8 reserved_at_1c1[0x1f];
2450 : : };
2451 : :
2452 : : union mlx5_ifc_hca_cap_union_bits {
2453 : : struct mlx5_ifc_cmd_hca_cap_bits cmd_hca_cap;
2454 : : struct mlx5_ifc_cmd_hca_cap_2_bits cmd_hca_cap_2;
2455 : : struct mlx5_ifc_per_protocol_networking_offload_caps_bits
2456 : : per_protocol_networking_offload_caps;
2457 : : struct mlx5_ifc_qos_cap_bits qos_cap;
2458 : : struct mlx5_ifc_virtio_emulation_cap_bits vdpa_caps;
2459 : : struct mlx5_ifc_flow_table_nic_cap_bits flow_table_nic_cap;
2460 : : struct mlx5_ifc_flow_table_esw_cap_bits flow_table_esw_cap;
2461 : : struct mlx5_ifc_esw_cap_bits esw_cap;
2462 : : struct mlx5_ifc_roce_caps_bits roce_caps;
2463 : : struct mlx5_ifc_wqe_based_flow_table_cap_bits wqe_based_flow_table_cap;
2464 : : u8 reserved_at_0[0x8000];
2465 : : };
2466 : :
2467 : : struct mlx5_ifc_set_action_in_bits {
2468 : : u8 action_type[0x4];
2469 : : u8 field[0xc];
2470 : : u8 reserved_at_10[0x3];
2471 : : u8 offset[0x5];
2472 : : u8 reserved_at_18[0x3];
2473 : : u8 length[0x5];
2474 : : u8 data[0x20];
2475 : : };
2476 : :
2477 : : struct mlx5_ifc_copy_action_in_bits {
2478 : : u8 action_type[0x4];
2479 : : u8 src_field[0xc];
2480 : : u8 reserved_at_10[0x3];
2481 : : u8 src_offset[0x5];
2482 : : u8 reserved_at_18[0x3];
2483 : : u8 length[0x5];
2484 : : u8 reserved_at_20[0x4];
2485 : : u8 dst_field[0xc];
2486 : : u8 reserved_at_30[0x3];
2487 : : u8 dst_offset[0x5];
2488 : : u8 reserved_at_38[0x8];
2489 : : };
2490 : :
2491 : : struct mlx5_ifc_query_hca_cap_out_bits {
2492 : : u8 status[0x8];
2493 : : u8 reserved_at_8[0x18];
2494 : : u8 syndrome[0x20];
2495 : : u8 reserved_at_40[0x40];
2496 : : union mlx5_ifc_hca_cap_union_bits capability;
2497 : : };
2498 : :
2499 : : struct mlx5_ifc_query_hca_cap_in_bits {
2500 : : u8 opcode[0x10];
2501 : : u8 reserved_at_10[0x10];
2502 : : u8 reserved_at_20[0x10];
2503 : : u8 op_mod[0x10];
2504 : : u8 reserved_at_40[0x40];
2505 : : };
2506 : :
2507 : : struct mlx5_ifc_mac_address_layout_bits {
2508 : : u8 reserved_at_0[0x10];
2509 : : u8 mac_addr_47_32[0x10];
2510 : : u8 mac_addr_31_0[0x20];
2511 : : };
2512 : :
2513 : : struct mlx5_ifc_nic_vport_context_bits {
2514 : : u8 reserved_at_0[0x5];
2515 : : u8 min_wqe_inline_mode[0x3];
2516 : : u8 reserved_at_8[0x15];
2517 : : u8 disable_mc_local_lb[0x1];
2518 : : u8 disable_uc_local_lb[0x1];
2519 : : u8 roce_en[0x1];
2520 : : u8 arm_change_event[0x1];
2521 : : u8 reserved_at_21[0x1a];
2522 : : u8 event_on_mtu[0x1];
2523 : : u8 event_on_promisc_change[0x1];
2524 : : u8 event_on_vlan_change[0x1];
2525 : : u8 event_on_mc_address_change[0x1];
2526 : : u8 event_on_uc_address_change[0x1];
2527 : : u8 reserved_at_40[0xc];
2528 : : u8 affiliation_criteria[0x4];
2529 : : u8 affiliated_vhca_id[0x10];
2530 : : u8 reserved_at_60[0xd0];
2531 : : u8 mtu[0x10];
2532 : : u8 system_image_guid[0x40];
2533 : : u8 port_guid[0x40];
2534 : : u8 node_guid[0x40];
2535 : : u8 reserved_at_200[0x140];
2536 : : u8 qkey_violation_counter[0x10];
2537 : : u8 reserved_at_350[0x430];
2538 : : u8 promisc_uc[0x1];
2539 : : u8 promisc_mc[0x1];
2540 : : u8 promisc_all[0x1];
2541 : : u8 reserved_at_783[0x2];
2542 : : u8 allowed_list_type[0x3];
2543 : : u8 reserved_at_788[0xc];
2544 : : u8 allowed_list_size[0xc];
2545 : : struct mlx5_ifc_mac_address_layout_bits permanent_address;
2546 : : u8 reserved_at_7e0[0x20];
2547 : : };
2548 : :
2549 : : struct mlx5_ifc_query_nic_vport_context_out_bits {
2550 : : u8 status[0x8];
2551 : : u8 reserved_at_8[0x18];
2552 : : u8 syndrome[0x20];
2553 : : u8 reserved_at_40[0x40];
2554 : : struct mlx5_ifc_nic_vport_context_bits nic_vport_context;
2555 : : };
2556 : :
2557 : : struct mlx5_ifc_query_nic_vport_context_in_bits {
2558 : : u8 opcode[0x10];
2559 : : u8 reserved_at_10[0x10];
2560 : : u8 reserved_at_20[0x10];
2561 : : u8 op_mod[0x10];
2562 : : u8 other_vport[0x1];
2563 : : u8 reserved_at_41[0xf];
2564 : : u8 vport_number[0x10];
2565 : : u8 reserved_at_60[0x5];
2566 : : u8 allowed_list_type[0x3];
2567 : : u8 reserved_at_68[0x18];
2568 : : };
2569 : :
2570 : : struct mlx5_ifc_tisc_bits {
2571 : : u8 strict_lag_tx_port_affinity[0x1];
2572 : : u8 reserved_at_1[0x3];
2573 : : u8 lag_tx_port_affinity[0x04];
2574 : : u8 reserved_at_8[0x4];
2575 : : u8 prio[0x4];
2576 : : u8 reserved_at_10[0x10];
2577 : : u8 reserved_at_20[0x100];
2578 : : u8 reserved_at_120[0x8];
2579 : : u8 transport_domain[0x18];
2580 : : u8 reserved_at_140[0x8];
2581 : : u8 underlay_qpn[0x18];
2582 : : u8 reserved_at_160[0x3a0];
2583 : : };
2584 : :
2585 : : struct mlx5_ifc_query_tis_out_bits {
2586 : : u8 status[0x8];
2587 : : u8 reserved_at_8[0x18];
2588 : : u8 syndrome[0x20];
2589 : : u8 reserved_at_40[0x40];
2590 : : struct mlx5_ifc_tisc_bits tis_context;
2591 : : };
2592 : :
2593 : : struct mlx5_ifc_query_tis_in_bits {
2594 : : u8 opcode[0x10];
2595 : : u8 reserved_at_10[0x10];
2596 : : u8 reserved_at_20[0x10];
2597 : : u8 op_mod[0x10];
2598 : : u8 reserved_at_40[0x8];
2599 : : u8 tisn[0x18];
2600 : : u8 reserved_at_60[0x20];
2601 : : };
2602 : :
2603 : : /* port_select_mode definition. */
2604 : : enum mlx5_lag_mode_type {
2605 : : MLX5_LAG_MODE_TIS = 0,
2606 : : MLX5_LAG_MODE_HASH = 1,
2607 : : };
2608 : :
2609 : : struct mlx5_ifc_lag_context_bits {
2610 : : u8 fdb_selection_mode[0x1];
2611 : : u8 reserved_at_1[0x14];
2612 : : u8 port_select_mode[0x3];
2613 : : u8 reserved_at_18[0x5];
2614 : : u8 lag_state[0x3];
2615 : : u8 reserved_at_20[0x14];
2616 : : u8 tx_remap_affinity_2[0x4];
2617 : : u8 reserved_at_38[0x4];
2618 : : u8 tx_remap_affinity_1[0x4];
2619 : : };
2620 : :
2621 : : struct mlx5_ifc_query_lag_in_bits {
2622 : : u8 opcode[0x10];
2623 : : u8 uid[0x10];
2624 : : u8 reserved_at_20[0x10];
2625 : : u8 op_mod[0x10];
2626 : : u8 reserved_at_40[0x40];
2627 : : };
2628 : :
2629 : : struct mlx5_ifc_query_lag_out_bits {
2630 : : u8 status[0x8];
2631 : : u8 reserved_at_8[0x18];
2632 : : u8 syndrome[0x20];
2633 : : struct mlx5_ifc_lag_context_bits context;
2634 : : };
2635 : :
2636 : : struct mlx5_ifc_alloc_transport_domain_out_bits {
2637 : : u8 status[0x8];
2638 : : u8 reserved_at_8[0x18];
2639 : : u8 syndrome[0x20];
2640 : : u8 reserved_at_40[0x8];
2641 : : u8 transport_domain[0x18];
2642 : : u8 reserved_at_60[0x20];
2643 : : };
2644 : :
2645 : : struct mlx5_ifc_alloc_transport_domain_in_bits {
2646 : : u8 opcode[0x10];
2647 : : u8 reserved_at_10[0x10];
2648 : : u8 reserved_at_20[0x10];
2649 : : u8 op_mod[0x10];
2650 : : u8 reserved_at_40[0x40];
2651 : : };
2652 : :
2653 : : enum {
2654 : : MLX5_WQ_TYPE_LINKED_LIST = 0x0,
2655 : : MLX5_WQ_TYPE_CYCLIC = 0x1,
2656 : : MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ = 0x2,
2657 : : MLX5_WQ_TYPE_CYCLIC_STRIDING_RQ = 0x3,
2658 : : };
2659 : :
2660 : : enum {
2661 : : MLX5_WQ_END_PAD_MODE_NONE = 0x0,
2662 : : MLX5_WQ_END_PAD_MODE_ALIGN = 0x1,
2663 : : };
2664 : :
2665 : : struct mlx5_ifc_wq_bits {
2666 : : u8 wq_type[0x4];
2667 : : u8 wq_signature[0x1];
2668 : : u8 end_padding_mode[0x2];
2669 : : u8 cd_slave[0x1];
2670 : : u8 reserved_at_8[0x18];
2671 : : u8 hds_skip_first_sge[0x1];
2672 : : u8 log2_hds_buf_size[0x3];
2673 : : u8 reserved_at_24[0x7];
2674 : : u8 page_offset[0x5];
2675 : : u8 lwm[0x10];
2676 : : u8 reserved_at_40[0x8];
2677 : : u8 pd[0x18];
2678 : : u8 reserved_at_60[0x8];
2679 : : u8 uar_page[0x18];
2680 : : u8 dbr_addr[0x40];
2681 : : u8 hw_counter[0x20];
2682 : : u8 sw_counter[0x20];
2683 : : u8 reserved_at_100[0xc];
2684 : : u8 log_wq_stride[0x4];
2685 : : u8 reserved_at_110[0x3];
2686 : : u8 log_wq_pg_sz[0x5];
2687 : : u8 reserved_at_118[0x3];
2688 : : u8 log_wq_sz[0x5];
2689 : : u8 dbr_umem_valid[0x1];
2690 : : u8 wq_umem_valid[0x1];
2691 : : u8 reserved_at_122[0x1];
2692 : : u8 log_hairpin_num_packets[0x5];
2693 : : u8 reserved_at_128[0x3];
2694 : : u8 log_hairpin_data_sz[0x5];
2695 : : u8 reserved_at_130[0x4];
2696 : : u8 single_wqe_log_num_of_strides[0x4];
2697 : : u8 two_byte_shift_en[0x1];
2698 : : u8 reserved_at_139[0x4];
2699 : : u8 single_stride_log_num_of_bytes[0x3];
2700 : : u8 dbr_umem_id[0x20];
2701 : : u8 wq_umem_id[0x20];
2702 : : u8 wq_umem_offset[0x40];
2703 : : u8 reserved_at_1c0[0x440];
2704 : : };
2705 : :
2706 : : enum {
2707 : : MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_INLINE = 0x0,
2708 : : MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_RMP = 0x1,
2709 : : };
2710 : :
2711 : : enum {
2712 : : MLX5_RQC_STATE_RST = 0x0,
2713 : : MLX5_RQC_STATE_RDY = 0x1,
2714 : : MLX5_RQC_STATE_ERR = 0x3,
2715 : : };
2716 : :
2717 : : struct mlx5_ifc_rqc_bits {
2718 : : u8 rlky[0x1];
2719 : : u8 delay_drop_en[0x1];
2720 : : u8 scatter_fcs[0x1];
2721 : : u8 vsd[0x1];
2722 : : u8 mem_rq_type[0x4];
2723 : : u8 state[0x4];
2724 : : u8 reserved_at_c[0x1];
2725 : : u8 flush_in_error_en[0x1];
2726 : : u8 hairpin[0x1];
2727 : : u8 reserved_at_f[0x6];
2728 : : u8 hairpin_data_buffer_type[0x3];
2729 : : u8 reserved_at_a8[0x2];
2730 : : u8 ts_format[0x02];
2731 : : u8 reserved_at_1c[0x4];
2732 : : u8 reserved_at_20[0x8];
2733 : : u8 user_index[0x18];
2734 : : u8 reserved_at_40[0x8];
2735 : : u8 cqn[0x18];
2736 : : u8 counter_set_id[0x8];
2737 : : u8 reserved_at_68[0x18];
2738 : : u8 reserved_at_80[0x8];
2739 : : u8 rmpn[0x18];
2740 : : u8 reserved_at_a0[0x8];
2741 : : u8 hairpin_peer_sq[0x18];
2742 : : u8 reserved_at_c0[0x10];
2743 : : u8 hairpin_peer_vhca[0x10];
2744 : : u8 reserved_at_e0[0xa0];
2745 : : struct mlx5_ifc_wq_bits wq; /* Not used in LRO RQ. */
2746 : : };
2747 : :
2748 : : struct mlx5_ifc_create_rq_out_bits {
2749 : : u8 status[0x8];
2750 : : u8 reserved_at_8[0x18];
2751 : : u8 syndrome[0x20];
2752 : : u8 reserved_at_40[0x8];
2753 : : u8 rqn[0x18];
2754 : : u8 reserved_at_60[0x20];
2755 : : };
2756 : :
2757 : : struct mlx5_ifc_create_rq_in_bits {
2758 : : u8 opcode[0x10];
2759 : : u8 uid[0x10];
2760 : : u8 reserved_at_20[0x10];
2761 : : u8 op_mod[0x10];
2762 : : u8 reserved_at_40[0xc0];
2763 : : struct mlx5_ifc_rqc_bits ctx;
2764 : : };
2765 : :
2766 : : struct mlx5_ifc_modify_rq_out_bits {
2767 : : u8 status[0x8];
2768 : : u8 reserved_at_8[0x18];
2769 : : u8 syndrome[0x20];
2770 : : u8 reserved_at_40[0x40];
2771 : : };
2772 : :
2773 : : struct mlx5_ifc_query_rq_out_bits {
2774 : : u8 status[0x8];
2775 : : u8 reserved_at_8[0x18];
2776 : : u8 syndrome[0x20];
2777 : : u8 reserved_at_40[0xc0];
2778 : : struct mlx5_ifc_rqc_bits rq_context;
2779 : : };
2780 : :
2781 : : struct mlx5_ifc_query_rq_in_bits {
2782 : : u8 opcode[0x10];
2783 : : u8 reserved_at_10[0x10];
2784 : : u8 reserved_at_20[0x10];
2785 : : u8 op_mod[0x10];
2786 : : u8 reserved_at_40[0x8];
2787 : : u8 rqn[0x18];
2788 : : u8 reserved_at_60[0x20];
2789 : : };
2790 : :
2791 : : enum {
2792 : : MLX5_RMPC_STATE_RDY = 0x1,
2793 : : MLX5_RMPC_STATE_ERR = 0x3,
2794 : : };
2795 : :
2796 : : struct mlx5_ifc_rmpc_bits {
2797 : : u8 reserved_at_0[0x8];
2798 : : u8 state[0x4];
2799 : : u8 reserved_at_c[0x14];
2800 : : u8 basic_cyclic_rcv_wqe[0x1];
2801 : : u8 reserved_at_21[0x1f];
2802 : : u8 reserved_at_40[0x140];
2803 : : struct mlx5_ifc_wq_bits wq;
2804 : : };
2805 : :
2806 : : struct mlx5_ifc_query_rmp_out_bits {
2807 : : u8 status[0x8];
2808 : : u8 reserved_at_8[0x18];
2809 : : u8 syndrome[0x20];
2810 : : u8 reserved_at_40[0xc0];
2811 : : struct mlx5_ifc_rmpc_bits rmp_context;
2812 : : };
2813 : :
2814 : : struct mlx5_ifc_query_rmp_in_bits {
2815 : : u8 opcode[0x10];
2816 : : u8 reserved_at_10[0x10];
2817 : : u8 reserved_at_20[0x10];
2818 : : u8 op_mod[0x10];
2819 : : u8 reserved_at_40[0x8];
2820 : : u8 rmpn[0x18];
2821 : : u8 reserved_at_60[0x20];
2822 : : };
2823 : :
2824 : : struct mlx5_ifc_modify_rmp_out_bits {
2825 : : u8 status[0x8];
2826 : : u8 reserved_at_8[0x18];
2827 : : u8 syndrome[0x20];
2828 : : u8 reserved_at_40[0x40];
2829 : : };
2830 : :
2831 : : struct mlx5_ifc_rmp_bitmask_bits {
2832 : : u8 reserved_at_0[0x20];
2833 : : u8 reserved_at_20[0x1f];
2834 : : u8 lwm[0x1];
2835 : : };
2836 : :
2837 : : struct mlx5_ifc_modify_rmp_in_bits {
2838 : : u8 opcode[0x10];
2839 : : u8 uid[0x10];
2840 : : u8 reserved_at_20[0x10];
2841 : : u8 op_mod[0x10];
2842 : : u8 rmp_state[0x4];
2843 : : u8 reserved_at_44[0x4];
2844 : : u8 rmpn[0x18];
2845 : : u8 reserved_at_60[0x20];
2846 : : struct mlx5_ifc_rmp_bitmask_bits bitmask;
2847 : : u8 reserved_at_c0[0x40];
2848 : : struct mlx5_ifc_rmpc_bits ctx;
2849 : : };
2850 : :
2851 : : struct mlx5_ifc_create_rmp_out_bits {
2852 : : u8 status[0x8];
2853 : : u8 reserved_at_8[0x18];
2854 : : u8 syndrome[0x20];
2855 : : u8 reserved_at_40[0x8];
2856 : : u8 rmpn[0x18];
2857 : : u8 reserved_at_60[0x20];
2858 : : };
2859 : :
2860 : : struct mlx5_ifc_create_rmp_in_bits {
2861 : : u8 opcode[0x10];
2862 : : u8 uid[0x10];
2863 : : u8 reserved_at_20[0x10];
2864 : : u8 op_mod[0x10];
2865 : : u8 reserved_at_40[0xc0];
2866 : : struct mlx5_ifc_rmpc_bits ctx;
2867 : : };
2868 : :
2869 : : struct mlx5_ifc_create_tis_out_bits {
2870 : : u8 status[0x8];
2871 : : u8 reserved_at_8[0x18];
2872 : : u8 syndrome[0x20];
2873 : : u8 reserved_at_40[0x8];
2874 : : u8 tisn[0x18];
2875 : : u8 reserved_at_60[0x20];
2876 : : };
2877 : :
2878 : : struct mlx5_ifc_create_tis_in_bits {
2879 : : u8 opcode[0x10];
2880 : : u8 uid[0x10];
2881 : : u8 reserved_at_20[0x10];
2882 : : u8 op_mod[0x10];
2883 : : u8 reserved_at_40[0xc0];
2884 : : struct mlx5_ifc_tisc_bits ctx;
2885 : : };
2886 : :
2887 : : enum {
2888 : : MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_WQ_LWM = 1ULL << 0,
2889 : : MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD = 1ULL << 1,
2890 : : MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_SCATTER_FCS = 1ULL << 2,
2891 : : MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_RQ_COUNTER_SET_ID = 1ULL << 3,
2892 : : };
2893 : :
2894 : : struct mlx5_ifc_modify_rq_in_bits {
2895 : : u8 opcode[0x10];
2896 : : u8 uid[0x10];
2897 : : u8 reserved_at_20[0x10];
2898 : : u8 op_mod[0x10];
2899 : : u8 rq_state[0x4];
2900 : : u8 reserved_at_44[0x4];
2901 : : u8 rqn[0x18];
2902 : : u8 reserved_at_60[0x20];
2903 : : u8 modify_bitmask[0x40];
2904 : : u8 reserved_at_c0[0x40];
2905 : : struct mlx5_ifc_rqc_bits ctx;
2906 : : };
2907 : :
2908 : : enum {
2909 : : MLX5_L3_PROT_TYPE_IPV4 = 0,
2910 : : MLX5_L3_PROT_TYPE_IPV6 = 1,
2911 : : };
2912 : :
2913 : : enum {
2914 : : MLX5_L4_PROT_TYPE_TCP = 0,
2915 : : MLX5_L4_PROT_TYPE_UDP = 1,
2916 : : };
2917 : :
2918 : : enum {
2919 : : MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_SRC_IP = 0x0,
2920 : : MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_DST_IP = 0x1,
2921 : : MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_SPORT = 0x2,
2922 : : MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_DPORT = 0x3,
2923 : : MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_IPSEC_SPI = 0x4,
2924 : : };
2925 : :
2926 : : struct mlx5_ifc_rx_hash_field_select_bits {
2927 : : u8 l3_prot_type[0x1];
2928 : : u8 l4_prot_type[0x1];
2929 : : u8 selected_fields[0x1e];
2930 : : };
2931 : :
2932 : : enum {
2933 : : MLX5_TIRC_DISP_TYPE_DIRECT = 0x0,
2934 : : MLX5_TIRC_DISP_TYPE_INDIRECT = 0x1,
2935 : : };
2936 : :
2937 : : enum {
2938 : : MLX5_TIRC_LRO_ENABLE_MASK_IPV4_LRO = 0x1,
2939 : : MLX5_TIRC_LRO_ENABLE_MASK_IPV6_LRO = 0x2,
2940 : : };
2941 : :
2942 : : enum {
2943 : : MLX5_RX_HASH_FN_NONE = 0x0,
2944 : : MLX5_RX_HASH_FN_INVERTED_XOR8 = 0x1,
2945 : : MLX5_RX_HASH_FN_TOEPLITZ = 0x2,
2946 : : };
2947 : :
2948 : : enum {
2949 : : MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST = 0x1,
2950 : : MLX5_TIRC_SELF_LB_BLOCK_BLOCK_MULTICAST = 0x2,
2951 : : };
2952 : :
2953 : : enum {
2954 : : MLX5_LRO_MAX_MSG_SIZE_START_FROM_L4 = 0x0,
2955 : : MLX5_LRO_MAX_MSG_SIZE_START_FROM_L2 = 0x1,
2956 : : };
2957 : :
2958 : : struct mlx5_ifc_tirc_bits {
2959 : : u8 reserved_at_0[0x20];
2960 : : u8 disp_type[0x4];
2961 : : u8 reserved_at_24[0x1c];
2962 : : u8 reserved_at_40[0x40];
2963 : : u8 reserved_at_80[0x4];
2964 : : u8 lro_timeout_period_usecs[0x10];
2965 : : u8 lro_enable_mask[0x4];
2966 : : u8 lro_max_msg_sz[0x8];
2967 : : u8 reserved_at_a0[0x40];
2968 : : u8 reserved_at_e0[0x8];
2969 : : u8 inline_rqn[0x18];
2970 : : u8 rx_hash_symmetric[0x1];
2971 : : u8 reserved_at_101[0x1];
2972 : : u8 tunneled_offload_en[0x1];
2973 : : u8 reserved_at_103[0x5];
2974 : : u8 indirect_table[0x18];
2975 : : u8 rx_hash_fn[0x4];
2976 : : u8 reserved_at_124[0x2];
2977 : : u8 self_lb_block[0x2];
2978 : : u8 transport_domain[0x18];
2979 : : u8 rx_hash_toeplitz_key[10][0x20];
2980 : : struct mlx5_ifc_rx_hash_field_select_bits rx_hash_field_selector_outer;
2981 : : struct mlx5_ifc_rx_hash_field_select_bits rx_hash_field_selector_inner;
2982 : : u8 reserved_at_2c0[0x4c0];
2983 : : };
2984 : :
2985 : : struct mlx5_ifc_create_tir_out_bits {
2986 : : u8 status[0x8];
2987 : : u8 reserved_at_8[0x18];
2988 : : u8 syndrome[0x20];
2989 : : u8 reserved_at_40[0x8];
2990 : : u8 tirn[0x18];
2991 : : u8 reserved_at_60[0x20];
2992 : : };
2993 : :
2994 : : struct mlx5_ifc_create_tir_in_bits {
2995 : : u8 opcode[0x10];
2996 : : u8 uid[0x10];
2997 : : u8 reserved_at_20[0x10];
2998 : : u8 op_mod[0x10];
2999 : : u8 reserved_at_40[0xc0];
3000 : : struct mlx5_ifc_tirc_bits ctx;
3001 : : };
3002 : :
3003 : : enum {
3004 : : MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_LRO = 1ULL << 0,
3005 : : MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_INDIRECT_TABLE = 1ULL << 1,
3006 : : MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_HASH = 1ULL << 2,
3007 : : /* bit 3 - tunneled_offload_en modify not supported. */
3008 : : MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_SELF_LB_EN = 1ULL << 4,
3009 : : };
3010 : :
3011 : : struct mlx5_ifc_modify_tir_out_bits {
3012 : : u8 status[0x8];
3013 : : u8 reserved_at_8[0x18];
3014 : : u8 syndrome[0x20];
3015 : : u8 reserved_at_40[0x40];
3016 : : };
3017 : :
3018 : : struct mlx5_ifc_modify_tir_in_bits {
3019 : : u8 opcode[0x10];
3020 : : u8 uid[0x10];
3021 : : u8 reserved_at_20[0x10];
3022 : : u8 op_mod[0x10];
3023 : : u8 reserved_at_40[0x8];
3024 : : u8 tirn[0x18];
3025 : : u8 reserved_at_60[0x20];
3026 : : u8 modify_bitmask[0x40];
3027 : : u8 reserved_at_c0[0x40];
3028 : : struct mlx5_ifc_tirc_bits ctx;
3029 : : };
3030 : :
3031 : : enum {
3032 : : MLX5_INLINE_Q_TYPE_RQ = 0x0,
3033 : : MLX5_INLINE_Q_TYPE_VIRTQ = 0x1,
3034 : : };
3035 : :
3036 : : struct mlx5_ifc_rq_num_bits {
3037 : : u8 reserved_at_0[0x8];
3038 : : u8 rq_num[0x18];
3039 : : };
3040 : :
3041 : : struct mlx5_ifc_rqtc_bits {
3042 : : u8 reserved_at_0[0xa5];
3043 : : u8 list_q_type[0x3];
3044 : : u8 reserved_at_a8[0x8];
3045 : : u8 rqt_max_size[0x10];
3046 : : u8 reserved_at_c0[0x10];
3047 : : u8 rqt_actual_size[0x10];
3048 : : u8 reserved_at_e0[0x6a0];
3049 : : struct mlx5_ifc_rq_num_bits rq_num[];
3050 : : };
3051 : :
3052 : : struct mlx5_ifc_create_rqt_out_bits {
3053 : : u8 status[0x8];
3054 : : u8 reserved_at_8[0x18];
3055 : : u8 syndrome[0x20];
3056 : : u8 reserved_at_40[0x8];
3057 : : u8 rqtn[0x18];
3058 : : u8 reserved_at_60[0x20];
3059 : : };
3060 : :
3061 : : #ifdef PEDANTIC
3062 : : #pragma GCC diagnostic ignored "-Wpedantic"
3063 : : #endif
3064 : : struct mlx5_ifc_create_rqt_in_bits {
3065 : : u8 opcode[0x10];
3066 : : u8 uid[0x10];
3067 : : u8 reserved_at_20[0x10];
3068 : : u8 op_mod[0x10];
3069 : : u8 reserved_at_40[0xc0];
3070 : : struct mlx5_ifc_rqtc_bits rqt_context;
3071 : : };
3072 : :
3073 : : struct mlx5_ifc_modify_rqt_in_bits {
3074 : : u8 opcode[0x10];
3075 : : u8 uid[0x10];
3076 : : u8 reserved_at_20[0x10];
3077 : : u8 op_mod[0x10];
3078 : : u8 reserved_at_40[0x8];
3079 : : u8 rqtn[0x18];
3080 : : u8 reserved_at_60[0x20];
3081 : : u8 modify_bitmask[0x40];
3082 : : u8 reserved_at_c0[0x40];
3083 : : struct mlx5_ifc_rqtc_bits rqt_context;
3084 : : };
3085 : : #ifdef PEDANTIC
3086 : : #pragma GCC diagnostic error "-Wpedantic"
3087 : : #endif
3088 : :
3089 : : struct mlx5_ifc_modify_rqt_out_bits {
3090 : : u8 status[0x8];
3091 : : u8 reserved_at_8[0x18];
3092 : : u8 syndrome[0x20];
3093 : : u8 reserved_at_40[0x40];
3094 : : };
3095 : :
3096 : : enum {
3097 : : MLX5_SQC_STATE_RST = 0x0,
3098 : : MLX5_SQC_STATE_RDY = 0x1,
3099 : : MLX5_SQC_STATE_ERR = 0x3,
3100 : : };
3101 : :
3102 : : enum {
3103 : : MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_INTERNAL_BUFFER = 0x0,
3104 : : MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_HOST_MEMORY = 0x1,
3105 : : };
3106 : :
3107 : : struct mlx5_ifc_sqc_bits {
3108 : : u8 rlky[0x1];
3109 : : u8 cd_master[0x1];
3110 : : u8 fre[0x1];
3111 : : u8 flush_in_error_en[0x1];
3112 : : u8 allow_multi_pkt_send_wqe[0x1];
3113 : : u8 min_wqe_inline_mode[0x3];
3114 : : u8 state[0x4];
3115 : : u8 reg_umr[0x1];
3116 : : u8 allow_swp[0x1];
3117 : : u8 hairpin[0x1];
3118 : : u8 non_wire[0x1];
3119 : : u8 static_sq_wq[0x1];
3120 : : u8 reserved_at_11[0x4];
3121 : : u8 hairpin_wq_buffer_type[0x3];
3122 : : u8 reserved_at_18[0x2];
3123 : : u8 ts_format[0x02];
3124 : : u8 reserved_at_1c[0x4];
3125 : : u8 reserved_at_20[0x8];
3126 : : u8 user_index[0x18];
3127 : : u8 reserved_at_40[0x8];
3128 : : u8 cqn[0x18];
3129 : : u8 reserved_at_60[0x8];
3130 : : u8 hairpin_peer_rq[0x18];
3131 : : u8 reserved_at_80[0x10];
3132 : : u8 hairpin_peer_vhca[0x10];
3133 : : u8 reserved_at_a0[0x50];
3134 : : u8 packet_pacing_rate_limit_index[0x10];
3135 : : u8 tis_lst_sz[0x10];
3136 : : u8 reserved_at_110[0x10];
3137 : : u8 reserved_at_120[0x40];
3138 : : u8 reserved_at_160[0x8];
3139 : : u8 tis_num_0[0x18];
3140 : : struct mlx5_ifc_wq_bits wq;
3141 : : };
3142 : :
3143 : : struct mlx5_ifc_query_sq_in_bits {
3144 : : u8 opcode[0x10];
3145 : : u8 reserved_at_10[0x10];
3146 : : u8 reserved_at_20[0x10];
3147 : : u8 op_mod[0x10];
3148 : : u8 reserved_at_40[0x8];
3149 : : u8 sqn[0x18];
3150 : : u8 reserved_at_60[0x20];
3151 : : };
3152 : :
3153 : : struct mlx5_ifc_modify_sq_out_bits {
3154 : : u8 status[0x8];
3155 : : u8 reserved_at_8[0x18];
3156 : : u8 syndrome[0x20];
3157 : : u8 reserved_at_40[0x40];
3158 : : };
3159 : :
3160 : : struct mlx5_ifc_modify_sq_in_bits {
3161 : : u8 opcode[0x10];
3162 : : u8 uid[0x10];
3163 : : u8 reserved_at_20[0x10];
3164 : : u8 op_mod[0x10];
3165 : : u8 sq_state[0x4];
3166 : : u8 reserved_at_44[0x4];
3167 : : u8 sqn[0x18];
3168 : : u8 reserved_at_60[0x20];
3169 : : u8 modify_bitmask[0x40];
3170 : : u8 reserved_at_c0[0x40];
3171 : : struct mlx5_ifc_sqc_bits ctx;
3172 : : };
3173 : :
3174 : : struct mlx5_ifc_create_sq_out_bits {
3175 : : u8 status[0x8];
3176 : : u8 reserved_at_8[0x18];
3177 : : u8 syndrome[0x20];
3178 : : u8 reserved_at_40[0x8];
3179 : : u8 sqn[0x18];
3180 : : u8 reserved_at_60[0x20];
3181 : : };
3182 : :
3183 : : struct mlx5_ifc_create_sq_in_bits {
3184 : : u8 opcode[0x10];
3185 : : u8 uid[0x10];
3186 : : u8 reserved_at_20[0x10];
3187 : : u8 op_mod[0x10];
3188 : : u8 reserved_at_40[0xc0];
3189 : : struct mlx5_ifc_sqc_bits ctx;
3190 : : };
3191 : :
3192 : : enum {
3193 : : MLX5_FLOW_METER_OBJ_MODIFY_FIELD_ACTIVE = (1ULL << 0),
3194 : : MLX5_FLOW_METER_OBJ_MODIFY_FIELD_CBS = (1ULL << 1),
3195 : : MLX5_FLOW_METER_OBJ_MODIFY_FIELD_CIR = (1ULL << 2),
3196 : : MLX5_FLOW_METER_OBJ_MODIFY_FIELD_EBS = (1ULL << 3),
3197 : : MLX5_FLOW_METER_OBJ_MODIFY_FIELD_EIR = (1ULL << 4),
3198 : : };
3199 : :
3200 : : struct mlx5_ifc_flow_meter_parameters_bits {
3201 : : u8 valid[0x1];
3202 : : u8 bucket_overflow[0x1];
3203 : : u8 start_color[0x2];
3204 : : u8 both_buckets_on_green[0x1];
3205 : : u8 meter_mode[0x2];
3206 : : u8 reserved_at_1[0x19];
3207 : : u8 reserved_at_2[0x20];
3208 : : u8 reserved_at_3[0x3];
3209 : : u8 cbs_exponent[0x5];
3210 : : u8 cbs_mantissa[0x8];
3211 : : u8 reserved_at_4[0x3];
3212 : : u8 cir_exponent[0x5];
3213 : : u8 cir_mantissa[0x8];
3214 : : u8 reserved_at_5[0x20];
3215 : : u8 reserved_at_6[0x3];
3216 : : u8 ebs_exponent[0x5];
3217 : : u8 ebs_mantissa[0x8];
3218 : : u8 reserved_at_7[0x3];
3219 : : u8 eir_exponent[0x5];
3220 : : u8 eir_mantissa[0x8];
3221 : : u8 reserved_at_8[0x60];
3222 : : };
3223 : : #define MLX5_IFC_FLOW_METER_PARAM_MASK UINT64_C(0x80FFFFFF)
3224 : : #define MLX5_IFC_FLOW_METER_DISABLE_CBS_CIR_VAL 0x14BF00C8
3225 : :
3226 : : enum {
3227 : : MLX5_METER_MODE_IP_LEN = 0x0,
3228 : : MLX5_METER_MODE_L2_LEN = 0x1,
3229 : : MLX5_METER_MODE_L2_IPG_LEN = 0x2,
3230 : : MLX5_METER_MODE_PKT = 0x3,
3231 : : };
3232 : :
3233 : : enum {
3234 : : MLX5_CQE_SIZE_64B = 0x0,
3235 : : MLX5_CQE_SIZE_128B = 0x1,
3236 : : };
3237 : :
3238 : : enum {
3239 : : MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_UNLOCKED_INTERNAL_BUFFER = 0x0,
3240 : : MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_LOCKED_INTERNAL_BUFFER = 0x1,
3241 : : };
3242 : :
3243 : : struct mlx5_ifc_cqc_bits {
3244 : : u8 status[0x4];
3245 : : u8 as_notify[0x1];
3246 : : u8 initiator_src_dct[0x1];
3247 : : u8 dbr_umem_valid[0x1];
3248 : : u8 ext_element[0x1];
3249 : : u8 cqe_sz[0x3];
3250 : : u8 cc[0x1];
3251 : : u8 reserved_at_c[0x1];
3252 : : u8 scqe_break_moderation_en[0x1];
3253 : : u8 oi[0x1];
3254 : : u8 cq_period_mode[0x2];
3255 : : u8 cqe_comp_en[0x1];
3256 : : u8 mini_cqe_res_format[0x2];
3257 : : u8 st[0x4];
3258 : : u8 always_armed_cq[0x1];
3259 : : u8 ext_element_type[0x3];
3260 : : u8 reserved_at_1c[0x2];
3261 : : u8 cqe_comp_layout[0x2];
3262 : : u8 dbr_umem_id[0x20];
3263 : : u8 reserved_at_40[0x14];
3264 : : u8 page_offset[0x6];
3265 : : u8 reserved_at_5a[0x2];
3266 : : u8 mini_cqe_res_format_ext[0x2];
3267 : : u8 cq_timestamp_format[0x2];
3268 : : u8 reserved_at_60[0x3];
3269 : : u8 log_cq_size[0x5];
3270 : : u8 uar_page[0x18];
3271 : : u8 reserved_at_80[0x4];
3272 : : u8 cq_period[0xc];
3273 : : u8 cq_max_count[0x10];
3274 : : u8 reserved_at_a0[0x18];
3275 : : u8 c_eqn[0x8];
3276 : : u8 reserved_at_c0[0x3];
3277 : : u8 log_page_size[0x5];
3278 : : u8 reserved_at_c8[0x18];
3279 : : u8 reserved_at_e0[0x20];
3280 : : u8 reserved_at_100[0x8];
3281 : : u8 last_notified_index[0x18];
3282 : : u8 reserved_at_120[0x8];
3283 : : u8 last_solicit_index[0x18];
3284 : : u8 reserved_at_140[0x8];
3285 : : u8 consumer_counter[0x18];
3286 : : u8 reserved_at_160[0x8];
3287 : : u8 producer_counter[0x18];
3288 : : u8 local_partition_id[0xc];
3289 : : u8 process_id[0x14];
3290 : : u8 reserved_at_1A0[0x20];
3291 : : u8 dbr_addr[0x40];
3292 : : };
3293 : :
3294 : : struct mlx5_ifc_health_buffer_bits {
3295 : : u8 reserved_0[0x100];
3296 : : u8 assert_existptr[0x20];
3297 : : u8 assert_callra[0x20];
3298 : : u8 reserved_1[0x40];
3299 : : u8 fw_version[0x20];
3300 : : u8 hw_id[0x20];
3301 : : u8 reserved_2[0x20];
3302 : : u8 irisc_index[0x8];
3303 : : u8 synd[0x8];
3304 : : u8 ext_synd[0x10];
3305 : : };
3306 : :
3307 : : /* HCA PCI BAR resource structure. */
3308 : : struct mlx5_ifc_initial_seg_bits {
3309 : : u8 fw_rev_minor[0x10];
3310 : : u8 fw_rev_major[0x10];
3311 : : u8 cmd_interface_rev[0x10];
3312 : : u8 fw_rev_subminor[0x10];
3313 : : u8 reserved_0[0x40];
3314 : : u8 cmdq_phy_addr_63_32[0x20];
3315 : : u8 cmdq_phy_addr_31_12[0x14];
3316 : : u8 reserved_1[0x2];
3317 : : u8 nic_interface[0x2];
3318 : : u8 log_cmdq_size[0x4];
3319 : : u8 log_cmdq_stride[0x4];
3320 : : u8 command_doorbell_vector[0x20];
3321 : : u8 reserved_2[0xf00];
3322 : : u8 initializing[0x1];
3323 : : u8 nic_interface_supported[0x7];
3324 : : u8 reserved_4[0x18];
3325 : : struct mlx5_ifc_health_buffer_bits health_buffer;
3326 : : u8 no_dram_nic_offset[0x20];
3327 : : u8 reserved_5[0x6de0];
3328 : : u8 internal_timer_h[0x20];
3329 : : u8 internal_timer_l[0x20];
3330 : : u8 reserved_6[0x20];
3331 : : u8 reserved_7[0x1f];
3332 : : u8 clear_int[0x1];
3333 : : u8 health_syndrome[0x8];
3334 : : u8 health_counter[0x18];
3335 : : u8 reserved_8[0x160];
3336 : : u8 real_time[0x40];
3337 : : u8 reserved_9[0x17e20];
3338 : : };
3339 : :
3340 : : struct mlx5_ifc_create_cq_out_bits {
3341 : : u8 status[0x8];
3342 : : u8 reserved_at_8[0x18];
3343 : : u8 syndrome[0x20];
3344 : : u8 reserved_at_40[0x8];
3345 : : u8 cqn[0x18];
3346 : : u8 reserved_at_60[0x20];
3347 : : };
3348 : :
3349 : : struct mlx5_ifc_create_cq_in_bits {
3350 : : u8 opcode[0x10];
3351 : : u8 uid[0x10];
3352 : : u8 reserved_at_20[0x10];
3353 : : u8 op_mod[0x10];
3354 : : u8 reserved_at_40[0x40];
3355 : : struct mlx5_ifc_cqc_bits cq_context;
3356 : : u8 cq_umem_offset[0x40];
3357 : : u8 cq_umem_id[0x20];
3358 : : u8 cq_umem_valid[0x1];
3359 : : u8 reserved_at_2e1[0x1f];
3360 : : u8 reserved_at_300[0x580];
3361 : : u8 pas[];
3362 : : };
3363 : :
3364 : : enum {
3365 : : MLX5_GENERAL_OBJ_TYPE_GENEVE_TLV_OPT = 0x000b,
3366 : : MLX5_GENERAL_OBJ_TYPE_DEK = 0x000c,
3367 : : MLX5_GENERAL_OBJ_TYPE_VIRTQ = 0x000d,
3368 : : MLX5_GENERAL_OBJ_TYPE_DEFINER = 0x0018,
3369 : : MLX5_GENERAL_OBJ_TYPE_VIRTIO_Q_COUNTERS = 0x001c,
3370 : : MLX5_GENERAL_OBJ_TYPE_IMPORT_KEK = 0x001d,
3371 : : MLX5_GENERAL_OBJ_TYPE_CREDENTIAL = 0x001e,
3372 : : MLX5_GENERAL_OBJ_TYPE_CRYPTO_LOGIN = 0x001f,
3373 : : MLX5_GENERAL_OBJ_TYPE_FLEX_PARSE_GRAPH = 0x0022,
3374 : : MLX5_GENERAL_OBJ_TYPE_FLOW_METER_ASO = 0x0024,
3375 : : MLX5_GENERAL_OBJ_TYPE_FLOW_HIT_ASO = 0x0025,
3376 : : MLX5_GENERAL_OBJ_TYPE_CONN_TRACK_OFFLOAD = 0x0031,
3377 : : MLX5_GENERAL_OBJ_TYPE_ARG = 0x0023,
3378 : : MLX5_GENERAL_OBJ_TYPE_STC = 0x0040,
3379 : : MLX5_GENERAL_OBJ_TYPE_RTC = 0x0041,
3380 : : MLX5_GENERAL_OBJ_TYPE_STE = 0x0042,
3381 : : MLX5_GENERAL_OBJ_TYPE_MODIFY_HEADER_PATTERN = 0x0043,
3382 : : MLX5_GENERAL_OBJ_TYPE_FT_ALIAS = 0xff15,
3383 : : MLX5_GENERAL_OBJ_TYPE_TIR_ALIAS = 0xff16,
3384 : : };
3385 : :
3386 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits {
3387 : : u8 opcode[0x10];
3388 : : u8 reserved_at_10[0x20];
3389 : : u8 obj_type[0x10];
3390 : : u8 obj_id[0x20];
3391 : : union {
3392 : : struct {
3393 : : u8 alias_object[0x1];
3394 : : u8 reserved_at_61[0x2];
3395 : : u8 log_obj_range[0x5];
3396 : : u8 reserved_at_68[0x18];
3397 : : };
3398 : : u8 obj_offset[0x20];
3399 : : };
3400 : : };
3401 : :
3402 : : struct mlx5_ifc_general_obj_out_cmd_hdr_bits {
3403 : : u8 status[0x8];
3404 : : u8 reserved_at_8[0x18];
3405 : : u8 syndrome[0x20];
3406 : : u8 obj_id[0x20];
3407 : : u8 reserved_at_60[0x20];
3408 : : };
3409 : :
3410 : : struct mlx5_ifc_allow_other_vhca_access_in_bits {
3411 : : u8 opcode[0x10];
3412 : : u8 uid[0x10];
3413 : : u8 reserved_at_20[0x10];
3414 : : u8 op_mod[0x10];
3415 : : u8 reserved_at_40[0x50];
3416 : : u8 object_type_to_be_accessed[0x10];
3417 : : u8 object_id_to_be_accessed[0x20];
3418 : : u8 reserved_at_c0[0x40];
3419 : : union {
3420 : : u8 access_key_raw[0x100];
3421 : : u8 access_key[8][0x20];
3422 : : };
3423 : : };
3424 : :
3425 : : struct mlx5_ifc_allow_other_vhca_access_out_bits {
3426 : : u8 status[0x8];
3427 : : u8 reserved_at_8[0x18];
3428 : : u8 syndrome[0x20];
3429 : : u8 reserved_at_40[0x40];
3430 : : };
3431 : :
3432 : : struct mlx5_ifc_virtio_q_counters_bits {
3433 : : u8 modify_field_select[0x40];
3434 : : u8 reserved_at_40[0x40];
3435 : : u8 received_desc[0x40];
3436 : : u8 completed_desc[0x40];
3437 : : u8 error_cqes[0x20];
3438 : : u8 bad_desc_errors[0x20];
3439 : : u8 exceed_max_chain[0x20];
3440 : : u8 invalid_buffer[0x20];
3441 : : u8 reserved_at_180[0x50];
3442 : : };
3443 : :
3444 : : struct mlx5_ifc_geneve_tlv_option_bits {
3445 : : u8 modify_field_select[0x40];
3446 : : u8 reserved_at_40[0x8];
3447 : : u8 sample_offset[0x8];
3448 : : u8 sample_id_valid[0x1];
3449 : : u8 sample_offset_valid[0x1];
3450 : : u8 option_class_ignore[0x1];
3451 : : u8 reserved_at_53[0x5];
3452 : : u8 geneve_option_fte_index[0x8];
3453 : : u8 option_class[0x10];
3454 : : u8 option_type[0x8];
3455 : : u8 reserved_at_78[0x3];
3456 : : u8 option_data_length[0x5];
3457 : : u8 geneve_sample_field_id[0x20];
3458 : : u8 reserved_at_a0[0x160];
3459 : : };
3460 : :
3461 : : enum mlx5_ifc_rtc_update_mode {
3462 : : MLX5_IFC_RTC_STE_UPDATE_MODE_BY_HASH = 0x0,
3463 : : MLX5_IFC_RTC_STE_UPDATE_MODE_BY_OFFSET = 0x1,
3464 : : };
3465 : :
3466 : : enum mlx5_ifc_rtc_access_mode {
3467 : : MLX5_IFC_RTC_STE_ACCESS_MODE_BY_HASH = 0x0,
3468 : : MLX5_IFC_RTC_STE_ACCESS_MODE_LINEAR = 0x1,
3469 : : };
3470 : :
3471 : : enum mlx5_ifc_rtc_ste_format {
3472 : : MLX5_IFC_RTC_STE_FORMAT_8DW = 0x4,
3473 : : MLX5_IFC_RTC_STE_FORMAT_11DW = 0x5,
3474 : : MLX5_IFC_RTC_STE_FORMAT_RANGE = 0x7,
3475 : : MLX5_IFC_RTC_STE_FORMAT_4DW_RANGE = 0x8,
3476 : : };
3477 : :
3478 : : enum mlx5_ifc_rtc_reparse_mode {
3479 : : MLX5_IFC_RTC_REPARSE_NEVER = 0x0,
3480 : : MLX5_IFC_RTC_REPARSE_ALWAYS = 0x1,
3481 : : MLX5_IFC_RTC_REPARSE_BY_STC = 0x2,
3482 : : };
3483 : :
3484 : : #define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16
3485 : :
3486 : : struct mlx5_ifc_rtc_bits {
3487 : : u8 modify_field_select[0x40];
3488 : : u8 reserved_at_40[0x40];
3489 : : u8 update_index_mode[0x2];
3490 : : u8 reparse_mode[0x2];
3491 : : u8 num_match_ste[0x4];
3492 : : u8 pd[0x18];
3493 : : u8 reserved_at_a0[0x9];
3494 : : u8 access_index_mode[0x3];
3495 : : u8 num_hash_definer[0x4];
3496 : : u8 update_method[0x1];
3497 : : u8 reserved_at_b1[0x2];
3498 : : u8 log_depth[0x5];
3499 : : u8 log_hash_size[0x8];
3500 : : u8 ste_format_0[0x8];
3501 : : u8 table_type[0x8];
3502 : : u8 ste_format_1[0x8];
3503 : : u8 reserved_at_d8[0x8];
3504 : : u8 match_definer_0[0x20];
3505 : : u8 stc_id[0x20];
3506 : : u8 ste_table_base_id[0x20];
3507 : : u8 ste_table_offset[0x20];
3508 : : u8 reserved_at_160[0x8];
3509 : : u8 miss_flow_table_id[0x18];
3510 : : u8 match_definer_1[0x20];
3511 : : u8 reserved_at_1a0[0x260];
3512 : : };
3513 : :
3514 : : struct mlx5_ifc_ste_match_4dw_range_ctrl_dw_bits {
3515 : : u8 match[0x1];
3516 : : u8 reserved_at_1[0x2];
3517 : : u8 base1[0x1];
3518 : : u8 inverse1[0x1];
3519 : : u8 reserved_at_5[0x1];
3520 : : u8 operator1[0x2];
3521 : : u8 reserved_at_8[0x3];
3522 : : u8 base0[0x1];
3523 : : u8 inverse0[0x1];
3524 : : u8 reserved_at_a[0x1];
3525 : : u8 operator0[0x2];
3526 : : u8 compare_delta[0x10];
3527 : : };
3528 : :
3529 : : struct mlx5_ifc_alias_context_bits {
3530 : : u8 vhca_id_to_be_accessed[0x10];
3531 : : u8 reserved_at_10[0xd];
3532 : : u8 status[0x3];
3533 : : u8 object_id_to_be_accessed[0x20];
3534 : : u8 reserved_at_40[0x40];
3535 : : union {
3536 : : u8 access_key_raw[0x100];
3537 : : u8 access_key[8][0x20];
3538 : : };
3539 : : u8 metadata[0x80];
3540 : : };
3541 : :
3542 : : enum mlx5_ifc_stc_action_type {
3543 : : MLX5_IFC_STC_ACTION_TYPE_NOP = 0x00,
3544 : : MLX5_IFC_STC_ACTION_TYPE_COPY = 0x05,
3545 : : MLX5_IFC_STC_ACTION_TYPE_SET = 0x06,
3546 : : MLX5_IFC_STC_ACTION_TYPE_ADD = 0x07,
3547 : : MLX5_IFC_STC_ACTION_TYPE_REMOVE_WORDS = 0x08,
3548 : : MLX5_IFC_STC_ACTION_TYPE_HEADER_REMOVE = 0x09,
3549 : : MLX5_IFC_STC_ACTION_TYPE_HEADER_INSERT = 0x0b,
3550 : : MLX5_IFC_STC_ACTION_TYPE_TAG = 0x0c,
3551 : : MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST = 0x0e,
3552 : : MLX5_IFC_STC_ACTION_TYPE_ASO = 0x12,
3553 : : MLX5_IFC_STC_ACTION_TYPE_COUNTER = 0x14,
3554 : : MLX5_IFC_STC_ACTION_TYPE_ADD_FIELD = 0x1b,
3555 : : MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_STE_TABLE = 0x80,
3556 : : MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_TIR = 0x81,
3557 : : MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT = 0x82,
3558 : : MLX5_IFC_STC_ACTION_TYPE_DROP = 0x83,
3559 : : MLX5_IFC_STC_ACTION_TYPE_ALLOW = 0x84,
3560 : : MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT = 0x85,
3561 : : MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK = 0x86,
3562 : : };
3563 : :
3564 : : enum mlx5_ifc_stc_reparse_mode {
3565 : : MLX5_IFC_STC_REPARSE_IGNORE = 0x0,
3566 : : MLX5_IFC_STC_REPARSE_NEVER = 0x1,
3567 : : MLX5_IFC_STC_REPARSE_ALWAYS = 0x2,
3568 : : };
3569 : :
3570 : : struct mlx5_ifc_stc_ste_param_ste_table_bits {
3571 : : u8 ste_obj_id[0x20];
3572 : : u8 match_definer_id[0x20];
3573 : : u8 reserved_at_40[0x3];
3574 : : u8 log_hash_size[0x5];
3575 : : u8 reserved_at_48[0x38];
3576 : : };
3577 : :
3578 : : struct mlx5_ifc_stc_ste_param_tir_bits {
3579 : : u8 reserved_at_0[0x8];
3580 : : u8 tirn[0x18];
3581 : : u8 reserved_at_20[0x60];
3582 : : };
3583 : :
3584 : : struct mlx5_ifc_stc_ste_param_table_bits {
3585 : : u8 reserved_at_0[0x8];
3586 : : u8 table_id[0x18];
3587 : : u8 reserved_at_20[0x60];
3588 : : };
3589 : :
3590 : : struct mlx5_ifc_stc_ste_param_flow_counter_bits {
3591 : : u8 flow_counter_id[0x20];
3592 : : };
3593 : :
3594 : : enum {
3595 : : MLX5_ASO_CT_NUM_PER_OBJ = 1,
3596 : : MLX5_ASO_METER_NUM_PER_OBJ = 2,
3597 : : };
3598 : :
3599 : : struct mlx5_ifc_stc_ste_param_execute_aso_bits {
3600 : : u8 aso_object_id[0x20];
3601 : : u8 return_reg_id[0x4];
3602 : : u8 aso_type[0x4];
3603 : : u8 reserved_at_28[0x18];
3604 : : };
3605 : :
3606 : : struct mlx5_ifc_stc_ste_param_header_modify_list_bits {
3607 : : u8 header_modify_pattern_id[0x20];
3608 : : u8 header_modify_argument_id[0x20];
3609 : : };
3610 : :
3611 : : enum mlx5_ifc_header_anchors {
3612 : : MLX5_HEADER_ANCHOR_PACKET_START = 0x0,
3613 : : MLX5_HEADER_ANCHOR_FIRST_VLAN_START = 0x2,
3614 : : MLX5_HEADER_ANCHOR_IPV6_IPV4 = 0x07,
3615 : : MLX5_HEADER_ANCHOR_TCP_UDP = 0x09,
3616 : : MLX5_HEADER_ANCHOR_INNER_MAC = 0x13,
3617 : : MLX5_HEADER_ANCHOR_INNER_IPV6_IPV4 = 0x19,
3618 : : };
3619 : :
3620 : : struct mlx5_ifc_stc_ste_param_remove_bits {
3621 : : u8 action_type[0x4];
3622 : : u8 decap[0x1];
3623 : : u8 reserved_at_5[0x5];
3624 : : u8 remove_start_anchor[0x6];
3625 : : u8 reserved_at_10[0x2];
3626 : : u8 remove_end_anchor[0x6];
3627 : : u8 reserved_at_18[0x8];
3628 : : };
3629 : :
3630 : : struct mlx5_ifc_stc_ste_param_remove_words_bits {
3631 : : u8 action_type[0x4];
3632 : : u8 reserved_at_4[0x6];
3633 : : u8 remove_start_anchor[0x6];
3634 : : u8 reserved_at_10[0x1];
3635 : : u8 remove_offset[0x7];
3636 : : u8 reserved_at_18[0x2];
3637 : : u8 remove_size[0x6];
3638 : : };
3639 : :
3640 : : struct mlx5_ifc_stc_ste_param_insert_bits {
3641 : : u8 action_type[0x4];
3642 : : u8 encap[0x1];
3643 : : u8 inline_data[0x1];
3644 : : u8 push_esp[0x1];
3645 : : u8 reserved_at_7[0x3];
3646 : : u8 insert_anchor[0x6];
3647 : : u8 reserved_at_10[0x1];
3648 : : u8 insert_offset[0x7];
3649 : : u8 reserved_at_18[0x1];
3650 : : u8 insert_size[0x7];
3651 : : u8 insert_argument[0x20];
3652 : : };
3653 : :
3654 : : struct mlx5_ifc_stc_ste_param_vport_bits {
3655 : : u8 eswitch_owner_vhca_id[0x10];
3656 : : u8 vport_number[0x10];
3657 : : u8 eswitch_owner_vhca_id_valid[0x1];
3658 : : u8 reserved_at_21[0x59];
3659 : : };
3660 : :
3661 : : union mlx5_ifc_stc_param_bits {
3662 : : struct mlx5_ifc_stc_ste_param_ste_table_bits ste_table;
3663 : : struct mlx5_ifc_stc_ste_param_tir_bits tir;
3664 : : struct mlx5_ifc_stc_ste_param_table_bits table;
3665 : : struct mlx5_ifc_stc_ste_param_flow_counter_bits counter;
3666 : : struct mlx5_ifc_stc_ste_param_header_modify_list_bits modify_header;
3667 : : struct mlx5_ifc_stc_ste_param_execute_aso_bits aso;
3668 : : struct mlx5_ifc_stc_ste_param_remove_bits remove_header;
3669 : : struct mlx5_ifc_stc_ste_param_insert_bits insert_header;
3670 : : struct mlx5_ifc_set_action_in_bits add;
3671 : : struct mlx5_ifc_set_action_in_bits set;
3672 : : struct mlx5_ifc_copy_action_in_bits copy;
3673 : : struct mlx5_ifc_stc_ste_param_vport_bits vport;
3674 : : u8 reserved_at_0[0x80];
3675 : : };
3676 : :
3677 : : enum {
3678 : : MLX5_IFC_MODIFY_STC_FIELD_SELECT_NEW_STC = 1 << 0,
3679 : : };
3680 : :
3681 : : struct mlx5_ifc_stc_bits {
3682 : : u8 modify_field_select[0x40];
3683 : : u8 reserved_at_40[0x46];
3684 : : u8 reparse_mode[0x2];
3685 : : u8 table_type[0x8];
3686 : : u8 ste_action_offset[0x8];
3687 : : u8 action_type[0x8];
3688 : : u8 reserved_at_a0[0x60];
3689 : : union mlx5_ifc_stc_param_bits stc_param;
3690 : : u8 reserved_at_180[0x280];
3691 : : };
3692 : :
3693 : : struct mlx5_ifc_ste_bits {
3694 : : u8 modify_field_select[0x40];
3695 : : u8 reserved_at_40[0x48];
3696 : : u8 table_type[0x8];
3697 : : u8 reserved_at_90[0x370];
3698 : : };
3699 : :
3700 : : enum {
3701 : : MLX5_IFC_DEFINER_FORMAT_ID_SELECT = 61,
3702 : : };
3703 : :
3704 : : struct mlx5_ifc_definer_bits {
3705 : : u8 modify_field_select[0x40];
3706 : : u8 reserved_at_40[0x50];
3707 : : u8 format_id[0x10];
3708 : : u8 reserved_at_60[0x60];
3709 : : u8 format_select_dw3[0x8];
3710 : : u8 format_select_dw2[0x8];
3711 : : u8 format_select_dw1[0x8];
3712 : : u8 format_select_dw0[0x8];
3713 : : u8 format_select_dw7[0x8];
3714 : : u8 format_select_dw6[0x8];
3715 : : u8 format_select_dw5[0x8];
3716 : : u8 format_select_dw4[0x8];
3717 : : u8 reserved_at_100[0x18];
3718 : : u8 format_select_dw8[0x8];
3719 : : u8 reserved_at_120[0x20];
3720 : : u8 format_select_byte3[0x8];
3721 : : u8 format_select_byte2[0x8];
3722 : : u8 format_select_byte1[0x8];
3723 : : u8 format_select_byte0[0x8];
3724 : : u8 format_select_byte7[0x8];
3725 : : u8 format_select_byte6[0x8];
3726 : : u8 format_select_byte5[0x8];
3727 : : u8 format_select_byte4[0x8];
3728 : : u8 reserved_at_180[0x40];
3729 : : u8 ctrl[0xa0];
3730 : : u8 match_mask[0x160];
3731 : : };
3732 : :
3733 : : struct mlx5_ifc_arg_bits {
3734 : : u8 rsvd0[0x88];
3735 : : u8 access_pd[0x18];
3736 : : };
3737 : :
3738 : : struct mlx5_ifc_header_modify_pattern_in_bits {
3739 : : u8 modify_field_select[0x40];
3740 : :
3741 : : u8 reserved_at_40[0x40];
3742 : :
3743 : : u8 pattern_length[0x8];
3744 : : u8 reserved_at_88[0x18];
3745 : :
3746 : : u8 reserved_at_a0[0x60];
3747 : :
3748 : : u8 pattern_data[MAX_ACTIONS_DATA_IN_HEADER_MODIFY * 8];
3749 : : };
3750 : :
3751 : : struct mlx5_ifc_create_virtio_q_counters_in_bits {
3752 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3753 : : struct mlx5_ifc_virtio_q_counters_bits virtio_q_counters;
3754 : : };
3755 : :
3756 : : struct mlx5_ifc_query_virtio_q_counters_out_bits {
3757 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3758 : : struct mlx5_ifc_virtio_q_counters_bits virtio_q_counters;
3759 : : };
3760 : :
3761 : : struct mlx5_ifc_create_geneve_tlv_option_in_bits {
3762 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3763 : : struct mlx5_ifc_geneve_tlv_option_bits geneve_tlv_opt;
3764 : : };
3765 : :
3766 : : struct mlx5_ifc_query_geneve_tlv_option_out_bits {
3767 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3768 : : struct mlx5_ifc_geneve_tlv_option_bits geneve_tlv_opt;
3769 : : };
3770 : :
3771 : : struct mlx5_ifc_create_rtc_in_bits {
3772 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3773 : : struct mlx5_ifc_rtc_bits rtc;
3774 : : };
3775 : :
3776 : : struct mlx5_ifc_create_stc_in_bits {
3777 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3778 : : struct mlx5_ifc_stc_bits stc;
3779 : : };
3780 : :
3781 : : struct mlx5_ifc_create_ste_in_bits {
3782 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3783 : : struct mlx5_ifc_ste_bits ste;
3784 : : };
3785 : :
3786 : : struct mlx5_ifc_create_definer_in_bits {
3787 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3788 : : struct mlx5_ifc_definer_bits definer;
3789 : : };
3790 : :
3791 : : struct mlx5_ifc_create_arg_in_bits {
3792 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3793 : : struct mlx5_ifc_arg_bits arg;
3794 : : };
3795 : :
3796 : : struct mlx5_ifc_create_header_modify_pattern_in_bits {
3797 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3798 : : struct mlx5_ifc_header_modify_pattern_in_bits pattern;
3799 : : };
3800 : :
3801 : : struct mlx5_ifc_create_alias_obj_in_bits {
3802 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3803 : : struct mlx5_ifc_alias_context_bits alias_ctx;
3804 : : };
3805 : :
3806 : : struct mlx5_ifc_generate_wqe_in_bits {
3807 : : u8 opcode[0x10];
3808 : : u8 uid[0x10];
3809 : : u8 reserved_at_20[0x10];
3810 : : u8 op_mode[0x10];
3811 : : u8 reserved_at_40[0x40];
3812 : : u8 reserved_at_80[0x8];
3813 : : u8 pdn[0x18];
3814 : : u8 reserved_at_a0[0x160];
3815 : : u8 wqe_ctrl[0x80];
3816 : : u8 wqe_gta_ctrl[0x180];
3817 : : u8 wqe_gta_data_0[0x200];
3818 : : u8 wqe_gta_data_1[0x200];
3819 : : };
3820 : :
3821 : : struct mlx5_ifc_generate_wqe_out_bits {
3822 : : u8 status[0x8];
3823 : : u8 reserved_at_8[0x18];
3824 : : u8 syndrome[0x20];
3825 : : u8 reserved_at_40[0x1c0];
3826 : : u8 cqe_data[0x200];
3827 : : };
3828 : :
3829 : : enum {
3830 : : MLX5_CRYPTO_KEY_SIZE_128b = 0x0,
3831 : : MLX5_CRYPTO_KEY_SIZE_256b = 0x1,
3832 : : };
3833 : :
3834 : : enum {
3835 : : MLX5_CRYPTO_KEY_PURPOSE_TLS = 0x1,
3836 : : MLX5_CRYPTO_KEY_PURPOSE_IPSEC = 0x2,
3837 : : MLX5_CRYPTO_KEY_PURPOSE_AES_XTS = 0x3,
3838 : : MLX5_CRYPTO_KEY_PURPOSE_MACSEC = 0x4,
3839 : : MLX5_CRYPTO_KEY_PURPOSE_GCM = 0x5,
3840 : : MLX5_CRYPTO_KEY_PURPOSE_PSP = 0x6,
3841 : : };
3842 : :
3843 : : struct mlx5_ifc_dek_bits {
3844 : : u8 modify_field_select[0x40];
3845 : : u8 state[0x8];
3846 : : u8 reserved_at_48[0xc];
3847 : : u8 key_size[0x4];
3848 : : u8 has_keytag[0x1];
3849 : : u8 reserved_at_59[0x3];
3850 : : u8 key_purpose[0x4];
3851 : : u8 reserved_at_60[0x8];
3852 : : u8 pd[0x18];
3853 : : u8 reserved_at_80[0x100];
3854 : : u8 opaque[0x40];
3855 : : u8 reserved_at_1c0[0x40];
3856 : : u8 key[0x400];
3857 : : u8 reserved_at_600[0x200];
3858 : : };
3859 : :
3860 : : struct mlx5_ifc_create_dek_in_bits {
3861 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3862 : : struct mlx5_ifc_dek_bits dek;
3863 : : };
3864 : :
3865 : : struct mlx5_ifc_import_kek_bits {
3866 : : u8 modify_field_select[0x40];
3867 : : u8 state[0x8];
3868 : : u8 reserved_at_48[0xc];
3869 : : u8 key_size[0x4];
3870 : : u8 reserved_at_58[0x1a8];
3871 : : u8 key[0x400];
3872 : : u8 reserved_at_600[0x200];
3873 : : };
3874 : :
3875 : : struct mlx5_ifc_create_import_kek_in_bits {
3876 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3877 : : struct mlx5_ifc_import_kek_bits import_kek;
3878 : : };
3879 : :
3880 : : enum {
3881 : : MLX5_CREDENTIAL_ROLE_OFFICER = 0x0,
3882 : : MLX5_CREDENTIAL_ROLE_USER = 0x1,
3883 : : };
3884 : :
3885 : : struct mlx5_ifc_credential_bits {
3886 : : u8 modify_field_select[0x40];
3887 : : u8 state[0x8];
3888 : : u8 reserved_at_48[0x10];
3889 : : u8 credential_role[0x8];
3890 : : u8 reserved_at_60[0x1a0];
3891 : : u8 credential[0x180];
3892 : : u8 reserved_at_380[0x480];
3893 : : };
3894 : :
3895 : : struct mlx5_ifc_create_credential_in_bits {
3896 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3897 : : struct mlx5_ifc_credential_bits credential;
3898 : : };
3899 : :
3900 : : struct mlx5_ifc_crypto_login_bits {
3901 : : u8 modify_field_select[0x40];
3902 : : u8 reserved_at_40[0x48];
3903 : : u8 credential_pointer[0x18];
3904 : : u8 reserved_at_a0[0x8];
3905 : : u8 session_import_kek_ptr[0x18];
3906 : : u8 reserved_at_c0[0x140];
3907 : : u8 credential[0x180];
3908 : : u8 reserved_at_380[0x480];
3909 : : };
3910 : :
3911 : : struct mlx5_ifc_create_crypto_login_in_bits {
3912 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
3913 : : struct mlx5_ifc_crypto_login_bits crypto_login;
3914 : : };
3915 : :
3916 : : enum {
3917 : : MLX5_VIRTQ_STATE_INIT = 0,
3918 : : MLX5_VIRTQ_STATE_RDY = 1,
3919 : : MLX5_VIRTQ_STATE_SUSPEND = 2,
3920 : : MLX5_VIRTQ_STATE_ERROR = 3,
3921 : : };
3922 : :
3923 : : enum {
3924 : : MLX5_VIRTQ_MODIFY_TYPE_STATE = (1UL << 0),
3925 : : MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_PARAMS = (1UL << 3),
3926 : : MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_DUMP_ENABLE = (1UL << 4),
3927 : : MLX5_VIRTQ_MODIFY_TYPE_QUEUE_PERIOD = (1UL << 5),
3928 : : MLX5_VIRTQ_MODIFY_TYPE_ADDR = (1UL << 6),
3929 : : MLX5_VIRTQ_MODIFY_TYPE_HW_AVAILABLE_INDEX = (1UL << 7),
3930 : : MLX5_VIRTQ_MODIFY_TYPE_HW_USED_INDEX = (1UL << 8),
3931 : : MLX5_VIRTQ_MODIFY_TYPE_Q_TYPE = (1UL << 9),
3932 : : MLX5_VIRTQ_MODIFY_TYPE_VERSION_1_0 = (1UL << 10),
3933 : : MLX5_VIRTQ_MODIFY_TYPE_Q_MKEY = (1UL << 11),
3934 : : MLX5_VIRTQ_MODIFY_TYPE_QUEUE_FEATURE_BIT_MASK = (1UL << 12),
3935 : : MLX5_VIRTQ_MODIFY_TYPE_EVENT_MODE = (1UL << 13),
3936 : : };
3937 : :
3938 : : struct mlx5_ifc_virtio_q_bits {
3939 : : u8 virtio_q_type[0x8];
3940 : : u8 reserved_at_8[0x5];
3941 : : u8 event_mode[0x3];
3942 : : u8 queue_index[0x10];
3943 : : u8 full_emulation[0x1];
3944 : : u8 virtio_version_1_0[0x1];
3945 : : u8 reserved_at_22[0x2];
3946 : : u8 offload_type[0x4];
3947 : : u8 event_qpn_or_msix[0x18];
3948 : : u8 doorbell_stride_idx[0x10];
3949 : : u8 queue_size[0x10];
3950 : : u8 device_emulation_id[0x20];
3951 : : u8 desc_addr[0x40];
3952 : : u8 used_addr[0x40];
3953 : : u8 available_addr[0x40];
3954 : : u8 virtio_q_mkey[0x20];
3955 : : u8 reserved_at_160[0x18];
3956 : : u8 error_type[0x8];
3957 : : u8 umem_1_id[0x20];
3958 : : u8 umem_1_size[0x20];
3959 : : u8 umem_1_offset[0x40];
3960 : : u8 umem_2_id[0x20];
3961 : : u8 umem_2_size[0x20];
3962 : : u8 umem_2_offset[0x40];
3963 : : u8 umem_3_id[0x20];
3964 : : u8 umem_3_size[0x20];
3965 : : u8 umem_3_offset[0x40];
3966 : : u8 counter_set_id[0x20];
3967 : : u8 reserved_at_320[0x8];
3968 : : u8 pd[0x18];
3969 : : u8 reserved_at_340[0x2];
3970 : : u8 queue_period_mode[0x2];
3971 : : u8 queue_period_us[0xc];
3972 : : u8 queue_max_count[0x10];
3973 : : u8 reserved_at_360[0xa0];
3974 : : };
3975 : :
3976 : : struct mlx5_ifc_virtio_net_q_bits {
3977 : : u8 modify_field_select[0x40];
3978 : : u8 reserved_at_40[0x40];
3979 : : u8 tso_ipv4[0x1];
3980 : : u8 tso_ipv6[0x1];
3981 : : u8 tx_csum[0x1];
3982 : : u8 rx_csum[0x1];
3983 : : u8 reserved_at_84[0x6];
3984 : : u8 dirty_bitmap_dump_enable[0x1];
3985 : : u8 vhost_log_page[0x5];
3986 : : u8 reserved_at_90[0xc];
3987 : : u8 state[0x4];
3988 : : u8 reserved_at_a0[0x8];
3989 : : u8 tisn_or_qpn[0x18];
3990 : : u8 dirty_bitmap_mkey[0x20];
3991 : : u8 dirty_bitmap_size[0x20];
3992 : : u8 dirty_bitmap_addr[0x40];
3993 : : u8 hw_available_index[0x10];
3994 : : u8 hw_used_index[0x10];
3995 : : u8 reserved_at_160[0xa0];
3996 : : struct mlx5_ifc_virtio_q_bits virtio_q_context;
3997 : : };
3998 : :
3999 : : struct mlx5_ifc_create_virtq_in_bits {
4000 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4001 : : struct mlx5_ifc_virtio_net_q_bits virtq;
4002 : : };
4003 : :
4004 : : struct mlx5_ifc_query_virtq_out_bits {
4005 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4006 : : struct mlx5_ifc_virtio_net_q_bits virtq;
4007 : : };
4008 : :
4009 : : struct mlx5_ifc_flow_hit_aso_bits {
4010 : : u8 modify_field_select[0x40];
4011 : : u8 reserved_at_40[0x48];
4012 : : u8 access_pd[0x18];
4013 : : u8 reserved_at_a0[0x160];
4014 : : u8 flag[0x200];
4015 : : };
4016 : :
4017 : : struct mlx5_ifc_create_flow_hit_aso_in_bits {
4018 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4019 : : struct mlx5_ifc_flow_hit_aso_bits flow_hit_aso;
4020 : : };
4021 : :
4022 : : struct mlx5_ifc_flow_meter_aso_bits {
4023 : : u8 modify_field_select[0x40];
4024 : : u8 reserved_at_40[0x48];
4025 : : u8 access_pd[0x18];
4026 : : u8 reserved_at_a0[0x160];
4027 : : u8 parameters[0x200];
4028 : : };
4029 : :
4030 : : struct mlx5_ifc_create_flow_meter_aso_in_bits {
4031 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4032 : : struct mlx5_ifc_flow_meter_aso_bits flow_meter_aso;
4033 : : };
4034 : :
4035 : : struct mlx5_ifc_tcp_window_params_bits {
4036 : : u8 max_ack[0x20];
4037 : : u8 max_win[0x20];
4038 : : u8 reply_end[0x20];
4039 : : u8 sent_end[0x20];
4040 : : };
4041 : :
4042 : : struct mlx5_ifc_conn_track_aso_bits {
4043 : : struct mlx5_ifc_tcp_window_params_bits reply_dir; /* End of DW3. */
4044 : : struct mlx5_ifc_tcp_window_params_bits original_dir; /* End of DW7. */
4045 : : u8 last_end[0x20]; /* End of DW8. */
4046 : : u8 last_ack[0x20]; /* End of DW9. */
4047 : : u8 last_seq[0x20]; /* End of DW10. */
4048 : : u8 last_win[0x10];
4049 : : u8 reserved_at_170[0xa];
4050 : : u8 last_dir[0x1];
4051 : : u8 last_index[0x5]; /* End of DW11. */
4052 : : u8 reserved_at_180[0x40]; /* End of DW13. */
4053 : : u8 reply_direction_tcp_scale[0x4];
4054 : : u8 reply_direction_tcp_close_initiated[0x1];
4055 : : u8 reply_direction_tcp_liberal_enabled[0x1];
4056 : : u8 reply_direction_tcp_data_unacked[0x1];
4057 : : u8 reply_direction_tcp_max_ack[0x1];
4058 : : u8 reserved_at_1c8[0x8];
4059 : : u8 original_direction_tcp_scale[0x4];
4060 : : u8 original_direction_tcp_close_initiated[0x1];
4061 : : u8 original_direction_tcp_liberal_enabled[0x1];
4062 : : u8 original_direction_tcp_data_unacked[0x1];
4063 : : u8 original_direction_tcp_max_ack[0x1];
4064 : : u8 reserved_at_1d8[0x8]; /* End of DW14. */
4065 : : u8 valid[0x1];
4066 : : u8 state[0x3];
4067 : : u8 freeze_track[0x1];
4068 : : u8 reserved_at_1e5[0xb];
4069 : : u8 reserved_at_1f0[0x1];
4070 : : u8 connection_assured[0x1];
4071 : : u8 sack_permitted[0x1];
4072 : : u8 challenged_acked[0x1];
4073 : : u8 heartbeat[0x1];
4074 : : u8 max_ack_window[0x3];
4075 : : u8 reserved_at_1f8[0x1];
4076 : : u8 retransmission_counter[0x3];
4077 : : u8 retranmission_limit_exceeded[0x1];
4078 : : u8 retranmission_limit[0x3]; /* End of DW15. */
4079 : : };
4080 : :
4081 : : struct mlx5_ifc_conn_track_offload_bits {
4082 : : u8 modify_field_select[0x40];
4083 : : u8 reserved_at_40[0x40];
4084 : : u8 reserved_at_80[0x8];
4085 : : u8 conn_track_aso_access_pd[0x18];
4086 : : u8 reserved_at_a0[0x160];
4087 : : struct mlx5_ifc_conn_track_aso_bits conn_track_aso;
4088 : : };
4089 : :
4090 : : struct mlx5_ifc_create_conn_track_aso_in_bits {
4091 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4092 : : struct mlx5_ifc_conn_track_offload_bits conn_track_offload;
4093 : : };
4094 : :
4095 : : enum mlx5_access_aso_opc_mod {
4096 : : ASO_OPC_MOD_IPSEC = 0x0,
4097 : : ASO_OPC_MOD_CONNECTION_TRACKING = 0x1,
4098 : : ASO_OPC_MOD_POLICER = 0x2,
4099 : : ASO_OPC_MOD_RACE_AVOIDANCE = 0x3,
4100 : : ASO_OPC_MOD_FLOW_HIT = 0x4,
4101 : : };
4102 : :
4103 : : #define ASO_CSEG_DATA_MASK_MODE_OFFSET 30
4104 : :
4105 : : enum mlx5_aso_data_mask_mode {
4106 : : BITWISE_64BIT = 0x0,
4107 : : BYTEWISE_64BYTE = 0x1,
4108 : : CALCULATED_64BYTE = 0x2,
4109 : : };
4110 : :
4111 : : #define ASO_CSEG_COND_0_OPER_OFFSET 20
4112 : : #define ASO_CSEG_COND_1_OPER_OFFSET 16
4113 : :
4114 : : enum mlx5_aso_pre_cond_op {
4115 : : ASO_OP_ALWAYS_FALSE = 0x0,
4116 : : ASO_OP_ALWAYS_TRUE = 0x1,
4117 : : ASO_OP_EQUAL = 0x2,
4118 : : ASO_OP_NOT_EQUAL = 0x3,
4119 : : ASO_OP_GREATER_OR_EQUAL = 0x4,
4120 : : ASO_OP_LESSER_OR_EQUAL = 0x5,
4121 : : ASO_OP_LESSER = 0x6,
4122 : : ASO_OP_GREATER = 0x7,
4123 : : ASO_OP_CYCLIC_GREATER = 0x8,
4124 : : ASO_OP_CYCLIC_LESSER = 0x9,
4125 : : };
4126 : :
4127 : : #define ASO_CSEG_COND_OPER_OFFSET 6
4128 : :
4129 : : enum mlx5_aso_op {
4130 : : ASO_OPER_LOGICAL_AND = 0x0,
4131 : : ASO_OPER_LOGICAL_OR = 0x1,
4132 : : };
4133 : :
4134 : : #define MLX5_ASO_CSEG_READ_ENABLE 1
4135 : :
4136 : : /* ASO WQE CTRL segment. */
4137 : : struct mlx5_aso_cseg {
4138 : : uint32_t va_h;
4139 : : uint32_t va_l_r;
4140 : : uint32_t lkey;
4141 : : uint32_t operand_masks;
4142 : : uint32_t condition_0_data;
4143 : : uint32_t condition_0_mask;
4144 : : uint32_t condition_1_data;
4145 : : uint32_t condition_1_mask;
4146 : : uint64_t bitwise_data;
4147 : : uint64_t data_mask;
4148 : : } __rte_packed;
4149 : :
4150 : : #define MLX5_MTR_MAX_TOKEN_VALUE INT32_MAX
4151 : :
4152 : : /* A meter data segment - 2 per ASO WQE. */
4153 : : struct mlx5_aso_mtr_dseg {
4154 : : uint32_t v_bo_sc_bbog_mm;
4155 : : /*
4156 : : * bit 31: valid, 30: bucket overflow, 28-29: start color,
4157 : : * 27: both buckets on green, 24-25: meter mode.
4158 : : */
4159 : : uint32_t reserved;
4160 : : uint32_t cbs_cir;
4161 : : /*
4162 : : * bit 24-28: cbs_exponent, bit 16-23 cbs_mantissa,
4163 : : * bit 8-12: cir_exponent, bit 0-7 cir_mantissa.
4164 : : */
4165 : : uint32_t c_tokens;
4166 : : uint32_t ebs_eir;
4167 : : /*
4168 : : * bit 24-28: ebs_exponent, bit 16-23 ebs_mantissa,
4169 : : * bit 8-12: eir_exponent, bit 0-7 eir_mantissa.
4170 : : */
4171 : : uint32_t e_tokens;
4172 : : uint64_t timestamp;
4173 : : } __rte_packed;
4174 : :
4175 : : #define ASO_DSEG_VALID_OFFSET 31
4176 : : #define ASO_DSEG_BO_OFFSET 30
4177 : : #define ASO_DSEG_SC_OFFSET 28
4178 : : #define ASO_DSEG_BBOG_OFFSET 27
4179 : : #define ASO_DSEG_MTR_MODE 24
4180 : : #define ASO_DSEG_CBS_EXP_OFFSET 24
4181 : : #define ASO_DSEG_CBS_MAN_OFFSET 16
4182 : : #define ASO_DSEG_XIR_EXP_MASK 0x1F
4183 : : #define ASO_DSEG_XIR_EXP_OFFSET 8
4184 : : #define ASO_DSEG_EBS_EXP_OFFSET 24
4185 : : #define ASO_DSEG_EBS_MAN_OFFSET 16
4186 : : #define ASO_DSEG_EXP_MASK 0x1F
4187 : : #define ASO_DSEG_MAN_MASK 0xFF
4188 : :
4189 : : #define MLX5_ASO_WQE_DSEG_SIZE 0x40
4190 : : #define MLX5_ASO_METERS_PER_WQE 2
4191 : : #define MLX5_ASO_MTRS_PER_POOL 128
4192 : :
4193 : : /* ASO WQE data segment. */
4194 : : struct mlx5_aso_dseg {
4195 : : union {
4196 : : uint8_t data[MLX5_ASO_WQE_DSEG_SIZE];
4197 : : struct mlx5_aso_mtr_dseg mtrs[MLX5_ASO_METERS_PER_WQE];
4198 : : };
4199 : : } __rte_packed;
4200 : :
4201 : : /* ASO WQE. */
4202 : : struct mlx5_aso_wqe {
4203 : : struct mlx5_wqe_cseg general_cseg;
4204 : : struct mlx5_aso_cseg aso_cseg;
4205 : : struct mlx5_aso_dseg aso_dseg;
4206 : : } __rte_packed;
4207 : :
4208 : : enum {
4209 : : MLX5_EVENT_TYPE_OBJECT_CHANGE = 0x27,
4210 : : MLX5_EVENT_TYPE_SRQ_LIMIT_REACHED = 0x14,
4211 : : };
4212 : :
4213 : : enum {
4214 : : MLX5_QP_ST_RC = 0x0,
4215 : : };
4216 : :
4217 : : enum {
4218 : : MLX5_QP_PM_MIGRATED = 0x3,
4219 : : };
4220 : :
4221 : : enum {
4222 : : MLX5_NON_ZERO_RQ = 0x0,
4223 : : MLX5_SRQ_RQ = 0x1,
4224 : : MLX5_CRQ_RQ = 0x2,
4225 : : MLX5_ZERO_LEN_RQ = 0x3,
4226 : : };
4227 : :
4228 : : struct mlx5_ifc_ads_bits {
4229 : : u8 fl[0x1];
4230 : : u8 free_ar[0x1];
4231 : : u8 reserved_at_2[0xe];
4232 : : u8 pkey_index[0x10];
4233 : : u8 reserved_at_20[0x8];
4234 : : u8 grh[0x1];
4235 : : u8 mlid[0x7];
4236 : : u8 rlid[0x10];
4237 : : u8 ack_timeout[0x5];
4238 : : u8 reserved_at_45[0x3];
4239 : : u8 src_addr_index[0x8];
4240 : : u8 reserved_at_50[0x4];
4241 : : u8 stat_rate[0x4];
4242 : : u8 hop_limit[0x8];
4243 : : u8 reserved_at_60[0x4];
4244 : : u8 tclass[0x8];
4245 : : u8 flow_label[0x14];
4246 : : u8 rgid_rip[16][0x8];
4247 : : u8 reserved_at_100[0x4];
4248 : : u8 f_dscp[0x1];
4249 : : u8 f_ecn[0x1];
4250 : : u8 reserved_at_106[0x1];
4251 : : u8 f_eth_prio[0x1];
4252 : : u8 ecn[0x2];
4253 : : u8 dscp[0x6];
4254 : : u8 udp_sport[0x10];
4255 : : u8 dei_cfi[0x1];
4256 : : u8 eth_prio[0x3];
4257 : : u8 sl[0x4];
4258 : : u8 vhca_port_num[0x8];
4259 : : u8 rmac_47_32[0x10];
4260 : : u8 rmac_31_0[0x20];
4261 : : };
4262 : :
4263 : : struct mlx5_ifc_qpc_bits {
4264 : : u8 state[0x4];
4265 : : u8 lag_tx_port_affinity[0x4];
4266 : : u8 st[0x8];
4267 : : u8 reserved_at_10[0x3];
4268 : : u8 pm_state[0x2];
4269 : : u8 reserved_at_15[0x1];
4270 : : u8 req_e2e_credit_mode[0x2];
4271 : : u8 offload_type[0x4];
4272 : : u8 end_padding_mode[0x2];
4273 : : u8 reserved_at_1e[0x2];
4274 : : u8 wq_signature[0x1];
4275 : : u8 block_lb_mc[0x1];
4276 : : u8 atomic_like_write_en[0x1];
4277 : : u8 latency_sensitive[0x1];
4278 : : u8 reserved_at_24[0x1];
4279 : : u8 drain_sigerr[0x1];
4280 : : u8 reserved_at_26[0x2];
4281 : : u8 pd[0x18];
4282 : : u8 mtu[0x3];
4283 : : u8 log_msg_max[0x5];
4284 : : u8 reserved_at_48[0x1];
4285 : : u8 log_rq_size[0x4];
4286 : : u8 log_rq_stride[0x3];
4287 : : u8 no_sq[0x1];
4288 : : u8 log_sq_size[0x4];
4289 : : u8 reserved_at_55[0x3];
4290 : : u8 ts_format[0x2];
4291 : : u8 reserved_at_5a[0x1];
4292 : : u8 rlky[0x1];
4293 : : u8 ulp_stateless_offload_mode[0x4];
4294 : : u8 counter_set_id[0x8];
4295 : : u8 uar_page[0x18];
4296 : : u8 reserved_at_80[0x8];
4297 : : u8 user_index[0x18];
4298 : : u8 reserved_at_a0[0x3];
4299 : : u8 log_page_size[0x5];
4300 : : u8 remote_qpn[0x18];
4301 : : struct mlx5_ifc_ads_bits primary_address_path;
4302 : : struct mlx5_ifc_ads_bits secondary_address_path;
4303 : : u8 log_ack_req_freq[0x4];
4304 : : u8 reserved_at_384[0x4];
4305 : : u8 log_sra_max[0x3];
4306 : : u8 reserved_at_38b[0x2];
4307 : : u8 retry_count[0x3];
4308 : : u8 rnr_retry[0x3];
4309 : : u8 reserved_at_393[0x1];
4310 : : u8 fre[0x1];
4311 : : u8 cur_rnr_retry[0x3];
4312 : : u8 cur_retry_count[0x3];
4313 : : u8 reserved_at_39b[0x5];
4314 : : u8 reserved_at_3a0[0x20];
4315 : : u8 reserved_at_3c0[0x8];
4316 : : u8 next_send_psn[0x18];
4317 : : u8 reserved_at_3e0[0x8];
4318 : : u8 cqn_snd[0x18];
4319 : : u8 reserved_at_400[0x8];
4320 : : u8 deth_sqpn[0x18];
4321 : : u8 reserved_at_420[0x20];
4322 : : u8 reserved_at_440[0x8];
4323 : : u8 last_acked_psn[0x18];
4324 : : u8 reserved_at_460[0x8];
4325 : : u8 ssn[0x18];
4326 : : u8 reserved_at_480[0x8];
4327 : : u8 log_rra_max[0x3];
4328 : : u8 reserved_at_48b[0x1];
4329 : : u8 atomic_mode[0x4];
4330 : : u8 rre[0x1];
4331 : : u8 rwe[0x1];
4332 : : u8 rae[0x1];
4333 : : u8 reserved_at_493[0x1];
4334 : : u8 page_offset[0x6];
4335 : : u8 reserved_at_49a[0x3];
4336 : : u8 cd_slave_receive[0x1];
4337 : : u8 cd_slave_send[0x1];
4338 : : u8 cd_master[0x1];
4339 : : u8 reserved_at_4a0[0x3];
4340 : : u8 min_rnr_nak[0x5];
4341 : : u8 next_rcv_psn[0x18];
4342 : : u8 reserved_at_4c0[0x8];
4343 : : u8 xrcd[0x18];
4344 : : u8 reserved_at_4e0[0x8];
4345 : : u8 cqn_rcv[0x18];
4346 : : u8 dbr_addr[0x40];
4347 : : u8 q_key[0x20];
4348 : : u8 reserved_at_560[0x5];
4349 : : u8 rq_type[0x3];
4350 : : u8 srqn_rmpn_xrqn[0x18];
4351 : : u8 reserved_at_580[0x8];
4352 : : u8 rmsn[0x18];
4353 : : u8 hw_sq_wqebb_counter[0x10];
4354 : : u8 sw_sq_wqebb_counter[0x10];
4355 : : u8 hw_rq_counter[0x20];
4356 : : u8 sw_rq_counter[0x20];
4357 : : u8 reserved_at_600[0x20];
4358 : : u8 reserved_at_620[0xf];
4359 : : u8 cgs[0x1];
4360 : : u8 cs_req[0x8];
4361 : : u8 cs_res[0x8];
4362 : : u8 dc_access_key[0x40];
4363 : : u8 reserved_at_680[0x3];
4364 : : u8 dbr_umem_valid[0x1];
4365 : : u8 reserved_at_684[0x9c];
4366 : : u8 dbr_umem_id[0x20];
4367 : : };
4368 : :
4369 : : struct mlx5_ifc_create_qp_out_bits {
4370 : : u8 status[0x8];
4371 : : u8 reserved_at_8[0x18];
4372 : : u8 syndrome[0x20];
4373 : : u8 reserved_at_40[0x8];
4374 : : u8 qpn[0x18];
4375 : : u8 reserved_at_60[0x20];
4376 : : };
4377 : :
4378 : : struct mlx5_ifc_qpc_extension_bits {
4379 : : u8 reserved_at_0[0x2];
4380 : : u8 mmo[0x1];
4381 : : u8 reserved_at_3[0x5fd];
4382 : : };
4383 : :
4384 : : #ifdef PEDANTIC
4385 : : #pragma GCC diagnostic ignored "-Wpedantic"
4386 : : #endif
4387 : : struct mlx5_ifc_qpc_pas_list_bits {
4388 : : u8 pas[0][0x40];
4389 : : };
4390 : :
4391 : : #ifdef PEDANTIC
4392 : : #pragma GCC diagnostic ignored "-Wpedantic"
4393 : : #endif
4394 : : struct mlx5_ifc_qpc_extension_and_pas_list_bits {
4395 : : struct mlx5_ifc_qpc_extension_bits qpc_data_extension;
4396 : : u8 pas[][0x40];
4397 : : };
4398 : :
4399 : :
4400 : : #ifdef PEDANTIC
4401 : : #pragma GCC diagnostic ignored "-Wpedantic"
4402 : : #endif
4403 : : struct mlx5_ifc_create_qp_in_bits {
4404 : : u8 opcode[0x10];
4405 : : u8 uid[0x10];
4406 : : u8 reserved_at_20[0x10];
4407 : : u8 op_mod[0x10];
4408 : : u8 qpc_ext[0x1];
4409 : : u8 reserved_at_41[0x3f];
4410 : : u8 opt_param_mask[0x20];
4411 : : u8 reserved_at_a0[0x20];
4412 : : struct mlx5_ifc_qpc_bits qpc;
4413 : : u8 wq_umem_offset[0x40];
4414 : : u8 wq_umem_id[0x20];
4415 : : u8 wq_umem_valid[0x1];
4416 : : u8 reserved_at_861[0x1f];
4417 : : union {
4418 : : struct mlx5_ifc_qpc_pas_list_bits qpc_pas_list;
4419 : : struct mlx5_ifc_qpc_extension_and_pas_list_bits
4420 : : qpc_extension_and_pas_list;
4421 : : };
4422 : : };
4423 : : #ifdef PEDANTIC
4424 : : #pragma GCC diagnostic error "-Wpedantic"
4425 : : #endif
4426 : :
4427 : : struct mlx5_ifc_sqerr2rts_qp_out_bits {
4428 : : u8 status[0x8];
4429 : : u8 reserved_at_8[0x18];
4430 : : u8 syndrome[0x20];
4431 : : u8 reserved_at_40[0x40];
4432 : : };
4433 : :
4434 : : struct mlx5_ifc_sqerr2rts_qp_in_bits {
4435 : : u8 opcode[0x10];
4436 : : u8 uid[0x10];
4437 : : u8 reserved_at_20[0x10];
4438 : : u8 op_mod[0x10];
4439 : : u8 reserved_at_40[0x8];
4440 : : u8 qpn[0x18];
4441 : : u8 reserved_at_60[0x20];
4442 : : u8 opt_param_mask[0x20];
4443 : : u8 reserved_at_a0[0x20];
4444 : : struct mlx5_ifc_qpc_bits qpc;
4445 : : u8 reserved_at_800[0x80];
4446 : : };
4447 : :
4448 : : struct mlx5_ifc_sqd2rts_qp_out_bits {
4449 : : u8 status[0x8];
4450 : : u8 reserved_at_8[0x18];
4451 : : u8 syndrome[0x20];
4452 : : u8 reserved_at_40[0x40];
4453 : : };
4454 : :
4455 : : struct mlx5_ifc_sqd2rts_qp_in_bits {
4456 : : u8 opcode[0x10];
4457 : : u8 uid[0x10];
4458 : : u8 reserved_at_20[0x10];
4459 : : u8 op_mod[0x10];
4460 : : u8 reserved_at_40[0x8];
4461 : : u8 qpn[0x18];
4462 : : u8 reserved_at_60[0x20];
4463 : : u8 opt_param_mask[0x20];
4464 : : u8 reserved_at_a0[0x20];
4465 : : struct mlx5_ifc_qpc_bits qpc;
4466 : : u8 reserved_at_800[0x80];
4467 : : };
4468 : :
4469 : : struct mlx5_ifc_rts2rts_qp_out_bits {
4470 : : u8 status[0x8];
4471 : : u8 reserved_at_8[0x18];
4472 : : u8 syndrome[0x20];
4473 : : u8 reserved_at_40[0x40];
4474 : : };
4475 : :
4476 : : struct mlx5_ifc_rts2rts_qp_in_bits {
4477 : : u8 opcode[0x10];
4478 : : u8 uid[0x10];
4479 : : u8 reserved_at_20[0x10];
4480 : : u8 op_mod[0x10];
4481 : : u8 reserved_at_40[0x8];
4482 : : u8 qpn[0x18];
4483 : : u8 reserved_at_60[0x20];
4484 : : u8 opt_param_mask[0x20];
4485 : : u8 reserved_at_a0[0x20];
4486 : : struct mlx5_ifc_qpc_bits qpc;
4487 : : u8 reserved_at_800[0x80];
4488 : : };
4489 : :
4490 : : struct mlx5_ifc_rtr2rts_qp_out_bits {
4491 : : u8 status[0x8];
4492 : : u8 reserved_at_8[0x18];
4493 : : u8 syndrome[0x20];
4494 : : u8 reserved_at_40[0x40];
4495 : : };
4496 : :
4497 : : struct mlx5_ifc_rtr2rts_qp_in_bits {
4498 : : u8 opcode[0x10];
4499 : : u8 uid[0x10];
4500 : : u8 reserved_at_20[0x10];
4501 : : u8 op_mod[0x10];
4502 : : u8 reserved_at_40[0x8];
4503 : : u8 qpn[0x18];
4504 : : u8 reserved_at_60[0x20];
4505 : : u8 opt_param_mask[0x20];
4506 : : u8 reserved_at_a0[0x20];
4507 : : struct mlx5_ifc_qpc_bits qpc;
4508 : : u8 reserved_at_800[0x80];
4509 : : };
4510 : :
4511 : : struct mlx5_ifc_rst2init_qp_out_bits {
4512 : : u8 status[0x8];
4513 : : u8 reserved_at_8[0x18];
4514 : : u8 syndrome[0x20];
4515 : : u8 reserved_at_40[0x40];
4516 : : };
4517 : :
4518 : : struct mlx5_ifc_rst2init_qp_in_bits {
4519 : : u8 opcode[0x10];
4520 : : u8 uid[0x10];
4521 : : u8 reserved_at_20[0x10];
4522 : : u8 op_mod[0x10];
4523 : : u8 reserved_at_40[0x8];
4524 : : u8 qpn[0x18];
4525 : : u8 reserved_at_60[0x20];
4526 : : u8 opt_param_mask[0x20];
4527 : : u8 reserved_at_a0[0x20];
4528 : : struct mlx5_ifc_qpc_bits qpc;
4529 : : u8 reserved_at_800[0x80];
4530 : : };
4531 : :
4532 : : struct mlx5_ifc_init2rtr_qp_out_bits {
4533 : : u8 status[0x8];
4534 : : u8 reserved_at_8[0x18];
4535 : : u8 syndrome[0x20];
4536 : : u8 reserved_at_40[0x40];
4537 : : };
4538 : :
4539 : : struct mlx5_ifc_init2rtr_qp_in_bits {
4540 : : u8 opcode[0x10];
4541 : : u8 uid[0x10];
4542 : : u8 reserved_at_20[0x10];
4543 : : u8 op_mod[0x10];
4544 : : u8 reserved_at_40[0x8];
4545 : : u8 qpn[0x18];
4546 : : u8 reserved_at_60[0x20];
4547 : : u8 opt_param_mask[0x20];
4548 : : u8 reserved_at_a0[0x20];
4549 : : struct mlx5_ifc_qpc_bits qpc;
4550 : : u8 reserved_at_800[0x80];
4551 : : };
4552 : :
4553 : : struct mlx5_ifc_init2init_qp_out_bits {
4554 : : u8 status[0x8];
4555 : : u8 reserved_at_8[0x18];
4556 : : u8 syndrome[0x20];
4557 : : u8 reserved_at_40[0x40];
4558 : : };
4559 : :
4560 : : struct mlx5_ifc_init2init_qp_in_bits {
4561 : : u8 opcode[0x10];
4562 : : u8 uid[0x10];
4563 : : u8 reserved_at_20[0x10];
4564 : : u8 op_mod[0x10];
4565 : : u8 reserved_at_40[0x8];
4566 : : u8 qpn[0x18];
4567 : : u8 reserved_at_60[0x20];
4568 : : u8 opt_param_mask[0x20];
4569 : : u8 reserved_at_a0[0x20];
4570 : : struct mlx5_ifc_qpc_bits qpc;
4571 : : u8 reserved_at_800[0x80];
4572 : : };
4573 : :
4574 : : struct mlx5_ifc_2rst_qp_out_bits {
4575 : : u8 status[0x8];
4576 : : u8 reserved_at_8[0x18];
4577 : : u8 syndrome[0x20];
4578 : : u8 reserved_at_40[0x40];
4579 : : };
4580 : :
4581 : : struct mlx5_ifc_2rst_qp_in_bits {
4582 : : u8 opcode[0x10];
4583 : : u8 uid[0x10];
4584 : : u8 vhca_tunnel_id[0x10];
4585 : : u8 op_mod[0x10];
4586 : : u8 reserved_at_80[0x8];
4587 : : u8 qpn[0x18];
4588 : : u8 reserved_at_a0[0x20];
4589 : : };
4590 : :
4591 : : struct mlx5_ifc_dealloc_pd_out_bits {
4592 : : u8 status[0x8];
4593 : : u8 reserved_0[0x18];
4594 : : u8 syndrome[0x20];
4595 : : u8 reserved_1[0x40];
4596 : : };
4597 : :
4598 : : struct mlx5_ifc_dealloc_pd_in_bits {
4599 : : u8 opcode[0x10];
4600 : : u8 reserved_0[0x10];
4601 : : u8 reserved_1[0x10];
4602 : : u8 op_mod[0x10];
4603 : : u8 reserved_2[0x8];
4604 : : u8 pd[0x18];
4605 : : u8 reserved_3[0x20];
4606 : : };
4607 : :
4608 : : struct mlx5_ifc_alloc_pd_out_bits {
4609 : : u8 status[0x8];
4610 : : u8 reserved_0[0x18];
4611 : : u8 syndrome[0x20];
4612 : : u8 reserved_1[0x8];
4613 : : u8 pd[0x18];
4614 : : u8 reserved_2[0x20];
4615 : : };
4616 : :
4617 : : struct mlx5_ifc_alloc_pd_in_bits {
4618 : : u8 opcode[0x10];
4619 : : u8 reserved_0[0x10];
4620 : : u8 reserved_1[0x10];
4621 : : u8 op_mod[0x10];
4622 : : u8 reserved_2[0x40];
4623 : : };
4624 : :
4625 : : #ifdef PEDANTIC
4626 : : #pragma GCC diagnostic ignored "-Wpedantic"
4627 : : #endif
4628 : : struct mlx5_ifc_query_qp_out_bits {
4629 : : u8 status[0x8];
4630 : : u8 reserved_at_8[0x18];
4631 : : u8 syndrome[0x20];
4632 : : u8 reserved_at_40[0x40];
4633 : : u8 opt_param_mask[0x20];
4634 : : u8 reserved_at_a0[0x20];
4635 : : struct mlx5_ifc_qpc_bits qpc;
4636 : : u8 reserved_at_800[0x80];
4637 : : u8 pas[][0x40];
4638 : : };
4639 : : #ifdef PEDANTIC
4640 : : #pragma GCC diagnostic error "-Wpedantic"
4641 : : #endif
4642 : :
4643 : : struct mlx5_ifc_query_qp_in_bits {
4644 : : u8 opcode[0x10];
4645 : : u8 reserved_at_10[0x10];
4646 : : u8 reserved_at_20[0x10];
4647 : : u8 op_mod[0x10];
4648 : : u8 reserved_at_40[0x8];
4649 : : u8 qpn[0x18];
4650 : : u8 reserved_at_60[0x20];
4651 : : };
4652 : :
4653 : : enum {
4654 : : MLX5_DATA_RATE = 0x0,
4655 : : MLX5_WQE_RATE = 0x1,
4656 : : };
4657 : :
4658 : : struct mlx5_ifc_set_pp_rate_limit_context_bits {
4659 : : u8 rate_limit[0x20];
4660 : : u8 burst_upper_bound[0x20];
4661 : : u8 reserved_at_40[0xC];
4662 : : u8 rate_mode[0x4];
4663 : : u8 typical_packet_size[0x10];
4664 : : u8 reserved_at_60[0x120];
4665 : : };
4666 : :
4667 : : #define MLX5_ACCESS_REGISTER_DATA_DWORD_MAX 8u
4668 : :
4669 : : #ifdef PEDANTIC
4670 : : #pragma GCC diagnostic ignored "-Wpedantic"
4671 : : #endif
4672 : : struct mlx5_ifc_access_register_out_bits {
4673 : : u8 status[0x8];
4674 : : u8 reserved_at_8[0x18];
4675 : : u8 syndrome[0x20];
4676 : : u8 reserved_at_40[0x40];
4677 : : u8 register_data[][0x20];
4678 : : };
4679 : :
4680 : : struct mlx5_ifc_access_register_in_bits {
4681 : : u8 opcode[0x10];
4682 : : u8 reserved_at_10[0x10];
4683 : : u8 reserved_at_20[0x10];
4684 : : u8 op_mod[0x10];
4685 : : u8 reserved_at_40[0x10];
4686 : : u8 register_id[0x10];
4687 : : u8 argument[0x20];
4688 : : u8 register_data[][0x20];
4689 : : };
4690 : : #ifdef PEDANTIC
4691 : : #pragma GCC diagnostic error "-Wpedantic"
4692 : : #endif
4693 : :
4694 : : enum {
4695 : : MLX5_ACCESS_REGISTER_IN_OP_MOD_WRITE = 0x0,
4696 : : MLX5_ACCESS_REGISTER_IN_OP_MOD_READ = 0x1,
4697 : : };
4698 : :
4699 : : enum {
4700 : : MLX5_REGISTER_ID_MTUTC = 0x9055,
4701 : : MLX5_CRYPTO_OPERATIONAL_REGISTER_ID = 0xC002,
4702 : : MLX5_CRYPTO_COMMISSIONING_REGISTER_ID = 0xC003,
4703 : : MLX5_IMPORT_KEK_HANDLE_REGISTER_ID = 0xC004,
4704 : : MLX5_CREDENTIAL_HANDLE_REGISTER_ID = 0xC005,
4705 : : MLX5_QSHR_REGISTER_ID = 0x4030,
4706 : : };
4707 : :
4708 : : struct mlx5_ifc_register_mtutc_bits {
4709 : : u8 time_stamp_mode[0x2];
4710 : : u8 time_stamp_state[0x2];
4711 : : u8 reserved_at_4[0x18];
4712 : : u8 operation[0x4];
4713 : : u8 freq_adjustment[0x20];
4714 : : u8 reserved_at_40[0x40];
4715 : : u8 utc_sec[0x20];
4716 : : u8 utc_nsec[0x20];
4717 : : u8 time_adjustment[0x20];
4718 : : };
4719 : :
4720 : : struct mlx5_ifc_ets_global_config_register_bits {
4721 : : u8 reserved_at_0[0x2];
4722 : : u8 rate_limit_update[0x1];
4723 : : u8 reserved_at_3[0x29];
4724 : : u8 max_bw_units[0x4];
4725 : : u8 reserved_at_48[0x8];
4726 : : u8 max_bw_value[0x8];
4727 : : };
4728 : :
4729 : : #define ETS_GLOBAL_CONFIG_BW_UNIT_DISABLED 0x0
4730 : : #define ETS_GLOBAL_CONFIG_BW_UNIT_HUNDREDS_MBPS 0x3
4731 : : #define ETS_GLOBAL_CONFIG_BW_UNIT_GBPS 0x4
4732 : :
4733 : : struct mlx5_ifc_register_qshr_bits {
4734 : : u8 reserved_at_0[0x4];
4735 : : u8 connected_host[0x1];
4736 : : u8 vqos[0x1];
4737 : : u8 fast_response[0x1];
4738 : : u8 reserved_at_7[0x1];
4739 : : u8 local_port[0x8];
4740 : : u8 reserved_at_16[0x230];
4741 : : struct mlx5_ifc_ets_global_config_register_bits global_config;
4742 : : };
4743 : :
4744 : : #define MLX5_MTUTC_TIMESTAMP_MODE_INTERNAL_TIMER 0
4745 : : #define MLX5_MTUTC_TIMESTAMP_MODE_REAL_TIME 1
4746 : :
4747 : : struct mlx5_ifc_crypto_operational_register_bits {
4748 : : u8 wrapped_crypto_operational[0x1];
4749 : : u8 reserved_at_1[0x1b];
4750 : : u8 kek_size[0x4];
4751 : : u8 reserved_at_20[0x20];
4752 : : u8 credential[0x140];
4753 : : u8 kek[0x100];
4754 : : u8 reserved_at_280[0x180];
4755 : : };
4756 : :
4757 : : struct mlx5_ifc_crypto_caps_bits {
4758 : : u8 wrapped_crypto_operational[0x1];
4759 : : u8 wrapped_crypto_going_to_commissioning[0x1];
4760 : : u8 sw_wrapped_dek[0x1];
4761 : : u8 synchronize_dek[0x1];
4762 : : u8 int_kek_manual[0x1];
4763 : : u8 int_kek_auto[0x1];
4764 : : u8 reserved_at_6[0xd];
4765 : : u8 sw_wrapped_dek_key_purpose[0x1];
4766 : : u8 reserved_at_14[0x4];
4767 : : u8 wrapped_import_method[0x8];
4768 : : u8 reserved_at_20[0x3];
4769 : : u8 log_dek_max_alloc[0x5];
4770 : : u8 reserved_at_28[0x3];
4771 : : u8 log_max_num_deks[0x5];
4772 : : u8 reserved_at_30[0x3];
4773 : : u8 log_max_num_import_keks[0x5];
4774 : : u8 reserved_at_38[0x3];
4775 : : u8 log_max_num_creds[0x5];
4776 : : u8 failed_selftests[0x10];
4777 : : u8 num_nv_import_keks[0x8];
4778 : : u8 num_nv_credentials[0x8];
4779 : : u8 reserved_at_60[0x3];
4780 : : u8 log_dek_granularity[0x5];
4781 : : u8 reserved_at_68[0x3];
4782 : : u8 log_max_num_int_kek[0x5];
4783 : : u8 sw_wrapped_dek_new[0x10];
4784 : : u8 reserved_at_80[0x80];
4785 : : u8 crypto_mmo_qp[0x1];
4786 : : u8 crypto_aes_gcm_256_encrypt[0x1];
4787 : : u8 crypto_aes_gcm_128_encrypt[0x1];
4788 : : u8 crypto_aes_gcm_256_decrypt[0x1];
4789 : : u8 crypto_aes_gcm_128_decrypt[0x1];
4790 : : u8 gcm_auth_tag_128[0x1];
4791 : : u8 gcm_auth_tag_96[0x1];
4792 : : u8 reserved_at_107[0x3];
4793 : : u8 log_crypto_mmo_max_size[0x6];
4794 : : u8 reserved_at_110[0x10];
4795 : : u8 reserved_at_120[0x6e0];
4796 : : };
4797 : :
4798 : : struct mlx5_ifc_crypto_commissioning_register_bits {
4799 : : u8 token[0x1]; /* TODO: add size after PRM update */
4800 : : };
4801 : :
4802 : : struct mlx5_ifc_import_kek_handle_register_bits {
4803 : : struct mlx5_ifc_crypto_login_bits crypto_login_object;
4804 : : struct mlx5_ifc_import_kek_bits import_kek_object;
4805 : : u8 reserved_at_200[0x4];
4806 : : u8 write_operation[0x4];
4807 : : u8 import_kek_id[0x18];
4808 : : u8 reserved_at_220[0xe0];
4809 : : };
4810 : :
4811 : : struct mlx5_ifc_credential_handle_register_bits {
4812 : : struct mlx5_ifc_crypto_login_bits crypto_login_object;
4813 : : struct mlx5_ifc_credential_bits credential_object;
4814 : : u8 reserved_at_200[0x4];
4815 : : u8 write_operation[0x4];
4816 : : u8 credential_id[0x18];
4817 : : u8 reserved_at_220[0xe0];
4818 : : };
4819 : :
4820 : : enum {
4821 : : MLX5_REGISTER_ADD_OPERATION = 0x1,
4822 : : MLX5_REGISTER_DELETE_OPERATION = 0x2,
4823 : : };
4824 : :
4825 : : struct mlx5_ifc_parse_graph_arc_bits {
4826 : : u8 start_inner_tunnel[0x1];
4827 : : u8 reserved_at_1[0x7];
4828 : : u8 arc_parse_graph_node[0x8];
4829 : : u8 compare_condition_value[0x10];
4830 : : u8 parse_graph_node_handle[0x20];
4831 : : u8 reserved_at_40[0x40];
4832 : : };
4833 : :
4834 : : struct mlx5_ifc_parse_graph_flow_match_sample_bits {
4835 : : u8 flow_match_sample_en[0x1];
4836 : : u8 reserved_at_1[0x3];
4837 : : u8 flow_match_sample_offset_mode[0x4];
4838 : : u8 reserved_at_5[0x8];
4839 : : u8 flow_match_sample_field_offset[0x10];
4840 : : u8 reserved_at_32[0x4];
4841 : : u8 flow_match_sample_field_offset_shift[0x4];
4842 : : u8 flow_match_sample_field_base_offset[0x8];
4843 : : u8 reserved_at_48[0xd];
4844 : : u8 flow_match_sample_tunnel_mode[0x3];
4845 : : u8 flow_match_sample_field_offset_mask[0x20];
4846 : : u8 flow_match_sample_field_id[0x20];
4847 : : };
4848 : :
4849 : : struct mlx5_ifc_parse_graph_flex_bits {
4850 : : u8 modify_field_select[0x40];
4851 : : u8 reserved_at_64[0x20];
4852 : : u8 header_length_base_value[0x10];
4853 : : u8 reserved_at_112[0x4];
4854 : : u8 header_length_field_shift[0x4];
4855 : : u8 reserved_at_120[0x4];
4856 : : u8 header_length_mode[0x4];
4857 : : u8 header_length_field_offset[0x10];
4858 : : u8 next_header_field_offset[0x10];
4859 : : u8 reserved_at_160[0x12];
4860 : : u8 head_anchor_id[0x6];
4861 : : u8 reserved_at_178[0x3];
4862 : : u8 next_header_field_size[0x5];
4863 : : u8 header_length_field_mask[0x20];
4864 : : u8 reserved_at_224[0x20];
4865 : : struct mlx5_ifc_parse_graph_flow_match_sample_bits sample_table[0x8];
4866 : : struct mlx5_ifc_parse_graph_arc_bits input_arc[0x8];
4867 : : struct mlx5_ifc_parse_graph_arc_bits output_arc[0x8];
4868 : : };
4869 : :
4870 : : struct mlx5_ifc_create_flex_parser_in_bits {
4871 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4872 : : struct mlx5_ifc_parse_graph_flex_bits flex;
4873 : : };
4874 : :
4875 : : struct mlx5_ifc_create_flex_parser_out_bits {
4876 : : struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
4877 : : struct mlx5_ifc_parse_graph_flex_bits flex;
4878 : : };
4879 : :
4880 : : struct mlx5_ifc_parse_graph_flex_out_bits {
4881 : : u8 status[0x8];
4882 : : u8 reserved_at_8[0x18];
4883 : : u8 syndrome[0x20];
4884 : : u8 reserved_at_40[0x40];
4885 : : struct mlx5_ifc_parse_graph_flex_bits capability;
4886 : : };
4887 : :
4888 : : struct regexp_params_field_select_bits {
4889 : : u8 reserved_at_0[0x1d];
4890 : : u8 rof_mkey[0x1];
4891 : : u8 stop_engine[0x1];
4892 : : u8 reserved_at_1f[0x1];
4893 : : };
4894 : :
4895 : : struct mlx5_ifc_regexp_params_bits {
4896 : : u8 reserved_at_0[0x1f];
4897 : : u8 stop_engine[0x1];
4898 : : u8 reserved_at_20[0x60];
4899 : : u8 rof_mkey[0x20];
4900 : : u8 rof_size[0x20];
4901 : : u8 rof_mkey_va[0x40];
4902 : : u8 reserved_at_100[0x80];
4903 : : };
4904 : :
4905 : : struct mlx5_ifc_set_regexp_params_in_bits {
4906 : : u8 opcode[0x10];
4907 : : u8 uid[0x10];
4908 : : u8 reserved_at_20[0x10];
4909 : : u8 op_mod[0x10];
4910 : : u8 reserved_at_40[0x18];
4911 : : u8 engine_id[0x8];
4912 : : struct regexp_params_field_select_bits field_select;
4913 : : struct mlx5_ifc_regexp_params_bits regexp_params;
4914 : : };
4915 : :
4916 : : struct mlx5_ifc_set_regexp_params_out_bits {
4917 : : u8 status[0x8];
4918 : : u8 reserved_at_8[0x18];
4919 : : u8 syndrome[0x20];
4920 : : u8 reserved_at_18[0x40];
4921 : : };
4922 : :
4923 : : struct mlx5_ifc_query_regexp_params_in_bits {
4924 : : u8 opcode[0x10];
4925 : : u8 uid[0x10];
4926 : : u8 reserved_at_20[0x10];
4927 : : u8 op_mod[0x10];
4928 : : u8 reserved_at_40[0x18];
4929 : : u8 engine_id[0x8];
4930 : : u8 reserved[0x20];
4931 : : };
4932 : :
4933 : : struct mlx5_ifc_query_regexp_params_out_bits {
4934 : : u8 status[0x8];
4935 : : u8 reserved_at_8[0x18];
4936 : : u8 syndrome[0x20];
4937 : : u8 reserved[0x40];
4938 : : struct mlx5_ifc_regexp_params_bits regexp_params;
4939 : : };
4940 : :
4941 : : struct mlx5_ifc_set_regexp_register_in_bits {
4942 : : u8 opcode[0x10];
4943 : : u8 uid[0x10];
4944 : : u8 reserved_at_20[0x10];
4945 : : u8 op_mod[0x10];
4946 : : u8 reserved_at_40[0x18];
4947 : : u8 engine_id[0x8];
4948 : : u8 register_address[0x20];
4949 : : u8 register_data[0x20];
4950 : : u8 reserved[0x60];
4951 : : };
4952 : :
4953 : : struct mlx5_ifc_set_regexp_register_out_bits {
4954 : : u8 status[0x8];
4955 : : u8 reserved_at_8[0x18];
4956 : : u8 syndrome[0x20];
4957 : : u8 reserved[0x40];
4958 : : };
4959 : :
4960 : : struct mlx5_ifc_query_regexp_register_in_bits {
4961 : : u8 opcode[0x10];
4962 : : u8 uid[0x10];
4963 : : u8 reserved_at_20[0x10];
4964 : : u8 op_mod[0x10];
4965 : : u8 reserved_at_40[0x18];
4966 : : u8 engine_id[0x8];
4967 : : u8 register_address[0x20];
4968 : : };
4969 : :
4970 : : struct mlx5_ifc_query_regexp_register_out_bits {
4971 : : u8 status[0x8];
4972 : : u8 reserved_at_8[0x18];
4973 : : u8 syndrome[0x20];
4974 : : u8 reserved[0x20];
4975 : : u8 register_data[0x20];
4976 : : };
4977 : :
4978 : : /* Queue counters. */
4979 : : struct mlx5_ifc_alloc_q_counter_out_bits {
4980 : : u8 status[0x8];
4981 : : u8 reserved_at_8[0x18];
4982 : : u8 syndrome[0x20];
4983 : : u8 reserved_at_40[0x18];
4984 : : u8 counter_set_id[0x8];
4985 : : u8 reserved_at_60[0x20];
4986 : : };
4987 : :
4988 : : struct mlx5_ifc_alloc_q_counter_in_bits {
4989 : : u8 opcode[0x10];
4990 : : u8 uid[0x10];
4991 : : u8 reserved_at_20[0x10];
4992 : : u8 op_mod[0x10];
4993 : : u8 reserved_at_40[0x40];
4994 : : };
4995 : :
4996 : : struct mlx5_ifc_query_q_counter_out_bits {
4997 : : u8 status[0x8];
4998 : : u8 reserved_at_8[0x18];
4999 : : u8 syndrome[0x20];
5000 : : u8 reserved_at_40[0x40];
5001 : : u8 rx_write_requests[0x20];
5002 : : u8 reserved_at_a0[0x20];
5003 : : u8 rx_read_requests[0x20];
5004 : : u8 reserved_at_e0[0x20];
5005 : : u8 rx_atomic_requests[0x20];
5006 : : u8 reserved_at_120[0x20];
5007 : : u8 rx_dct_connect[0x20];
5008 : : u8 reserved_at_160[0x20];
5009 : : u8 out_of_buffer[0x20];
5010 : : u8 reserved_at_1a0[0x20];
5011 : : u8 out_of_sequence[0x20];
5012 : : u8 reserved_at_1e0[0x20];
5013 : : u8 duplicate_request[0x20];
5014 : : u8 reserved_at_220[0x20];
5015 : : u8 rnr_nak_retry_err[0x20];
5016 : : u8 reserved_at_260[0x20];
5017 : : u8 packet_seq_err[0x20];
5018 : : u8 reserved_at_2a0[0x20];
5019 : : u8 implied_nak_seq_err[0x20];
5020 : : u8 reserved_at_2e0[0x20];
5021 : : u8 local_ack_timeout_err[0x20];
5022 : : u8 reserved_at_320[0xa0];
5023 : : u8 resp_local_length_error[0x20];
5024 : : u8 req_local_length_error[0x20];
5025 : : u8 resp_local_qp_error[0x20];
5026 : : u8 local_operation_error[0x20];
5027 : : u8 resp_local_protection[0x20];
5028 : : u8 req_local_protection[0x20];
5029 : : u8 resp_cqe_error[0x20];
5030 : : u8 req_cqe_error[0x20];
5031 : : u8 req_mw_binding[0x20];
5032 : : u8 req_bad_response[0x20];
5033 : : u8 req_remote_invalid_request[0x20];
5034 : : u8 resp_remote_invalid_request[0x20];
5035 : : u8 req_remote_access_errors[0x20];
5036 : : u8 resp_remote_access_errors[0x20];
5037 : : u8 req_remote_operation_errors[0x20];
5038 : : u8 req_transport_retries_exceeded[0x20];
5039 : : u8 cq_overflow[0x20];
5040 : : u8 resp_cqe_flush_error[0x20];
5041 : : u8 req_cqe_flush_error[0x20];
5042 : : u8 reserved_at_620[0x1e0];
5043 : : };
5044 : :
5045 : : struct mlx5_ifc_query_q_counter_in_bits {
5046 : : u8 opcode[0x10];
5047 : : u8 uid[0x10];
5048 : : u8 reserved_at_20[0x10];
5049 : : u8 op_mod[0x10];
5050 : : u8 reserved_at_40[0x80];
5051 : : u8 clear[0x1];
5052 : : u8 reserved_at_c1[0x1f];
5053 : : u8 reserved_at_e0[0x18];
5054 : : u8 counter_set_id[0x8];
5055 : : };
5056 : :
5057 : : enum {
5058 : : FS_FT_NIC_RX = 0x0,
5059 : : FS_FT_NIC_TX = 0x1,
5060 : : FS_FT_FDB = 0x4,
5061 : : FS_FT_FDB_RX = 0xa,
5062 : : FS_FT_FDB_TX = 0xb,
5063 : : };
5064 : :
5065 : : struct mlx5_ifc_flow_table_context_bits {
5066 : : u8 reformat_en[0x1];
5067 : : u8 decap_en[0x1];
5068 : : u8 sw_owner[0x1];
5069 : : u8 termination_table[0x1];
5070 : : u8 table_miss_action[0x4];
5071 : : u8 level[0x8];
5072 : : u8 rtc_valid[0x1];
5073 : : u8 reserved_at_11[0x7];
5074 : : u8 log_size[0x8];
5075 : :
5076 : : u8 reserved_at_20[0x8];
5077 : : u8 table_miss_id[0x18];
5078 : :
5079 : : u8 reserved_at_40[0x8];
5080 : : u8 lag_master_next_table_id[0x18];
5081 : :
5082 : : u8 reserved_at_60[0x60];
5083 : :
5084 : : union {
5085 : : struct {
5086 : : u8 rtc_id_0[0x20];
5087 : : u8 rtc_id_1[0x20];
5088 : : u8 reserved_at_100[0x40];
5089 : : };
5090 : : struct {
5091 : : u8 sw_owner_icm_root_1[0x40];
5092 : : u8 sw_owner_icm_root_0[0x40];
5093 : : };
5094 : : };
5095 : : };
5096 : :
5097 : : struct mlx5_ifc_create_flow_table_in_bits {
5098 : : u8 opcode[0x10];
5099 : : u8 uid[0x10];
5100 : :
5101 : : u8 reserved_at_20[0x10];
5102 : : u8 op_mod[0x10];
5103 : :
5104 : : u8 other_vport[0x1];
5105 : : u8 reserved_at_41[0xf];
5106 : : u8 vport_number[0x10];
5107 : :
5108 : : u8 reserved_at_60[0x20];
5109 : :
5110 : : u8 table_type[0x8];
5111 : : u8 reserved_at_88[0x18];
5112 : :
5113 : : u8 reserved_at_a0[0x20];
5114 : :
5115 : : struct mlx5_ifc_flow_table_context_bits flow_table_context;
5116 : : };
5117 : :
5118 : : struct mlx5_ifc_create_flow_table_out_bits {
5119 : : u8 status[0x8];
5120 : : u8 icm_address_63_40[0x18];
5121 : : u8 syndrome[0x20];
5122 : : u8 icm_address_39_32[0x8];
5123 : : u8 table_id[0x18];
5124 : : u8 icm_address_31_0[0x20];
5125 : : };
5126 : :
5127 : : struct mlx5_ifc_query_flow_table_in_bits {
5128 : : u8 opcode[0x10];
5129 : : u8 uid[0x10];
5130 : :
5131 : : u8 vhca_tunnel_id[0x10];
5132 : : u8 op_mod[0x10];
5133 : :
5134 : : u8 other_vport[0x1];
5135 : : u8 reserved_at_41[0xf];
5136 : : u8 vport_number[0x10];
5137 : :
5138 : : u8 reserved_at_60[0x20];
5139 : :
5140 : : u8 table_type[0x8];
5141 : : u8 reserved_at_88[0x18];
5142 : :
5143 : : u8 reserved_at_a0[0x8];
5144 : : u8 table_id[0x18];
5145 : :
5146 : : u8 reserved_at_c0[0x140];
5147 : : };
5148 : :
5149 : : struct mlx5_ifc_query_flow_table_out_bits {
5150 : : u8 status[0x8];
5151 : : u8 reserved_at_8[0x18];
5152 : :
5153 : : u8 syndrome[0x20];
5154 : :
5155 : : u8 reserved_at_40[0x80];
5156 : :
5157 : : struct mlx5_ifc_flow_table_context_bits flow_table_context;
5158 : : };
5159 : :
5160 : : enum mlx5_flow_destination_type {
5161 : : MLX5_FLOW_DESTINATION_TYPE_VPORT = 0x0,
5162 : : MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE = 0x1,
5163 : : MLX5_FLOW_DESTINATION_TYPE_TIR = 0x2,
5164 : : };
5165 : :
5166 : : enum mlx5_flow_context_action {
5167 : : MLX5_FLOW_CONTEXT_ACTION_DROP = 1 << 1,
5168 : : MLX5_FLOW_CONTEXT_ACTION_FWD_DEST = 1 << 2,
5169 : : MLX5_FLOW_CONTEXT_ACTION_REFORMAT = 1 << 4,
5170 : : MLX5_FLOW_CONTEXT_ACTION_DECRYPT = 1 << 12,
5171 : : MLX5_FLOW_CONTEXT_ACTION_ENCRYPT = 1 << 13,
5172 : : };
5173 : :
5174 : : enum mlx5_flow_context_flow_source {
5175 : : MLX5_FLOW_CONTEXT_FLOW_SOURCE_ANY_VPORT = 0x0,
5176 : : MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK = 0x1,
5177 : : MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT = 0x2,
5178 : : };
5179 : :
5180 : : struct mlx5_ifc_set_fte_out_bits {
5181 : : u8 status[0x8];
5182 : : u8 reserved_at_8[0x18];
5183 : : u8 syndrome[0x20];
5184 : : u8 reserved_at_40[0x40];
5185 : : };
5186 : :
5187 : : struct mlx5_ifc_dest_format_bits {
5188 : : u8 destination_type[0x8];
5189 : : u8 destination_id[0x18];
5190 : : u8 destination_eswitch_owner_vhca_id_valid[0x1];
5191 : : u8 packet_reformat[0x1];
5192 : : u8 reserved_at_22[0xe];
5193 : : u8 destination_eswitch_owner_vhca_id[0x10];
5194 : : };
5195 : :
5196 : : struct mlx5_ifc_flow_counter_list_bits {
5197 : : u8 flow_counter_id[0x20];
5198 : : u8 reserved_at_20[0x20];
5199 : : };
5200 : :
5201 : : union mlx5_ifc_dest_format_flow_counter_list_auto_bits {
5202 : : struct mlx5_ifc_dest_format_bits dest_format;
5203 : : struct mlx5_ifc_flow_counter_list_bits flow_counter_list;
5204 : : u8 reserved_at_0[0x40];
5205 : : };
5206 : :
5207 : : struct mlx5_ifc_extended_dest_format_bits {
5208 : : struct mlx5_ifc_dest_format_bits destination_entry;
5209 : :
5210 : : u8 packet_reformat_id[0x20];
5211 : :
5212 : : u8 reserved_at_60[0x20];
5213 : : };
5214 : :
5215 : : #define MLX5_IFC_MULTI_PATH_FT_MAX_LEVEL 64
5216 : :
5217 : : #ifdef PEDANTIC
5218 : : #pragma GCC diagnostic ignored "-Wpedantic"
5219 : : #endif
5220 : : struct mlx5_ifc_flow_context_bits {
5221 : : u8 reserved_at_00[0x20];
5222 : : u8 group_id[0x20];
5223 : : u8 reserved_at_40[0x8];
5224 : : u8 flow_tag[0x18];
5225 : : u8 reserved_at_60[0x10];
5226 : : u8 action[0x10];
5227 : : u8 extended_destination[0x1];
5228 : : u8 reserved_at_81[0x1];
5229 : : u8 flow_source[0x2];
5230 : : u8 encrypt_decrypt_type[0x4];
5231 : : u8 destination_list_size[0x18];
5232 : : u8 reserved_at_a0[0x8];
5233 : : u8 flow_counter_list_size[0x18];
5234 : : u8 packet_reformat_id[0x20];
5235 : : u8 reserved_at_e0[0x40];
5236 : : u8 encrypt_decrypt_obj_id[0x20];
5237 : : u8 reserved_at_140[0x16c0];
5238 : : union mlx5_ifc_dest_format_flow_counter_list_auto_bits destination[];
5239 : : };
5240 : :
5241 : : struct mlx5_ifc_set_fte_in_bits {
5242 : : u8 opcode[0x10];
5243 : : u8 reserved_at_10[0x10];
5244 : : u8 reserved_at_20[0x10];
5245 : : u8 op_mod[0x10];
5246 : : u8 other_vport[0x1];
5247 : : u8 reserved_at_41[0xf];
5248 : : u8 vport_number[0x10];
5249 : : u8 reserved_at_60[0x20];
5250 : : u8 table_type[0x8];
5251 : : u8 reserved_at_88[0x18];
5252 : : u8 reserved_at_a0[0x8];
5253 : : u8 table_id[0x18];
5254 : : u8 ignore_flow_level[0x1];
5255 : : u8 reserved_at_c1[0x17];
5256 : : u8 modify_enable_mask[0x8];
5257 : : u8 reserved_at_e0[0x20];
5258 : : u8 flow_index[0x20];
5259 : : u8 reserved_at_120[0xe0];
5260 : : struct mlx5_ifc_flow_context_bits flow_context;
5261 : : };
5262 : :
5263 : : struct mlx5_ifc_create_flow_group_in_bits {
5264 : : u8 opcode[0x10];
5265 : : u8 reserved_at_10[0x10];
5266 : : u8 reserved_at_20[0x20];
5267 : : u8 other_vport[0x1];
5268 : : u8 reserved_at_41[0xf];
5269 : : u8 vport_number[0x10];
5270 : : u8 reserved_at_60[0x20];
5271 : : u8 table_type[0x8];
5272 : : u8 reserved_at_88[0x18];
5273 : : u8 reserved_at_a0[0x8];
5274 : : u8 table_id[0x18];
5275 : : u8 reserved_at_c0[0x1f40];
5276 : : };
5277 : :
5278 : : struct mlx5_ifc_create_flow_group_out_bits {
5279 : : u8 status[0x8];
5280 : : u8 reserved_at_8[0x18];
5281 : : u8 syndrome[0x20];
5282 : : u8 reserved_at_40[0x8];
5283 : : u8 group_id[0x18];
5284 : : u8 reserved_at_60[0x20];
5285 : : };
5286 : :
5287 : : enum {
5288 : : MLX5_IFC_MODIFY_FLOW_TABLE_MISS_ACTION = 1 << 0,
5289 : : MLX5_IFC_MODIFY_FLOW_TABLE_RTC_ID = 1 << 1,
5290 : : };
5291 : :
5292 : : enum {
5293 : : MLX5_IFC_MODIFY_FLOW_TABLE_MISS_ACTION_DEFAULT = 0,
5294 : : MLX5_IFC_MODIFY_FLOW_TABLE_MISS_ACTION_GOTO_TBL = 1,
5295 : : };
5296 : :
5297 : : struct mlx5_ifc_modify_flow_table_in_bits {
5298 : : u8 opcode[0x10];
5299 : : u8 uid[0x10];
5300 : :
5301 : : u8 reserved_at_20[0x10];
5302 : : u8 op_mod[0x10];
5303 : :
5304 : : u8 reserved_at_40[0x10];
5305 : : u8 vport_number[0x10];
5306 : :
5307 : : u8 reserved_at_60[0x10];
5308 : : u8 modify_field_select[0x10];
5309 : :
5310 : : u8 table_type[0x8];
5311 : : u8 reserved_at_88[0x18];
5312 : :
5313 : : u8 reserved_at_a0[0x8];
5314 : : u8 table_id[0x18];
5315 : :
5316 : : struct mlx5_ifc_flow_table_context_bits flow_table_context;
5317 : : };
5318 : :
5319 : : struct mlx5_ifc_modify_flow_table_out_bits {
5320 : : u8 status[0x8];
5321 : : u8 reserved_at_8[0x18];
5322 : :
5323 : : u8 syndrome[0x20];
5324 : :
5325 : : u8 reserved_at_40[0x60];
5326 : : };
5327 : :
5328 : : struct mlx5_ifc_packet_reformat_context_in_bits {
5329 : : u8 reformat_type[0x8];
5330 : : u8 reserved_at_8[0x4];
5331 : : u8 reformat_param_0[0x4];
5332 : : u8 reserved_at_16[0x6];
5333 : : u8 reformat_data_size[0xa];
5334 : :
5335 : : u8 reformat_param_1[0x8];
5336 : : u8 reserved_at_40[0x8];
5337 : : u8 reformat_data[6][0x8];
5338 : :
5339 : : u8 more_reformat_data[][0x8];
5340 : : };
5341 : :
5342 : : struct mlx5_ifc_alloc_packet_reformat_context_in_bits {
5343 : : u8 opcode[0x10];
5344 : : u8 uid[0x10];
5345 : :
5346 : : u8 reserved_at_20[0x10];
5347 : : u8 op_mod[0x10];
5348 : :
5349 : : u8 reserved_at_40[0xa0];
5350 : :
5351 : : u8 packet_reformat_context[];
5352 : : };
5353 : :
5354 : : struct mlx5_ifc_alloc_packet_reformat_out_bits {
5355 : : u8 status[0x8];
5356 : : u8 reserved_at_8[0x18];
5357 : :
5358 : : u8 syndrome[0x20];
5359 : :
5360 : : u8 packet_reformat_id[0x20];
5361 : :
5362 : : u8 reserved_at_60[0x20];
5363 : : };
5364 : :
5365 : : /* CQE format mask. */
5366 : : #define MLX5E_CQE_FORMAT_MASK 0xc
5367 : :
5368 : : /* MPW opcode. */
5369 : : #define MLX5_OPC_MOD_MPW 0x01
5370 : :
5371 : : /* Compressed Rx CQE structure. */
5372 : : struct mlx5_mini_cqe8 {
5373 : : union {
5374 : : uint32_t rx_hash_result;
5375 : : struct {
5376 : : union {
5377 : : uint16_t checksum;
5378 : : uint16_t flow_tag_high;
5379 : : struct {
5380 : : uint8_t reserved;
5381 : : uint8_t hdr_type;
5382 : : };
5383 : : };
5384 : : uint16_t stride_idx;
5385 : : };
5386 : : struct {
5387 : : uint16_t wqe_counter;
5388 : : uint8_t validity_iteration_count;
5389 : : uint8_t s_wqe_opcode;
5390 : : } s_wqe_info;
5391 : : };
5392 : : union {
5393 : : uint32_t byte_cnt_flow;
5394 : : uint32_t byte_cnt;
5395 : : };
5396 : : };
5397 : :
5398 : : /* Mini CQE responder format. */
5399 : : enum {
5400 : : MLX5_CQE_RESP_FORMAT_HASH = 0x0,
5401 : : MLX5_CQE_RESP_FORMAT_CSUM = 0x1,
5402 : : MLX5_CQE_RESP_FORMAT_FTAG_STRIDX = 0x2,
5403 : : MLX5_CQE_RESP_FORMAT_CSUM_STRIDX = 0x3,
5404 : : MLX5_CQE_RESP_FORMAT_L34H_STRIDX = 0x4,
5405 : : };
5406 : :
5407 : : /* srTCM PRM flow meter parameters. */
5408 : : enum {
5409 : : MLX5_FLOW_COLOR_RED = 0,
5410 : : MLX5_FLOW_COLOR_YELLOW,
5411 : : MLX5_FLOW_COLOR_GREEN,
5412 : : MLX5_FLOW_COLOR_UNDEFINED,
5413 : : };
5414 : :
5415 : : /* Maximum value of srTCM & trTCM metering parameters. */
5416 : : #define MLX5_SRTCM_XBS_MAX (0xFF * (1ULL << 0x1F))
5417 : : #define MLX5_SRTCM_XIR_MAX (8 * (1ULL << 30) * 0xFF)
5418 : :
5419 : : /* The bits meter color use. */
5420 : : #define MLX5_MTR_COLOR_BITS 8
5421 : :
5422 : : /* The bit size of one register. */
5423 : : #define MLX5_REG_BITS 32
5424 : :
5425 : : /* Idle bits for non-color usage in color register. */
5426 : : #define MLX5_MTR_IDLE_BITS_IN_COLOR_REG (MLX5_REG_BITS - MLX5_MTR_COLOR_BITS)
5427 : :
5428 : : /* Length mode of dynamic flex parser graph node. */
5429 : : enum mlx5_parse_graph_node_len_mode {
5430 : : MLX5_GRAPH_NODE_LEN_FIXED = 0x0,
5431 : : MLX5_GRAPH_NODE_LEN_FIELD = 0x1,
5432 : : MLX5_GRAPH_NODE_LEN_BITMASK = 0x2,
5433 : : };
5434 : :
5435 : : /* Offset mode of the samples of flex parser. */
5436 : : enum mlx5_parse_graph_flow_match_sample_offset_mode {
5437 : : MLX5_GRAPH_SAMPLE_OFFSET_FIXED = 0x0,
5438 : : MLX5_GRAPH_SAMPLE_OFFSET_FIELD = 0x1,
5439 : : MLX5_GRAPH_SAMPLE_OFFSET_BITMASK = 0x2,
5440 : : };
5441 : :
5442 : : enum mlx5_parse_graph_flow_match_sample_tunnel_mode {
5443 : : MLX5_GRAPH_SAMPLE_TUNNEL_OUTER = 0x0,
5444 : : MLX5_GRAPH_SAMPLE_TUNNEL_INNER = 0x1,
5445 : : MLX5_GRAPH_SAMPLE_TUNNEL_FIRST = 0x2
5446 : : };
5447 : :
5448 : : /* Node index for an input / output arc of the flex parser graph. */
5449 : : enum mlx5_parse_graph_arc_node_index {
5450 : : MLX5_GRAPH_ARC_NODE_NULL = 0x0,
5451 : : MLX5_GRAPH_ARC_NODE_HEAD = 0x1,
5452 : : MLX5_GRAPH_ARC_NODE_MAC = 0x2,
5453 : : MLX5_GRAPH_ARC_NODE_IP = 0x3,
5454 : : MLX5_GRAPH_ARC_NODE_GRE = 0x4,
5455 : : MLX5_GRAPH_ARC_NODE_UDP = 0x5,
5456 : : MLX5_GRAPH_ARC_NODE_MPLS = 0x6,
5457 : : MLX5_GRAPH_ARC_NODE_TCP = 0x7,
5458 : : MLX5_GRAPH_ARC_NODE_VXLAN_GPE = 0x8,
5459 : : MLX5_GRAPH_ARC_NODE_GENEVE = 0x9,
5460 : : MLX5_GRAPH_ARC_NODE_IPSEC_ESP = 0xa,
5461 : : MLX5_GRAPH_ARC_NODE_IPV4 = 0xb,
5462 : : MLX5_GRAPH_ARC_NODE_IPV6 = 0xc,
5463 : : MLX5_GRAPH_ARC_NODE_PROGRAMMABLE = 0x1f,
5464 : : };
5465 : :
5466 : : enum mlx5_packet_reformat_context_reformat_type {
5467 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x2,
5468 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L2_TO_L3_TUNNEL = 0x4,
5469 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV4 = 0x5,
5470 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L2_TO_L3_ESP_TUNNEL = 0x6,
5471 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_UDPV4 = 0x7,
5472 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_DEL_ESP_TRANSPORT = 0x8,
5473 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L3_ESP_TUNNEL_TO_L2 = 0x9,
5474 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_DEL_ESP_TRANSPORT_OVER_UDP = 0xA,
5475 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV6 = 0xB,
5476 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_UDPV6 = 0xC,
5477 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_NISP_TNL = 0xD,
5478 : : MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_REMOVE_NISP_TNL = 0xE,
5479 : : };
5480 : :
5481 : : #define MLX5_PARSE_GRAPH_FLOW_SAMPLE_MAX 8
5482 : : #define MLX5_PARSE_GRAPH_IN_ARC_MAX 8
5483 : : #define MLX5_PARSE_GRAPH_OUT_ARC_MAX 8
5484 : :
5485 : : /**
5486 : : * Convert a user mark to flow mark.
5487 : : *
5488 : : * @param val
5489 : : * Mark value to convert.
5490 : : *
5491 : : * @return
5492 : : * Converted mark value.
5493 : : */
5494 : : static inline uint32_t
5495 : 0 : mlx5_flow_mark_set(uint32_t val)
5496 : : {
5497 : : uint32_t ret;
5498 : :
5499 : : /*
5500 : : * Add one to the user value to differentiate un-marked flows from
5501 : : * marked flows, if the ID is equal to MLX5_FLOW_MARK_DEFAULT it
5502 : : * remains untouched.
5503 : : */
5504 [ # # # # : 0 : if (val != MLX5_FLOW_MARK_DEFAULT)
# # ]
5505 : 0 : ++val;
5506 : : #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
5507 : : /*
5508 : : * Mark is 24 bits (minus reserved values) but is stored on a 32 bit
5509 : : * word, byte-swapped by the kernel on little-endian systems. In this
5510 : : * case, left-shifting the resulting big-endian value ensures the
5511 : : * least significant 24 bits are retained when converting it back.
5512 : : */
5513 [ # # # # : 0 : ret = rte_cpu_to_be_32(val) >> 8;
# # ]
5514 : : #else
5515 : : ret = val;
5516 : : #endif
5517 : 0 : return ret;
5518 : : }
5519 : :
5520 : : /**
5521 : : * Convert a mark to user mark.
5522 : : *
5523 : : * @param val
5524 : : * Mark value to convert.
5525 : : *
5526 : : * @return
5527 : : * Converted mark value.
5528 : : */
5529 : : static inline uint32_t
5530 : : mlx5_flow_mark_get(uint32_t val)
5531 : : {
5532 : : /*
5533 : : * Subtract one from the retrieved value. It was added by
5534 : : * mlx5_flow_mark_set() to distinguish unmarked flows.
5535 : : */
5536 : : #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
5537 : 0 : return (val >> 8) - 1;
5538 : : #else
5539 : : return val - 1;
5540 : : #endif
5541 : : }
5542 : :
5543 : : /**
5544 : : * Convert a timestamp format to configure settings in the queue context.
5545 : : *
5546 : : * @param val
5547 : : * timestamp format supported by the queue.
5548 : : *
5549 : : * @return
5550 : : * Converted timestamp format settings.
5551 : : */
5552 : : static inline uint32_t
5553 : : mlx5_ts_format_conv(uint32_t ts_format)
5554 : : {
5555 : : return ts_format == MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR ?
5556 [ # # ]: 0 : MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING :
5557 : : MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT;
5558 : : }
5559 : :
5560 : : #endif /* RTE_PMD_MLX5_PRM_H_ */
|