17b4f1e6bSMatan Azrad /* SPDX-License-Identifier: BSD-3-Clause 27b4f1e6bSMatan Azrad * Copyright 2016 6WIND S.A. 37b4f1e6bSMatan Azrad * Copyright 2016 Mellanox Technologies, Ltd 47b4f1e6bSMatan Azrad */ 57b4f1e6bSMatan Azrad 67b4f1e6bSMatan Azrad #ifndef RTE_PMD_MLX5_PRM_H_ 77b4f1e6bSMatan Azrad #define RTE_PMD_MLX5_PRM_H_ 87b4f1e6bSMatan Azrad 94240b11eSDekel Peled #include <unistd.h> 104240b11eSDekel Peled 117b4f1e6bSMatan Azrad #include <rte_vect.h> 127b4f1e6bSMatan Azrad #include <rte_byteorder.h> 137b4f1e6bSMatan Azrad 149d60f545SOphir Munk #include <mlx5_glue.h> 157b4f1e6bSMatan Azrad #include "mlx5_autoconf.h" 167b4f1e6bSMatan Azrad 177b4f1e6bSMatan Azrad /* RSS hash key size. */ 187b4f1e6bSMatan Azrad #define MLX5_RSS_HASH_KEY_LEN 40 197b4f1e6bSMatan Azrad 207b4f1e6bSMatan Azrad /* Get CQE owner bit. */ 217b4f1e6bSMatan Azrad #define MLX5_CQE_OWNER(op_own) ((op_own) & MLX5_CQE_OWNER_MASK) 227b4f1e6bSMatan Azrad 237b4f1e6bSMatan Azrad /* Get CQE format. */ 247b4f1e6bSMatan Azrad #define MLX5_CQE_FORMAT(op_own) (((op_own) & MLX5E_CQE_FORMAT_MASK) >> 2) 257b4f1e6bSMatan Azrad 267b4f1e6bSMatan Azrad /* Get CQE opcode. */ 277b4f1e6bSMatan Azrad #define MLX5_CQE_OPCODE(op_own) (((op_own) & 0xf0) >> 4) 287b4f1e6bSMatan Azrad 29a7da07e5SAlexander Kozyrev /* Get CQE number of mini CQEs. */ 30a7da07e5SAlexander Kozyrev #define MLX5_CQE_NUM_MINIS(op_own) (((op_own) & 0xf0) >> 4) 31a7da07e5SAlexander Kozyrev 327b4f1e6bSMatan Azrad /* Get CQE solicited event. */ 337b4f1e6bSMatan Azrad #define MLX5_CQE_SE(op_own) (((op_own) >> 1) & 1) 347b4f1e6bSMatan Azrad 357b4f1e6bSMatan Azrad /* Invalidate a CQE. */ 367b4f1e6bSMatan Azrad #define MLX5_CQE_INVALIDATE (MLX5_CQE_INVALID << 4) 377b4f1e6bSMatan Azrad 38a7da07e5SAlexander Kozyrev /* Initialize CQE validity iteration count. */ 39a7da07e5SAlexander Kozyrev #define MLX5_CQE_VIC_INIT 0xffu 40a7da07e5SAlexander Kozyrev 4179a7e409SViacheslav Ovsiienko /* Hardware index widths. */ 4279a7e409SViacheslav Ovsiienko #define MLX5_CQ_INDEX_WIDTH 24 4379a7e409SViacheslav Ovsiienko #define MLX5_WQ_INDEX_WIDTH 16 4479a7e409SViacheslav Ovsiienko 457b4f1e6bSMatan Azrad /* WQE Segment sizes in bytes. */ 467b4f1e6bSMatan Azrad #define MLX5_WSEG_SIZE 16u 477b4f1e6bSMatan Azrad #define MLX5_WQE_CSEG_SIZE sizeof(struct mlx5_wqe_cseg) 487b4f1e6bSMatan Azrad #define MLX5_WQE_DSEG_SIZE sizeof(struct mlx5_wqe_dseg) 497b4f1e6bSMatan Azrad #define MLX5_WQE_ESEG_SIZE sizeof(struct mlx5_wqe_eseg) 507b4f1e6bSMatan Azrad 517b4f1e6bSMatan Azrad /* WQE/WQEBB size in bytes. */ 527b4f1e6bSMatan Azrad #define MLX5_WQE_SIZE sizeof(struct mlx5_wqe) 537b4f1e6bSMatan Azrad 547b4f1e6bSMatan Azrad /* 557b4f1e6bSMatan Azrad * Max size of a WQE session. 567b4f1e6bSMatan Azrad * Absolute maximum size is 63 (MLX5_DSEG_MAX) segments, 577b4f1e6bSMatan Azrad * the WQE size field in Control Segment is 6 bits wide. 587b4f1e6bSMatan Azrad */ 597b4f1e6bSMatan Azrad #define MLX5_WQE_SIZE_MAX (60 * MLX5_WSEG_SIZE) 607b4f1e6bSMatan Azrad 617b4f1e6bSMatan Azrad /* 627b4f1e6bSMatan Azrad * Default minimum number of Tx queues for inlining packets. 637b4f1e6bSMatan Azrad * If there are less queues as specified we assume we have 647b4f1e6bSMatan Azrad * no enough CPU resources (cycles) to perform inlining, 657b4f1e6bSMatan Azrad * the PCIe throughput is not supposed as bottleneck and 667b4f1e6bSMatan Azrad * inlining is disabled. 677b4f1e6bSMatan Azrad */ 687b4f1e6bSMatan Azrad #define MLX5_INLINE_MAX_TXQS 8u 697b4f1e6bSMatan Azrad #define MLX5_INLINE_MAX_TXQS_BLUEFIELD 16u 707b4f1e6bSMatan Azrad 717b4f1e6bSMatan Azrad /* 727b4f1e6bSMatan Azrad * Default packet length threshold to be inlined with 737b4f1e6bSMatan Azrad * enhanced MPW. If packet length exceeds the threshold 747b4f1e6bSMatan Azrad * the data are not inlined. Should be aligned in WQEBB 757b4f1e6bSMatan Azrad * boundary with accounting the title Control and Ethernet 767b4f1e6bSMatan Azrad * segments. 777b4f1e6bSMatan Azrad */ 787b4f1e6bSMatan Azrad #define MLX5_EMPW_DEF_INLINE_LEN (4u * MLX5_WQE_SIZE + \ 797b4f1e6bSMatan Azrad MLX5_DSEG_MIN_INLINE_SIZE) 807b4f1e6bSMatan Azrad /* 817b4f1e6bSMatan Azrad * Maximal inline data length sent with enhanced MPW. 827b4f1e6bSMatan Azrad * Is based on maximal WQE size. 837b4f1e6bSMatan Azrad */ 847b4f1e6bSMatan Azrad #define MLX5_EMPW_MAX_INLINE_LEN (MLX5_WQE_SIZE_MAX - \ 857b4f1e6bSMatan Azrad MLX5_WQE_CSEG_SIZE - \ 867b4f1e6bSMatan Azrad MLX5_WQE_ESEG_SIZE - \ 877b4f1e6bSMatan Azrad MLX5_WQE_DSEG_SIZE + \ 887b4f1e6bSMatan Azrad MLX5_DSEG_MIN_INLINE_SIZE) 897b4f1e6bSMatan Azrad /* 907b4f1e6bSMatan Azrad * Minimal amount of packets to be sent with EMPW. 917b4f1e6bSMatan Azrad * This limits the minimal required size of sent EMPW. 927b4f1e6bSMatan Azrad * If there are no enough resources to built minimal 937b4f1e6bSMatan Azrad * EMPW the sending loop exits. 947b4f1e6bSMatan Azrad */ 957b4f1e6bSMatan Azrad #define MLX5_EMPW_MIN_PACKETS (2u + 3u * 4u) 967b4f1e6bSMatan Azrad /* 977b4f1e6bSMatan Azrad * Maximal amount of packets to be sent with EMPW. 987b4f1e6bSMatan Azrad * This value is not recommended to exceed MLX5_TX_COMP_THRESH, 997b4f1e6bSMatan Azrad * otherwise there might be up to MLX5_EMPW_MAX_PACKETS mbufs 1007b4f1e6bSMatan Azrad * without CQE generation request, being multiplied by 1017b4f1e6bSMatan Azrad * MLX5_TX_COMP_MAX_CQE it may cause significant latency 1027b4f1e6bSMatan Azrad * in tx burst routine at the moment of freeing multiple mbufs. 1037b4f1e6bSMatan Azrad */ 1047b4f1e6bSMatan Azrad #define MLX5_EMPW_MAX_PACKETS MLX5_TX_COMP_THRESH 1057b4f1e6bSMatan Azrad #define MLX5_MPW_MAX_PACKETS 6 1067593cf1dSViacheslav Ovsiienko #define MLX5_MPW_INLINE_MAX_PACKETS 6 1077b4f1e6bSMatan Azrad 1087b4f1e6bSMatan Azrad /* 1097b4f1e6bSMatan Azrad * Default packet length threshold to be inlined with 1107b4f1e6bSMatan Azrad * ordinary SEND. Inlining saves the MR key search 1117b4f1e6bSMatan Azrad * and extra PCIe data fetch transaction, but eats the 1127b4f1e6bSMatan Azrad * CPU cycles. 1137b4f1e6bSMatan Azrad */ 1147b4f1e6bSMatan Azrad #define MLX5_SEND_DEF_INLINE_LEN (5U * MLX5_WQE_SIZE + \ 1157b4f1e6bSMatan Azrad MLX5_ESEG_MIN_INLINE_SIZE - \ 1167b4f1e6bSMatan Azrad MLX5_WQE_CSEG_SIZE - \ 1177b4f1e6bSMatan Azrad MLX5_WQE_ESEG_SIZE - \ 1187b4f1e6bSMatan Azrad MLX5_WQE_DSEG_SIZE) 1197b4f1e6bSMatan Azrad /* 1207b4f1e6bSMatan Azrad * Maximal inline data length sent with ordinary SEND. 1217b4f1e6bSMatan Azrad * Is based on maximal WQE size. 1227b4f1e6bSMatan Azrad */ 1237b4f1e6bSMatan Azrad #define MLX5_SEND_MAX_INLINE_LEN (MLX5_WQE_SIZE_MAX - \ 1247b4f1e6bSMatan Azrad MLX5_WQE_CSEG_SIZE - \ 1257b4f1e6bSMatan Azrad MLX5_WQE_ESEG_SIZE - \ 1267b4f1e6bSMatan Azrad MLX5_WQE_DSEG_SIZE + \ 1277b4f1e6bSMatan Azrad MLX5_ESEG_MIN_INLINE_SIZE) 1287b4f1e6bSMatan Azrad 1297f6e6beeSDekel Peled /* Missed in mlx5dv.h, should define here. */ 13079a7e409SViacheslav Ovsiienko #ifndef HAVE_MLX5_OPCODE_ENHANCED_MPSW 1317b4f1e6bSMatan Azrad #define MLX5_OPCODE_ENHANCED_MPSW 0x29u 13279a7e409SViacheslav Ovsiienko #endif 13379a7e409SViacheslav Ovsiienko 13479a7e409SViacheslav Ovsiienko #ifndef HAVE_MLX5_OPCODE_SEND_EN 13579a7e409SViacheslav Ovsiienko #define MLX5_OPCODE_SEND_EN 0x17u 13679a7e409SViacheslav Ovsiienko #endif 13779a7e409SViacheslav Ovsiienko 13879a7e409SViacheslav Ovsiienko #ifndef HAVE_MLX5_OPCODE_WAIT 13979a7e409SViacheslav Ovsiienko #define MLX5_OPCODE_WAIT 0x0fu 14079a7e409SViacheslav Ovsiienko #endif 1417b4f1e6bSMatan Azrad 1427dac7abeSViacheslav Ovsiienko #define MLX5_OPC_MOD_WAIT_CQ_PI 0u 1437dac7abeSViacheslav Ovsiienko #define MLX5_OPC_MOD_WAIT_DATA 1u 1447dac7abeSViacheslav Ovsiienko #define MLX5_OPC_MOD_WAIT_TIME 2u 1457dac7abeSViacheslav Ovsiienko 1467dac7abeSViacheslav Ovsiienko 1477dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_INVERT 0x10u 1487dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_ALWAYS_TRUE 0u 1497dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_EQUAL 1u 1507dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_BIGGER 2u 1517dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_SMALLER 3u 1527dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_CYCLIC_BIGGER 4u 1537dac7abeSViacheslav Ovsiienko #define MLX5_WAIT_COND_CYCLIC_SMALLER 5u 1547dac7abeSViacheslav Ovsiienko 1557f6e6beeSDekel Peled #ifndef HAVE_MLX5_OPCODE_ACCESS_ASO 1567f6e6beeSDekel Peled #define MLX5_OPCODE_ACCESS_ASO 0x2du 1577f6e6beeSDekel Peled #endif 1587f6e6beeSDekel Peled 1597b4f1e6bSMatan Azrad /* CQE value to inform that VLAN is stripped. */ 1607b4f1e6bSMatan Azrad #define MLX5_CQE_VLAN_STRIPPED (1u << 0) 1617b4f1e6bSMatan Azrad 1627b4f1e6bSMatan Azrad /* IPv4 options. */ 1637b4f1e6bSMatan Azrad #define MLX5_CQE_RX_IP_EXT_OPTS_PACKET (1u << 1) 1647b4f1e6bSMatan Azrad 1657b4f1e6bSMatan Azrad /* IPv6 packet. */ 1667b4f1e6bSMatan Azrad #define MLX5_CQE_RX_IPV6_PACKET (1u << 2) 1677b4f1e6bSMatan Azrad 1687b4f1e6bSMatan Azrad /* IPv4 packet. */ 1697b4f1e6bSMatan Azrad #define MLX5_CQE_RX_IPV4_PACKET (1u << 3) 1707b4f1e6bSMatan Azrad 1717b4f1e6bSMatan Azrad /* TCP packet. */ 1727b4f1e6bSMatan Azrad #define MLX5_CQE_RX_TCP_PACKET (1u << 4) 1737b4f1e6bSMatan Azrad 1747b4f1e6bSMatan Azrad /* UDP packet. */ 1757b4f1e6bSMatan Azrad #define MLX5_CQE_RX_UDP_PACKET (1u << 5) 1767b4f1e6bSMatan Azrad 1777b4f1e6bSMatan Azrad /* IP is fragmented. */ 1787b4f1e6bSMatan Azrad #define MLX5_CQE_RX_IP_FRAG_PACKET (1u << 7) 1797b4f1e6bSMatan Azrad 1807b4f1e6bSMatan Azrad /* L2 header is valid. */ 1817b4f1e6bSMatan Azrad #define MLX5_CQE_RX_L2_HDR_VALID (1u << 8) 1827b4f1e6bSMatan Azrad 1837b4f1e6bSMatan Azrad /* L3 header is valid. */ 1847b4f1e6bSMatan Azrad #define MLX5_CQE_RX_L3_HDR_VALID (1u << 9) 1857b4f1e6bSMatan Azrad 1867b4f1e6bSMatan Azrad /* L4 header is valid. */ 1877b4f1e6bSMatan Azrad #define MLX5_CQE_RX_L4_HDR_VALID (1u << 10) 1887b4f1e6bSMatan Azrad 1897b4f1e6bSMatan Azrad /* Outer packet, 0 IPv4, 1 IPv6. */ 1907b4f1e6bSMatan Azrad #define MLX5_CQE_RX_OUTER_PACKET (1u << 1) 1917b4f1e6bSMatan Azrad 1927b4f1e6bSMatan Azrad /* Tunnel packet bit in the CQE. */ 1937b4f1e6bSMatan Azrad #define MLX5_CQE_RX_TUNNEL_PACKET (1u << 0) 1947b4f1e6bSMatan Azrad 1957b4f1e6bSMatan Azrad /* Mask for LRO push flag in the CQE lro_tcppsh_abort_dupack field. */ 1967b4f1e6bSMatan Azrad #define MLX5_CQE_LRO_PUSH_MASK 0x40 1977b4f1e6bSMatan Azrad 1987b4f1e6bSMatan Azrad /* Mask for L4 type in the CQE hdr_type_etc field. */ 1997b4f1e6bSMatan Azrad #define MLX5_CQE_L4_TYPE_MASK 0x70 2007b4f1e6bSMatan Azrad 2017b4f1e6bSMatan Azrad /* The bit index of L4 type in CQE hdr_type_etc field. */ 2027b4f1e6bSMatan Azrad #define MLX5_CQE_L4_TYPE_SHIFT 0x4 2037b4f1e6bSMatan Azrad 2047b4f1e6bSMatan Azrad /* L4 type to indicate TCP packet without acknowledgment. */ 2057b4f1e6bSMatan Azrad #define MLX5_L4_HDR_TYPE_TCP_EMPTY_ACK 0x3 2067b4f1e6bSMatan Azrad 2077b4f1e6bSMatan Azrad /* L4 type to indicate TCP packet with acknowledgment. */ 2087b4f1e6bSMatan Azrad #define MLX5_L4_HDR_TYPE_TCP_WITH_ACL 0x4 2097b4f1e6bSMatan Azrad 2107b4f1e6bSMatan Azrad /* Inner L3 checksum offload (Tunneled packets only). */ 2117b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L3_INNER_CSUM (1u << 4) 2127b4f1e6bSMatan Azrad 2137b4f1e6bSMatan Azrad /* Inner L4 checksum offload (Tunneled packets only). */ 2147b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L4_INNER_CSUM (1u << 5) 2157b4f1e6bSMatan Azrad 2167b4f1e6bSMatan Azrad /* Outer L4 type is TCP. */ 2177b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L4_OUTER_TCP (0u << 5) 2187b4f1e6bSMatan Azrad 2197b4f1e6bSMatan Azrad /* Outer L4 type is UDP. */ 2207b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L4_OUTER_UDP (1u << 5) 2217b4f1e6bSMatan Azrad 2227b4f1e6bSMatan Azrad /* Outer L3 type is IPV4. */ 2237b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L3_OUTER_IPV4 (0u << 4) 2247b4f1e6bSMatan Azrad 2257b4f1e6bSMatan Azrad /* Outer L3 type is IPV6. */ 2267b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L3_OUTER_IPV6 (1u << 4) 2277b4f1e6bSMatan Azrad 2287b4f1e6bSMatan Azrad /* Inner L4 type is TCP. */ 2297b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L4_INNER_TCP (0u << 1) 2307b4f1e6bSMatan Azrad 2317b4f1e6bSMatan Azrad /* Inner L4 type is UDP. */ 2327b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L4_INNER_UDP (1u << 1) 2337b4f1e6bSMatan Azrad 2347b4f1e6bSMatan Azrad /* Inner L3 type is IPV4. */ 2357b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L3_INNER_IPV4 (0u << 0) 2367b4f1e6bSMatan Azrad 2377b4f1e6bSMatan Azrad /* Inner L3 type is IPV6. */ 2387b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_L3_INNER_IPV6 (1u << 0) 2397b4f1e6bSMatan Azrad 2407b4f1e6bSMatan Azrad /* VLAN insertion flag. */ 2417b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_VLAN_INSERT (1u << 31) 2427b4f1e6bSMatan Azrad 2437b4f1e6bSMatan Azrad /* Data inline segment flag. */ 2447b4f1e6bSMatan Azrad #define MLX5_ETH_WQE_DATA_INLINE (1u << 31) 2457b4f1e6bSMatan Azrad 2467b4f1e6bSMatan Azrad /* Is flow mark valid. */ 2477b4f1e6bSMatan Azrad #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN 2487b4f1e6bSMatan Azrad #define MLX5_FLOW_MARK_IS_VALID(val) ((val) & 0xffffff00) 2497b4f1e6bSMatan Azrad #else 2507b4f1e6bSMatan Azrad #define MLX5_FLOW_MARK_IS_VALID(val) ((val) & 0xffffff) 2517b4f1e6bSMatan Azrad #endif 2527b4f1e6bSMatan Azrad 2537b4f1e6bSMatan Azrad /* INVALID is used by packets matching no flow rules. */ 2547b4f1e6bSMatan Azrad #define MLX5_FLOW_MARK_INVALID 0 2557b4f1e6bSMatan Azrad 2567b4f1e6bSMatan Azrad /* Maximum allowed value to mark a packet. */ 2577b4f1e6bSMatan Azrad #define MLX5_FLOW_MARK_MAX 0xfffff0 2587b4f1e6bSMatan Azrad 2597b4f1e6bSMatan Azrad /* Default mark value used when none is provided. */ 2607b4f1e6bSMatan Azrad #define MLX5_FLOW_MARK_DEFAULT 0xffffff 2617b4f1e6bSMatan Azrad 2627b4f1e6bSMatan Azrad /* Default mark mask for metadata legacy mode. */ 2637b4f1e6bSMatan Azrad #define MLX5_FLOW_MARK_MASK 0xffffff 2647b4f1e6bSMatan Azrad 26554c2d46bSAlexander Kozyrev /* Byte length mask when mark is enable in miniCQE */ 26654c2d46bSAlexander Kozyrev #define MLX5_LEN_WITH_MARK_MASK 0xffffff00 26754c2d46bSAlexander Kozyrev 2687b4f1e6bSMatan Azrad /* Maximum number of DS in WQE. Limited by 6-bit field. */ 2697b4f1e6bSMatan Azrad #define MLX5_DSEG_MAX 63 2707b4f1e6bSMatan Azrad 2713cddeba0SAlexander Kozyrev /* The 32 bit syndrome offset in struct mlx5_error_cqe. */ 2723cddeba0SAlexander Kozyrev #if (RTE_CACHE_LINE_SIZE == 128) 2733cddeba0SAlexander Kozyrev #define MLX5_ERROR_CQE_SYNDROME_OFFSET 116 2743cddeba0SAlexander Kozyrev #else 275d2781de6SRaja Zidane #define MLX5_ERROR_CQE_SYNDROME_OFFSET 52 2763cddeba0SAlexander Kozyrev #endif 277d2781de6SRaja Zidane 2787b4f1e6bSMatan Azrad /* The completion mode offset in the WQE control segment line 2. */ 2797b4f1e6bSMatan Azrad #define MLX5_COMP_MODE_OFFSET 2 2807b4f1e6bSMatan Azrad 2817b4f1e6bSMatan Azrad /* Amount of data bytes in minimal inline data segment. */ 2827b4f1e6bSMatan Azrad #define MLX5_DSEG_MIN_INLINE_SIZE 12u 2837b4f1e6bSMatan Azrad 2847b4f1e6bSMatan Azrad /* Amount of data bytes in minimal inline eth segment. */ 2857b4f1e6bSMatan Azrad #define MLX5_ESEG_MIN_INLINE_SIZE 18u 2867b4f1e6bSMatan Azrad 2877b4f1e6bSMatan Azrad /* Amount of data bytes after eth data segment. */ 2887b4f1e6bSMatan Azrad #define MLX5_ESEG_EXTRA_DATA_SIZE 32u 2897b4f1e6bSMatan Azrad 2907b4f1e6bSMatan Azrad /* The maximum log value of segments per RQ WQE. */ 2917b4f1e6bSMatan Azrad #define MLX5_MAX_LOG_RQ_SEGS 5u 2927b4f1e6bSMatan Azrad 29310599cf8SMichael Baum /* Log 2 of the default size of a WQE for Multi-Packet RQ. */ 29410599cf8SMichael Baum #define MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE 14U 29510599cf8SMichael Baum 2967b4f1e6bSMatan Azrad /* The alignment needed for WQ buffer. */ 2972aba9fc7SOphir Munk #define MLX5_WQE_BUF_ALIGNMENT rte_mem_page_size() 2987b4f1e6bSMatan Azrad 29979a7e409SViacheslav Ovsiienko /* The alignment needed for CQ buffer. */ 3002aba9fc7SOphir Munk #define MLX5_CQE_BUF_ALIGNMENT rte_mem_page_size() 30179a7e409SViacheslav Ovsiienko 302365cdf5fSErez Shitrit #define MAX_ACTIONS_DATA_IN_HEADER_MODIFY 512 303365cdf5fSErez Shitrit 304ce946c7dSErez Shitrit /* Alias FT id passed to the ALLOW_OTHER_VHCA_ACCESS & CREATE_GENERAL_OBJECT 305ce946c7dSErez Shitrit * commands should have the following format: 306ce946c7dSErez Shitrit * {table_type: 8bits, table_id: 24bits}. 307ce946c7dSErez Shitrit */ 308ce946c7dSErez Shitrit #define FT_ID_FT_TYPE_OFFSET 24 309ce946c7dSErez Shitrit 3107b4f1e6bSMatan Azrad /* Completion mode. */ 3117b4f1e6bSMatan Azrad enum mlx5_completion_mode { 3127b4f1e6bSMatan Azrad MLX5_COMP_ONLY_ERR = 0x0, 3137b4f1e6bSMatan Azrad MLX5_COMP_ONLY_FIRST_ERR = 0x1, 3147b4f1e6bSMatan Azrad MLX5_COMP_ALWAYS = 0x2, 3157b4f1e6bSMatan Azrad MLX5_COMP_CQE_AND_EQE = 0x3, 3167b4f1e6bSMatan Azrad }; 3177b4f1e6bSMatan Azrad 3187b4f1e6bSMatan Azrad /* MPW mode. */ 3197b4f1e6bSMatan Azrad enum mlx5_mpw_mode { 3207b4f1e6bSMatan Azrad MLX5_MPW_DISABLED, 3217b4f1e6bSMatan Azrad MLX5_MPW, 3227b4f1e6bSMatan Azrad MLX5_MPW_ENHANCED, /* Enhanced Multi-Packet Send WQE, a.k.a MPWv2. */ 3237b4f1e6bSMatan Azrad }; 3247b4f1e6bSMatan Azrad 3257b4f1e6bSMatan Azrad /* WQE Control segment. */ 326*e7750639SAndre Muezerie struct __rte_aligned(MLX5_WSEG_SIZE) __rte_packed_begin mlx5_wqe_cseg { 3277b4f1e6bSMatan Azrad uint32_t opcode; 3287b4f1e6bSMatan Azrad uint32_t sq_ds; 3297b4f1e6bSMatan Azrad uint32_t flags; 3307b4f1e6bSMatan Azrad uint32_t misc; 331*e7750639SAndre Muezerie } __rte_packed_end; 3327b4f1e6bSMatan Azrad 333105d2149SDekel Peled /* 334105d2149SDekel Peled * WQE CSEG opcode field size is 32 bits, divided: 335105d2149SDekel Peled * Bits 31:24 OPC_MOD 336105d2149SDekel Peled * Bits 23:8 wqe_index 337105d2149SDekel Peled * Bits 7:0 OPCODE 338105d2149SDekel Peled */ 339105d2149SDekel Peled #define WQE_CSEG_OPC_MOD_OFFSET 24 340105d2149SDekel Peled #define WQE_CSEG_WQE_INDEX_OFFSET 8 341105d2149SDekel Peled 3427b4f1e6bSMatan Azrad /* Header of data segment. Minimal size Data Segment */ 343*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_dseg { 3447b4f1e6bSMatan Azrad uint32_t bcount; 3457b4f1e6bSMatan Azrad union { 3467b4f1e6bSMatan Azrad uint8_t inline_data[MLX5_DSEG_MIN_INLINE_SIZE]; 347*e7750639SAndre Muezerie struct __rte_packed_begin { 3487b4f1e6bSMatan Azrad uint32_t lkey; 3497b4f1e6bSMatan Azrad uint64_t pbuf; 350*e7750639SAndre Muezerie } __rte_packed_end; 3517b4f1e6bSMatan Azrad }; 352*e7750639SAndre Muezerie } __rte_packed_end; 3537b4f1e6bSMatan Azrad 3547b4f1e6bSMatan Azrad /* Subset of struct WQE Ethernet Segment. */ 355*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_eseg { 3567b4f1e6bSMatan Azrad union { 357*e7750639SAndre Muezerie struct __rte_packed_begin { 3587b4f1e6bSMatan Azrad uint32_t swp_offs; 3597b4f1e6bSMatan Azrad uint8_t cs_flags; 3607b4f1e6bSMatan Azrad uint8_t swp_flags; 3617b4f1e6bSMatan Azrad uint16_t mss; 3627b4f1e6bSMatan Azrad uint32_t metadata; 3637b4f1e6bSMatan Azrad uint16_t inline_hdr_sz; 3647b4f1e6bSMatan Azrad union { 3657b4f1e6bSMatan Azrad uint16_t inline_data; 3667b4f1e6bSMatan Azrad uint16_t vlan_tag; 3677b4f1e6bSMatan Azrad }; 368*e7750639SAndre Muezerie } __rte_packed_end; 369*e7750639SAndre Muezerie struct __rte_packed_begin { 3707b4f1e6bSMatan Azrad uint32_t offsets; 3717b4f1e6bSMatan Azrad uint32_t flags; 3727b4f1e6bSMatan Azrad uint32_t flow_metadata; 3737b4f1e6bSMatan Azrad uint32_t inline_hdr; 374*e7750639SAndre Muezerie } __rte_packed_end; 3757b4f1e6bSMatan Azrad }; 376*e7750639SAndre Muezerie } __rte_packed_end; 3777b4f1e6bSMatan Azrad 378*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_qseg { 37979a7e409SViacheslav Ovsiienko uint32_t reserved0; 38079a7e409SViacheslav Ovsiienko uint32_t reserved1; 38179a7e409SViacheslav Ovsiienko uint32_t max_index; 38279a7e409SViacheslav Ovsiienko uint32_t qpn_cqn; 383*e7750639SAndre Muezerie } __rte_packed_end; 38479a7e409SViacheslav Ovsiienko 385*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_wseg { 3867dac7abeSViacheslav Ovsiienko uint32_t operation; 3877dac7abeSViacheslav Ovsiienko uint32_t lkey; 3887dac7abeSViacheslav Ovsiienko uint32_t va_high; 3897dac7abeSViacheslav Ovsiienko uint32_t va_low; 3907dac7abeSViacheslav Ovsiienko uint64_t value; 3917dac7abeSViacheslav Ovsiienko uint64_t mask; 392*e7750639SAndre Muezerie } __rte_packed_end; 3937dac7abeSViacheslav Ovsiienko 3947b4f1e6bSMatan Azrad /* The title WQEBB, header of WQE. */ 395*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe { 3967b4f1e6bSMatan Azrad union { 3977b4f1e6bSMatan Azrad struct mlx5_wqe_cseg cseg; 3987b4f1e6bSMatan Azrad uint32_t ctrl[4]; 3997b4f1e6bSMatan Azrad }; 4007b4f1e6bSMatan Azrad struct mlx5_wqe_eseg eseg; 4017b4f1e6bSMatan Azrad union { 4027b4f1e6bSMatan Azrad struct mlx5_wqe_dseg dseg[2]; 4037b4f1e6bSMatan Azrad uint8_t data[MLX5_ESEG_EXTRA_DATA_SIZE]; 4047b4f1e6bSMatan Azrad }; 405*e7750639SAndre Muezerie } __rte_packed_end; 4067b4f1e6bSMatan Azrad 4077b4f1e6bSMatan Azrad /* WQE for Multi-Packet RQ. */ 4087b4f1e6bSMatan Azrad struct mlx5_wqe_mprq { 4097b4f1e6bSMatan Azrad struct mlx5_wqe_srq_next_seg next_seg; 4107b4f1e6bSMatan Azrad struct mlx5_wqe_data_seg dseg; 4117b4f1e6bSMatan Azrad }; 4127b4f1e6bSMatan Azrad 4137b4f1e6bSMatan Azrad #define MLX5_MPRQ_LEN_MASK 0x000ffff 4147b4f1e6bSMatan Azrad #define MLX5_MPRQ_LEN_SHIFT 0 4157b4f1e6bSMatan Azrad #define MLX5_MPRQ_STRIDE_NUM_MASK 0x3fff0000 4167b4f1e6bSMatan Azrad #define MLX5_MPRQ_STRIDE_NUM_SHIFT 16 4177b4f1e6bSMatan Azrad #define MLX5_MPRQ_FILLER_MASK 0x80000000 4187b4f1e6bSMatan Azrad #define MLX5_MPRQ_FILLER_SHIFT 31 4197b4f1e6bSMatan Azrad 4207b4f1e6bSMatan Azrad #define MLX5_MPRQ_STRIDE_SHIFT_BYTE 2 4217b4f1e6bSMatan Azrad 4223cddeba0SAlexander Kozyrev struct mlx5_error_cqe { 4233cddeba0SAlexander Kozyrev #if (RTE_CACHE_LINE_SIZE == 128) 4243cddeba0SAlexander Kozyrev uint8_t padding[64]; 4253cddeba0SAlexander Kozyrev #endif 4263cddeba0SAlexander Kozyrev uint8_t rsvd0[2]; 4273cddeba0SAlexander Kozyrev uint16_t eth_wqe_id; 4283cddeba0SAlexander Kozyrev uint8_t rsvd1[16]; 4293cddeba0SAlexander Kozyrev uint16_t ib_stride_index; 4303cddeba0SAlexander Kozyrev uint8_t rsvd2[10]; 4313cddeba0SAlexander Kozyrev uint32_t srqn; 4323cddeba0SAlexander Kozyrev uint8_t rsvd3[8]; 4333cddeba0SAlexander Kozyrev uint32_t byte_cnt; 4343cddeba0SAlexander Kozyrev uint8_t rsvd4[4]; 4353cddeba0SAlexander Kozyrev uint8_t hw_err_synd; 4363cddeba0SAlexander Kozyrev uint8_t hw_synd_type; 4373cddeba0SAlexander Kozyrev uint8_t vendor_err_synd; 4383cddeba0SAlexander Kozyrev uint8_t syndrome; 4393cddeba0SAlexander Kozyrev uint32_t s_wqe_opcode_qpn; 4403cddeba0SAlexander Kozyrev uint16_t wqe_counter; 4413cddeba0SAlexander Kozyrev uint8_t signature; 4423cddeba0SAlexander Kozyrev uint8_t op_own; 4433cddeba0SAlexander Kozyrev }; 4443cddeba0SAlexander Kozyrev 4457b4f1e6bSMatan Azrad /* CQ element structure - should be equal to the cache line size */ 4467b4f1e6bSMatan Azrad struct mlx5_cqe { 4477b4f1e6bSMatan Azrad #if (RTE_CACHE_LINE_SIZE == 128) 4487b4f1e6bSMatan Azrad uint8_t padding[64]; 4497b4f1e6bSMatan Azrad #endif 4507b4f1e6bSMatan Azrad uint8_t pkt_info; 4517b4f1e6bSMatan Azrad uint8_t rsvd0; 4527b4f1e6bSMatan Azrad uint16_t wqe_id; 4537b4f1e6bSMatan Azrad uint8_t lro_tcppsh_abort_dupack; 4547b4f1e6bSMatan Azrad uint8_t lro_min_ttl; 4557b4f1e6bSMatan Azrad uint16_t lro_tcp_win; 4567b4f1e6bSMatan Azrad uint32_t lro_ack_seq_num; 4577b4f1e6bSMatan Azrad uint32_t rx_hash_res; 4587b4f1e6bSMatan Azrad uint8_t rx_hash_type; 4597b4f1e6bSMatan Azrad uint8_t rsvd1[3]; 4607b4f1e6bSMatan Azrad uint16_t csum; 4617b4f1e6bSMatan Azrad uint8_t rsvd2[6]; 4627b4f1e6bSMatan Azrad uint16_t hdr_type_etc; 4637b4f1e6bSMatan Azrad uint16_t vlan_info; 4647b4f1e6bSMatan Azrad uint8_t lro_num_seg; 4659c777ccfSXueming Li union { 4669c777ccfSXueming Li uint8_t user_index_bytes[3]; 467*e7750639SAndre Muezerie struct __rte_packed_begin { 4689c777ccfSXueming Li uint8_t user_index_hi; 4699c777ccfSXueming Li uint16_t user_index_low; 470*e7750639SAndre Muezerie } __rte_packed_end; 4719c777ccfSXueming Li }; 4727b4f1e6bSMatan Azrad uint32_t flow_table_metadata; 4737b4f1e6bSMatan Azrad uint8_t rsvd4[4]; 4747b4f1e6bSMatan Azrad uint32_t byte_cnt; 4757b4f1e6bSMatan Azrad uint64_t timestamp; 4767b4f1e6bSMatan Azrad uint32_t sop_drop_qpn; 4777b4f1e6bSMatan Azrad uint16_t wqe_counter; 478a7da07e5SAlexander Kozyrev uint8_t validity_iteration_count; 4797b4f1e6bSMatan Azrad uint8_t op_own; 4807b4f1e6bSMatan Azrad }; 4817b4f1e6bSMatan Azrad 48279a7e409SViacheslav Ovsiienko struct mlx5_cqe_ts { 48379a7e409SViacheslav Ovsiienko uint64_t timestamp; 48479a7e409SViacheslav Ovsiienko uint32_t sop_drop_qpn; 48579a7e409SViacheslav Ovsiienko uint16_t wqe_counter; 486a7da07e5SAlexander Kozyrev uint8_t validity_iteration_count; 48779a7e409SViacheslav Ovsiienko uint8_t op_own; 48879a7e409SViacheslav Ovsiienko }; 48979a7e409SViacheslav Ovsiienko 490*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_rseg { 491caec80f9SSuanming Mou uint64_t raddr; 492caec80f9SSuanming Mou uint32_t rkey; 493caec80f9SSuanming Mou uint32_t reserved; 494*e7750639SAndre Muezerie } __rte_packed_end; 495caec80f9SSuanming Mou 496caec80f9SSuanming Mou #define MLX5_UMRC_IF_OFFSET 31u 497caec80f9SSuanming Mou #define MLX5_UMRC_KO_OFFSET 16u 498caec80f9SSuanming Mou #define MLX5_UMRC_TO_BS_OFFSET 0u 499caec80f9SSuanming Mou 500b32dbedbSSuanming Mou /* 501b32dbedbSSuanming Mou * As PRM describes, the address of the UMR pointer must be 502b32dbedbSSuanming Mou * aligned to 2KB. 503b32dbedbSSuanming Mou */ 504b32dbedbSSuanming Mou #define MLX5_UMR_KLM_PTR_ALIGN (1 << 11) 505b32dbedbSSuanming Mou 506b32dbedbSSuanming Mou #define MLX5_UMR_KLM_NUM_ALIGN \ 507b32dbedbSSuanming Mou (MLX5_UMR_KLM_PTR_ALIGN / sizeof(struct mlx5_klm)) 508b32dbedbSSuanming Mou 509*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_umr_cseg { 510caec80f9SSuanming Mou uint32_t if_cf_toe_cq_res; 511caec80f9SSuanming Mou uint32_t ko_to_bs; 512caec80f9SSuanming Mou uint64_t mkey_mask; 513caec80f9SSuanming Mou uint32_t rsvd1[8]; 514*e7750639SAndre Muezerie } __rte_packed_end; 515caec80f9SSuanming Mou 516*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_mkey_cseg { 517caec80f9SSuanming Mou uint32_t fr_res_af_sf; 518caec80f9SSuanming Mou uint32_t qpn_mkey; 519caec80f9SSuanming Mou uint32_t reserved2; 520caec80f9SSuanming Mou uint32_t flags_pd; 521caec80f9SSuanming Mou uint64_t start_addr; 522caec80f9SSuanming Mou uint64_t len; 523caec80f9SSuanming Mou uint32_t bsf_octword_size; 524caec80f9SSuanming Mou uint32_t reserved3[4]; 525caec80f9SSuanming Mou uint32_t translations_octword_size; 526caec80f9SSuanming Mou uint32_t res4_lps; 527caec80f9SSuanming Mou uint32_t reserved; 528*e7750639SAndre Muezerie } __rte_packed_end; 529caec80f9SSuanming Mou 530d5ee804dSDekel Peled enum { 531d5ee804dSDekel Peled MLX5_BSF_SIZE_16B = 0x0, 532d5ee804dSDekel Peled MLX5_BSF_SIZE_32B = 0x1, 533d5ee804dSDekel Peled MLX5_BSF_SIZE_64B = 0x2, 534d5ee804dSDekel Peled MLX5_BSF_SIZE_128B = 0x3, 535d5ee804dSDekel Peled }; 536d5ee804dSDekel Peled 537d5ee804dSDekel Peled enum { 538d5ee804dSDekel Peled MLX5_BSF_P_TYPE_SIGNATURE = 0x0, 539d5ee804dSDekel Peled MLX5_BSF_P_TYPE_CRYPTO = 0x1, 540d5ee804dSDekel Peled }; 541d5ee804dSDekel Peled 542d5ee804dSDekel Peled enum { 543d5ee804dSDekel Peled MLX5_ENCRYPTION_ORDER_ENCRYPTED_WIRE_SIGNATURE = 0x0, 544d5ee804dSDekel Peled MLX5_ENCRYPTION_ORDER_ENCRYPTED_MEMORY_SIGNATURE = 0x1, 545d5ee804dSDekel Peled MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_WIRE = 0x2, 546d5ee804dSDekel Peled MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_MEMORY = 0x3, 547d5ee804dSDekel Peled }; 548d5ee804dSDekel Peled 549d5ee804dSDekel Peled enum { 550d5ee804dSDekel Peled MLX5_ENCRYPTION_STANDARD_AES_XTS = 0x0, 551d5ee804dSDekel Peled }; 552d5ee804dSDekel Peled 553d5ee804dSDekel Peled enum { 554d5ee804dSDekel Peled MLX5_BLOCK_SIZE_512B = 0x1, 555d5ee804dSDekel Peled MLX5_BLOCK_SIZE_520B = 0x2, 556d5ee804dSDekel Peled MLX5_BLOCK_SIZE_4096B = 0x3, 557d5ee804dSDekel Peled MLX5_BLOCK_SIZE_4160B = 0x4, 558d5ee804dSDekel Peled MLX5_BLOCK_SIZE_1MB = 0x5, 559d5ee804dSDekel Peled MLX5_BLOCK_SIZE_4048B = 0x6, 560d5ee804dSDekel Peled }; 561d5ee804dSDekel Peled 5627f8eb434SSuanming Mou enum { 5637f8eb434SSuanming Mou MLX5_ENCRYPTION_TYPE_AES_GCM = 0x3, 5647f8eb434SSuanming Mou }; 5657f8eb434SSuanming Mou 5667f8eb434SSuanming Mou enum { 5677f8eb434SSuanming Mou MLX5_CRYPTO_OP_TYPE_ENCRYPTION = 0x0, 5687f8eb434SSuanming Mou MLX5_CRYPTO_OP_TYPE_DECRYPTION = 0x1, 5697f8eb434SSuanming Mou }; 5707f8eb434SSuanming Mou 571d5ee804dSDekel Peled #define MLX5_BSF_SIZE_OFFSET 30 572d5ee804dSDekel Peled #define MLX5_BSF_P_TYPE_OFFSET 24 573d5ee804dSDekel Peled #define MLX5_ENCRYPTION_ORDER_OFFSET 16 574d5ee804dSDekel Peled #define MLX5_BLOCK_SIZE_OFFSET 24 575d5ee804dSDekel Peled 5767f8eb434SSuanming Mou #define MLX5_CRYPTO_MMO_TYPE_OFFSET 24 5777f8eb434SSuanming Mou #define MLX5_CRYPTO_MMO_OP_OFFSET 20 5787f8eb434SSuanming Mou 579*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_umr_bsf_seg { 580d5ee804dSDekel Peled /* 581d5ee804dSDekel Peled * bs_bpt_eo_es contains: 582d5ee804dSDekel Peled * bs bsf_size 2 bits at MLX5_BSF_SIZE_OFFSET 583d5ee804dSDekel Peled * bpt bsf_p_type 2 bits at MLX5_BSF_P_TYPE_OFFSET 584d5ee804dSDekel Peled * eo encryption_order 4 bits at MLX5_ENCRYPTION_ORDER_OFFSET 585d5ee804dSDekel Peled * es encryption_standard 4 bits at offset 0 586d5ee804dSDekel Peled */ 587d5ee804dSDekel Peled uint32_t bs_bpt_eo_es; 588d5ee804dSDekel Peled uint32_t raw_data_size; 589d5ee804dSDekel Peled /* 590d5ee804dSDekel Peled * bsp_res contains: 591d5ee804dSDekel Peled * bsp crypto_block_size_pointer 8 bits at MLX5_BLOCK_SIZE_OFFSET 592d5ee804dSDekel Peled * res reserved 24 bits 593d5ee804dSDekel Peled */ 594d5ee804dSDekel Peled uint32_t bsp_res; 595d5ee804dSDekel Peled uint32_t reserved0; 596d5ee804dSDekel Peled uint8_t xts_initial_tweak[16]; 597d5ee804dSDekel Peled /* 598d5ee804dSDekel Peled * res_dp contains: 599d5ee804dSDekel Peled * res reserved 8 bits 600d5ee804dSDekel Peled * dp dek_pointer 24 bits at offset 0 601d5ee804dSDekel Peled */ 602d5ee804dSDekel Peled uint32_t res_dp; 603d5ee804dSDekel Peled uint32_t reserved1; 604d5ee804dSDekel Peled uint64_t keytag; 605d5ee804dSDekel Peled uint32_t reserved2[4]; 606*e7750639SAndre Muezerie } __rte_packed_end; 607d5ee804dSDekel Peled 608caec80f9SSuanming Mou #ifdef PEDANTIC 609caec80f9SSuanming Mou #pragma GCC diagnostic ignored "-Wpedantic" 610caec80f9SSuanming Mou #endif 611caec80f9SSuanming Mou 612*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_umr_wqe { 613caec80f9SSuanming Mou struct mlx5_wqe_cseg ctr; 614caec80f9SSuanming Mou struct mlx5_wqe_umr_cseg ucseg; 615caec80f9SSuanming Mou struct mlx5_wqe_mkey_cseg mkc; 616caec80f9SSuanming Mou union { 617caec80f9SSuanming Mou struct mlx5_wqe_dseg kseg[0]; 618caec80f9SSuanming Mou struct mlx5_wqe_umr_bsf_seg bsf[0]; 619caec80f9SSuanming Mou }; 620*e7750639SAndre Muezerie } __rte_packed_end; 621caec80f9SSuanming Mou 622*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_rdma_write_wqe { 623caec80f9SSuanming Mou struct mlx5_wqe_cseg ctr; 624caec80f9SSuanming Mou struct mlx5_wqe_rseg rseg; 625013b4c52SBruce Richardson struct mlx5_wqe_dseg dseg[]; 626*e7750639SAndre Muezerie } __rte_packed_end; 627caec80f9SSuanming Mou 628*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_send_en_seg { 629bfc1d480SSuanming Mou uint32_t reserve[2]; 630bfc1d480SSuanming Mou uint32_t sqnpc; 631bfc1d480SSuanming Mou uint32_t qpn; 632*e7750639SAndre Muezerie } __rte_packed_end; 633bfc1d480SSuanming Mou 634*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_wqe_send_en_wqe { 635bfc1d480SSuanming Mou struct mlx5_wqe_cseg ctr; 636bfc1d480SSuanming Mou struct mlx5_wqe_send_en_seg sseg; 637*e7750639SAndre Muezerie } __rte_packed_end; 638bfc1d480SSuanming Mou 639caec80f9SSuanming Mou #ifdef PEDANTIC 640caec80f9SSuanming Mou #pragma GCC diagnostic error "-Wpedantic" 641caec80f9SSuanming Mou #endif 642caec80f9SSuanming Mou 6438a3ba482SMatan Azrad /* GGA */ 6445f41b66dSYuval Avnery /* MMO metadata segment */ 6455f41b66dSYuval Avnery 6468a3ba482SMatan Azrad #define MLX5_OPCODE_MMO 0x2fu 647b0109583SSuanming Mou #define MLX5_OPC_MOD_MMO_CRYPTO 0x6u 6488a3ba482SMatan Azrad #define MLX5_OPC_MOD_MMO_REGEX 0x4u 6498a3ba482SMatan Azrad #define MLX5_OPC_MOD_MMO_COMP 0x2u 6508a3ba482SMatan Azrad #define MLX5_OPC_MOD_MMO_DECOMP 0x3u 6518a3ba482SMatan Azrad #define MLX5_OPC_MOD_MMO_DMA 0x1u 6528a3ba482SMatan Azrad 65393297930SMichael Baum #define WQE_GGA_DECOMP_DEFLATE 0x0u 65493297930SMichael Baum #define WQE_GGA_DECOMP_LZ4 0x2u 65593297930SMichael Baum 65693297930SMichael Baum #define MLX5_GGA_DECOMP_LZ4_BLOCK_WITHOUT_CHECKSUM 0x1u 65793297930SMichael Baum #define MLX5_GGA_DECOMP_LZ4_BLOCK_WITH_CHECKSUM 0x2u 65893297930SMichael Baum 6598a3ba482SMatan Azrad #define WQE_GGA_COMP_WIN_SIZE_OFFSET 12u 6608a3ba482SMatan Azrad #define WQE_GGA_COMP_BLOCK_SIZE_OFFSET 16u 6618a3ba482SMatan Azrad #define WQE_GGA_COMP_DYNAMIC_SIZE_OFFSET 20u 66293297930SMichael Baum #define WQE_GGA_DECOMP_PARAMS_OFFSET 20u 66393297930SMichael Baum #define WQE_GGA_DECOMP_TYPE_OFFSET 8u 66493297930SMichael Baum #define WQE_GGA_DECOMP_BLOCK_INDEPENDENT_OFFSET 22u 66593297930SMichael Baum 6668a3ba482SMatan Azrad #define MLX5_GGA_COMP_WIN_SIZE_UNITS 1024u 6678a3ba482SMatan Azrad #define MLX5_GGA_COMP_WIN_SIZE_MAX (32u * MLX5_GGA_COMP_WIN_SIZE_UNITS) 6688a3ba482SMatan Azrad #define MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX 15u 6698a3ba482SMatan Azrad #define MLX5_GGA_COMP_LOG_DYNAMIC_SIZE_MAX 15u 6708a3ba482SMatan Azrad #define MLX5_GGA_COMP_LOG_DYNAMIC_SIZE_MIN 0u 671d2781de6SRaja Zidane #define MLX5_GGA_COMP_OUT_OF_SPACE_SYNDROME_BE 0x29D0084 672d2781de6SRaja Zidane #define MLX5_GGA_COMP_MISSING_BFINAL_SYNDROME_BE 0x29D0011 6735f41b66dSYuval Avnery 6745f41b66dSYuval Avnery struct mlx5_wqe_metadata_seg { 6755f41b66dSYuval Avnery uint32_t mmo_control_31_0; /* mmo_control_63_32 is in ctrl_seg.imm */ 6765f41b66dSYuval Avnery uint32_t lkey; 6775f41b66dSYuval Avnery uint64_t addr; 6785f41b66dSYuval Avnery }; 6795f41b66dSYuval Avnery 680*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_gga_wqe { 6818a3ba482SMatan Azrad uint32_t opcode; 6828a3ba482SMatan Azrad uint32_t sq_ds; 6838a3ba482SMatan Azrad uint32_t flags; 68493297930SMichael Baum uint32_t gga_ctrl1; 6858a3ba482SMatan Azrad uint32_t gga_ctrl2; 6868a3ba482SMatan Azrad uint32_t opaque_lkey; 6878a3ba482SMatan Azrad uint64_t opaque_vaddr; 6888a3ba482SMatan Azrad struct mlx5_wqe_dseg gather; 6898a3ba482SMatan Azrad struct mlx5_wqe_dseg scatter; 690*e7750639SAndre Muezerie } __rte_packed_end; 6918a3ba482SMatan Azrad 6928b3a69fbSMichael Baum union mlx5_gga_compress_opaque { 693*e7750639SAndre Muezerie struct __rte_packed_begin { 6948b3a69fbSMichael Baum uint32_t syndrome; 6958a3ba482SMatan Azrad uint32_t reserved0; 6968a3ba482SMatan Azrad uint32_t scattered_length; 6978b3a69fbSMichael Baum union { 698*e7750639SAndre Muezerie struct __rte_packed_begin { 6998b3a69fbSMichael Baum uint32_t reserved1[5]; 7008a3ba482SMatan Azrad uint32_t crc32; 7018a3ba482SMatan Azrad uint32_t adler32; 702*e7750639SAndre Muezerie } v1 __rte_packed_end; 703*e7750639SAndre Muezerie struct __rte_packed_begin { 7048b3a69fbSMichael Baum uint32_t crc32; 7058b3a69fbSMichael Baum uint32_t adler32; 7068b3a69fbSMichael Baum uint32_t crc32c; 7078b3a69fbSMichael Baum uint32_t xxh32; 708*e7750639SAndre Muezerie } v2 __rte_packed_end; 7098b3a69fbSMichael Baum }; 710*e7750639SAndre Muezerie } __rte_packed_end; 7118b3a69fbSMichael Baum uint32_t data[64]; 7128b3a69fbSMichael Baum }; 7138a3ba482SMatan Azrad 714b32dbedbSSuanming Mou union mlx5_gga_crypto_opaque { 715*e7750639SAndre Muezerie struct __rte_packed_begin { 716b32dbedbSSuanming Mou uint32_t syndrome; 717b32dbedbSSuanming Mou uint32_t reserved0[2]; 718*e7750639SAndre Muezerie struct __rte_packed_begin { 719b32dbedbSSuanming Mou uint32_t iv[3]; 720b32dbedbSSuanming Mou uint32_t tag_size; 721b32dbedbSSuanming Mou uint32_t aad_size; 722*e7750639SAndre Muezerie } cp __rte_packed_end; 723*e7750639SAndre Muezerie } __rte_packed_end; 724b32dbedbSSuanming Mou uint8_t data[64]; 725b32dbedbSSuanming Mou }; 726b32dbedbSSuanming Mou 7275f41b66dSYuval Avnery struct mlx5_ifc_regexp_mmo_control_bits { 7285f41b66dSYuval Avnery uint8_t reserved_at_31[0x2]; 7295f41b66dSYuval Avnery uint8_t le[0x1]; 7305f41b66dSYuval Avnery uint8_t reserved_at_28[0x1]; 7315f41b66dSYuval Avnery uint8_t subset_id_0[0xc]; 7325f41b66dSYuval Avnery uint8_t reserved_at_16[0x4]; 7335f41b66dSYuval Avnery uint8_t subset_id_1[0xc]; 7345f41b66dSYuval Avnery uint8_t ctrl[0x4]; 7355f41b66dSYuval Avnery uint8_t subset_id_2[0xc]; 7365f41b66dSYuval Avnery uint8_t reserved_at_16_1[0x4]; 7375f41b66dSYuval Avnery uint8_t subset_id_3[0xc]; 7385f41b66dSYuval Avnery }; 7395f41b66dSYuval Avnery 7405f41b66dSYuval Avnery struct mlx5_ifc_regexp_metadata_bits { 7415f41b66dSYuval Avnery uint8_t rof_version[0x10]; 7425f41b66dSYuval Avnery uint8_t latency_count[0x10]; 7435f41b66dSYuval Avnery uint8_t instruction_count[0x10]; 7445f41b66dSYuval Avnery uint8_t primary_thread_count[0x10]; 7455f41b66dSYuval Avnery uint8_t match_count[0x8]; 7465f41b66dSYuval Avnery uint8_t detected_match_count[0x8]; 7475f41b66dSYuval Avnery uint8_t status[0x10]; 7485f41b66dSYuval Avnery uint8_t job_id[0x20]; 7495f41b66dSYuval Avnery uint8_t reserved[0x80]; 7505f41b66dSYuval Avnery }; 7515f41b66dSYuval Avnery 7520db041e7SYuval Avnery struct mlx5_ifc_regexp_match_tuple_bits { 7530db041e7SYuval Avnery uint8_t length[0x10]; 7540db041e7SYuval Avnery uint8_t start_ptr[0x10]; 7550db041e7SYuval Avnery uint8_t rule_id[0x20]; 7560db041e7SYuval Avnery }; 7570db041e7SYuval Avnery 7587b4f1e6bSMatan Azrad /* Adding direct verbs to data-path. */ 7597b4f1e6bSMatan Azrad 7607b4f1e6bSMatan Azrad /* CQ sequence number mask. */ 7617b4f1e6bSMatan Azrad #define MLX5_CQ_SQN_MASK 0x3 7627b4f1e6bSMatan Azrad 7637b4f1e6bSMatan Azrad /* CQ sequence number index. */ 7647b4f1e6bSMatan Azrad #define MLX5_CQ_SQN_OFFSET 28 7657b4f1e6bSMatan Azrad 7667b4f1e6bSMatan Azrad /* CQ doorbell index mask. */ 7677b4f1e6bSMatan Azrad #define MLX5_CI_MASK 0xffffff 7687b4f1e6bSMatan Azrad 7697b4f1e6bSMatan Azrad /* CQ doorbell offset. */ 7707b4f1e6bSMatan Azrad #define MLX5_CQ_ARM_DB 1 7717b4f1e6bSMatan Azrad 7727b4f1e6bSMatan Azrad /* CQ doorbell offset*/ 7737b4f1e6bSMatan Azrad #define MLX5_CQ_DOORBELL 0x20 7747b4f1e6bSMatan Azrad 7757b4f1e6bSMatan Azrad /* CQE format value. */ 7767b4f1e6bSMatan Azrad #define MLX5_COMPRESSED 0x3 7777b4f1e6bSMatan Azrad 7788395927cSMatan Azrad /* CQ doorbell cmd types. */ 7798395927cSMatan Azrad #define MLX5_CQ_DBR_CMD_SOL_ONLY (1 << 24) 7808395927cSMatan Azrad #define MLX5_CQ_DBR_CMD_ALL (0 << 24) 7818395927cSMatan Azrad 7827b4f1e6bSMatan Azrad /* Action type of header modification. */ 7837b4f1e6bSMatan Azrad enum { 7847b4f1e6bSMatan Azrad MLX5_MODIFICATION_TYPE_SET = 0x1, 7857b4f1e6bSMatan Azrad MLX5_MODIFICATION_TYPE_ADD = 0x2, 7867b4f1e6bSMatan Azrad MLX5_MODIFICATION_TYPE_COPY = 0x3, 787365cdf5fSErez Shitrit MLX5_MODIFICATION_TYPE_INSERT = 0x4, 788365cdf5fSErez Shitrit MLX5_MODIFICATION_TYPE_REMOVE = 0x5, 789365cdf5fSErez Shitrit MLX5_MODIFICATION_TYPE_NOP = 0x6, 790365cdf5fSErez Shitrit MLX5_MODIFICATION_TYPE_REMOVE_WORDS = 0x7, 7911667b1d7SItamar Gozlan MLX5_MODIFICATION_TYPE_ADD_FIELD = 0x8, 792102e59c2SErez Shitrit MLX5_MODIFICATION_TYPE_MAX, 7937b4f1e6bSMatan Azrad }; 7947b4f1e6bSMatan Azrad 7957b4f1e6bSMatan Azrad /* The field of packet to be modified. */ 7967b4f1e6bSMatan Azrad enum mlx5_modification_field { 7977b4f1e6bSMatan Azrad MLX5_MODI_OUT_NONE = -1, 7987b4f1e6bSMatan Azrad MLX5_MODI_OUT_SMAC_47_16 = 1, 7997b4f1e6bSMatan Azrad MLX5_MODI_OUT_SMAC_15_0, 8007b4f1e6bSMatan Azrad MLX5_MODI_OUT_ETHERTYPE, 8017b4f1e6bSMatan Azrad MLX5_MODI_OUT_DMAC_47_16, 8027b4f1e6bSMatan Azrad MLX5_MODI_OUT_DMAC_15_0, 8037b4f1e6bSMatan Azrad MLX5_MODI_OUT_IP_DSCP, 8047b4f1e6bSMatan Azrad MLX5_MODI_OUT_TCP_FLAGS, 8057b4f1e6bSMatan Azrad MLX5_MODI_OUT_TCP_SPORT, 8067b4f1e6bSMatan Azrad MLX5_MODI_OUT_TCP_DPORT, 8077b4f1e6bSMatan Azrad MLX5_MODI_OUT_IPV4_TTL, 8087b4f1e6bSMatan Azrad MLX5_MODI_OUT_UDP_SPORT, 8097b4f1e6bSMatan Azrad MLX5_MODI_OUT_UDP_DPORT, 8107b4f1e6bSMatan Azrad MLX5_MODI_OUT_SIPV6_127_96, 8117b4f1e6bSMatan Azrad MLX5_MODI_OUT_SIPV6_95_64, 8127b4f1e6bSMatan Azrad MLX5_MODI_OUT_SIPV6_63_32, 8137b4f1e6bSMatan Azrad MLX5_MODI_OUT_SIPV6_31_0, 8147b4f1e6bSMatan Azrad MLX5_MODI_OUT_DIPV6_127_96, 8157b4f1e6bSMatan Azrad MLX5_MODI_OUT_DIPV6_95_64, 8167b4f1e6bSMatan Azrad MLX5_MODI_OUT_DIPV6_63_32, 8177b4f1e6bSMatan Azrad MLX5_MODI_OUT_DIPV6_31_0, 8187b4f1e6bSMatan Azrad MLX5_MODI_OUT_SIPV4, 8197b4f1e6bSMatan Azrad MLX5_MODI_OUT_DIPV4, 8207b4f1e6bSMatan Azrad MLX5_MODI_OUT_FIRST_VID, 8217b4f1e6bSMatan Azrad MLX5_MODI_IN_SMAC_47_16 = 0x31, 8227b4f1e6bSMatan Azrad MLX5_MODI_IN_SMAC_15_0, 8237b4f1e6bSMatan Azrad MLX5_MODI_IN_ETHERTYPE, 8247b4f1e6bSMatan Azrad MLX5_MODI_IN_DMAC_47_16, 8257b4f1e6bSMatan Azrad MLX5_MODI_IN_DMAC_15_0, 8267b4f1e6bSMatan Azrad MLX5_MODI_IN_IP_DSCP, 8277b4f1e6bSMatan Azrad MLX5_MODI_IN_TCP_FLAGS, 8287b4f1e6bSMatan Azrad MLX5_MODI_IN_TCP_SPORT, 8297b4f1e6bSMatan Azrad MLX5_MODI_IN_TCP_DPORT, 8307b4f1e6bSMatan Azrad MLX5_MODI_IN_IPV4_TTL, 8317b4f1e6bSMatan Azrad MLX5_MODI_IN_UDP_SPORT, 8327b4f1e6bSMatan Azrad MLX5_MODI_IN_UDP_DPORT, 8337b4f1e6bSMatan Azrad MLX5_MODI_IN_SIPV6_127_96, 8347b4f1e6bSMatan Azrad MLX5_MODI_IN_SIPV6_95_64, 8357b4f1e6bSMatan Azrad MLX5_MODI_IN_SIPV6_63_32, 8367b4f1e6bSMatan Azrad MLX5_MODI_IN_SIPV6_31_0, 8377b4f1e6bSMatan Azrad MLX5_MODI_IN_DIPV6_127_96, 8387b4f1e6bSMatan Azrad MLX5_MODI_IN_DIPV6_95_64, 8397b4f1e6bSMatan Azrad MLX5_MODI_IN_DIPV6_63_32, 8407b4f1e6bSMatan Azrad MLX5_MODI_IN_DIPV6_31_0, 8417b4f1e6bSMatan Azrad MLX5_MODI_IN_SIPV4, 8427b4f1e6bSMatan Azrad MLX5_MODI_IN_DIPV4, 8437b4f1e6bSMatan Azrad MLX5_MODI_OUT_IPV6_HOPLIMIT, 8447b4f1e6bSMatan Azrad MLX5_MODI_IN_IPV6_HOPLIMIT, 8457b4f1e6bSMatan Azrad MLX5_MODI_META_DATA_REG_A, 8462038994bSMichael Baum MLX5_MODI_OUT_IP_PROTOCOL, 8477b4f1e6bSMatan Azrad MLX5_MODI_META_DATA_REG_B = 0x50, 8487b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_0, 8497b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_1, 8507b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_2, 8517b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_3, 8527b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_4, 8537b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_5, 8547b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_6, 8557b4f1e6bSMatan Azrad MLX5_MODI_META_REG_C_7, 8567b4f1e6bSMatan Azrad MLX5_MODI_OUT_TCP_SEQ_NUM, 8577b4f1e6bSMatan Azrad MLX5_MODI_IN_TCP_SEQ_NUM, 8587b4f1e6bSMatan Azrad MLX5_MODI_OUT_TCP_ACK_NUM, 8599111a2c4SMichael Baum MLX5_MODI_IN_TCP_ACK_NUM, 8602038994bSMichael Baum MLX5_MODI_OUT_ESP_SPI = 0x5E, 8619111a2c4SMichael Baum MLX5_MODI_IN_ESP_SPI, 8627e3c919fSAlexander Kozyrev MLX5_MODI_GTP_TEID = 0x6E, 863097d84a4SSean Zhang MLX5_MODI_OUT_IP_ECN = 0x73, 8649111a2c4SMichael Baum MLX5_MODI_IN_IP_ECN, 8659111a2c4SMichael Baum MLX5_MODI_TUNNEL_HDR_DW_1, 8662038994bSMichael Baum MLX5_MODI_GTPU_FIRST_EXT_DW_0, 86707f35716SYevgeny Kliteynik MLX5_MODI_HASH_RESULT = 0x81, 8682038994bSMichael Baum MLX5_MODI_OUT_ESP_SEQ_NUM, 8699111a2c4SMichael Baum MLX5_MODI_IN_ESP_SEQ_NUM, 8704580dcecSMichael Baum MLX5_MODI_IN_MPLS_LABEL_0 = 0x8a, 8714580dcecSMichael Baum MLX5_MODI_IN_MPLS_LABEL_1, 8724580dcecSMichael Baum MLX5_MODI_IN_MPLS_LABEL_2, 8734580dcecSMichael Baum MLX5_MODI_IN_MPLS_LABEL_3, 8744580dcecSMichael Baum MLX5_MODI_IN_MPLS_LABEL_4, 8752038994bSMichael Baum MLX5_MODI_META_REG_C_8, 8762038994bSMichael Baum MLX5_MODI_META_REG_C_9, 8772038994bSMichael Baum MLX5_MODI_META_REG_C_10, 8782038994bSMichael Baum MLX5_MODI_META_REG_C_11, 8792038994bSMichael Baum MLX5_MODI_META_REG_C_12, 8802038994bSMichael Baum MLX5_MODI_META_REG_C_13, 8812038994bSMichael Baum MLX5_MODI_META_REG_C_14, 8822038994bSMichael Baum MLX5_MODI_META_REG_C_15, 883ec1e7a5cSGavin Li MLX5_MODI_OUT_IPV6_TRAFFIC_CLASS = 0x11C, 8842038994bSMichael Baum MLX5_MODI_OUT_IPV4_TOTAL_LEN, 8852038994bSMichael Baum MLX5_MODI_OUT_IPV6_PAYLOAD_LEN, 8862038994bSMichael Baum MLX5_MODI_OUT_IPV4_IHL, 8872038994bSMichael Baum MLX5_MODI_OUT_TCP_DATA_OFFSET, 8889111a2c4SMichael Baum MLX5_MODI_IN_IPV6_TRAFFIC_CLASS, 8899111a2c4SMichael Baum MLX5_MODI_IN_IPV4_TOTAL_LEN, 8909111a2c4SMichael Baum MLX5_MODI_IN_IPV6_PAYLOAD_LEN, 8919111a2c4SMichael Baum MLX5_MODI_IN_IPV4_IHL, 8929111a2c4SMichael Baum MLX5_MODI_IN_TCP_DATA_OFFSET, 8939111a2c4SMichael Baum MLX5_MODI_OUT_IPSEC_NEXT_HDR, 894f60e1649SMichael Baum MLX5_MODI_OUT_IPV6_FLOW_LABEL, 895f60e1649SMichael Baum MLX5_MODI_IN_IPV6_FLOW_LABEL, 8966b6c0b8dSRongwei Liu MLX5_MODI_INVALID = INT_MAX, 8977b4f1e6bSMatan Azrad }; 8987b4f1e6bSMatan Azrad 8997b4f1e6bSMatan Azrad /* Total number of metadata reg_c's. */ 9007b4f1e6bSMatan Azrad #define MLX5_MREG_C_NUM (MLX5_MODI_META_REG_C_7 - MLX5_MODI_META_REG_C_0 + 1) 9017b4f1e6bSMatan Azrad 9027b4f1e6bSMatan Azrad enum modify_reg { 9035d5a26f2SOphir Munk REG_NON = 0, 9047b4f1e6bSMatan Azrad REG_A, 9057b4f1e6bSMatan Azrad REG_B, 9067b4f1e6bSMatan Azrad REG_C_0, 9077b4f1e6bSMatan Azrad REG_C_1, 9087b4f1e6bSMatan Azrad REG_C_2, 9097b4f1e6bSMatan Azrad REG_C_3, 9107b4f1e6bSMatan Azrad REG_C_4, 9117b4f1e6bSMatan Azrad REG_C_5, 9127b4f1e6bSMatan Azrad REG_C_6, 9137b4f1e6bSMatan Azrad REG_C_7, 9147e3a1442SItamar Gozlan REG_C_8, 9157e3a1442SItamar Gozlan REG_C_9, 9167e3a1442SItamar Gozlan REG_C_10, 9177e3a1442SItamar Gozlan REG_C_11, 9187b4f1e6bSMatan Azrad }; 9197b4f1e6bSMatan Azrad 92004e740e6SGregory Etelson static __rte_always_inline uint8_t 92104e740e6SGregory Etelson mlx5_regc_index(enum modify_reg regc_val) 92204e740e6SGregory Etelson { 92304e740e6SGregory Etelson return (uint8_t)(regc_val - REG_C_0); 92404e740e6SGregory Etelson } 92504e740e6SGregory Etelson 92604e740e6SGregory Etelson static __rte_always_inline enum modify_reg 92704e740e6SGregory Etelson mlx5_regc_value(uint8_t regc_ix) 92804e740e6SGregory Etelson { 92904e740e6SGregory Etelson return REG_C_0 + regc_ix; 93004e740e6SGregory Etelson } 93104e740e6SGregory Etelson 9327b4f1e6bSMatan Azrad /* Modification sub command. */ 9337b4f1e6bSMatan Azrad struct mlx5_modification_cmd { 934*e7750639SAndre Muezerie union __rte_packed_begin { 9357b4f1e6bSMatan Azrad uint32_t data0; 9367b4f1e6bSMatan Azrad struct { 9377b4f1e6bSMatan Azrad unsigned int length:5; 9387b4f1e6bSMatan Azrad unsigned int rsvd0:3; 9397b4f1e6bSMatan Azrad unsigned int offset:5; 9407b4f1e6bSMatan Azrad unsigned int rsvd1:3; 9417b4f1e6bSMatan Azrad unsigned int field:12; 9427b4f1e6bSMatan Azrad unsigned int action_type:4; 9437b4f1e6bSMatan Azrad }; 944*e7750639SAndre Muezerie } __rte_packed_end; 945*e7750639SAndre Muezerie union __rte_packed_begin { 9467b4f1e6bSMatan Azrad uint32_t data1; 9477b4f1e6bSMatan Azrad uint8_t data[4]; 9487b4f1e6bSMatan Azrad struct { 9497b4f1e6bSMatan Azrad unsigned int rsvd2:8; 9507b4f1e6bSMatan Azrad unsigned int dst_offset:5; 9517b4f1e6bSMatan Azrad unsigned int rsvd3:3; 9527b4f1e6bSMatan Azrad unsigned int dst_field:12; 9537b4f1e6bSMatan Azrad unsigned int rsvd4:4; 9547b4f1e6bSMatan Azrad }; 955*e7750639SAndre Muezerie } __rte_packed_end; 9567b4f1e6bSMatan Azrad }; 9577b4f1e6bSMatan Azrad 95899d7c45cSTal Shnaiderman typedef uint64_t u64; 9597b4f1e6bSMatan Azrad typedef uint32_t u32; 9607b4f1e6bSMatan Azrad typedef uint16_t u16; 9617b4f1e6bSMatan Azrad typedef uint8_t u8; 9627b4f1e6bSMatan Azrad 9637b4f1e6bSMatan Azrad #define __mlx5_nullp(typ) ((struct mlx5_ifc_##typ##_bits *)0) 9647b4f1e6bSMatan Azrad #define __mlx5_bit_sz(typ, fld) sizeof(__mlx5_nullp(typ)->fld) 9655a90a6e4STal Shnaiderman #define __mlx5_bit_off(typ, fld) ((unsigned int)(uintptr_t) \ 9667b4f1e6bSMatan Azrad (&(__mlx5_nullp(typ)->fld))) 9677b4f1e6bSMatan Azrad #define __mlx5_dw_bit_off(typ, fld) (32 - __mlx5_bit_sz(typ, fld) - \ 9687b4f1e6bSMatan Azrad (__mlx5_bit_off(typ, fld) & 0x1f)) 9697b4f1e6bSMatan Azrad #define __mlx5_dw_off(typ, fld) (__mlx5_bit_off(typ, fld) / 32) 9707b4f1e6bSMatan Azrad #define __mlx5_64_off(typ, fld) (__mlx5_bit_off(typ, fld) / 64) 9717b4f1e6bSMatan Azrad #define __mlx5_dw_mask(typ, fld) (__mlx5_mask(typ, fld) << \ 9727b4f1e6bSMatan Azrad __mlx5_dw_bit_off(typ, fld)) 9737b4f1e6bSMatan Azrad #define __mlx5_mask(typ, fld) ((u32)((1ull << __mlx5_bit_sz(typ, fld)) - 1)) 9747b4f1e6bSMatan Azrad #define __mlx5_16_off(typ, fld) (__mlx5_bit_off(typ, fld) / 16) 9757b4f1e6bSMatan Azrad #define __mlx5_16_bit_off(typ, fld) (16 - __mlx5_bit_sz(typ, fld) - \ 9767b4f1e6bSMatan Azrad (__mlx5_bit_off(typ, fld) & 0xf)) 9777b4f1e6bSMatan Azrad #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1)) 9788712c80aSMatan Azrad #define __mlx5_16_mask(typ, fld) (__mlx5_mask16(typ, fld) << \ 9798712c80aSMatan Azrad __mlx5_16_bit_off(typ, fld)) 9807b4f1e6bSMatan Azrad #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) 9817b4f1e6bSMatan Azrad #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32) 9827b4f1e6bSMatan Azrad #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8) 9837b4f1e6bSMatan Azrad #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld)) 9847b4f1e6bSMatan Azrad 9857b4f1e6bSMatan Azrad /* insert a value to a struct */ 9867b4f1e6bSMatan Azrad #define MLX5_SET(typ, p, fld, v) \ 9877b4f1e6bSMatan Azrad do { \ 9887b4f1e6bSMatan Azrad u32 _v = v; \ 989094ddb60SOphir Munk *((rte_be32_t *)(p) + __mlx5_dw_off(typ, fld)) = \ 9907b4f1e6bSMatan Azrad rte_cpu_to_be_32((rte_be_to_cpu_32(*((u32 *)(p) + \ 9917b4f1e6bSMatan Azrad __mlx5_dw_off(typ, fld))) & \ 9927b4f1e6bSMatan Azrad (~__mlx5_dw_mask(typ, fld))) | \ 9937b4f1e6bSMatan Azrad (((_v) & __mlx5_mask(typ, fld)) << \ 9947b4f1e6bSMatan Azrad __mlx5_dw_bit_off(typ, fld))); \ 9957b4f1e6bSMatan Azrad } while (0) 9967b4f1e6bSMatan Azrad 9977b4f1e6bSMatan Azrad #define MLX5_SET64(typ, p, fld, v) \ 9987b4f1e6bSMatan Azrad do { \ 9998e46d4e1SAlexander Kozyrev MLX5_ASSERT(__mlx5_bit_sz(typ, fld) == 64); \ 1000094ddb60SOphir Munk *((rte_be64_t *)(p) + __mlx5_64_off(typ, fld)) = \ 10017b4f1e6bSMatan Azrad rte_cpu_to_be_64(v); \ 10027b4f1e6bSMatan Azrad } while (0) 10037b4f1e6bSMatan Azrad 10048712c80aSMatan Azrad #define MLX5_SET16(typ, p, fld, v) \ 10058712c80aSMatan Azrad do { \ 10068712c80aSMatan Azrad u16 _v = v; \ 1007094ddb60SOphir Munk *((rte_be16_t *)(p) + __mlx5_16_off(typ, fld)) = \ 1008094ddb60SOphir Munk rte_cpu_to_be_16((rte_be_to_cpu_16(*((rte_be16_t *)(p) + \ 10098712c80aSMatan Azrad __mlx5_16_off(typ, fld))) & \ 10108712c80aSMatan Azrad (~__mlx5_16_mask(typ, fld))) | \ 10118712c80aSMatan Azrad (((_v) & __mlx5_mask16(typ, fld)) << \ 10128712c80aSMatan Azrad __mlx5_16_bit_off(typ, fld))); \ 10138712c80aSMatan Azrad } while (0) 10148712c80aSMatan Azrad 10150db041e7SYuval Avnery #define MLX5_GET_VOLATILE(typ, p, fld) \ 10160db041e7SYuval Avnery ((rte_be_to_cpu_32(*((volatile __be32 *)(p) +\ 10170db041e7SYuval Avnery __mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \ 10180db041e7SYuval Avnery __mlx5_mask(typ, fld)) 10197b4f1e6bSMatan Azrad #define MLX5_GET(typ, p, fld) \ 1020094ddb60SOphir Munk ((rte_be_to_cpu_32(*((rte_be32_t *)(p) +\ 10217b4f1e6bSMatan Azrad __mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \ 10227b4f1e6bSMatan Azrad __mlx5_mask(typ, fld)) 10237b4f1e6bSMatan Azrad #define MLX5_GET16(typ, p, fld) \ 1024094ddb60SOphir Munk ((rte_be_to_cpu_16(*((rte_be16_t *)(p) + \ 10257b4f1e6bSMatan Azrad __mlx5_16_off(typ, fld))) >> __mlx5_16_bit_off(typ, fld)) & \ 10267b4f1e6bSMatan Azrad __mlx5_mask16(typ, fld)) 1027094ddb60SOphir Munk #define MLX5_GET64(typ, p, fld) rte_be_to_cpu_64(*((rte_be64_t *)(p) + \ 10287b4f1e6bSMatan Azrad __mlx5_64_off(typ, fld))) 10297b4f1e6bSMatan Azrad #define MLX5_FLD_SZ_BYTES(typ, fld) (__mlx5_bit_sz(typ, fld) / 8) 103004223e45STal Shnaiderman #define MLX5_UN_SZ_BYTES(typ) (sizeof(union mlx5_ifc_##typ##_bits) / 8) 10317b4f1e6bSMatan Azrad 10327b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_misc_bits { 10337b4f1e6bSMatan Azrad u8 gre_c_present[0x1]; 10347b4f1e6bSMatan Azrad u8 reserved_at_1[0x1]; 10357b4f1e6bSMatan Azrad u8 gre_k_present[0x1]; 10367b4f1e6bSMatan Azrad u8 gre_s_present[0x1]; 10377b4f1e6bSMatan Azrad u8 source_vhci_port[0x4]; 10387b4f1e6bSMatan Azrad u8 source_sqn[0x18]; 10397b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 10407b4f1e6bSMatan Azrad u8 source_port[0x10]; 10417b4f1e6bSMatan Azrad u8 outer_second_prio[0x3]; 10427b4f1e6bSMatan Azrad u8 outer_second_cfi[0x1]; 10437b4f1e6bSMatan Azrad u8 outer_second_vid[0xc]; 10447b4f1e6bSMatan Azrad u8 inner_second_prio[0x3]; 10457b4f1e6bSMatan Azrad u8 inner_second_cfi[0x1]; 10467b4f1e6bSMatan Azrad u8 inner_second_vid[0xc]; 10477b4f1e6bSMatan Azrad u8 outer_second_cvlan_tag[0x1]; 10487b4f1e6bSMatan Azrad u8 inner_second_cvlan_tag[0x1]; 10497b4f1e6bSMatan Azrad u8 outer_second_svlan_tag[0x1]; 10507b4f1e6bSMatan Azrad u8 inner_second_svlan_tag[0x1]; 10517b4f1e6bSMatan Azrad u8 reserved_at_64[0xc]; 10527b4f1e6bSMatan Azrad u8 gre_protocol[0x10]; 10537b4f1e6bSMatan Azrad u8 gre_key_h[0x18]; 10547b4f1e6bSMatan Azrad u8 gre_key_l[0x8]; 10557b4f1e6bSMatan Azrad u8 vxlan_vni[0x18]; 105632c2847aSDong Zhou u8 bth_opcode[0x8]; 10577b4f1e6bSMatan Azrad u8 geneve_vni[0x18]; 105876895c7dSJiawei Wang u8 lag_rx_port_affinity[0x4]; 105976895c7dSJiawei Wang u8 reserved_at_e8[0x2]; 10603b48087aSShiri Kuzin u8 geneve_tlv_option_0_exist[0x1]; 10617b4f1e6bSMatan Azrad u8 geneve_oam[0x1]; 10627b4f1e6bSMatan Azrad u8 reserved_at_e0[0xc]; 10637b4f1e6bSMatan Azrad u8 outer_ipv6_flow_label[0x14]; 10647b4f1e6bSMatan Azrad u8 reserved_at_100[0xc]; 10657b4f1e6bSMatan Azrad u8 inner_ipv6_flow_label[0x14]; 10667b4f1e6bSMatan Azrad u8 reserved_at_120[0xa]; 10677b4f1e6bSMatan Azrad u8 geneve_opt_len[0x6]; 10687b4f1e6bSMatan Azrad u8 geneve_protocol_type[0x10]; 106932c2847aSDong Zhou u8 reserved_at_140[0x8]; 107032c2847aSDong Zhou u8 bth_dst_qp[0x18]; 107118ca4a4eSRaja Zidane u8 inner_esp_spi[0x20]; 107218ca4a4eSRaja Zidane u8 outer_esp_spi[0x20]; 107318ca4a4eSRaja Zidane u8 reserved_at_1a0[0x60]; 10747b4f1e6bSMatan Azrad }; 10757b4f1e6bSMatan Azrad 10767b4f1e6bSMatan Azrad struct mlx5_ifc_ipv4_layout_bits { 10777b4f1e6bSMatan Azrad u8 reserved_at_0[0x60]; 10787b4f1e6bSMatan Azrad u8 ipv4[0x20]; 10797b4f1e6bSMatan Azrad }; 10807b4f1e6bSMatan Azrad 10817b4f1e6bSMatan Azrad struct mlx5_ifc_ipv6_layout_bits { 10827b4f1e6bSMatan Azrad u8 ipv6[16][0x8]; 10837b4f1e6bSMatan Azrad }; 10847b4f1e6bSMatan Azrad 10857b4f1e6bSMatan Azrad union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits { 10867b4f1e6bSMatan Azrad struct mlx5_ifc_ipv6_layout_bits ipv6_layout; 10877b4f1e6bSMatan Azrad struct mlx5_ifc_ipv4_layout_bits ipv4_layout; 10887b4f1e6bSMatan Azrad u8 reserved_at_0[0x80]; 10897b4f1e6bSMatan Azrad }; 10907b4f1e6bSMatan Azrad 10917b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_lyr_2_4_bits { 10927b4f1e6bSMatan Azrad u8 smac_47_16[0x20]; 10937b4f1e6bSMatan Azrad u8 smac_15_0[0x10]; 10947b4f1e6bSMatan Azrad u8 ethertype[0x10]; 10957b4f1e6bSMatan Azrad u8 dmac_47_16[0x20]; 10967b4f1e6bSMatan Azrad u8 dmac_15_0[0x10]; 10977b4f1e6bSMatan Azrad u8 first_prio[0x3]; 10987b4f1e6bSMatan Azrad u8 first_cfi[0x1]; 10997b4f1e6bSMatan Azrad u8 first_vid[0xc]; 11007b4f1e6bSMatan Azrad u8 ip_protocol[0x8]; 11017b4f1e6bSMatan Azrad u8 ip_dscp[0x6]; 11027b4f1e6bSMatan Azrad u8 ip_ecn[0x2]; 11037b4f1e6bSMatan Azrad u8 cvlan_tag[0x1]; 11047b4f1e6bSMatan Azrad u8 svlan_tag[0x1]; 11057b4f1e6bSMatan Azrad u8 frag[0x1]; 11067b4f1e6bSMatan Azrad u8 ip_version[0x4]; 11077b4f1e6bSMatan Azrad u8 tcp_flags[0x9]; 11087b4f1e6bSMatan Azrad u8 tcp_sport[0x10]; 11097b4f1e6bSMatan Azrad u8 tcp_dport[0x10]; 11100f250a4bSGregory Etelson u8 reserved_at_c0[0x10]; 11110f250a4bSGregory Etelson u8 ipv4_ihl[0x4]; 11120f250a4bSGregory Etelson u8 l3_ok[0x1]; 11130f250a4bSGregory Etelson u8 l4_ok[0x1]; 11140f250a4bSGregory Etelson u8 ipv4_checksum_ok[0x1]; 11150f250a4bSGregory Etelson u8 l4_checksum_ok[0x1]; 1116e8e5fdfdSDekel Peled u8 ip_ttl_hoplimit[0x8]; 11177b4f1e6bSMatan Azrad u8 udp_sport[0x10]; 11187b4f1e6bSMatan Azrad u8 udp_dport[0x10]; 11197b4f1e6bSMatan Azrad union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits src_ipv4_src_ipv6; 11207b4f1e6bSMatan Azrad union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits dst_ipv4_dst_ipv6; 11217b4f1e6bSMatan Azrad }; 11227b4f1e6bSMatan Azrad 11237b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_mpls_bits { 11247b4f1e6bSMatan Azrad u8 mpls_label[0x14]; 11257b4f1e6bSMatan Azrad u8 mpls_exp[0x3]; 11267b4f1e6bSMatan Azrad u8 mpls_s_bos[0x1]; 11277b4f1e6bSMatan Azrad u8 mpls_ttl[0x8]; 11287b4f1e6bSMatan Azrad }; 11297b4f1e6bSMatan Azrad 11307b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_misc2_bits { 11317b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_mpls_bits outer_first_mpls; 11327b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_mpls_bits inner_first_mpls; 11337b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_mpls_bits outer_first_mpls_over_gre; 11347b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_mpls_bits outer_first_mpls_over_udp; 11357b4f1e6bSMatan Azrad u8 metadata_reg_c_7[0x20]; 11367b4f1e6bSMatan Azrad u8 metadata_reg_c_6[0x20]; 11377b4f1e6bSMatan Azrad u8 metadata_reg_c_5[0x20]; 11387b4f1e6bSMatan Azrad u8 metadata_reg_c_4[0x20]; 11397b4f1e6bSMatan Azrad u8 metadata_reg_c_3[0x20]; 11407b4f1e6bSMatan Azrad u8 metadata_reg_c_2[0x20]; 11417b4f1e6bSMatan Azrad u8 metadata_reg_c_1[0x20]; 11427b4f1e6bSMatan Azrad u8 metadata_reg_c_0[0x20]; 11437b4f1e6bSMatan Azrad u8 metadata_reg_a[0x20]; 11447b4f1e6bSMatan Azrad u8 metadata_reg_b[0x20]; 11457b4f1e6bSMatan Azrad u8 reserved_at_1c0[0x40]; 11467b4f1e6bSMatan Azrad }; 11477b4f1e6bSMatan Azrad 11487b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_misc3_bits { 11497b4f1e6bSMatan Azrad u8 inner_tcp_seq_num[0x20]; 11507b4f1e6bSMatan Azrad u8 outer_tcp_seq_num[0x20]; 11517b4f1e6bSMatan Azrad u8 inner_tcp_ack_num[0x20]; 11527b4f1e6bSMatan Azrad u8 outer_tcp_ack_num[0x20]; 11537b4f1e6bSMatan Azrad u8 reserved_at_auto1[0x8]; 11547b4f1e6bSMatan Azrad u8 outer_vxlan_gpe_vni[0x18]; 11557b4f1e6bSMatan Azrad u8 outer_vxlan_gpe_next_protocol[0x8]; 11567b4f1e6bSMatan Azrad u8 outer_vxlan_gpe_flags[0x8]; 11577b4f1e6bSMatan Azrad u8 reserved_at_a8[0x10]; 11587b4f1e6bSMatan Azrad u8 icmp_header_data[0x20]; 11597b4f1e6bSMatan Azrad u8 icmpv6_header_data[0x20]; 11607b4f1e6bSMatan Azrad u8 icmp_type[0x8]; 11617b4f1e6bSMatan Azrad u8 icmp_code[0x8]; 11627b4f1e6bSMatan Azrad u8 icmpv6_type[0x8]; 11637b4f1e6bSMatan Azrad u8 icmpv6_code[0x8]; 11641324ff18SShiri Kuzin u8 geneve_tlv_option_0_data[0x20]; 11657b4f1e6bSMatan Azrad u8 gtpu_teid[0x20]; 11667b4f1e6bSMatan Azrad u8 gtpu_msg_type[0x08]; 11677b4f1e6bSMatan Azrad u8 gtpu_msg_flags[0x08]; 116815a08fd5SShiri Kuzin u8 reserved_at_170[0x10]; 116915a08fd5SShiri Kuzin u8 gtpu_dw_2[0x20]; 117015a08fd5SShiri Kuzin u8 gtpu_first_ext_dw_0[0x20]; 117115a08fd5SShiri Kuzin u8 gtpu_dw_0[0x20]; 117215a08fd5SShiri Kuzin u8 reserved_at_240[0x20]; 117315a08fd5SShiri Kuzin 11747b4f1e6bSMatan Azrad }; 11757b4f1e6bSMatan Azrad 1176daa38a89SBing Zhao struct mlx5_ifc_fte_match_set_misc4_bits { 1177daa38a89SBing Zhao u8 prog_sample_field_value_0[0x20]; 1178daa38a89SBing Zhao u8 prog_sample_field_id_0[0x20]; 1179daa38a89SBing Zhao u8 prog_sample_field_value_1[0x20]; 1180daa38a89SBing Zhao u8 prog_sample_field_id_1[0x20]; 1181daa38a89SBing Zhao u8 prog_sample_field_value_2[0x20]; 1182daa38a89SBing Zhao u8 prog_sample_field_id_2[0x20]; 1183daa38a89SBing Zhao u8 prog_sample_field_value_3[0x20]; 1184daa38a89SBing Zhao u8 prog_sample_field_id_3[0x20]; 118565be2ca6SGregory Etelson u8 prog_sample_field_value_4[0x20]; 118665be2ca6SGregory Etelson u8 prog_sample_field_id_4[0x20]; 118765be2ca6SGregory Etelson u8 prog_sample_field_value_5[0x20]; 118865be2ca6SGregory Etelson u8 prog_sample_field_id_5[0x20]; 118965be2ca6SGregory Etelson u8 prog_sample_field_value_6[0x20]; 119065be2ca6SGregory Etelson u8 prog_sample_field_id_6[0x20]; 119165be2ca6SGregory Etelson u8 prog_sample_field_value_7[0x20]; 119265be2ca6SGregory Etelson u8 prog_sample_field_id_7[0x20]; 1193daa38a89SBing Zhao }; 1194daa38a89SBing Zhao 1195630a587bSRongwei Liu struct mlx5_ifc_fte_match_set_misc5_bits { 1196630a587bSRongwei Liu u8 macsec_tag_0[0x20]; 1197630a587bSRongwei Liu u8 macsec_tag_1[0x20]; 1198630a587bSRongwei Liu u8 macsec_tag_2[0x20]; 1199630a587bSRongwei Liu u8 macsec_tag_3[0x20]; 1200630a587bSRongwei Liu u8 tunnel_header_0[0x20]; 1201630a587bSRongwei Liu u8 tunnel_header_1[0x20]; 1202630a587bSRongwei Liu u8 tunnel_header_2[0x20]; 1203630a587bSRongwei Liu u8 tunnel_header_3[0x20]; 1204630a587bSRongwei Liu u8 reserved[0x100]; 1205630a587bSRongwei Liu }; 1206630a587bSRongwei Liu 12077b4f1e6bSMatan Azrad /* Flow matcher. */ 12087b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_param_bits { 12097b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_lyr_2_4_bits outer_headers; 12107b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_misc_bits misc_parameters; 12117b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_lyr_2_4_bits inner_headers; 12127b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_misc2_bits misc_parameters_2; 12137b4f1e6bSMatan Azrad struct mlx5_ifc_fte_match_set_misc3_bits misc_parameters_3; 1214daa38a89SBing Zhao struct mlx5_ifc_fte_match_set_misc4_bits misc_parameters_4; 1215630a587bSRongwei Liu struct mlx5_ifc_fte_match_set_misc5_bits misc_parameters_5; 1216e961c8e3STal Shnaiderman /* 1217e961c8e3STal Shnaiderman * Add reserved bit to match the struct size with the size defined in PRM. 1218e961c8e3STal Shnaiderman * This extension is not required in Linux. 1219e961c8e3STal Shnaiderman */ 1220e961c8e3STal Shnaiderman #ifndef HAVE_INFINIBAND_VERBS_H 1221630a587bSRongwei Liu u8 reserved_0[0x200]; 1222e961c8e3STal Shnaiderman #endif 12237b4f1e6bSMatan Azrad }; 12247b4f1e6bSMatan Azrad 12251d194496SOphir Munk struct mlx5_ifc_dest_format_struct_bits { 12261d194496SOphir Munk u8 destination_type[0x8]; 12271d194496SOphir Munk u8 destination_id[0x18]; 12281d194496SOphir Munk u8 reserved_0[0x20]; 12291d194496SOphir Munk }; 12301d194496SOphir Munk 12317b4f1e6bSMatan Azrad enum { 12327b4f1e6bSMatan Azrad MLX5_MATCH_CRITERIA_ENABLE_OUTER_BIT, 12337b4f1e6bSMatan Azrad MLX5_MATCH_CRITERIA_ENABLE_MISC_BIT, 12347b4f1e6bSMatan Azrad MLX5_MATCH_CRITERIA_ENABLE_INNER_BIT, 12357b4f1e6bSMatan Azrad MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT, 1236daa38a89SBing Zhao MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT, 1237daa38a89SBing Zhao MLX5_MATCH_CRITERIA_ENABLE_MISC4_BIT, 1238630a587bSRongwei Liu MLX5_MATCH_CRITERIA_ENABLE_MISC5_BIT, 12397b4f1e6bSMatan Azrad }; 12407b4f1e6bSMatan Azrad 12417b4f1e6bSMatan Azrad enum { 12427b4f1e6bSMatan Azrad MLX5_CMD_OP_QUERY_HCA_CAP = 0x100, 12437b4f1e6bSMatan Azrad MLX5_CMD_OP_CREATE_MKEY = 0x200, 1244446c3781SMatan Azrad MLX5_CMD_OP_CREATE_CQ = 0x400, 12453dfa7877SKiran Vedere MLX5_CMD_OP_QUERY_CQ = 0x402, 124615c3807eSMatan Azrad MLX5_CMD_OP_CREATE_QP = 0x500, 124715c3807eSMatan Azrad MLX5_CMD_OP_RST2INIT_QP = 0x502, 124815c3807eSMatan Azrad MLX5_CMD_OP_INIT2RTR_QP = 0x503, 124915c3807eSMatan Azrad MLX5_CMD_OP_RTR2RTS_QP = 0x504, 125015c3807eSMatan Azrad MLX5_CMD_OP_RTS2RTS_QP = 0x505, 125115c3807eSMatan Azrad MLX5_CMD_OP_SQERR2RTS_QP = 0x506, 125215c3807eSMatan Azrad MLX5_CMD_OP_QP_2ERR = 0x507, 125315c3807eSMatan Azrad MLX5_CMD_OP_QP_2RST = 0x50A, 125415c3807eSMatan Azrad MLX5_CMD_OP_QUERY_QP = 0x50B, 125515c3807eSMatan Azrad MLX5_CMD_OP_SQD2RTS_QP = 0x50C, 125615c3807eSMatan Azrad MLX5_CMD_OP_INIT2INIT_QP = 0x50E, 125715c3807eSMatan Azrad MLX5_CMD_OP_SUSPEND_QP = 0x50F, 125815c3807eSMatan Azrad MLX5_CMD_OP_RESUME_QP = 0x510, 12597b4f1e6bSMatan Azrad MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT = 0x754, 1260750e48c7SMatan Azrad MLX5_CMD_OP_ALLOC_Q_COUNTER = 0x771, 1261750e48c7SMatan Azrad MLX5_CMD_OP_QUERY_Q_COUNTER = 0x773, 12627ae7f458STal Shnaiderman MLX5_CMD_OP_ALLOC_PD = 0x800, 12637ae7f458STal Shnaiderman MLX5_CMD_OP_DEALLOC_PD = 0x801, 1264bb7ef9a9SViacheslav Ovsiienko MLX5_CMD_OP_ACCESS_REGISTER = 0x805, 12657b4f1e6bSMatan Azrad MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN = 0x816, 1266cf5ac38dSRongwei Liu MLX5_CMD_OP_QUERY_LAG = 0x842, 12677b4f1e6bSMatan Azrad MLX5_CMD_OP_CREATE_TIR = 0x900, 1268847d9789SAndrey Vesnovaty MLX5_CMD_OP_MODIFY_TIR = 0x901, 12697b4f1e6bSMatan Azrad MLX5_CMD_OP_CREATE_SQ = 0X904, 12707b4f1e6bSMatan Azrad MLX5_CMD_OP_MODIFY_SQ = 0X905, 12713dfa7877SKiran Vedere MLX5_CMD_OP_QUERY_SQ = 0x907, 12727b4f1e6bSMatan Azrad MLX5_CMD_OP_CREATE_RQ = 0x908, 12737b4f1e6bSMatan Azrad MLX5_CMD_OP_MODIFY_RQ = 0x909, 1274542689e9SMatan Azrad MLX5_CMD_OP_QUERY_RQ = 0x90b, 1275ee160711SXueming Li MLX5_CMD_OP_CREATE_RMP = 0x90c, 1276ee160711SXueming Li MLX5_CMD_OP_MODIFY_RMP = 0x90d, 1277ee160711SXueming Li MLX5_CMD_OP_DESTROY_RMP = 0x90e, 1278ee160711SXueming Li MLX5_CMD_OP_QUERY_RMP = 0x90f, 12797b4f1e6bSMatan Azrad MLX5_CMD_OP_CREATE_TIS = 0x912, 12807b4f1e6bSMatan Azrad MLX5_CMD_OP_QUERY_TIS = 0x915, 12817b4f1e6bSMatan Azrad MLX5_CMD_OP_CREATE_RQT = 0x916, 1282e1da60a8SMatan Azrad MLX5_CMD_OP_MODIFY_RQT = 0x917, 1283365cdf5fSErez Shitrit MLX5_CMD_OP_CREATE_FLOW_TABLE = 0x930, 1284004edb48SHamdan Igbaria MLX5_CMD_OP_QUERY_FLOW_TABLE = 0x932, 1285365cdf5fSErez Shitrit MLX5_CMD_OP_CREATE_FLOW_GROUP = 0x933, 1286365cdf5fSErez Shitrit MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY = 0x936, 1287365cdf5fSErez Shitrit MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, 128825cb2d2aSHamdan Igbaria MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT = 0x93d, 128925cb2d2aSHamdan Igbaria MLX5_CMD_OP_DEALLOC_PACKET_REFORMAT_CONTEXT = 0x93e, 12907b4f1e6bSMatan Azrad MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939, 12917b4f1e6bSMatan Azrad MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b, 12928712c80aSMatan Azrad MLX5_CMD_OP_CREATE_GENERAL_OBJECT = 0xa00, 12938712c80aSMatan Azrad MLX5_CMD_OP_MODIFY_GENERAL_OBJECT = 0xa01, 12948712c80aSMatan Azrad MLX5_CMD_OP_QUERY_GENERAL_OBJECT = 0xa02, 12959428310aSOri Kam MLX5_CMD_SET_REGEX_PARAMS = 0xb04, 12969428310aSOri Kam MLX5_CMD_QUERY_REGEX_PARAMS = 0xb05, 12979428310aSOri Kam MLX5_CMD_SET_REGEX_REGISTERS = 0xb06, 12989428310aSOri Kam MLX5_CMD_QUERY_REGEX_REGISTERS = 0xb07, 1299bb7ef9a9SViacheslav Ovsiienko MLX5_CMD_OP_ACCESS_REGISTER_USER = 0xb0c, 130065ea97e9SMichael Baum MLX5_CMD_OP_QUERY_MATCH_SAMPLE_INFO = 0xb13, 1301720439d8SYevgeny Kliteynik MLX5_CMD_OP_ALLOW_OTHER_VHCA_ACCESS = 0xb16, 130212802ab2SAlex Vesker MLX5_CMD_OP_GENERATE_WQE = 0xb17, 13037b4f1e6bSMatan Azrad }; 13047b4f1e6bSMatan Azrad 13057b4f1e6bSMatan Azrad enum { 13067b4f1e6bSMatan Azrad MLX5_MKC_ACCESS_MODE_MTT = 0x1, 130753ec4db0SMatan Azrad MLX5_MKC_ACCESS_MODE_KLM = 0x2, 130853ec4db0SMatan Azrad MLX5_MKC_ACCESS_MODE_KLM_FBS = 0x3, 13097b4f1e6bSMatan Azrad }; 13107b4f1e6bSMatan Azrad 131115c3807eSMatan Azrad #define MLX5_ADAPTER_PAGE_SHIFT 12 131215c3807eSMatan Azrad #define MLX5_LOG_RQ_STRIDE_SHIFT 4 13131d0ab7e7SSuanming Mou /** 13141d0ab7e7SSuanming Mou * The batch counter dcs id starts from 0x800000 and none batch counter 13151d0ab7e7SSuanming Mou * starts from 0. As currently, the counter is changed to be indexed by 13161d0ab7e7SSuanming Mou * pool index and the offset of the counter in the pool counters_raw array. 13171d0ab7e7SSuanming Mou * It means now the counter index is same for batch and none batch counter. 13181d0ab7e7SSuanming Mou * Add the 0x800000 batch counter offset to the batch counter index helps 13191d0ab7e7SSuanming Mou * indicate the counter index is from batch or none batch container pool. 13201d0ab7e7SSuanming Mou */ 13211d0ab7e7SSuanming Mou #define MLX5_CNT_BATCH_OFFSET 0x800000 132215c3807eSMatan Azrad 1323e1293b10SSuanming Mou /* The counter batch query requires ID align with 4. */ 1324e1293b10SSuanming Mou #define MLX5_CNT_BATCH_QUERY_ID_ALIGNMENT 4 1325e1293b10SSuanming Mou 13267b4f1e6bSMatan Azrad /* Flow counters. */ 13277b4f1e6bSMatan Azrad struct mlx5_ifc_alloc_flow_counter_out_bits { 13287b4f1e6bSMatan Azrad u8 status[0x8]; 13297b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 13307b4f1e6bSMatan Azrad u8 syndrome[0x20]; 13317b4f1e6bSMatan Azrad u8 flow_counter_id[0x20]; 13327b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 13337b4f1e6bSMatan Azrad }; 13347b4f1e6bSMatan Azrad 13357b4f1e6bSMatan Azrad struct mlx5_ifc_alloc_flow_counter_in_bits { 13367b4f1e6bSMatan Azrad u8 opcode[0x10]; 13377b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 13387b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 13397b4f1e6bSMatan Azrad u8 op_mod[0x10]; 13404d368e1dSXiaoyu Min u8 reserved_at_40[0x8]; 13414d368e1dSXiaoyu Min u8 pd[0x18]; 13424d368e1dSXiaoyu Min u8 reserved_at_60[0x13]; 13434d368e1dSXiaoyu Min u8 flow_counter_bulk_log_size[0x5]; 13447b4f1e6bSMatan Azrad u8 flow_counter_bulk[0x8]; 13457b4f1e6bSMatan Azrad }; 13467b4f1e6bSMatan Azrad 13477b4f1e6bSMatan Azrad struct mlx5_ifc_dealloc_flow_counter_out_bits { 13487b4f1e6bSMatan Azrad u8 status[0x8]; 13497b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 13507b4f1e6bSMatan Azrad u8 syndrome[0x20]; 13517b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 13527b4f1e6bSMatan Azrad }; 13537b4f1e6bSMatan Azrad 13547b4f1e6bSMatan Azrad struct mlx5_ifc_dealloc_flow_counter_in_bits { 13557b4f1e6bSMatan Azrad u8 opcode[0x10]; 13567b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 13577b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 13587b4f1e6bSMatan Azrad u8 op_mod[0x10]; 13597b4f1e6bSMatan Azrad u8 flow_counter_id[0x20]; 13607b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 13617b4f1e6bSMatan Azrad }; 13627b4f1e6bSMatan Azrad 13637b4f1e6bSMatan Azrad struct mlx5_ifc_traffic_counter_bits { 13647b4f1e6bSMatan Azrad u8 packets[0x40]; 13657b4f1e6bSMatan Azrad u8 octets[0x40]; 13667b4f1e6bSMatan Azrad }; 13677b4f1e6bSMatan Azrad 13687b4f1e6bSMatan Azrad struct mlx5_ifc_query_flow_counter_out_bits { 13697b4f1e6bSMatan Azrad u8 status[0x8]; 13707b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 13717b4f1e6bSMatan Azrad u8 syndrome[0x20]; 13727b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 13737b4f1e6bSMatan Azrad struct mlx5_ifc_traffic_counter_bits flow_statistics[]; 13747b4f1e6bSMatan Azrad }; 13757b4f1e6bSMatan Azrad 13767b4f1e6bSMatan Azrad struct mlx5_ifc_query_flow_counter_in_bits { 13777b4f1e6bSMatan Azrad u8 opcode[0x10]; 13787b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 13797b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 13807b4f1e6bSMatan Azrad u8 op_mod[0x10]; 13817b4f1e6bSMatan Azrad u8 reserved_at_40[0x20]; 13827b4f1e6bSMatan Azrad u8 mkey[0x20]; 13837b4f1e6bSMatan Azrad u8 address[0x40]; 13847b4f1e6bSMatan Azrad u8 clear[0x1]; 13857b4f1e6bSMatan Azrad u8 dump_to_memory[0x1]; 13867b4f1e6bSMatan Azrad u8 num_of_counters[0x1e]; 13877b4f1e6bSMatan Azrad u8 flow_counter_id[0x20]; 13887b4f1e6bSMatan Azrad }; 13897b4f1e6bSMatan Azrad 139065ea97e9SMichael Baum struct mlx5_ifc_query_match_sample_info_out_bits { 139165ea97e9SMichael Baum u8 status[0x8]; 139265ea97e9SMichael Baum u8 reserved_at_8[0x18]; 139365ea97e9SMichael Baum u8 syndrome[0x20]; 139465ea97e9SMichael Baum u8 reserved_at_40[0x40]; 139565ea97e9SMichael Baum u8 reserved_at_80[0x4]; 139665ea97e9SMichael Baum u8 modify_field_id[0xc]; 139765ea97e9SMichael Baum u8 ok_bit_format_select_dw[0x8]; 139865ea97e9SMichael Baum u8 field_format_select_dw[0x8]; 139965ea97e9SMichael Baum u8 reserved_at_a0[0x3]; 140065ea97e9SMichael Baum u8 ok_bit_offset[0x5]; 140165ea97e9SMichael Baum u8 reserved_at_a8[0x18]; 140265ea97e9SMichael Baum u8 reserved_at_c0[0x40]; 140365ea97e9SMichael Baum }; 140465ea97e9SMichael Baum 140565ea97e9SMichael Baum struct mlx5_ifc_query_match_sample_info_in_bits { 140665ea97e9SMichael Baum u8 opcode[0x10]; 140765ea97e9SMichael Baum u8 uid[0x10]; 140865ea97e9SMichael Baum u8 reserved_at_20[0x10]; 140965ea97e9SMichael Baum u8 op_mod[0x10]; 141065ea97e9SMichael Baum u8 reserved_at_40[0x60]; 141165ea97e9SMichael Baum u8 sample_field_id[0x20]; 141265ea97e9SMichael Baum u8 reserved_at_c0[0x140]; 141365ea97e9SMichael Baum }; 141465ea97e9SMichael Baum 141553ec4db0SMatan Azrad #define MLX5_MAX_KLM_BYTE_COUNT 0x80000000u 141653ec4db0SMatan Azrad #define MLX5_MIN_KLM_FIXED_BUFFER_SIZE 0x1000u 141753ec4db0SMatan Azrad 141853ec4db0SMatan Azrad struct mlx5_ifc_klm_bits { 141953ec4db0SMatan Azrad u8 byte_count[0x20]; 142053ec4db0SMatan Azrad u8 mkey[0x20]; 142153ec4db0SMatan Azrad u8 address[0x40]; 142253ec4db0SMatan Azrad }; 142353ec4db0SMatan Azrad 14247b4f1e6bSMatan Azrad struct mlx5_ifc_mkc_bits { 14257b4f1e6bSMatan Azrad u8 reserved_at_0[0x1]; 14267b4f1e6bSMatan Azrad u8 free[0x1]; 14277b4f1e6bSMatan Azrad u8 reserved_at_2[0x1]; 14287b4f1e6bSMatan Azrad u8 access_mode_4_2[0x3]; 14297b4f1e6bSMatan Azrad u8 reserved_at_6[0x7]; 14307b4f1e6bSMatan Azrad u8 relaxed_ordering_write[0x1]; 14317b4f1e6bSMatan Azrad u8 reserved_at_e[0x1]; 14327b4f1e6bSMatan Azrad u8 small_fence_on_rdma_read_response[0x1]; 14337b4f1e6bSMatan Azrad u8 umr_en[0x1]; 14347b4f1e6bSMatan Azrad u8 a[0x1]; 14357b4f1e6bSMatan Azrad u8 rw[0x1]; 14367b4f1e6bSMatan Azrad u8 rr[0x1]; 14377b4f1e6bSMatan Azrad u8 lw[0x1]; 14387b4f1e6bSMatan Azrad u8 lr[0x1]; 14397b4f1e6bSMatan Azrad u8 access_mode_1_0[0x2]; 14407b4f1e6bSMatan Azrad u8 reserved_at_18[0x8]; 14417b4f1e6bSMatan Azrad u8 qpn[0x18]; 14427b4f1e6bSMatan Azrad u8 mkey_7_0[0x8]; 14437b4f1e6bSMatan Azrad u8 reserved_at_40[0x20]; 14447b4f1e6bSMatan Azrad u8 length64[0x1]; 14457b4f1e6bSMatan Azrad u8 bsf_en[0x1]; 14467b4f1e6bSMatan Azrad u8 sync_umr[0x1]; 14477b4f1e6bSMatan Azrad u8 reserved_at_63[0x2]; 14487b4f1e6bSMatan Azrad u8 expected_sigerr_count[0x1]; 14497b4f1e6bSMatan Azrad u8 reserved_at_66[0x1]; 14507b4f1e6bSMatan Azrad u8 en_rinval[0x1]; 14517b4f1e6bSMatan Azrad u8 pd[0x18]; 14527b4f1e6bSMatan Azrad u8 start_addr[0x40]; 14537b4f1e6bSMatan Azrad u8 len[0x40]; 14547b4f1e6bSMatan Azrad u8 bsf_octword_size[0x20]; 14557b4f1e6bSMatan Azrad u8 reserved_at_120[0x80]; 14567b4f1e6bSMatan Azrad u8 translations_octword_size[0x20]; 145753ac93f7SShiri Kuzin u8 reserved_at_1c0[0x19]; 145853ac93f7SShiri Kuzin u8 relaxed_ordering_read[0x1]; 145953ac93f7SShiri Kuzin u8 reserved_at_1da[0x1]; 14607b4f1e6bSMatan Azrad u8 log_page_size[0x5]; 14610111a74eSDekel Peled u8 reserved_at_1e0[0x3]; 14620111a74eSDekel Peled u8 crypto_en[0x2]; 14630111a74eSDekel Peled u8 reserved_at_1e5[0x1b]; 14640111a74eSDekel Peled }; 14650111a74eSDekel Peled 14660111a74eSDekel Peled /* Range of values for MKEY context crypto_en field. */ 14670111a74eSDekel Peled enum { 14680111a74eSDekel Peled MLX5_MKEY_CRYPTO_DISABLED = 0x0, 14690111a74eSDekel Peled MLX5_MKEY_CRYPTO_ENABLED = 0x1, 14707b4f1e6bSMatan Azrad }; 14717b4f1e6bSMatan Azrad 14727b4f1e6bSMatan Azrad struct mlx5_ifc_create_mkey_out_bits { 14737b4f1e6bSMatan Azrad u8 status[0x8]; 14747b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 14757b4f1e6bSMatan Azrad u8 syndrome[0x20]; 14767b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 14777b4f1e6bSMatan Azrad u8 mkey_index[0x18]; 14787b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 14797b4f1e6bSMatan Azrad }; 14807b4f1e6bSMatan Azrad 14817b4f1e6bSMatan Azrad struct mlx5_ifc_create_mkey_in_bits { 14827b4f1e6bSMatan Azrad u8 opcode[0x10]; 14837b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 14847b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 14857b4f1e6bSMatan Azrad u8 op_mod[0x10]; 14867b4f1e6bSMatan Azrad u8 reserved_at_40[0x20]; 14877b4f1e6bSMatan Azrad u8 pg_access[0x1]; 14887b4f1e6bSMatan Azrad u8 reserved_at_61[0x1f]; 14897b4f1e6bSMatan Azrad struct mlx5_ifc_mkc_bits memory_key_mkey_entry; 14907b4f1e6bSMatan Azrad u8 reserved_at_280[0x80]; 14917b4f1e6bSMatan Azrad u8 translations_octword_actual_size[0x20]; 14927b4f1e6bSMatan Azrad u8 mkey_umem_id[0x20]; 14937b4f1e6bSMatan Azrad u8 mkey_umem_offset[0x40]; 14947b4f1e6bSMatan Azrad u8 reserved_at_380[0x500]; 14957b4f1e6bSMatan Azrad u8 klm_pas_mtt[][0x20]; 14967b4f1e6bSMatan Azrad }; 14977b4f1e6bSMatan Azrad 14987b4f1e6bSMatan Azrad enum { 14997b4f1e6bSMatan Azrad MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0 << 1, 15007b4f1e6bSMatan Azrad MLX5_GET_HCA_CAP_OP_MOD_ETHERNET_OFFLOAD_CAPS = 0x1 << 1, 15017b4f1e6bSMatan Azrad MLX5_GET_HCA_CAP_OP_MOD_QOS_CAP = 0xc << 1, 1502569ffbc9SViacheslav Ovsiienko MLX5_GET_HCA_CAP_OP_MOD_ROCE = 0x4 << 1, 15038cc34c08SJiawei Wang MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE = 0x7 << 1, 15045f44fb19SBing Zhao MLX5_GET_HCA_CAP_OP_MOD_ESW_FLOW_TABLE = 0x8 << 1, 150538eb5c9fSShun Hao MLX5_SET_HCA_CAP_OP_MOD_ESW = 0x9 << 1, 1506ba1768c4SMatan Azrad MLX5_GET_HCA_CAP_OP_MOD_VDPA_EMULATION = 0x13 << 1, 1507f12c41bfSRaja Zidane MLX5_GET_HCA_CAP_OP_MOD_CRYPTO = 0x1A << 1, 1508365cdf5fSErez Shitrit MLX5_GET_HCA_CAP_OP_MOD_WQE_BASED_FLOW_TABLE = 0x1B << 1, 150965be2ca6SGregory Etelson MLX5_GET_HCA_CAP_OP_MOD_PARSE_GRAPH_NODE_CAP = 0x1C << 1, 1510dc4e9e82SBing Zhao MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE_2 = 0x20 << 1, 1511ba1768c4SMatan Azrad }; 1512ba1768c4SMatan Azrad 1513c696ab09SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q \ 1514c696ab09SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_VIRTQ) 1515c696ab09SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_Q_COUNTERS \ 1516c696ab09SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_VIRTIO_Q_COUNTERS) 1517c696ab09SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_PARSE_GRAPH_FLEX_NODE \ 1518c696ab09SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_FLEX_PARSE_GRAPH) 151901b8b5b6SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_HIT_ASO \ 152001b8b5b6SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_FLOW_HIT_ASO) 152149e0ccb5SLi Zhang #define MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_METER_ASO \ 152249e0ccb5SLi Zhang (1ULL << MLX5_GENERAL_OBJ_TYPE_FLOW_METER_ASO) 15231324ff18SShiri Kuzin #define MLX5_GENERAL_OBJ_TYPES_CAP_GENEVE_TLV_OPT \ 1524753a7c08SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_GENEVE_TLV_OPT) 15250c6285b7SBing Zhao #define MLX5_GENERAL_OBJ_TYPES_CAP_CONN_TRACK_OFFLOAD \ 15260c6285b7SBing Zhao (1ULL << MLX5_GENERAL_OBJ_TYPE_CONN_TRACK_OFFLOAD) 1527365cdf5fSErez Shitrit #define MLX5_GENERAL_OBJ_TYPES_CAP_DEFINER \ 1528365cdf5fSErez Shitrit (1ULL << MLX5_GENERAL_OBJ_TYPE_DEFINER) 1529178d8c50SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_DEK \ 1530178d8c50SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_DEK) 153121ca2494SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_IMPORT_KEK \ 153221ca2494SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_IMPORT_KEK) 1533abda4fd9SDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_CREDENTIAL \ 1534abda4fd9SDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_CREDENTIAL) 153538e4780bSDekel Peled #define MLX5_GENERAL_OBJ_TYPES_CAP_CRYPTO_LOGIN \ 153638e4780bSDekel Peled (1ULL << MLX5_GENERAL_OBJ_TYPE_CRYPTO_LOGIN) 15377b4f1e6bSMatan Azrad 15387b4f1e6bSMatan Azrad enum { 15397b4f1e6bSMatan Azrad MLX5_HCA_CAP_OPMOD_GET_MAX = 0, 15407b4f1e6bSMatan Azrad MLX5_HCA_CAP_OPMOD_GET_CUR = 1, 15417b4f1e6bSMatan Azrad }; 15427b4f1e6bSMatan Azrad 15437b4f1e6bSMatan Azrad enum { 15447b4f1e6bSMatan Azrad MLX5_CAP_INLINE_MODE_L2, 15457b4f1e6bSMatan Azrad MLX5_CAP_INLINE_MODE_VPORT_CONTEXT, 15467b4f1e6bSMatan Azrad MLX5_CAP_INLINE_MODE_NOT_REQUIRED, 15477b4f1e6bSMatan Azrad }; 15487b4f1e6bSMatan Azrad 15497b4f1e6bSMatan Azrad enum { 15507b4f1e6bSMatan Azrad MLX5_INLINE_MODE_NONE, 15517b4f1e6bSMatan Azrad MLX5_INLINE_MODE_L2, 15527b4f1e6bSMatan Azrad MLX5_INLINE_MODE_IP, 15537b4f1e6bSMatan Azrad MLX5_INLINE_MODE_TCP_UDP, 15547b4f1e6bSMatan Azrad MLX5_INLINE_MODE_RESERVED4, 15557b4f1e6bSMatan Azrad MLX5_INLINE_MODE_INNER_L2, 15567b4f1e6bSMatan Azrad MLX5_INLINE_MODE_INNER_IP, 15577b4f1e6bSMatan Azrad MLX5_INLINE_MODE_INNER_TCP_UDP, 15587b4f1e6bSMatan Azrad }; 15597b4f1e6bSMatan Azrad 1560569ffbc9SViacheslav Ovsiienko /* The supported timestamp formats reported in HCA attributes. */ 1561569ffbc9SViacheslav Ovsiienko enum { 1562569ffbc9SViacheslav Ovsiienko MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR = 0x0, 1563569ffbc9SViacheslav Ovsiienko MLX5_HCA_CAP_TIMESTAMP_FORMAT_RT = 0x1, 1564569ffbc9SViacheslav Ovsiienko MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR_RT = 0x2, 1565569ffbc9SViacheslav Ovsiienko }; 1566569ffbc9SViacheslav Ovsiienko 1567569ffbc9SViacheslav Ovsiienko /* The timestamp format attributes to configure queues (RQ/SQ/QP). */ 1568569ffbc9SViacheslav Ovsiienko enum { 1569569ffbc9SViacheslav Ovsiienko MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING = 0x0, 1570569ffbc9SViacheslav Ovsiienko MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT = 0x1, 1571569ffbc9SViacheslav Ovsiienko MLX5_QPC_TIMESTAMP_FORMAT_REAL_TIME = 0x2, 1572569ffbc9SViacheslav Ovsiienko }; 1573569ffbc9SViacheslav Ovsiienko 15747b4f1e6bSMatan Azrad /* HCA bit masks indicating which Flex parser protocols are already enabled. */ 15757b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_IPV4_OVER_VXLAN_ENABLED (1UL << 0) 15767b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_IPV6_OVER_VXLAN_ENABLED (1UL << 1) 15777b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_IPV6_OVER_IP_ENABLED (1UL << 2) 15787b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_GENEVE_ENABLED (1UL << 3) 15797b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_CW_MPLS_OVER_GRE_ENABLED (1UL << 4) 15807b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_CW_MPLS_OVER_UDP_ENABLED (1UL << 5) 15817b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_P_BIT_VXLAN_GPE_ENABLED (1UL << 6) 15827b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_VXLAN_GPE_ENABLED (1UL << 7) 15837b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_ICMP_ENABLED (1UL << 8) 15847b4f1e6bSMatan Azrad #define MLX5_HCA_FLEX_ICMPV6_ENABLED (1UL << 9) 1585365cdf5fSErez Shitrit #define MLX5_HCA_FLEX_GTPU_ENABLED (1UL << 11) 1586365cdf5fSErez Shitrit #define MLX5_HCA_FLEX_GTPU_DW_2_ENABLED (1UL << 16) 1587365cdf5fSErez Shitrit #define MLX5_HCA_FLEX_GTPU_FIRST_EXT_DW_0_ENABLED (1UL << 17) 1588365cdf5fSErez Shitrit #define MLX5_HCA_FLEX_GTPU_DW_0_ENABLED (1UL << 18) 1589365cdf5fSErez Shitrit #define MLX5_HCA_FLEX_GTPU_TEID_ENABLED (1UL << 19) 15907b4f1e6bSMatan Azrad 159196f85ec4SDong Zhou /* The device steering logic format. */ 159296f85ec4SDong Zhou #define MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5 0x0 159396f85ec4SDong Zhou #define MLX5_STEERING_LOGIC_FORMAT_CONNECTX_6DX 0x1 159496f85ec4SDong Zhou 15957b4f1e6bSMatan Azrad struct mlx5_ifc_cmd_hca_cap_bits { 15964d368e1dSXiaoyu Min u8 access_other_hca_roce[0x1]; 15974d368e1dSXiaoyu Min u8 alloc_flow_counter_pd[0x1]; 15984d368e1dSXiaoyu Min u8 flow_counter_access_aso[0x1]; 159965ea97e9SMichael Baum u8 query_match_sample_info[0x1]; 160065ea97e9SMichael Baum u8 reserved_at_4[0x4]; 16014d368e1dSXiaoyu Min u8 flow_access_aso_opc_mod[0x8]; 16024d368e1dSXiaoyu Min u8 reserved_at_10[0xf]; 16034d368e1dSXiaoyu Min u8 vhca_resource_manager[0x1]; 160410599cf8SMichael Baum u8 hca_cap_2[0x1]; 160510599cf8SMichael Baum u8 reserved_at_21[0xf]; 16067b4f1e6bSMatan Azrad u8 vhca_id[0x10]; 1607ae5c165bSMatan Azrad u8 reserved_at_40[0x20]; 1608ae5c165bSMatan Azrad u8 reserved_at_60[0x3]; 1609ae5c165bSMatan Azrad u8 log_regexp_scatter_gather_size[0x5]; 1610ae5c165bSMatan Azrad u8 reserved_at_68[0x3]; 1611ae5c165bSMatan Azrad u8 log_dma_mmo_size[0x5]; 1612ae5c165bSMatan Azrad u8 reserved_at_70[0x3]; 1613ae5c165bSMatan Azrad u8 log_compress_mmo_size[0x5]; 161493297930SMichael Baum u8 decompress_lz4_data_only_v2[0x1]; 161593297930SMichael Baum u8 decompress_lz4_no_checksum_v2[0x1]; 161693297930SMichael Baum u8 decompress_lz4_checksum_v2[0x1]; 1617ae5c165bSMatan Azrad u8 log_decompress_mmo_size[0x5]; 16187b4f1e6bSMatan Azrad u8 log_max_srq_sz[0x8]; 16197b4f1e6bSMatan Azrad u8 log_max_qp_sz[0x8]; 162079a7e409SViacheslav Ovsiienko u8 reserved_at_90[0x9]; 162179a7e409SViacheslav Ovsiienko u8 wqe_index_ignore_cap[0x1]; 162279a7e409SViacheslav Ovsiienko u8 dynamic_qp_allocation[0x1]; 16237b4f1e6bSMatan Azrad u8 log_max_qp[0x5]; 16242044860eSAdy Agbarih u8 reserved_at_a0[0x4]; 1625cfc672a9SOri Kam u8 regexp_num_of_engines[0x4]; 1626efa6a7e2SJiawei Wang u8 reserved_at_a8[0x1]; 1627efa6a7e2SJiawei Wang u8 reg_c_preserve[0x1]; 1628efa6a7e2SJiawei Wang u8 reserved_at_aa[0x1]; 16297b4f1e6bSMatan Azrad u8 log_max_srq[0x5]; 16302044860eSAdy Agbarih u8 reserved_at_b0[0xb]; 163191f7338eSSuanming Mou u8 scatter_fcs_w_decap_disable[0x1]; 163291f7338eSSuanming Mou u8 reserved_at_bc[0x4]; 16337b4f1e6bSMatan Azrad u8 reserved_at_c0[0x8]; 16347b4f1e6bSMatan Azrad u8 log_max_cq_sz[0x8]; 1635e6a6829fSMichael Baum u8 reserved_at_d0[0x2]; 1636e6a6829fSMichael Baum u8 access_register_user[0x1]; 1637e6a6829fSMichael Baum u8 reserved_at_d3[0x8]; 16387b4f1e6bSMatan Azrad u8 log_max_cq[0x5]; 16397b4f1e6bSMatan Azrad u8 log_max_eq_sz[0x8]; 1640ffd5b302SShiri Kuzin u8 relaxed_ordering_write[0x1]; 1641ffd5b302SShiri Kuzin u8 relaxed_ordering_read[0x1]; 1642e6a6829fSMichael Baum u8 log_max_mkey[0x6]; 16437b4f1e6bSMatan Azrad u8 reserved_at_f0[0x8]; 16447b4f1e6bSMatan Azrad u8 dump_fill_mkey[0x1]; 16457b4f1e6bSMatan Azrad u8 reserved_at_f9[0x3]; 16467b4f1e6bSMatan Azrad u8 log_max_eq[0x4]; 16477b4f1e6bSMatan Azrad u8 max_indirection[0x8]; 16487b4f1e6bSMatan Azrad u8 fixed_buffer_size[0x1]; 16497b4f1e6bSMatan Azrad u8 log_max_mrw_sz[0x7]; 16507b4f1e6bSMatan Azrad u8 force_teardown[0x1]; 16517b4f1e6bSMatan Azrad u8 reserved_at_111[0x1]; 16527b4f1e6bSMatan Azrad u8 log_max_bsf_list_size[0x6]; 16537b4f1e6bSMatan Azrad u8 umr_extended_translation_offset[0x1]; 16547b4f1e6bSMatan Azrad u8 null_mkey[0x1]; 16558b3a69fbSMichael Baum u8 log_maxklm_list_size[0x6]; 165679a7e409SViacheslav Ovsiienko u8 non_wire_sq[0x1]; 165779a7e409SViacheslav Ovsiienko u8 reserved_at_121[0x9]; 16587b4f1e6bSMatan Azrad u8 log_max_ra_req_dc[0x6]; 165979a7e409SViacheslav Ovsiienko u8 reserved_at_130[0x3]; 166079a7e409SViacheslav Ovsiienko u8 log_max_static_sq_wq[0x5]; 166179a7e409SViacheslav Ovsiienko u8 reserved_at_138[0x2]; 16627b4f1e6bSMatan Azrad u8 log_max_ra_res_dc[0x6]; 16637b4f1e6bSMatan Azrad u8 reserved_at_140[0xa]; 16647b4f1e6bSMatan Azrad u8 log_max_ra_req_qp[0x6]; 1665ae5c165bSMatan Azrad u8 rtr2rts_qp_counters_set_id[0x1]; 1666ae5c165bSMatan Azrad u8 rts2rts_udp_sport[0x1]; 1667ae5c165bSMatan Azrad u8 rts2rts_lag_tx_port_affinity[0x1]; 1668cbc4c13aSRaja Zidane u8 dma_mmo_sq[0x1]; 1669ae5c165bSMatan Azrad u8 compress_min_block_size[0x4]; 1670cbc4c13aSRaja Zidane u8 compress_mmo_sq[0x1]; 1671cbc4c13aSRaja Zidane u8 decompress_mmo_sq[0x1]; 16727b4f1e6bSMatan Azrad u8 log_max_ra_res_qp[0x6]; 16737b4f1e6bSMatan Azrad u8 end_pad[0x1]; 16747b4f1e6bSMatan Azrad u8 cc_query_allowed[0x1]; 16757b4f1e6bSMatan Azrad u8 cc_modify_allowed[0x1]; 16767b4f1e6bSMatan Azrad u8 start_pad[0x1]; 16777b4f1e6bSMatan Azrad u8 cache_line_128byte[0x1]; 16787b4f1e6bSMatan Azrad u8 reserved_at_165[0xa]; 16797b4f1e6bSMatan Azrad u8 qcam_reg[0x1]; 16807b4f1e6bSMatan Azrad u8 gid_table_size[0x10]; 16817b4f1e6bSMatan Azrad u8 out_of_seq_cnt[0x1]; 16827b4f1e6bSMatan Azrad u8 vport_counters[0x1]; 16837b4f1e6bSMatan Azrad u8 retransmission_q_counters[0x1]; 16847b4f1e6bSMatan Azrad u8 debug[0x1]; 16857b4f1e6bSMatan Azrad u8 modify_rq_counter_set_id[0x1]; 16867b4f1e6bSMatan Azrad u8 rq_delay_drop[0x1]; 16877b4f1e6bSMatan Azrad u8 max_qp_cnt[0xa]; 16887b4f1e6bSMatan Azrad u8 pkey_table_size[0x10]; 16897b4f1e6bSMatan Azrad u8 vport_group_manager[0x1]; 16907b4f1e6bSMatan Azrad u8 vhca_group_manager[0x1]; 16917b4f1e6bSMatan Azrad u8 ib_virt[0x1]; 16927b4f1e6bSMatan Azrad u8 eth_virt[0x1]; 16937b4f1e6bSMatan Azrad u8 vnic_env_queue_counters[0x1]; 16947b4f1e6bSMatan Azrad u8 ets[0x1]; 16957b4f1e6bSMatan Azrad u8 nic_flow_table[0x1]; 16967b4f1e6bSMatan Azrad u8 eswitch_manager[0x1]; 16977b4f1e6bSMatan Azrad u8 device_memory[0x1]; 16987b4f1e6bSMatan Azrad u8 mcam_reg[0x1]; 16997b4f1e6bSMatan Azrad u8 pcam_reg[0x1]; 17007b4f1e6bSMatan Azrad u8 local_ca_ack_delay[0x5]; 17017b4f1e6bSMatan Azrad u8 port_module_event[0x1]; 17027b4f1e6bSMatan Azrad u8 enhanced_error_q_counters[0x1]; 17037b4f1e6bSMatan Azrad u8 ports_check[0x1]; 17047b4f1e6bSMatan Azrad u8 reserved_at_1b3[0x1]; 17057b4f1e6bSMatan Azrad u8 disable_link_up[0x1]; 17067b4f1e6bSMatan Azrad u8 beacon_led[0x1]; 17077b4f1e6bSMatan Azrad u8 port_type[0x2]; 17087b4f1e6bSMatan Azrad u8 num_ports[0x8]; 17097b4f1e6bSMatan Azrad u8 reserved_at_1c0[0x1]; 17107b4f1e6bSMatan Azrad u8 pps[0x1]; 17117b4f1e6bSMatan Azrad u8 pps_modify[0x1]; 17127b4f1e6bSMatan Azrad u8 log_max_msg[0x5]; 17137b4f1e6bSMatan Azrad u8 reserved_at_1c8[0x4]; 17147b4f1e6bSMatan Azrad u8 max_tc[0x4]; 17157b4f1e6bSMatan Azrad u8 temp_warn_event[0x1]; 17167b4f1e6bSMatan Azrad u8 dcbx[0x1]; 17177b4f1e6bSMatan Azrad u8 general_notification_event[0x1]; 17187b4f1e6bSMatan Azrad u8 reserved_at_1d3[0x2]; 17197b4f1e6bSMatan Azrad u8 fpga[0x1]; 17207b4f1e6bSMatan Azrad u8 rol_s[0x1]; 17217b4f1e6bSMatan Azrad u8 rol_g[0x1]; 17227b4f1e6bSMatan Azrad u8 reserved_at_1d8[0x1]; 17237b4f1e6bSMatan Azrad u8 wol_s[0x1]; 17247b4f1e6bSMatan Azrad u8 wol_g[0x1]; 17257b4f1e6bSMatan Azrad u8 wol_a[0x1]; 17267b4f1e6bSMatan Azrad u8 wol_b[0x1]; 17277b4f1e6bSMatan Azrad u8 wol_m[0x1]; 17287b4f1e6bSMatan Azrad u8 wol_u[0x1]; 17297b4f1e6bSMatan Azrad u8 wol_p[0x1]; 17307b4f1e6bSMatan Azrad u8 stat_rate_support[0x10]; 1731365cdf5fSErez Shitrit u8 reserved_at_1ef[0xb]; 1732365cdf5fSErez Shitrit u8 wqe_based_flow_table_update_cap[0x1]; 17337b4f1e6bSMatan Azrad u8 cqe_version[0x4]; 17347b4f1e6bSMatan Azrad u8 compact_address_vector[0x1]; 17357b4f1e6bSMatan Azrad u8 striding_rq[0x1]; 17367b4f1e6bSMatan Azrad u8 reserved_at_202[0x1]; 17377b4f1e6bSMatan Azrad u8 ipoib_enhanced_offloads[0x1]; 17387b4f1e6bSMatan Azrad u8 ipoib_basic_offloads[0x1]; 17397b4f1e6bSMatan Azrad u8 reserved_at_205[0x1]; 17407b4f1e6bSMatan Azrad u8 repeated_block_disabled[0x1]; 17417b4f1e6bSMatan Azrad u8 umr_modify_entity_size_disabled[0x1]; 17427b4f1e6bSMatan Azrad u8 umr_modify_atomic_disabled[0x1]; 17437b4f1e6bSMatan Azrad u8 umr_indirect_mkey_disabled[0x1]; 17447b4f1e6bSMatan Azrad u8 umr_fence[0x2]; 17457b4f1e6bSMatan Azrad u8 reserved_at_20c[0x3]; 17467b4f1e6bSMatan Azrad u8 drain_sigerr[0x1]; 17477b4f1e6bSMatan Azrad u8 cmdif_checksum[0x2]; 17487b4f1e6bSMatan Azrad u8 sigerr_cqe[0x1]; 17497b4f1e6bSMatan Azrad u8 reserved_at_213[0x1]; 17507b4f1e6bSMatan Azrad u8 wq_signature[0x1]; 17517b4f1e6bSMatan Azrad u8 sctr_data_cqe[0x1]; 17527b4f1e6bSMatan Azrad u8 reserved_at_216[0x1]; 17537b4f1e6bSMatan Azrad u8 sho[0x1]; 17547b4f1e6bSMatan Azrad u8 tph[0x1]; 17557b4f1e6bSMatan Azrad u8 rf[0x1]; 17567b4f1e6bSMatan Azrad u8 dct[0x1]; 17577b4f1e6bSMatan Azrad u8 qos[0x1]; 17587b4f1e6bSMatan Azrad u8 eth_net_offloads[0x1]; 17597b4f1e6bSMatan Azrad u8 roce[0x1]; 17607b4f1e6bSMatan Azrad u8 atomic[0x1]; 17617b4f1e6bSMatan Azrad u8 reserved_at_21f[0x1]; 17627b4f1e6bSMatan Azrad u8 cq_oi[0x1]; 17637b4f1e6bSMatan Azrad u8 cq_resize[0x1]; 17647b4f1e6bSMatan Azrad u8 cq_moderation[0x1]; 17657b4f1e6bSMatan Azrad u8 reserved_at_223[0x3]; 17667b4f1e6bSMatan Azrad u8 cq_eq_remap[0x1]; 17677b4f1e6bSMatan Azrad u8 pg[0x1]; 17687b4f1e6bSMatan Azrad u8 block_lb_mc[0x1]; 17697b4f1e6bSMatan Azrad u8 reserved_at_229[0x1]; 17707b4f1e6bSMatan Azrad u8 scqe_break_moderation[0x1]; 17717b4f1e6bSMatan Azrad u8 cq_period_start_from_cqe[0x1]; 17727b4f1e6bSMatan Azrad u8 cd[0x1]; 17737b4f1e6bSMatan Azrad u8 reserved_at_22d[0x1]; 17747b4f1e6bSMatan Azrad u8 apm[0x1]; 17757b4f1e6bSMatan Azrad u8 vector_calc[0x1]; 17767b4f1e6bSMatan Azrad u8 umr_ptr_rlky[0x1]; 17777b4f1e6bSMatan Azrad u8 imaicl[0x1]; 17787b4f1e6bSMatan Azrad u8 reserved_at_232[0x4]; 17797b4f1e6bSMatan Azrad u8 qkv[0x1]; 17807b4f1e6bSMatan Azrad u8 pkv[0x1]; 17817b4f1e6bSMatan Azrad u8 set_deth_sqpn[0x1]; 17827b4f1e6bSMatan Azrad u8 reserved_at_239[0x3]; 17837b4f1e6bSMatan Azrad u8 xrc[0x1]; 17847b4f1e6bSMatan Azrad u8 ud[0x1]; 17857b4f1e6bSMatan Azrad u8 uc[0x1]; 17867b4f1e6bSMatan Azrad u8 rc[0x1]; 17877b4f1e6bSMatan Azrad u8 uar_4k[0x1]; 17882044860eSAdy Agbarih u8 reserved_at_241[0x8]; 17892044860eSAdy Agbarih u8 regexp_params[0x1]; 17907b4f1e6bSMatan Azrad u8 uar_sz[0x6]; 1791cf5ac38dSRongwei Liu u8 port_selection_cap[0x1]; 1792cf5ac38dSRongwei Liu u8 reserved_at_251[0x7]; 17937b4f1e6bSMatan Azrad u8 log_pg_sz[0x8]; 17947b4f1e6bSMatan Azrad u8 bf[0x1]; 17957b4f1e6bSMatan Azrad u8 driver_version[0x1]; 17967b4f1e6bSMatan Azrad u8 pad_tx_eth_packet[0x1]; 17977b4f1e6bSMatan Azrad u8 reserved_at_263[0x8]; 17987b4f1e6bSMatan Azrad u8 log_bf_reg_size[0x5]; 17997b4f1e6bSMatan Azrad u8 reserved_at_270[0xb]; 18007b4f1e6bSMatan Azrad u8 lag_master[0x1]; 18017b4f1e6bSMatan Azrad u8 num_lag_ports[0x4]; 18027b4f1e6bSMatan Azrad u8 reserved_at_280[0x10]; 18037b4f1e6bSMatan Azrad u8 max_wqe_sz_sq[0x10]; 1804cbc4c13aSRaja Zidane u8 reserved_at_2a0[0xc]; 1805cbc4c13aSRaja Zidane u8 regexp_mmo_sq[0x1]; 18062044860eSAdy Agbarih u8 regexp_version[0x3]; 18077b4f1e6bSMatan Azrad u8 max_wqe_sz_rq[0x10]; 18087b4f1e6bSMatan Azrad u8 max_flow_counter_31_16[0x10]; 18097b4f1e6bSMatan Azrad u8 max_wqe_sz_sq_dc[0x10]; 18107b4f1e6bSMatan Azrad u8 reserved_at_2e0[0x7]; 18117b4f1e6bSMatan Azrad u8 max_qp_mcg[0x19]; 18127b4f1e6bSMatan Azrad u8 reserved_at_300[0x10]; 18137b4f1e6bSMatan Azrad u8 flow_counter_bulk_alloc[0x08]; 18147b4f1e6bSMatan Azrad u8 log_max_mcg[0x8]; 18157b4f1e6bSMatan Azrad u8 reserved_at_320[0x3]; 18167b4f1e6bSMatan Azrad u8 log_max_transport_domain[0x5]; 18177b4f1e6bSMatan Azrad u8 reserved_at_328[0x3]; 18187b4f1e6bSMatan Azrad u8 log_max_pd[0x5]; 18197b4f1e6bSMatan Azrad u8 reserved_at_330[0xb]; 18207b4f1e6bSMatan Azrad u8 log_max_xrcd[0x5]; 18217b4f1e6bSMatan Azrad u8 nic_receive_steering_discard[0x1]; 18227b4f1e6bSMatan Azrad u8 receive_discard_vport_down[0x1]; 18237b4f1e6bSMatan Azrad u8 transmit_discard_vport_down[0x1]; 18247b4f1e6bSMatan Azrad u8 reserved_at_343[0x5]; 18257b4f1e6bSMatan Azrad u8 log_max_flow_counter_bulk[0x8]; 18267b4f1e6bSMatan Azrad u8 max_flow_counter_15_0[0x10]; 18277b4f1e6bSMatan Azrad u8 modify_tis[0x1]; 18287b4f1e6bSMatan Azrad u8 flow_counters_dump[0x1]; 18297b4f1e6bSMatan Azrad u8 reserved_at_360[0x1]; 18307b4f1e6bSMatan Azrad u8 log_max_rq[0x5]; 18317b4f1e6bSMatan Azrad u8 reserved_at_368[0x3]; 18327b4f1e6bSMatan Azrad u8 log_max_sq[0x5]; 18337b4f1e6bSMatan Azrad u8 reserved_at_370[0x3]; 18347b4f1e6bSMatan Azrad u8 log_max_tir[0x5]; 18357b4f1e6bSMatan Azrad u8 reserved_at_378[0x3]; 18367b4f1e6bSMatan Azrad u8 log_max_tis[0x5]; 18377b4f1e6bSMatan Azrad u8 basic_cyclic_rcv_wqe[0x1]; 1838ee160711SXueming Li u8 reserved_at_381[0x1]; 1839ee160711SXueming Li u8 mem_rq_rmp[0x1]; 18407b4f1e6bSMatan Azrad u8 log_max_rmp[0x5]; 18417b4f1e6bSMatan Azrad u8 reserved_at_388[0x3]; 18427b4f1e6bSMatan Azrad u8 log_max_rqt[0x5]; 18437b4f1e6bSMatan Azrad u8 reserved_at_390[0x3]; 18447b4f1e6bSMatan Azrad u8 log_max_rqt_size[0x5]; 18457b4f1e6bSMatan Azrad u8 reserved_at_398[0x3]; 18467b4f1e6bSMatan Azrad u8 log_max_tis_per_sq[0x5]; 18477b4f1e6bSMatan Azrad u8 ext_stride_num_range[0x1]; 18487b4f1e6bSMatan Azrad u8 reserved_at_3a1[0x2]; 18497b4f1e6bSMatan Azrad u8 log_max_stride_sz_rq[0x5]; 18507b4f1e6bSMatan Azrad u8 reserved_at_3a8[0x3]; 18517b4f1e6bSMatan Azrad u8 log_min_stride_sz_rq[0x5]; 18527b4f1e6bSMatan Azrad u8 reserved_at_3b0[0x3]; 18537b4f1e6bSMatan Azrad u8 log_max_stride_sz_sq[0x5]; 18547b4f1e6bSMatan Azrad u8 reserved_at_3b8[0x3]; 18557b4f1e6bSMatan Azrad u8 log_min_stride_sz_sq[0x5]; 18567b4f1e6bSMatan Azrad u8 hairpin[0x1]; 18577b4f1e6bSMatan Azrad u8 reserved_at_3c1[0x2]; 18587b4f1e6bSMatan Azrad u8 log_max_hairpin_queues[0x5]; 18597b4f1e6bSMatan Azrad u8 reserved_at_3c8[0x3]; 18607b4f1e6bSMatan Azrad u8 log_max_hairpin_wq_data_sz[0x5]; 18617b4f1e6bSMatan Azrad u8 reserved_at_3d0[0x3]; 18627b4f1e6bSMatan Azrad u8 log_max_hairpin_num_packets[0x5]; 18637b4f1e6bSMatan Azrad u8 reserved_at_3d8[0x3]; 18647b4f1e6bSMatan Azrad u8 log_max_wq_sz[0x5]; 18657b4f1e6bSMatan Azrad u8 nic_vport_change_event[0x1]; 18667b4f1e6bSMatan Azrad u8 disable_local_lb_uc[0x1]; 18677b4f1e6bSMatan Azrad u8 disable_local_lb_mc[0x1]; 18687b4f1e6bSMatan Azrad u8 log_min_hairpin_wq_data_sz[0x5]; 18697b4f1e6bSMatan Azrad u8 reserved_at_3e8[0x3]; 18707b4f1e6bSMatan Azrad u8 log_max_vlan_list[0x5]; 1871cedb44dcSSuanming Mou u8 reserved_at_3f0[0x1]; 1872cedb44dcSSuanming Mou u8 aes_xts_single_block_le_tweak[1]; 1873cedb44dcSSuanming Mou u8 aes_xts_multi_block_be_tweak[1]; 18747b4f1e6bSMatan Azrad u8 log_max_current_mc_list[0x5]; 18757b4f1e6bSMatan Azrad u8 reserved_at_3f8[0x3]; 18767b4f1e6bSMatan Azrad u8 log_max_current_uc_list[0x5]; 18777b4f1e6bSMatan Azrad u8 general_obj_types[0x40]; 1878569ffbc9SViacheslav Ovsiienko u8 sq_ts_format[0x2]; 1879569ffbc9SViacheslav Ovsiienko u8 rq_ts_format[0x2]; 188096f85ec4SDong Zhou u8 steering_format_version[0x4]; 188196f85ec4SDong Zhou u8 reserved_at_448[0x18]; 1882f7d1f11cSDekel Peled u8 reserved_at_460[0x8]; 1883f7d1f11cSDekel Peled u8 aes_xts[0x1]; 1884f7d1f11cSDekel Peled u8 crypto[0x1]; 188581cf20a2SHamdan Igbaria u8 ipsec_offload[0x1]; 188681cf20a2SHamdan Igbaria u8 reserved_at_46b[0x5]; 18877b4f1e6bSMatan Azrad u8 max_num_eqs[0x10]; 18887b4f1e6bSMatan Azrad u8 reserved_at_480[0x3]; 18897b4f1e6bSMatan Azrad u8 log_max_l2_table[0x5]; 18907b4f1e6bSMatan Azrad u8 reserved_at_488[0x8]; 18917b4f1e6bSMatan Azrad u8 log_uar_page_sz[0x10]; 18927b4f1e6bSMatan Azrad u8 reserved_at_4a0[0x20]; 18937b4f1e6bSMatan Azrad u8 device_frequency_mhz[0x20]; 18947b4f1e6bSMatan Azrad u8 device_frequency_khz[0x20]; 18957b4f1e6bSMatan Azrad u8 reserved_at_500[0x20]; 18967b4f1e6bSMatan Azrad u8 num_of_uars_per_page[0x20]; 18977b4f1e6bSMatan Azrad u8 flex_parser_protocols[0x20]; 18981324ff18SShiri Kuzin u8 max_geneve_tlv_options[0x8]; 1899fd27b58dSMichael Baum u8 geneve_tlv_sample[0x1]; 1900fd27b58dSMichael Baum u8 geneve_tlv_option_offset[0x1]; 1901fd27b58dSMichael Baum u8 reserved_at_56a[0x1]; 19021324ff18SShiri Kuzin u8 max_geneve_tlv_option_data_len[0x5]; 1903e4d88cf8SAlexander Kozyrev u8 flex_parser_header_modify[0x1]; 1904e4d88cf8SAlexander Kozyrev u8 reserved_at_571[0x2]; 1905e4d88cf8SAlexander Kozyrev u8 log_max_guaranteed_connections[0x5]; 1906e4d88cf8SAlexander Kozyrev u8 driver_version_before_init_hca[0x1]; 1907e4d88cf8SAlexander Kozyrev u8 adv_virtualization[0x1]; 1908e4d88cf8SAlexander Kozyrev u8 reserved_at_57a[0x1]; 1909e4d88cf8SAlexander Kozyrev u8 log_max_dct_connections[0x5]; 1910e4d88cf8SAlexander Kozyrev u8 log_max_atomic_size_qp[0x8]; 1911e4d88cf8SAlexander Kozyrev u8 reserved_at_587[0x3]; 1912e4d88cf8SAlexander Kozyrev u8 log_max_dci_stream_channels[0x5]; 1913e4d88cf8SAlexander Kozyrev u8 reserved_at_58f[0x3]; 1914e4d88cf8SAlexander Kozyrev u8 log_max_dci_errored_streams[0x5]; 1915e4d88cf8SAlexander Kozyrev u8 log_max_atomic_dize_dc[0x8]; 1916e4d88cf8SAlexander Kozyrev u8 max_multi_user_ggroup_size[0x10]; 1917e4d88cf8SAlexander Kozyrev u8 enhanced_cqe_compression[0x1]; 1918e4d88cf8SAlexander Kozyrev u8 reserved_at_5b0[0x1]; 1919e4d88cf8SAlexander Kozyrev u8 crossing_vhca_mkey[0x1]; 1920e4d88cf8SAlexander Kozyrev u8 log_max_dek[0x5]; 1921e4d88cf8SAlexander Kozyrev u8 reserved_at_5b7[0x1]; 19223d3f4e6dSAlexander Kozyrev u8 mini_cqe_resp_l3_l4_tag[0x1]; 19233d3f4e6dSAlexander Kozyrev u8 mini_cqe_resp_flow_tag[0x1]; 1924e4d88cf8SAlexander Kozyrev u8 reserved_at_5ba[0x1]; 19257b4f1e6bSMatan Azrad u8 mini_cqe_resp_stride_index[0x1]; 19267b4f1e6bSMatan Azrad u8 cqe_128_always[0x1]; 19277b4f1e6bSMatan Azrad u8 cqe_compression_128[0x1]; 19287b4f1e6bSMatan Azrad u8 cqe_compression[0x1]; 19297b4f1e6bSMatan Azrad u8 cqe_compression_timeout[0x10]; 19307b4f1e6bSMatan Azrad u8 cqe_compression_max_num[0x10]; 1931365cdf5fSErez Shitrit u8 reserved_at_5e0[0x8]; 1932365cdf5fSErez Shitrit u8 flex_parser_id_gtpu_dw_0[0x4]; 1933365cdf5fSErez Shitrit u8 reserved_at_5ec[0x4]; 19347b4f1e6bSMatan Azrad u8 tag_matching[0x1]; 19357b4f1e6bSMatan Azrad u8 rndv_offload_rc[0x1]; 19367b4f1e6bSMatan Azrad u8 rndv_offload_dc[0x1]; 19377b4f1e6bSMatan Azrad u8 log_tag_matching_list_sz[0x5]; 19387b4f1e6bSMatan Azrad u8 reserved_at_5f8[0x3]; 19397b4f1e6bSMatan Azrad u8 log_max_xrq[0x5]; 19407b4f1e6bSMatan Azrad u8 affiliate_nic_vport_criteria[0x8]; 19417b4f1e6bSMatan Azrad u8 native_port_num[0x8]; 19427b4f1e6bSMatan Azrad u8 num_vhca_ports[0x8]; 1943365cdf5fSErez Shitrit u8 flex_parser_id_gtpu_teid[0x4]; 1944365cdf5fSErez Shitrit u8 reserved_at_61c[0x2]; 19457b4f1e6bSMatan Azrad u8 sw_owner_id[0x1]; 19467dac7abeSViacheslav Ovsiienko u8 reserved_at_61f[0x6C]; 19477dac7abeSViacheslav Ovsiienko u8 wait_on_data[0x1]; 19487dac7abeSViacheslav Ovsiienko u8 wait_on_time[0x1]; 1949365cdf5fSErez Shitrit u8 reserved_at_68d[0x37]; 1950365cdf5fSErez Shitrit u8 flex_parser_id_geneve_opt_0[0x4]; 1951365cdf5fSErez Shitrit u8 flex_parser_id_icmp_dw1[0x4]; 1952365cdf5fSErez Shitrit u8 flex_parser_id_icmp_dw0[0x4]; 1953365cdf5fSErez Shitrit u8 flex_parser_id_icmpv6_dw1[0x4]; 1954365cdf5fSErez Shitrit u8 flex_parser_id_icmpv6_dw0[0x4]; 1955365cdf5fSErez Shitrit u8 flex_parser_id_outer_first_mpls_over_gre[0x4]; 1956365cdf5fSErez Shitrit u8 flex_parser_id_outer_first_mpls_over_udp_label[0x4]; 1957365cdf5fSErez Shitrit u8 reserved_at_6e0[0x20]; 1958365cdf5fSErez Shitrit u8 flex_parser_id_gtpu_dw_2[0x4]; 1959365cdf5fSErez Shitrit u8 flex_parser_id_gtpu_first_ext_dw_0[0x4]; 1960365cdf5fSErez Shitrit u8 reserved_at_708[0x40]; 1961cbc4c13aSRaja Zidane u8 dma_mmo_qp[0x1]; 1962cbc4c13aSRaja Zidane u8 regexp_mmo_qp[0x1]; 1963cbc4c13aSRaja Zidane u8 compress_mmo_qp[0x1]; 19648b3a69fbSMichael Baum u8 decompress_deflate_v1[0x1]; 19658b3a69fbSMichael Baum u8 reserved_at_74c[0x4]; 19668b3a69fbSMichael Baum u8 decompress_deflate_v2[0x1]; 19678b3a69fbSMichael Baum u8 reserved_at_751[0xf]; 1968365cdf5fSErez Shitrit u8 reserved_at_760[0x3]; 1969365cdf5fSErez Shitrit u8 log_max_num_header_modify_argument[0x5]; 1970365cdf5fSErez Shitrit u8 log_header_modify_argument_granularity_offset[0x4]; 1971365cdf5fSErez Shitrit u8 log_header_modify_argument_granularity[0x4]; 1972365cdf5fSErez Shitrit u8 reserved_at_770[0x3]; 1973365cdf5fSErez Shitrit u8 log_header_modify_argument_max_alloc[0x5]; 1974365cdf5fSErez Shitrit u8 reserved_at_778[0x8]; 1975365cdf5fSErez Shitrit u8 reserved_at_780[0x40]; 1976365cdf5fSErez Shitrit u8 match_definer_format_supported[0x40]; 19777b4f1e6bSMatan Azrad }; 19787b4f1e6bSMatan Azrad 19797b4f1e6bSMatan Azrad struct mlx5_ifc_qos_cap_bits { 19807b4f1e6bSMatan Azrad u8 packet_pacing[0x1]; 19817b4f1e6bSMatan Azrad u8 esw_scheduling[0x1]; 19827b4f1e6bSMatan Azrad u8 esw_bw_share[0x1]; 19837b4f1e6bSMatan Azrad u8 esw_rate_limit[0x1]; 19847b4f1e6bSMatan Azrad u8 reserved_at_4[0x1]; 19857b4f1e6bSMatan Azrad u8 packet_pacing_burst_bound[0x1]; 19867b4f1e6bSMatan Azrad u8 packet_pacing_typical_size[0x1]; 1987b6505738SDekel Peled u8 flow_meter_old[0x1]; 19887b4f1e6bSMatan Azrad u8 reserved_at_8[0x8]; 19897b4f1e6bSMatan Azrad u8 log_max_flow_meter[0x8]; 19907b4f1e6bSMatan Azrad u8 flow_meter_reg_id[0x8]; 199179a7e409SViacheslav Ovsiienko u8 wqe_rate_pp[0x1]; 199279a7e409SViacheslav Ovsiienko u8 reserved_at_25[0x7]; 1993b6505738SDekel Peled u8 flow_meter[0x1]; 19947b4f1e6bSMatan Azrad u8 reserved_at_2e[0x17]; 19957b4f1e6bSMatan Azrad u8 packet_pacing_max_rate[0x20]; 19967b4f1e6bSMatan Azrad u8 packet_pacing_min_rate[0x20]; 19977b4f1e6bSMatan Azrad u8 reserved_at_80[0x10]; 19987b4f1e6bSMatan Azrad u8 packet_pacing_rate_table_size[0x10]; 19997b4f1e6bSMatan Azrad u8 esw_element_type[0x10]; 20007b4f1e6bSMatan Azrad u8 esw_tsar_type[0x10]; 20017b4f1e6bSMatan Azrad u8 reserved_at_c0[0x10]; 20027b4f1e6bSMatan Azrad u8 max_qos_para_vport[0x10]; 20037b4f1e6bSMatan Azrad u8 max_tsar_bw_share[0x20]; 200449e0ccb5SLi Zhang u8 nic_element_type[0x10]; 200549e0ccb5SLi Zhang u8 nic_tsar_type[0x10]; 200649e0ccb5SLi Zhang u8 reserved_at_120[0x3]; 200749e0ccb5SLi Zhang u8 log_meter_aso_granularity[0x5]; 200849e0ccb5SLi Zhang u8 reserved_at_128[0x3]; 200949e0ccb5SLi Zhang u8 log_meter_aso_max_alloc[0x5]; 201049e0ccb5SLi Zhang u8 reserved_at_130[0x3]; 201149e0ccb5SLi Zhang u8 log_max_num_meter_aso[0x5]; 201249e0ccb5SLi Zhang u8 reserved_at_138[0x6b0]; 20137b4f1e6bSMatan Azrad }; 20147b4f1e6bSMatan Azrad 20157b4f1e6bSMatan Azrad struct mlx5_ifc_per_protocol_networking_offload_caps_bits { 20167b4f1e6bSMatan Azrad u8 csum_cap[0x1]; 20177b4f1e6bSMatan Azrad u8 vlan_cap[0x1]; 20187b4f1e6bSMatan Azrad u8 lro_cap[0x1]; 20197b4f1e6bSMatan Azrad u8 lro_psh_flag[0x1]; 20207b4f1e6bSMatan Azrad u8 lro_time_stamp[0x1]; 20217b4f1e6bSMatan Azrad u8 lro_max_msg_sz_mode[0x2]; 20227b4f1e6bSMatan Azrad u8 wqe_vlan_insert[0x1]; 20237b4f1e6bSMatan Azrad u8 self_lb_en_modifiable[0x1]; 20247b4f1e6bSMatan Azrad u8 self_lb_mc[0x1]; 20257b4f1e6bSMatan Azrad u8 self_lb_uc[0x1]; 20267b4f1e6bSMatan Azrad u8 max_lso_cap[0x5]; 20277b4f1e6bSMatan Azrad u8 multi_pkt_send_wqe[0x2]; 20287b4f1e6bSMatan Azrad u8 wqe_inline_mode[0x2]; 20297b4f1e6bSMatan Azrad u8 rss_ind_tbl_cap[0x4]; 20307b4f1e6bSMatan Azrad u8 reg_umr_sq[0x1]; 20317b4f1e6bSMatan Azrad u8 scatter_fcs[0x1]; 20327b4f1e6bSMatan Azrad u8 enhanced_multi_pkt_send_wqe[0x1]; 20337b4f1e6bSMatan Azrad u8 tunnel_lso_const_out_ip_id[0x1]; 20347b4f1e6bSMatan Azrad u8 tunnel_lro_gre[0x1]; 20357b4f1e6bSMatan Azrad u8 tunnel_lro_vxlan[0x1]; 20367b4f1e6bSMatan Azrad u8 tunnel_stateless_gre[0x1]; 20377b4f1e6bSMatan Azrad u8 tunnel_stateless_vxlan[0x1]; 20387b4f1e6bSMatan Azrad u8 swp[0x1]; 20397b4f1e6bSMatan Azrad u8 swp_csum[0x1]; 20407b4f1e6bSMatan Azrad u8 swp_lso[0x1]; 20417b4f1e6bSMatan Azrad u8 reserved_at_23[0x8]; 20427b4f1e6bSMatan Azrad u8 tunnel_stateless_gtp[0x1]; 20434ecf55ebSHaifei Luo u8 reserved_at_25[0x2]; 20444ecf55ebSHaifei Luo u8 tunnel_stateless_vxlan_gpe_nsh[0x1]; 20454ecf55ebSHaifei Luo u8 reserved_at_28[0x1]; 20467b4f1e6bSMatan Azrad u8 max_vxlan_udp_ports[0x8]; 20477b4f1e6bSMatan Azrad u8 reserved_at_38[0x6]; 20487b4f1e6bSMatan Azrad u8 max_geneve_opt_len[0x1]; 20497b4f1e6bSMatan Azrad u8 tunnel_stateless_geneve_rx[0x1]; 20507b4f1e6bSMatan Azrad u8 reserved_at_40[0x10]; 20517b4f1e6bSMatan Azrad u8 lro_min_mss_size[0x10]; 20527b4f1e6bSMatan Azrad u8 reserved_at_60[0x120]; 20537b4f1e6bSMatan Azrad u8 lro_timer_supported_periods[4][0x20]; 20547b4f1e6bSMatan Azrad u8 reserved_at_200[0x600]; 20557b4f1e6bSMatan Azrad }; 20567b4f1e6bSMatan Azrad 2057ba1768c4SMatan Azrad enum { 2058ba1768c4SMatan Azrad MLX5_VIRTQ_TYPE_SPLIT = 0, 2059ba1768c4SMatan Azrad MLX5_VIRTQ_TYPE_PACKED = 1, 2060ba1768c4SMatan Azrad }; 2061ba1768c4SMatan Azrad 2062ba1768c4SMatan Azrad enum { 2063ba1768c4SMatan Azrad MLX5_VIRTQ_EVENT_MODE_NO_MSIX = 0, 2064ba1768c4SMatan Azrad MLX5_VIRTQ_EVENT_MODE_QP = 1, 2065ba1768c4SMatan Azrad MLX5_VIRTQ_EVENT_MODE_MSIX = 2, 2066ba1768c4SMatan Azrad }; 2067ba1768c4SMatan Azrad 2068ba1768c4SMatan Azrad struct mlx5_ifc_virtio_emulation_cap_bits { 2069ba1768c4SMatan Azrad u8 desc_tunnel_offload_type[0x1]; 2070ba1768c4SMatan Azrad u8 eth_frame_offload_type[0x1]; 2071ba1768c4SMatan Azrad u8 virtio_version_1_0[0x1]; 2072ba1768c4SMatan Azrad u8 tso_ipv4[0x1]; 2073ba1768c4SMatan Azrad u8 tso_ipv6[0x1]; 2074ba1768c4SMatan Azrad u8 tx_csum[0x1]; 2075ba1768c4SMatan Azrad u8 rx_csum[0x1]; 2076ba1768c4SMatan Azrad u8 reserved_at_7[0x1][0x9]; 2077ba1768c4SMatan Azrad u8 event_mode[0x8]; 2078ba1768c4SMatan Azrad u8 virtio_queue_type[0x8]; 2079ba1768c4SMatan Azrad u8 reserved_at_20[0x13]; 2080ba1768c4SMatan Azrad u8 log_doorbell_stride[0x5]; 20812ac90aecSLi Zhang u8 vnet_modify_ext[0x1]; 20822ac90aecSLi Zhang u8 virtio_net_q_addr_modify[0x1]; 20832ac90aecSLi Zhang u8 virtio_q_index_modify[0x1]; 2084ba1768c4SMatan Azrad u8 log_doorbell_bar_size[0x5]; 2085ba1768c4SMatan Azrad u8 doorbell_bar_offset[0x40]; 2086ba1768c4SMatan Azrad u8 reserved_at_80[0x8]; 2087ba1768c4SMatan Azrad u8 max_num_virtio_queues[0x18]; 2088ba1768c4SMatan Azrad u8 reserved_at_a0[0x60]; 2089ba1768c4SMatan Azrad u8 umem_1_buffer_param_a[0x20]; 2090ba1768c4SMatan Azrad u8 umem_1_buffer_param_b[0x20]; 2091ba1768c4SMatan Azrad u8 umem_2_buffer_param_a[0x20]; 2092ba1768c4SMatan Azrad u8 umem_2_buffer_param_b[0x20]; 2093ba1768c4SMatan Azrad u8 umem_3_buffer_param_a[0x20]; 2094ba1768c4SMatan Azrad u8 umem_3_buffer_param_b[0x20]; 2095ba1768c4SMatan Azrad u8 reserved_at_1c0[0x620]; 2096ba1768c4SMatan Azrad }; 2097ba1768c4SMatan Azrad 209865be2ca6SGregory Etelson /** 209965be2ca6SGregory Etelson * PARSE_GRAPH_NODE Capabilities Field Descriptions 210065be2ca6SGregory Etelson */ 210165be2ca6SGregory Etelson struct mlx5_ifc_parse_graph_node_cap_bits { 210265be2ca6SGregory Etelson u8 node_in[0x20]; 210365be2ca6SGregory Etelson u8 node_out[0x20]; 210465be2ca6SGregory Etelson u8 header_length_mode[0x10]; 210565be2ca6SGregory Etelson u8 sample_offset_mode[0x10]; 210665be2ca6SGregory Etelson u8 max_num_arc_in[0x08]; 210765be2ca6SGregory Etelson u8 max_num_arc_out[0x08]; 210865be2ca6SGregory Etelson u8 max_num_sample[0x08]; 2109f1324a17SRongwei Liu u8 reserved_at_78[0x03]; 2110bc0a9303SRongwei Liu u8 parse_graph_anchor[0x1]; 2111bc0a9303SRongwei Liu u8 reserved_at_7c[0x01]; 2112f1324a17SRongwei Liu u8 sample_tunnel_inner2[0x1]; 2113f1324a17SRongwei Liu u8 zero_size_supported[0x1]; 211465be2ca6SGregory Etelson u8 sample_id_in_out[0x1]; 211565be2ca6SGregory Etelson u8 max_base_header_length[0x10]; 211665be2ca6SGregory Etelson u8 reserved_at_90[0x08]; 211765be2ca6SGregory Etelson u8 max_sample_base_offset[0x08]; 211865be2ca6SGregory Etelson u8 max_next_header_offset[0x10]; 211965be2ca6SGregory Etelson u8 reserved_at_b0[0x08]; 212065be2ca6SGregory Etelson u8 header_length_mask_width[0x08]; 212165be2ca6SGregory Etelson }; 212265be2ca6SGregory Etelson 21238cc34c08SJiawei Wang struct mlx5_ifc_flow_table_prop_layout_bits { 21248cc34c08SJiawei Wang u8 ft_support[0x1]; 21258cc34c08SJiawei Wang u8 flow_tag[0x1]; 21268cc34c08SJiawei Wang u8 flow_counter[0x1]; 21278cc34c08SJiawei Wang u8 flow_modify_en[0x1]; 21288cc34c08SJiawei Wang u8 modify_root[0x1]; 21298cc34c08SJiawei Wang u8 identified_miss_table[0x1]; 21308cc34c08SJiawei Wang u8 flow_table_modify[0x1]; 21318cc34c08SJiawei Wang u8 reformat[0x1]; 21328cc34c08SJiawei Wang u8 decap[0x1]; 21338cc34c08SJiawei Wang u8 reset_root_to_default[0x1]; 21348cc34c08SJiawei Wang u8 pop_vlan[0x1]; 21358cc34c08SJiawei Wang u8 push_vlan[0x1]; 21368cc34c08SJiawei Wang u8 fpga_vendor_acceleration[0x1]; 21378cc34c08SJiawei Wang u8 pop_vlan_2[0x1]; 21388cc34c08SJiawei Wang u8 push_vlan_2[0x1]; 21398cc34c08SJiawei Wang u8 reformat_and_vlan_action[0x1]; 21408cc34c08SJiawei Wang u8 modify_and_vlan_action[0x1]; 21418cc34c08SJiawei Wang u8 sw_owner[0x1]; 21428cc34c08SJiawei Wang u8 reformat_l3_tunnel_to_l2[0x1]; 21438cc34c08SJiawei Wang u8 reformat_l2_to_l3_tunnel[0x1]; 21448cc34c08SJiawei Wang u8 reformat_and_modify_action[0x1]; 21458cc34c08SJiawei Wang u8 reserved_at_15[0x9]; 21468cc34c08SJiawei Wang u8 sw_owner_v2[0x1]; 21478cc34c08SJiawei Wang u8 reserved_at_1f[0x1]; 21488cc34c08SJiawei Wang u8 reserved_at_20[0x2]; 21498cc34c08SJiawei Wang u8 log_max_ft_size[0x6]; 21508cc34c08SJiawei Wang u8 log_max_modify_header_context[0x8]; 21518cc34c08SJiawei Wang u8 max_modify_header_actions[0x8]; 21528cc34c08SJiawei Wang u8 max_ft_level[0x8]; 21538cc34c08SJiawei Wang u8 reserved_at_40[0x8]; 21548cc34c08SJiawei Wang u8 log_max_ft_sampler_num[8]; 21558cc34c08SJiawei Wang u8 metadata_reg_b_width[0x8]; 21568cc34c08SJiawei Wang u8 metadata_reg_a_width[0x8]; 2157365cdf5fSErez Shitrit u8 reserved_at_60[0xa]; 2158365cdf5fSErez Shitrit u8 reparse[0x1]; 215971e22895SYevgeny Kliteynik u8 reserved_at_6b[0x1]; 216071e22895SYevgeny Kliteynik u8 cross_vhca_object[0x1]; 2161b81f95caSItamar Gozlan u8 reformat_l2_to_l3_audp_tunnel[0x1]; 2162b81f95caSItamar Gozlan u8 reformat_l3_audp_tunnel_to_l2[0x1]; 2163b81f95caSItamar Gozlan u8 ignore_flow_level_rtc_valid[0x1]; 2164b81f95caSItamar Gozlan u8 reserved_at_70[0x8]; 21658cc34c08SJiawei Wang u8 log_max_ft_num[0x8]; 21668cc34c08SJiawei Wang u8 reserved_at_80[0x10]; 21678cc34c08SJiawei Wang u8 log_max_flow_counter[0x8]; 21688cc34c08SJiawei Wang u8 log_max_destination[0x8]; 21698cc34c08SJiawei Wang u8 reserved_at_a0[0x18]; 21708cc34c08SJiawei Wang u8 log_max_flow[0x8]; 21718cc34c08SJiawei Wang u8 reserved_at_c0[0x140]; 21728cc34c08SJiawei Wang }; 21738cc34c08SJiawei Wang 2174569ffbc9SViacheslav Ovsiienko struct mlx5_ifc_roce_caps_bits { 2175569ffbc9SViacheslav Ovsiienko u8 reserved_0[0x1e]; 2176569ffbc9SViacheslav Ovsiienko u8 qp_ts_format[0x2]; 21772acdf09bSHamdan Igbaria u8 reserved_at_20[0xa0]; 21782acdf09bSHamdan Igbaria u8 r_roce_max_src_udp_port[0x10]; 21792acdf09bSHamdan Igbaria u8 r_roce_min_src_udp_port[0x10]; 21802acdf09bSHamdan Igbaria u8 reserved_at_e0[0x720]; 2181569ffbc9SViacheslav Ovsiienko }; 2182569ffbc9SViacheslav Ovsiienko 2183097d84a4SSean Zhang struct mlx5_ifc_ft_fields_support_bits { 21845f44fb19SBing Zhao /* set_action_field_support */ 2185097d84a4SSean Zhang u8 outer_dmac[0x1]; 2186097d84a4SSean Zhang u8 outer_smac[0x1]; 2187097d84a4SSean Zhang u8 outer_ether_type[0x1]; 2188097d84a4SSean Zhang u8 reserved_at_3[0x1]; 2189097d84a4SSean Zhang u8 outer_first_prio[0x1]; 2190097d84a4SSean Zhang u8 outer_first_cfi[0x1]; 2191097d84a4SSean Zhang u8 outer_first_vid[0x1]; 2192097d84a4SSean Zhang u8 reserved_at_7[0x1]; 2193097d84a4SSean Zhang u8 outer_second_prio[0x1]; 2194097d84a4SSean Zhang u8 outer_second_cfi[0x1]; 2195097d84a4SSean Zhang u8 outer_second_vid[0x1]; 2196097d84a4SSean Zhang u8 reserved_at_b[0x1]; 2197097d84a4SSean Zhang u8 outer_sip[0x1]; 2198097d84a4SSean Zhang u8 outer_dip[0x1]; 2199097d84a4SSean Zhang u8 outer_frag[0x1]; 2200097d84a4SSean Zhang u8 outer_ip_protocol[0x1]; 2201097d84a4SSean Zhang u8 outer_ip_ecn[0x1]; 2202097d84a4SSean Zhang u8 outer_ip_dscp[0x1]; 2203097d84a4SSean Zhang u8 outer_udp_sport[0x1]; 2204097d84a4SSean Zhang u8 outer_udp_dport[0x1]; 2205097d84a4SSean Zhang u8 outer_tcp_sport[0x1]; 2206097d84a4SSean Zhang u8 outer_tcp_dport[0x1]; 2207097d84a4SSean Zhang u8 outer_tcp_flags[0x1]; 2208097d84a4SSean Zhang u8 outer_gre_protocol[0x1]; 2209097d84a4SSean Zhang u8 outer_gre_key[0x1]; 2210097d84a4SSean Zhang u8 outer_vxlan_vni[0x1]; 2211097d84a4SSean Zhang u8 reserved_at_1a[0x5]; 22125f44fb19SBing Zhao u8 source_eswitch_port[0x1]; /* end of DW0 */ 2213097d84a4SSean Zhang u8 inner_dmac[0x1]; 2214097d84a4SSean Zhang u8 inner_smac[0x1]; 2215097d84a4SSean Zhang u8 inner_ether_type[0x1]; 2216097d84a4SSean Zhang u8 reserved_at_23[0x1]; 2217097d84a4SSean Zhang u8 inner_first_prio[0x1]; 2218097d84a4SSean Zhang u8 inner_first_cfi[0x1]; 2219097d84a4SSean Zhang u8 inner_first_vid[0x1]; 2220097d84a4SSean Zhang u8 reserved_at_27[0x1]; 2221097d84a4SSean Zhang u8 inner_second_prio[0x1]; 2222097d84a4SSean Zhang u8 inner_second_cfi[0x1]; 2223097d84a4SSean Zhang u8 inner_second_vid[0x1]; 2224097d84a4SSean Zhang u8 reserved_at_2b[0x1]; 2225097d84a4SSean Zhang u8 inner_sip[0x1]; 2226097d84a4SSean Zhang u8 inner_dip[0x1]; 2227097d84a4SSean Zhang u8 inner_frag[0x1]; 2228097d84a4SSean Zhang u8 inner_ip_protocol[0x1]; 2229097d84a4SSean Zhang u8 inner_ip_ecn[0x1]; 2230097d84a4SSean Zhang u8 inner_ip_dscp[0x1]; 2231097d84a4SSean Zhang u8 inner_udp_sport[0x1]; 2232097d84a4SSean Zhang u8 inner_udp_dport[0x1]; 2233097d84a4SSean Zhang u8 inner_tcp_sport[0x1]; 2234097d84a4SSean Zhang u8 inner_tcp_dport[0x1]; 2235097d84a4SSean Zhang u8 inner_tcp_flags[0x1]; 22365f44fb19SBing Zhao u8 reserved_at_37[0x9]; /* end of DW1 */ 22375f44fb19SBing Zhao u8 reserved_at_40[0x20]; /* end of DW2 */ 22385f44fb19SBing Zhao u8 reserved_at_60[0x18]; 22395f44fb19SBing Zhao union { 22405f44fb19SBing Zhao struct { 22415f44fb19SBing Zhao u8 metadata_reg_c_7[0x1]; 22425f44fb19SBing Zhao u8 metadata_reg_c_6[0x1]; 22435f44fb19SBing Zhao u8 metadata_reg_c_5[0x1]; 22445f44fb19SBing Zhao u8 metadata_reg_c_4[0x1]; 22455f44fb19SBing Zhao u8 metadata_reg_c_3[0x1]; 22465f44fb19SBing Zhao u8 metadata_reg_c_2[0x1]; 22475f44fb19SBing Zhao u8 metadata_reg_c_1[0x1]; 22485f44fb19SBing Zhao u8 metadata_reg_c_0[0x1]; 22495f44fb19SBing Zhao }; 22505f44fb19SBing Zhao u8 metadata_reg_c_x[0x8]; 22515f44fb19SBing Zhao }; /* end of DW3 */ 22525f44fb19SBing Zhao /* set_action_field_support_2 */ 2253ec1e7a5cSGavin Li u8 reserved_at_80[0x37]; 2254ec1e7a5cSGavin Li u8 outer_ipv6_traffic_class[0x1]; 2255ec1e7a5cSGavin Li u8 reserved_at_B8[0x48]; 22565f44fb19SBing Zhao /* add_action_field_support */ 22575f44fb19SBing Zhao u8 reserved_at_100[0x80]; 22585f44fb19SBing Zhao /* add_action_field_support_2 */ 22595f44fb19SBing Zhao u8 reserved_at_180[0x80]; 22605f44fb19SBing Zhao /* copy_action_field_support */ 22615f44fb19SBing Zhao u8 reserved_at_200[0x80]; 22625f44fb19SBing Zhao /* copy_action_field_support_2 */ 22635f44fb19SBing Zhao u8 reserved_at_280[0x80]; 22645f44fb19SBing Zhao u8 reserved_at_300[0x100]; 2265097d84a4SSean Zhang }; 2266097d84a4SSean Zhang 22670f250a4bSGregory Etelson /* 22680f250a4bSGregory Etelson * Table 1872 - Flow Table Fields Supported 2 Format 22690f250a4bSGregory Etelson */ 22700f250a4bSGregory Etelson struct mlx5_ifc_ft_fields_support_2_bits { 227176895c7dSJiawei Wang u8 reserved_at_0[0xa]; 227276895c7dSJiawei Wang u8 lag_rx_port_affinity[0x1]; 227376895c7dSJiawei Wang u8 reserved_at_c[0x2]; 227407f35716SYevgeny Kliteynik u8 hash_result[0x1]; 227507f35716SYevgeny Kliteynik u8 reserved_at_e[0x1]; 2276630a587bSRongwei Liu u8 tunnel_header_2_3[0x1]; 2277630a587bSRongwei Liu u8 tunnel_header_0_1[0x1]; 2278630a587bSRongwei Liu u8 macsec_syndrome[0x1]; 2279630a587bSRongwei Liu u8 macsec_tag[0x1]; 2280630a587bSRongwei Liu u8 outer_lrh_sl[0x1]; 22810f250a4bSGregory Etelson u8 inner_ipv4_ihl[0x1]; 22820f250a4bSGregory Etelson u8 outer_ipv4_ihl[0x1]; 22830f250a4bSGregory Etelson u8 psp_syndrome[0x1]; 22840f250a4bSGregory Etelson u8 inner_l3_ok[0x1]; 22850f250a4bSGregory Etelson u8 inner_l4_ok[0x1]; 22860f250a4bSGregory Etelson u8 outer_l3_ok[0x1]; 22870f250a4bSGregory Etelson u8 outer_l4_ok[0x1]; 22880f250a4bSGregory Etelson u8 psp_header[0x1]; 22890f250a4bSGregory Etelson u8 inner_ipv4_checksum_ok[0x1]; 22900f250a4bSGregory Etelson u8 inner_l4_checksum_ok[0x1]; 22910f250a4bSGregory Etelson u8 outer_ipv4_checksum_ok[0x1]; 2292414a0cb5SOri Kam u8 outer_l4_checksum_ok[0x1]; /* end of DW0 */ 2293ec1e7a5cSGavin Li u8 reserved_at_20[0x17]; 2294ec1e7a5cSGavin Li u8 outer_ipv6_traffic_class[0x1]; 2295414a0cb5SOri Kam union { 2296414a0cb5SOri Kam struct { 2297414a0cb5SOri Kam u8 metadata_reg_c_15[0x1]; 2298414a0cb5SOri Kam u8 metadata_reg_c_14[0x1]; 2299414a0cb5SOri Kam u8 metadata_reg_c_13[0x1]; 2300414a0cb5SOri Kam u8 metadata_reg_c_12[0x1]; 2301414a0cb5SOri Kam u8 metadata_reg_c_11[0x1]; 2302414a0cb5SOri Kam u8 metadata_reg_c_10[0x1]; 2303414a0cb5SOri Kam u8 metadata_reg_c_9[0x1]; 2304414a0cb5SOri Kam u8 metadata_reg_c_8[0x1]; 2305414a0cb5SOri Kam }; 2306414a0cb5SOri Kam u8 metadata_reg_c_8_15[0x8]; 2307414a0cb5SOri Kam }; /* end of DW1 */ 2308414a0cb5SOri Kam u8 reserved_at_40[0x40]; 23090f250a4bSGregory Etelson }; 23100f250a4bSGregory Etelson 23118cc34c08SJiawei Wang struct mlx5_ifc_flow_table_nic_cap_bits { 23128cc34c08SJiawei Wang u8 reserved_at_0[0x200]; 23130f250a4bSGregory Etelson struct mlx5_ifc_flow_table_prop_layout_bits 23140f250a4bSGregory Etelson flow_table_properties_nic_receive; 23150f250a4bSGregory Etelson struct mlx5_ifc_flow_table_prop_layout_bits 2316630a587bSRongwei Liu flow_table_properties_nic_receive_rdma; 2317630a587bSRongwei Liu struct mlx5_ifc_flow_table_prop_layout_bits 2318630a587bSRongwei Liu flow_table_properties_nic_receive_sniffer; 2319630a587bSRongwei Liu struct mlx5_ifc_flow_table_prop_layout_bits 2320630a587bSRongwei Liu flow_table_properties_nic_transmit; 2321630a587bSRongwei Liu struct mlx5_ifc_flow_table_prop_layout_bits 2322630a587bSRongwei Liu flow_table_properties_nic_transmit_rdma; 2323630a587bSRongwei Liu struct mlx5_ifc_flow_table_prop_layout_bits 2324630a587bSRongwei Liu flow_table_properties_nic_transmit_sniffer; 2325097d84a4SSean Zhang u8 reserved_at_e00[0x200]; 2326097d84a4SSean Zhang struct mlx5_ifc_ft_fields_support_bits 2327097d84a4SSean Zhang ft_header_modify_nic_receive; 23280f250a4bSGregory Etelson struct mlx5_ifc_ft_fields_support_2_bits 23290f250a4bSGregory Etelson ft_field_support_2_nic_receive; 2330414a0cb5SOri Kam u8 reserved_at_1480[0x280]; 2331414a0cb5SOri Kam struct mlx5_ifc_ft_fields_support_2_bits 2332414a0cb5SOri Kam ft_field_support_2_nic_transmit; 2333414a0cb5SOri Kam u8 reserved_at_1780[0x480]; 23345f44fb19SBing Zhao struct mlx5_ifc_ft_fields_support_bits 23355f44fb19SBing Zhao ft_header_modify_nic_transmit; 23365f44fb19SBing Zhao u8 reserved_at_2000[0x6000]; 23375f44fb19SBing Zhao }; 23385f44fb19SBing Zhao 23395f44fb19SBing Zhao struct mlx5_ifc_flow_table_esw_cap_bits { 23405f44fb19SBing Zhao u8 reserved_at_0[0x800]; 23415f44fb19SBing Zhao struct mlx5_ifc_ft_fields_support_bits ft_header_modify_esw_fdb; 2342414a0cb5SOri Kam u8 reserved_at_C00[0x800]; 2343414a0cb5SOri Kam struct mlx5_ifc_ft_fields_support_2_bits 2344414a0cb5SOri Kam ft_field_support_2_esw_fdb; 2345414a0cb5SOri Kam u8 reserved_at_1480[0x6b80]; 23468cc34c08SJiawei Wang }; 23478cc34c08SJiawei Wang 234871e22895SYevgeny Kliteynik enum mlx5_ifc_cross_vhca_object_to_object_supported_types { 234971e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_TIR = 1 << 10, 235071e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_STC_TO_FT = 1 << 11, 235171e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_FT = 1 << 12, 235271e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_OBJ_TO_OBJ_TYPE_FT_TO_RTC = 1 << 13, 235371e22895SYevgeny Kliteynik }; 235471e22895SYevgeny Kliteynik 235571e22895SYevgeny Kliteynik enum mlx5_ifc_cross_vhca_allowed_objects_types { 235671e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_ALLOWED_OBJS_TIR = 1 << 0x8, 235771e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_ALLOWED_OBJS_FT = 1 << 0x9, 235871e22895SYevgeny Kliteynik MLX5_CROSS_VHCA_ALLOWED_OBJS_RTC = 1 << 0xa, 235971e22895SYevgeny Kliteynik }; 236071e22895SYevgeny Kliteynik 2361238190f3SAlex Vesker enum { 2362238190f3SAlex Vesker MLX5_GENERATE_WQE_TYPE_FLOW_UPDATE = 1 << 1, 2363238190f3SAlex Vesker }; 2364238190f3SAlex Vesker 23657f5e6de5SItamar Gozlan enum { 23667f5e6de5SItamar Gozlan MLX5_FLOW_TABLE_HASH_TYPE_CRC32, 23677f5e6de5SItamar Gozlan }; 236865be2ca6SGregory Etelson /* 236965be2ca6SGregory Etelson * HCA Capabilities 2 237065be2ca6SGregory Etelson */ 2371dc4e9e82SBing Zhao struct mlx5_ifc_cmd_hca_cap_2_bits { 2372dc4e9e82SBing Zhao u8 reserved_at_0[0x80]; /* End of DW4. */ 237365be2ca6SGregory Etelson u8 reserved_at_80[0x3]; 237465be2ca6SGregory Etelson u8 max_num_prog_sample_field[0x5]; 237565be2ca6SGregory Etelson u8 reserved_at_88[0x3]; 2376dc4e9e82SBing Zhao u8 log_max_num_reserved_qpn[0x5]; 2377dc4e9e82SBing Zhao u8 reserved_at_90[0x3]; 2378dc4e9e82SBing Zhao u8 log_reserved_qpn_granularity[0x5]; 2379dc4e9e82SBing Zhao u8 reserved_at_98[0x3]; 2380dc4e9e82SBing Zhao u8 log_reserved_qpn_max_alloc[0x5]; /* End of DW5. */ 2381dc4e9e82SBing Zhao u8 max_reformat_insert_size[0x8]; 2382dc4e9e82SBing Zhao u8 max_reformat_insert_offset[0x8]; 2383dc4e9e82SBing Zhao u8 max_reformat_remove_size[0x8]; 2384dc4e9e82SBing Zhao u8 max_reformat_remove_offset[0x8]; /* End of DW6. */ 238510599cf8SMichael Baum u8 reserved_at_c0[0x3]; 238610599cf8SMichael Baum u8 log_min_stride_wqe_sz[0x5]; 2387dc4e9e82SBing Zhao u8 reserved_at_c8[0x3]; 2388dc4e9e82SBing Zhao u8 log_conn_track_granularity[0x5]; 2389dc4e9e82SBing Zhao u8 reserved_at_d0[0x3]; 2390dc4e9e82SBing Zhao u8 log_conn_track_max_alloc[0x5]; 2391dc4e9e82SBing Zhao u8 reserved_at_d8[0x3]; 239239b1cce5SYevgeny Kliteynik u8 log_max_conn_track_offload[0x5]; /* End of DW7. */ 239339b1cce5SYevgeny Kliteynik u8 cross_vhca_object_to_object_supported[0x20]; 2394d4875687SErez Shitrit u8 allowed_object_for_other_vhca_access_high[0x20]; 2395d4875687SErez Shitrit u8 allowed_object_for_other_vhca_access[0x20]; 2396d4875687SErez Shitrit u8 reserved_at_140[0x20]; 2397e58c372dSDariusz Sosnowski u8 reserved_at_160[0x3]; 2398e58c372dSDariusz Sosnowski u8 hairpin_sq_wqe_bb_size[0x5]; 2399e58c372dSDariusz Sosnowski u8 hairpin_sq_wq_in_host_mem[0x1]; 2400f9fe5a5bSDariusz Sosnowski u8 hairpin_data_buffer_locked[0x1]; 2401d1cbb406SAlex Vesker u8 reserved_at_16a[0x16]; 2402d1cbb406SAlex Vesker u8 reserved_at_180[0x20]; 2403d1cbb406SAlex Vesker u8 reserved_at_1a0[0xa]; 2404365cdf5fSErez Shitrit u8 format_select_dw_8_6_ext[0x1]; 2405d1cbb406SAlex Vesker u8 reserved_at_1ac[0x15]; 2406365cdf5fSErez Shitrit u8 general_obj_types_127_64[0x40]; 24074d368e1dSXiaoyu Min u8 reserved_at_200[0x53]; 24084d368e1dSXiaoyu Min u8 flow_counter_bulk_log_max_alloc[0x5]; 24094d368e1dSXiaoyu Min u8 reserved_at_258[0x3]; 24104d368e1dSXiaoyu Min u8 flow_counter_bulk_log_granularity[0x5]; 24114d368e1dSXiaoyu Min u8 reserved_at_260[0x20]; 2412365cdf5fSErez Shitrit u8 format_select_dw_gtpu_dw_0[0x8]; 2413365cdf5fSErez Shitrit u8 format_select_dw_gtpu_dw_1[0x8]; 2414365cdf5fSErez Shitrit u8 format_select_dw_gtpu_dw_2[0x8]; 2415365cdf5fSErez Shitrit u8 format_select_dw_gtpu_first_ext_dw_0[0x8]; 241612802ab2SAlex Vesker u8 generate_wqe_type[0x20]; 24177f5e6de5SItamar Gozlan u8 reserved_at_2c0[0x160]; 24182acdf09bSHamdan Igbaria u8 reserved_at_420[0x18]; 24192acdf09bSHamdan Igbaria u8 encap_entropy_hash_type[0x4]; 24207f5e6de5SItamar Gozlan u8 flow_table_hash_type[0x4]; 24217f5e6de5SItamar Gozlan u8 reserved_at_440[0x3c0]; 2422dc4e9e82SBing Zhao }; 2423dc4e9e82SBing Zhao 242438eb5c9fSShun Hao struct mlx5_ifc_esw_cap_bits { 2425eefaf43dSShun Hao u8 reserved_at_0[0x1d]; 2426eefaf43dSShun Hao u8 merged_eswitch[0x1]; 2427eefaf43dSShun Hao u8 reserved_at_1e[0x2]; 2428eefaf43dSShun Hao 2429eefaf43dSShun Hao u8 reserved_at_20[0x40]; 243038eb5c9fSShun Hao 243138eb5c9fSShun Hao u8 esw_manager_vport_number_valid[0x1]; 243238eb5c9fSShun Hao u8 reserved_at_61[0xf]; 243338eb5c9fSShun Hao u8 esw_manager_vport_number[0x10]; 243438eb5c9fSShun Hao 243538eb5c9fSShun Hao u8 reserved_at_80[0x780]; 243638eb5c9fSShun Hao }; 243738eb5c9fSShun Hao 2438365cdf5fSErez Shitrit struct mlx5_ifc_wqe_based_flow_table_cap_bits { 2439365cdf5fSErez Shitrit u8 reserved_at_0[0x3]; 2440365cdf5fSErez Shitrit u8 log_max_num_ste[0x5]; 2441365cdf5fSErez Shitrit u8 reserved_at_8[0x3]; 2442365cdf5fSErez Shitrit u8 log_max_num_stc[0x5]; 2443365cdf5fSErez Shitrit u8 reserved_at_10[0x3]; 2444365cdf5fSErez Shitrit u8 log_max_num_rtc[0x5]; 2445365cdf5fSErez Shitrit u8 reserved_at_18[0x3]; 2446365cdf5fSErez Shitrit u8 log_max_num_header_modify_pattern[0x5]; 244707f35716SYevgeny Kliteynik u8 rtc_hash_split_table[0x1]; 244807f35716SYevgeny Kliteynik u8 rtc_linear_lookup_table[0x1]; 244907f35716SYevgeny Kliteynik u8 reserved_at_22[0x1]; 2450365cdf5fSErez Shitrit u8 stc_alloc_log_granularity[0x5]; 2451365cdf5fSErez Shitrit u8 reserved_at_28[0x3]; 2452365cdf5fSErez Shitrit u8 stc_alloc_log_max[0x5]; 2453365cdf5fSErez Shitrit u8 reserved_at_30[0x3]; 2454365cdf5fSErez Shitrit u8 ste_alloc_log_granularity[0x5]; 2455365cdf5fSErez Shitrit u8 reserved_at_38[0x3]; 2456365cdf5fSErez Shitrit u8 ste_alloc_log_max[0x5]; 2457365cdf5fSErez Shitrit u8 reserved_at_40[0xb]; 2458365cdf5fSErez Shitrit u8 rtc_reparse_mode[0x5]; 2459365cdf5fSErez Shitrit u8 reserved_at_50[0x3]; 2460365cdf5fSErez Shitrit u8 rtc_index_mode[0x5]; 2461365cdf5fSErez Shitrit u8 reserved_at_58[0x3]; 2462365cdf5fSErez Shitrit u8 rtc_log_depth_max[0x5]; 246310517315SDariusz Sosnowski u8 reserved_at_60[0x8]; 246410517315SDariusz Sosnowski u8 max_header_modify_pattern_length[0x8]; 2465365cdf5fSErez Shitrit u8 ste_format[0x10]; 2466365cdf5fSErez Shitrit u8 stc_action_type[0x80]; 2467365cdf5fSErez Shitrit u8 header_insert_type[0x10]; 2468365cdf5fSErez Shitrit u8 header_remove_type[0x10]; 2469365cdf5fSErez Shitrit u8 trivial_match_definer[0x20]; 247067acee3aSAlex Vesker u8 reserved_at_140[0x1b]; 247167acee3aSAlex Vesker u8 rtc_max_num_hash_definer_gen_wqe[0x5]; 247207f35716SYevgeny Kliteynik u8 reserved_at_160[0x18]; 247307f35716SYevgeny Kliteynik u8 access_index_mode[0x8]; 247467acee3aSAlex Vesker u8 reserved_at_180[0x10]; 247567acee3aSAlex Vesker u8 ste_format_gen_wqe[0x10]; 247607f35716SYevgeny Kliteynik u8 linear_match_definer_reg_c3[0x20]; 24771f8fc88dSAlex Vesker u8 fdb_jump_to_tir_stc[0x1]; 24781f8fc88dSAlex Vesker u8 reserved_at_1c1[0x1f]; 2479365cdf5fSErez Shitrit }; 2480365cdf5fSErez Shitrit 24817b4f1e6bSMatan Azrad union mlx5_ifc_hca_cap_union_bits { 24827b4f1e6bSMatan Azrad struct mlx5_ifc_cmd_hca_cap_bits cmd_hca_cap; 248310599cf8SMichael Baum struct mlx5_ifc_cmd_hca_cap_2_bits cmd_hca_cap_2; 24847b4f1e6bSMatan Azrad struct mlx5_ifc_per_protocol_networking_offload_caps_bits 24857b4f1e6bSMatan Azrad per_protocol_networking_offload_caps; 24867b4f1e6bSMatan Azrad struct mlx5_ifc_qos_cap_bits qos_cap; 2487ba1768c4SMatan Azrad struct mlx5_ifc_virtio_emulation_cap_bits vdpa_caps; 24888cc34c08SJiawei Wang struct mlx5_ifc_flow_table_nic_cap_bits flow_table_nic_cap; 24895f44fb19SBing Zhao struct mlx5_ifc_flow_table_esw_cap_bits flow_table_esw_cap; 249038eb5c9fSShun Hao struct mlx5_ifc_esw_cap_bits esw_cap; 2491569ffbc9SViacheslav Ovsiienko struct mlx5_ifc_roce_caps_bits roce_caps; 2492365cdf5fSErez Shitrit struct mlx5_ifc_wqe_based_flow_table_cap_bits wqe_based_flow_table_cap; 24937b4f1e6bSMatan Azrad u8 reserved_at_0[0x8000]; 24947b4f1e6bSMatan Azrad }; 24957b4f1e6bSMatan Azrad 2496a3def854SJiawei Wang struct mlx5_ifc_set_action_in_bits { 2497a3def854SJiawei Wang u8 action_type[0x4]; 2498a3def854SJiawei Wang u8 field[0xc]; 2499a3def854SJiawei Wang u8 reserved_at_10[0x3]; 2500a3def854SJiawei Wang u8 offset[0x5]; 2501a3def854SJiawei Wang u8 reserved_at_18[0x3]; 2502a3def854SJiawei Wang u8 length[0x5]; 2503a3def854SJiawei Wang u8 data[0x20]; 2504a3def854SJiawei Wang }; 2505a3def854SJiawei Wang 2506365cdf5fSErez Shitrit struct mlx5_ifc_copy_action_in_bits { 2507365cdf5fSErez Shitrit u8 action_type[0x4]; 2508365cdf5fSErez Shitrit u8 src_field[0xc]; 2509365cdf5fSErez Shitrit u8 reserved_at_10[0x3]; 2510365cdf5fSErez Shitrit u8 src_offset[0x5]; 2511365cdf5fSErez Shitrit u8 reserved_at_18[0x3]; 2512365cdf5fSErez Shitrit u8 length[0x5]; 2513365cdf5fSErez Shitrit u8 reserved_at_20[0x4]; 2514365cdf5fSErez Shitrit u8 dst_field[0xc]; 2515365cdf5fSErez Shitrit u8 reserved_at_30[0x3]; 2516365cdf5fSErez Shitrit u8 dst_offset[0x5]; 2517365cdf5fSErez Shitrit u8 reserved_at_38[0x8]; 2518365cdf5fSErez Shitrit }; 2519365cdf5fSErez Shitrit 25207b4f1e6bSMatan Azrad struct mlx5_ifc_query_hca_cap_out_bits { 25217b4f1e6bSMatan Azrad u8 status[0x8]; 25227b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 25237b4f1e6bSMatan Azrad u8 syndrome[0x20]; 25247b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 25257b4f1e6bSMatan Azrad union mlx5_ifc_hca_cap_union_bits capability; 25267b4f1e6bSMatan Azrad }; 25277b4f1e6bSMatan Azrad 25287b4f1e6bSMatan Azrad struct mlx5_ifc_query_hca_cap_in_bits { 25297b4f1e6bSMatan Azrad u8 opcode[0x10]; 25307b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 25317b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 25327b4f1e6bSMatan Azrad u8 op_mod[0x10]; 25337b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 25347b4f1e6bSMatan Azrad }; 25357b4f1e6bSMatan Azrad 25367b4f1e6bSMatan Azrad struct mlx5_ifc_mac_address_layout_bits { 25377b4f1e6bSMatan Azrad u8 reserved_at_0[0x10]; 25387b4f1e6bSMatan Azrad u8 mac_addr_47_32[0x10]; 25397b4f1e6bSMatan Azrad u8 mac_addr_31_0[0x20]; 25407b4f1e6bSMatan Azrad }; 25417b4f1e6bSMatan Azrad 25427b4f1e6bSMatan Azrad struct mlx5_ifc_nic_vport_context_bits { 25437b4f1e6bSMatan Azrad u8 reserved_at_0[0x5]; 25447b4f1e6bSMatan Azrad u8 min_wqe_inline_mode[0x3]; 25457b4f1e6bSMatan Azrad u8 reserved_at_8[0x15]; 25467b4f1e6bSMatan Azrad u8 disable_mc_local_lb[0x1]; 25477b4f1e6bSMatan Azrad u8 disable_uc_local_lb[0x1]; 25487b4f1e6bSMatan Azrad u8 roce_en[0x1]; 25497b4f1e6bSMatan Azrad u8 arm_change_event[0x1]; 25507b4f1e6bSMatan Azrad u8 reserved_at_21[0x1a]; 25517b4f1e6bSMatan Azrad u8 event_on_mtu[0x1]; 25527b4f1e6bSMatan Azrad u8 event_on_promisc_change[0x1]; 25537b4f1e6bSMatan Azrad u8 event_on_vlan_change[0x1]; 25547b4f1e6bSMatan Azrad u8 event_on_mc_address_change[0x1]; 25557b4f1e6bSMatan Azrad u8 event_on_uc_address_change[0x1]; 25567b4f1e6bSMatan Azrad u8 reserved_at_40[0xc]; 25577b4f1e6bSMatan Azrad u8 affiliation_criteria[0x4]; 25587b4f1e6bSMatan Azrad u8 affiliated_vhca_id[0x10]; 25597b4f1e6bSMatan Azrad u8 reserved_at_60[0xd0]; 25607b4f1e6bSMatan Azrad u8 mtu[0x10]; 25617b4f1e6bSMatan Azrad u8 system_image_guid[0x40]; 25627b4f1e6bSMatan Azrad u8 port_guid[0x40]; 25637b4f1e6bSMatan Azrad u8 node_guid[0x40]; 25647b4f1e6bSMatan Azrad u8 reserved_at_200[0x140]; 25657b4f1e6bSMatan Azrad u8 qkey_violation_counter[0x10]; 25667b4f1e6bSMatan Azrad u8 reserved_at_350[0x430]; 25677b4f1e6bSMatan Azrad u8 promisc_uc[0x1]; 25687b4f1e6bSMatan Azrad u8 promisc_mc[0x1]; 25697b4f1e6bSMatan Azrad u8 promisc_all[0x1]; 25707b4f1e6bSMatan Azrad u8 reserved_at_783[0x2]; 25717b4f1e6bSMatan Azrad u8 allowed_list_type[0x3]; 25727b4f1e6bSMatan Azrad u8 reserved_at_788[0xc]; 25737b4f1e6bSMatan Azrad u8 allowed_list_size[0xc]; 25747b4f1e6bSMatan Azrad struct mlx5_ifc_mac_address_layout_bits permanent_address; 25757b4f1e6bSMatan Azrad u8 reserved_at_7e0[0x20]; 25767b4f1e6bSMatan Azrad }; 25777b4f1e6bSMatan Azrad 25787b4f1e6bSMatan Azrad struct mlx5_ifc_query_nic_vport_context_out_bits { 25797b4f1e6bSMatan Azrad u8 status[0x8]; 25807b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 25817b4f1e6bSMatan Azrad u8 syndrome[0x20]; 25827b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 25837b4f1e6bSMatan Azrad struct mlx5_ifc_nic_vport_context_bits nic_vport_context; 25847b4f1e6bSMatan Azrad }; 25857b4f1e6bSMatan Azrad 25867b4f1e6bSMatan Azrad struct mlx5_ifc_query_nic_vport_context_in_bits { 25877b4f1e6bSMatan Azrad u8 opcode[0x10]; 25887b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 25897b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 25907b4f1e6bSMatan Azrad u8 op_mod[0x10]; 25917b4f1e6bSMatan Azrad u8 other_vport[0x1]; 25927b4f1e6bSMatan Azrad u8 reserved_at_41[0xf]; 25937b4f1e6bSMatan Azrad u8 vport_number[0x10]; 25947b4f1e6bSMatan Azrad u8 reserved_at_60[0x5]; 25957b4f1e6bSMatan Azrad u8 allowed_list_type[0x3]; 25967b4f1e6bSMatan Azrad u8 reserved_at_68[0x18]; 25977b4f1e6bSMatan Azrad }; 25987b4f1e6bSMatan Azrad 25997b4f1e6bSMatan Azrad struct mlx5_ifc_tisc_bits { 26007b4f1e6bSMatan Azrad u8 strict_lag_tx_port_affinity[0x1]; 26017b4f1e6bSMatan Azrad u8 reserved_at_1[0x3]; 26027b4f1e6bSMatan Azrad u8 lag_tx_port_affinity[0x04]; 26037b4f1e6bSMatan Azrad u8 reserved_at_8[0x4]; 26047b4f1e6bSMatan Azrad u8 prio[0x4]; 26057b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 26067b4f1e6bSMatan Azrad u8 reserved_at_20[0x100]; 26077b4f1e6bSMatan Azrad u8 reserved_at_120[0x8]; 26087b4f1e6bSMatan Azrad u8 transport_domain[0x18]; 26097b4f1e6bSMatan Azrad u8 reserved_at_140[0x8]; 26107b4f1e6bSMatan Azrad u8 underlay_qpn[0x18]; 26117b4f1e6bSMatan Azrad u8 reserved_at_160[0x3a0]; 26127b4f1e6bSMatan Azrad }; 26137b4f1e6bSMatan Azrad 26147b4f1e6bSMatan Azrad struct mlx5_ifc_query_tis_out_bits { 26157b4f1e6bSMatan Azrad u8 status[0x8]; 26167b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 26177b4f1e6bSMatan Azrad u8 syndrome[0x20]; 26187b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 26197b4f1e6bSMatan Azrad struct mlx5_ifc_tisc_bits tis_context; 26207b4f1e6bSMatan Azrad }; 26217b4f1e6bSMatan Azrad 26227b4f1e6bSMatan Azrad struct mlx5_ifc_query_tis_in_bits { 26237b4f1e6bSMatan Azrad u8 opcode[0x10]; 26247b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 26257b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 26267b4f1e6bSMatan Azrad u8 op_mod[0x10]; 26277b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 26287b4f1e6bSMatan Azrad u8 tisn[0x18]; 26297b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 26307b4f1e6bSMatan Azrad }; 26317b4f1e6bSMatan Azrad 2632cf5ac38dSRongwei Liu /* port_select_mode definition. */ 2633cf5ac38dSRongwei Liu enum mlx5_lag_mode_type { 2634cf5ac38dSRongwei Liu MLX5_LAG_MODE_TIS = 0, 2635cf5ac38dSRongwei Liu MLX5_LAG_MODE_HASH = 1, 2636cf5ac38dSRongwei Liu }; 2637cf5ac38dSRongwei Liu 2638cf5ac38dSRongwei Liu struct mlx5_ifc_lag_context_bits { 2639cf5ac38dSRongwei Liu u8 fdb_selection_mode[0x1]; 2640cf5ac38dSRongwei Liu u8 reserved_at_1[0x14]; 2641cf5ac38dSRongwei Liu u8 port_select_mode[0x3]; 2642cf5ac38dSRongwei Liu u8 reserved_at_18[0x5]; 2643cf5ac38dSRongwei Liu u8 lag_state[0x3]; 2644cf5ac38dSRongwei Liu u8 reserved_at_20[0x14]; 2645cf5ac38dSRongwei Liu u8 tx_remap_affinity_2[0x4]; 2646cf5ac38dSRongwei Liu u8 reserved_at_38[0x4]; 2647cf5ac38dSRongwei Liu u8 tx_remap_affinity_1[0x4]; 2648cf5ac38dSRongwei Liu }; 2649cf5ac38dSRongwei Liu 2650cf5ac38dSRongwei Liu struct mlx5_ifc_query_lag_in_bits { 2651cf5ac38dSRongwei Liu u8 opcode[0x10]; 2652cf5ac38dSRongwei Liu u8 uid[0x10]; 2653cf5ac38dSRongwei Liu u8 reserved_at_20[0x10]; 2654cf5ac38dSRongwei Liu u8 op_mod[0x10]; 2655cf5ac38dSRongwei Liu u8 reserved_at_40[0x40]; 2656cf5ac38dSRongwei Liu }; 2657cf5ac38dSRongwei Liu 2658cf5ac38dSRongwei Liu struct mlx5_ifc_query_lag_out_bits { 2659cf5ac38dSRongwei Liu u8 status[0x8]; 2660cf5ac38dSRongwei Liu u8 reserved_at_8[0x18]; 2661cf5ac38dSRongwei Liu u8 syndrome[0x20]; 2662cf5ac38dSRongwei Liu struct mlx5_ifc_lag_context_bits context; 2663cf5ac38dSRongwei Liu }; 2664cf5ac38dSRongwei Liu 26657b4f1e6bSMatan Azrad struct mlx5_ifc_alloc_transport_domain_out_bits { 26667b4f1e6bSMatan Azrad u8 status[0x8]; 26677b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 26687b4f1e6bSMatan Azrad u8 syndrome[0x20]; 26697b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 26707b4f1e6bSMatan Azrad u8 transport_domain[0x18]; 26717b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 26727b4f1e6bSMatan Azrad }; 26737b4f1e6bSMatan Azrad 26747b4f1e6bSMatan Azrad struct mlx5_ifc_alloc_transport_domain_in_bits { 26757b4f1e6bSMatan Azrad u8 opcode[0x10]; 26767b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 26777b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 26787b4f1e6bSMatan Azrad u8 op_mod[0x10]; 26797b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 26807b4f1e6bSMatan Azrad }; 26817b4f1e6bSMatan Azrad 26827b4f1e6bSMatan Azrad enum { 26837b4f1e6bSMatan Azrad MLX5_WQ_TYPE_LINKED_LIST = 0x0, 26847b4f1e6bSMatan Azrad MLX5_WQ_TYPE_CYCLIC = 0x1, 26857b4f1e6bSMatan Azrad MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ = 0x2, 26867b4f1e6bSMatan Azrad MLX5_WQ_TYPE_CYCLIC_STRIDING_RQ = 0x3, 26877b4f1e6bSMatan Azrad }; 26887b4f1e6bSMatan Azrad 26897b4f1e6bSMatan Azrad enum { 26907b4f1e6bSMatan Azrad MLX5_WQ_END_PAD_MODE_NONE = 0x0, 26917b4f1e6bSMatan Azrad MLX5_WQ_END_PAD_MODE_ALIGN = 0x1, 26927b4f1e6bSMatan Azrad }; 26937b4f1e6bSMatan Azrad 26947b4f1e6bSMatan Azrad struct mlx5_ifc_wq_bits { 26957b4f1e6bSMatan Azrad u8 wq_type[0x4]; 26967b4f1e6bSMatan Azrad u8 wq_signature[0x1]; 26977b4f1e6bSMatan Azrad u8 end_padding_mode[0x2]; 26987b4f1e6bSMatan Azrad u8 cd_slave[0x1]; 26997b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 27007b4f1e6bSMatan Azrad u8 hds_skip_first_sge[0x1]; 27017b4f1e6bSMatan Azrad u8 log2_hds_buf_size[0x3]; 27027b4f1e6bSMatan Azrad u8 reserved_at_24[0x7]; 27037b4f1e6bSMatan Azrad u8 page_offset[0x5]; 27047b4f1e6bSMatan Azrad u8 lwm[0x10]; 27057b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 27067b4f1e6bSMatan Azrad u8 pd[0x18]; 27077b4f1e6bSMatan Azrad u8 reserved_at_60[0x8]; 27087b4f1e6bSMatan Azrad u8 uar_page[0x18]; 27097b4f1e6bSMatan Azrad u8 dbr_addr[0x40]; 27107b4f1e6bSMatan Azrad u8 hw_counter[0x20]; 27117b4f1e6bSMatan Azrad u8 sw_counter[0x20]; 27127b4f1e6bSMatan Azrad u8 reserved_at_100[0xc]; 27137b4f1e6bSMatan Azrad u8 log_wq_stride[0x4]; 27147b4f1e6bSMatan Azrad u8 reserved_at_110[0x3]; 27157b4f1e6bSMatan Azrad u8 log_wq_pg_sz[0x5]; 27167b4f1e6bSMatan Azrad u8 reserved_at_118[0x3]; 27177b4f1e6bSMatan Azrad u8 log_wq_sz[0x5]; 27187b4f1e6bSMatan Azrad u8 dbr_umem_valid[0x1]; 27197b4f1e6bSMatan Azrad u8 wq_umem_valid[0x1]; 27207b4f1e6bSMatan Azrad u8 reserved_at_122[0x1]; 27217b4f1e6bSMatan Azrad u8 log_hairpin_num_packets[0x5]; 27227b4f1e6bSMatan Azrad u8 reserved_at_128[0x3]; 27237b4f1e6bSMatan Azrad u8 log_hairpin_data_sz[0x5]; 27247b4f1e6bSMatan Azrad u8 reserved_at_130[0x4]; 27257b4f1e6bSMatan Azrad u8 single_wqe_log_num_of_strides[0x4]; 27267b4f1e6bSMatan Azrad u8 two_byte_shift_en[0x1]; 27277b4f1e6bSMatan Azrad u8 reserved_at_139[0x4]; 27287b4f1e6bSMatan Azrad u8 single_stride_log_num_of_bytes[0x3]; 27297b4f1e6bSMatan Azrad u8 dbr_umem_id[0x20]; 27307b4f1e6bSMatan Azrad u8 wq_umem_id[0x20]; 27317b4f1e6bSMatan Azrad u8 wq_umem_offset[0x40]; 27327b4f1e6bSMatan Azrad u8 reserved_at_1c0[0x440]; 27337b4f1e6bSMatan Azrad }; 27347b4f1e6bSMatan Azrad 27357b4f1e6bSMatan Azrad enum { 27367b4f1e6bSMatan Azrad MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_INLINE = 0x0, 27377b4f1e6bSMatan Azrad MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_RMP = 0x1, 27387b4f1e6bSMatan Azrad }; 27397b4f1e6bSMatan Azrad 27407b4f1e6bSMatan Azrad enum { 27417b4f1e6bSMatan Azrad MLX5_RQC_STATE_RST = 0x0, 27427b4f1e6bSMatan Azrad MLX5_RQC_STATE_RDY = 0x1, 27437b4f1e6bSMatan Azrad MLX5_RQC_STATE_ERR = 0x3, 27447b4f1e6bSMatan Azrad }; 27457b4f1e6bSMatan Azrad 27467b4f1e6bSMatan Azrad struct mlx5_ifc_rqc_bits { 27477b4f1e6bSMatan Azrad u8 rlky[0x1]; 27487b4f1e6bSMatan Azrad u8 delay_drop_en[0x1]; 27497b4f1e6bSMatan Azrad u8 scatter_fcs[0x1]; 27507b4f1e6bSMatan Azrad u8 vsd[0x1]; 27517b4f1e6bSMatan Azrad u8 mem_rq_type[0x4]; 27527b4f1e6bSMatan Azrad u8 state[0x4]; 27537b4f1e6bSMatan Azrad u8 reserved_at_c[0x1]; 27547b4f1e6bSMatan Azrad u8 flush_in_error_en[0x1]; 27557b4f1e6bSMatan Azrad u8 hairpin[0x1]; 2756f9fe5a5bSDariusz Sosnowski u8 reserved_at_f[0x6]; 2757f9fe5a5bSDariusz Sosnowski u8 hairpin_data_buffer_type[0x3]; 2758f9fe5a5bSDariusz Sosnowski u8 reserved_at_a8[0x2]; 2759569ffbc9SViacheslav Ovsiienko u8 ts_format[0x02]; 2760569ffbc9SViacheslav Ovsiienko u8 reserved_at_1c[0x4]; 27617b4f1e6bSMatan Azrad u8 reserved_at_20[0x8]; 27627b4f1e6bSMatan Azrad u8 user_index[0x18]; 27637b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 27647b4f1e6bSMatan Azrad u8 cqn[0x18]; 27657b4f1e6bSMatan Azrad u8 counter_set_id[0x8]; 27667b4f1e6bSMatan Azrad u8 reserved_at_68[0x18]; 27677b4f1e6bSMatan Azrad u8 reserved_at_80[0x8]; 27687b4f1e6bSMatan Azrad u8 rmpn[0x18]; 27697b4f1e6bSMatan Azrad u8 reserved_at_a0[0x8]; 27707b4f1e6bSMatan Azrad u8 hairpin_peer_sq[0x18]; 27717b4f1e6bSMatan Azrad u8 reserved_at_c0[0x10]; 27727b4f1e6bSMatan Azrad u8 hairpin_peer_vhca[0x10]; 27737b4f1e6bSMatan Azrad u8 reserved_at_e0[0xa0]; 27747b4f1e6bSMatan Azrad struct mlx5_ifc_wq_bits wq; /* Not used in LRO RQ. */ 27757b4f1e6bSMatan Azrad }; 27767b4f1e6bSMatan Azrad 27777b4f1e6bSMatan Azrad struct mlx5_ifc_create_rq_out_bits { 27787b4f1e6bSMatan Azrad u8 status[0x8]; 27797b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 27807b4f1e6bSMatan Azrad u8 syndrome[0x20]; 27817b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 27827b4f1e6bSMatan Azrad u8 rqn[0x18]; 27837b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 27847b4f1e6bSMatan Azrad }; 27857b4f1e6bSMatan Azrad 27867b4f1e6bSMatan Azrad struct mlx5_ifc_create_rq_in_bits { 27877b4f1e6bSMatan Azrad u8 opcode[0x10]; 27887b4f1e6bSMatan Azrad u8 uid[0x10]; 27897b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 27907b4f1e6bSMatan Azrad u8 op_mod[0x10]; 27917b4f1e6bSMatan Azrad u8 reserved_at_40[0xc0]; 27927b4f1e6bSMatan Azrad struct mlx5_ifc_rqc_bits ctx; 27937b4f1e6bSMatan Azrad }; 27947b4f1e6bSMatan Azrad 27957b4f1e6bSMatan Azrad struct mlx5_ifc_modify_rq_out_bits { 27967b4f1e6bSMatan Azrad u8 status[0x8]; 27977b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 27987b4f1e6bSMatan Azrad u8 syndrome[0x20]; 27997b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 28007b4f1e6bSMatan Azrad }; 28017b4f1e6bSMatan Azrad 2802542689e9SMatan Azrad struct mlx5_ifc_query_rq_out_bits { 2803542689e9SMatan Azrad u8 status[0x8]; 2804542689e9SMatan Azrad u8 reserved_at_8[0x18]; 2805542689e9SMatan Azrad u8 syndrome[0x20]; 2806542689e9SMatan Azrad u8 reserved_at_40[0xc0]; 2807542689e9SMatan Azrad struct mlx5_ifc_rqc_bits rq_context; 2808542689e9SMatan Azrad }; 2809542689e9SMatan Azrad 2810542689e9SMatan Azrad struct mlx5_ifc_query_rq_in_bits { 2811542689e9SMatan Azrad u8 opcode[0x10]; 2812542689e9SMatan Azrad u8 reserved_at_10[0x10]; 2813542689e9SMatan Azrad u8 reserved_at_20[0x10]; 2814542689e9SMatan Azrad u8 op_mod[0x10]; 2815542689e9SMatan Azrad u8 reserved_at_40[0x8]; 2816542689e9SMatan Azrad u8 rqn[0x18]; 2817542689e9SMatan Azrad u8 reserved_at_60[0x20]; 2818542689e9SMatan Azrad }; 2819542689e9SMatan Azrad 2820ee160711SXueming Li enum { 2821ee160711SXueming Li MLX5_RMPC_STATE_RDY = 0x1, 2822ee160711SXueming Li MLX5_RMPC_STATE_ERR = 0x3, 2823ee160711SXueming Li }; 2824ee160711SXueming Li 2825ee160711SXueming Li struct mlx5_ifc_rmpc_bits { 2826ee160711SXueming Li u8 reserved_at_0[0x8]; 2827ee160711SXueming Li u8 state[0x4]; 2828ee160711SXueming Li u8 reserved_at_c[0x14]; 2829ee160711SXueming Li u8 basic_cyclic_rcv_wqe[0x1]; 2830ee160711SXueming Li u8 reserved_at_21[0x1f]; 2831ee160711SXueming Li u8 reserved_at_40[0x140]; 2832ee160711SXueming Li struct mlx5_ifc_wq_bits wq; 2833ee160711SXueming Li }; 2834ee160711SXueming Li 2835ee160711SXueming Li struct mlx5_ifc_query_rmp_out_bits { 2836ee160711SXueming Li u8 status[0x8]; 2837ee160711SXueming Li u8 reserved_at_8[0x18]; 2838ee160711SXueming Li u8 syndrome[0x20]; 2839ee160711SXueming Li u8 reserved_at_40[0xc0]; 2840ee160711SXueming Li struct mlx5_ifc_rmpc_bits rmp_context; 2841ee160711SXueming Li }; 2842ee160711SXueming Li 2843ee160711SXueming Li struct mlx5_ifc_query_rmp_in_bits { 2844ee160711SXueming Li u8 opcode[0x10]; 2845ee160711SXueming Li u8 reserved_at_10[0x10]; 2846ee160711SXueming Li u8 reserved_at_20[0x10]; 2847ee160711SXueming Li u8 op_mod[0x10]; 2848ee160711SXueming Li u8 reserved_at_40[0x8]; 2849ee160711SXueming Li u8 rmpn[0x18]; 2850ee160711SXueming Li u8 reserved_at_60[0x20]; 2851ee160711SXueming Li }; 2852ee160711SXueming Li 2853ee160711SXueming Li struct mlx5_ifc_modify_rmp_out_bits { 2854ee160711SXueming Li u8 status[0x8]; 2855ee160711SXueming Li u8 reserved_at_8[0x18]; 2856ee160711SXueming Li u8 syndrome[0x20]; 2857ee160711SXueming Li u8 reserved_at_40[0x40]; 2858ee160711SXueming Li }; 2859ee160711SXueming Li 2860ee160711SXueming Li struct mlx5_ifc_rmp_bitmask_bits { 2861ee160711SXueming Li u8 reserved_at_0[0x20]; 2862ee160711SXueming Li u8 reserved_at_20[0x1f]; 2863ee160711SXueming Li u8 lwm[0x1]; 2864ee160711SXueming Li }; 2865ee160711SXueming Li 2866ee160711SXueming Li struct mlx5_ifc_modify_rmp_in_bits { 2867ee160711SXueming Li u8 opcode[0x10]; 2868ee160711SXueming Li u8 uid[0x10]; 2869ee160711SXueming Li u8 reserved_at_20[0x10]; 2870ee160711SXueming Li u8 op_mod[0x10]; 2871ee160711SXueming Li u8 rmp_state[0x4]; 2872ee160711SXueming Li u8 reserved_at_44[0x4]; 2873ee160711SXueming Li u8 rmpn[0x18]; 2874ee160711SXueming Li u8 reserved_at_60[0x20]; 2875ee160711SXueming Li struct mlx5_ifc_rmp_bitmask_bits bitmask; 2876ee160711SXueming Li u8 reserved_at_c0[0x40]; 2877ee160711SXueming Li struct mlx5_ifc_rmpc_bits ctx; 2878ee160711SXueming Li }; 2879ee160711SXueming Li 2880ee160711SXueming Li struct mlx5_ifc_create_rmp_out_bits { 2881ee160711SXueming Li u8 status[0x8]; 2882ee160711SXueming Li u8 reserved_at_8[0x18]; 2883ee160711SXueming Li u8 syndrome[0x20]; 2884ee160711SXueming Li u8 reserved_at_40[0x8]; 2885ee160711SXueming Li u8 rmpn[0x18]; 2886ee160711SXueming Li u8 reserved_at_60[0x20]; 2887ee160711SXueming Li }; 2888ee160711SXueming Li 2889ee160711SXueming Li struct mlx5_ifc_create_rmp_in_bits { 2890ee160711SXueming Li u8 opcode[0x10]; 2891ee160711SXueming Li u8 uid[0x10]; 2892ee160711SXueming Li u8 reserved_at_20[0x10]; 2893ee160711SXueming Li u8 op_mod[0x10]; 2894ee160711SXueming Li u8 reserved_at_40[0xc0]; 2895ee160711SXueming Li struct mlx5_ifc_rmpc_bits ctx; 2896ee160711SXueming Li }; 2897ee160711SXueming Li 28987b4f1e6bSMatan Azrad struct mlx5_ifc_create_tis_out_bits { 28997b4f1e6bSMatan Azrad u8 status[0x8]; 29007b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 29017b4f1e6bSMatan Azrad u8 syndrome[0x20]; 29027b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 29037b4f1e6bSMatan Azrad u8 tisn[0x18]; 29047b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 29057b4f1e6bSMatan Azrad }; 29067b4f1e6bSMatan Azrad 29077b4f1e6bSMatan Azrad struct mlx5_ifc_create_tis_in_bits { 29087b4f1e6bSMatan Azrad u8 opcode[0x10]; 29097b4f1e6bSMatan Azrad u8 uid[0x10]; 29107b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 29117b4f1e6bSMatan Azrad u8 op_mod[0x10]; 29127b4f1e6bSMatan Azrad u8 reserved_at_40[0xc0]; 29137b4f1e6bSMatan Azrad struct mlx5_ifc_tisc_bits ctx; 29147b4f1e6bSMatan Azrad }; 29157b4f1e6bSMatan Azrad 29167b4f1e6bSMatan Azrad enum { 29177b4f1e6bSMatan Azrad MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_WQ_LWM = 1ULL << 0, 29187b4f1e6bSMatan Azrad MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD = 1ULL << 1, 29197b4f1e6bSMatan Azrad MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_SCATTER_FCS = 1ULL << 2, 29207b4f1e6bSMatan Azrad MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_RQ_COUNTER_SET_ID = 1ULL << 3, 29217b4f1e6bSMatan Azrad }; 29227b4f1e6bSMatan Azrad 29237b4f1e6bSMatan Azrad struct mlx5_ifc_modify_rq_in_bits { 29247b4f1e6bSMatan Azrad u8 opcode[0x10]; 29257b4f1e6bSMatan Azrad u8 uid[0x10]; 29267b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 29277b4f1e6bSMatan Azrad u8 op_mod[0x10]; 29287b4f1e6bSMatan Azrad u8 rq_state[0x4]; 29297b4f1e6bSMatan Azrad u8 reserved_at_44[0x4]; 29307b4f1e6bSMatan Azrad u8 rqn[0x18]; 29317b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 29327b4f1e6bSMatan Azrad u8 modify_bitmask[0x40]; 29337b4f1e6bSMatan Azrad u8 reserved_at_c0[0x40]; 29347b4f1e6bSMatan Azrad struct mlx5_ifc_rqc_bits ctx; 29357b4f1e6bSMatan Azrad }; 29367b4f1e6bSMatan Azrad 29377b4f1e6bSMatan Azrad enum { 2938c7fe1179SMatan Azrad MLX5_L3_PROT_TYPE_IPV4 = 0, 2939c7fe1179SMatan Azrad MLX5_L3_PROT_TYPE_IPV6 = 1, 2940c7fe1179SMatan Azrad }; 2941c7fe1179SMatan Azrad 2942c7fe1179SMatan Azrad enum { 2943c7fe1179SMatan Azrad MLX5_L4_PROT_TYPE_TCP = 0, 2944c7fe1179SMatan Azrad MLX5_L4_PROT_TYPE_UDP = 1, 2945c7fe1179SMatan Azrad }; 2946c7fe1179SMatan Azrad 2947c7fe1179SMatan Azrad enum { 29487b4f1e6bSMatan Azrad MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_SRC_IP = 0x0, 29497b4f1e6bSMatan Azrad MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_DST_IP = 0x1, 29507b4f1e6bSMatan Azrad MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_SPORT = 0x2, 29517b4f1e6bSMatan Azrad MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_DPORT = 0x3, 29527b4f1e6bSMatan Azrad MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_IPSEC_SPI = 0x4, 29537b4f1e6bSMatan Azrad }; 29547b4f1e6bSMatan Azrad 29557b4f1e6bSMatan Azrad struct mlx5_ifc_rx_hash_field_select_bits { 29567b4f1e6bSMatan Azrad u8 l3_prot_type[0x1]; 29577b4f1e6bSMatan Azrad u8 l4_prot_type[0x1]; 29587b4f1e6bSMatan Azrad u8 selected_fields[0x1e]; 29597b4f1e6bSMatan Azrad }; 29607b4f1e6bSMatan Azrad 29617b4f1e6bSMatan Azrad enum { 29627b4f1e6bSMatan Azrad MLX5_TIRC_DISP_TYPE_DIRECT = 0x0, 29637b4f1e6bSMatan Azrad MLX5_TIRC_DISP_TYPE_INDIRECT = 0x1, 29647b4f1e6bSMatan Azrad }; 29657b4f1e6bSMatan Azrad 29667b4f1e6bSMatan Azrad enum { 29677b4f1e6bSMatan Azrad MLX5_TIRC_LRO_ENABLE_MASK_IPV4_LRO = 0x1, 29687b4f1e6bSMatan Azrad MLX5_TIRC_LRO_ENABLE_MASK_IPV6_LRO = 0x2, 29697b4f1e6bSMatan Azrad }; 29707b4f1e6bSMatan Azrad 29717b4f1e6bSMatan Azrad enum { 29727b4f1e6bSMatan Azrad MLX5_RX_HASH_FN_NONE = 0x0, 29737b4f1e6bSMatan Azrad MLX5_RX_HASH_FN_INVERTED_XOR8 = 0x1, 29747b4f1e6bSMatan Azrad MLX5_RX_HASH_FN_TOEPLITZ = 0x2, 29757b4f1e6bSMatan Azrad }; 29767b4f1e6bSMatan Azrad 29777b4f1e6bSMatan Azrad enum { 29787b4f1e6bSMatan Azrad MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST = 0x1, 29797b4f1e6bSMatan Azrad MLX5_TIRC_SELF_LB_BLOCK_BLOCK_MULTICAST = 0x2, 29807b4f1e6bSMatan Azrad }; 29817b4f1e6bSMatan Azrad 29827b4f1e6bSMatan Azrad enum { 29837b4f1e6bSMatan Azrad MLX5_LRO_MAX_MSG_SIZE_START_FROM_L4 = 0x0, 29847b4f1e6bSMatan Azrad MLX5_LRO_MAX_MSG_SIZE_START_FROM_L2 = 0x1, 29857b4f1e6bSMatan Azrad }; 29867b4f1e6bSMatan Azrad 29877b4f1e6bSMatan Azrad struct mlx5_ifc_tirc_bits { 29887b4f1e6bSMatan Azrad u8 reserved_at_0[0x20]; 29897b4f1e6bSMatan Azrad u8 disp_type[0x4]; 29907b4f1e6bSMatan Azrad u8 reserved_at_24[0x1c]; 29917b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 29927b4f1e6bSMatan Azrad u8 reserved_at_80[0x4]; 29937b4f1e6bSMatan Azrad u8 lro_timeout_period_usecs[0x10]; 29947b4f1e6bSMatan Azrad u8 lro_enable_mask[0x4]; 29957b4f1e6bSMatan Azrad u8 lro_max_msg_sz[0x8]; 29967b4f1e6bSMatan Azrad u8 reserved_at_a0[0x40]; 29977b4f1e6bSMatan Azrad u8 reserved_at_e0[0x8]; 29987b4f1e6bSMatan Azrad u8 inline_rqn[0x18]; 29997b4f1e6bSMatan Azrad u8 rx_hash_symmetric[0x1]; 30007b4f1e6bSMatan Azrad u8 reserved_at_101[0x1]; 30017b4f1e6bSMatan Azrad u8 tunneled_offload_en[0x1]; 30027b4f1e6bSMatan Azrad u8 reserved_at_103[0x5]; 30037b4f1e6bSMatan Azrad u8 indirect_table[0x18]; 30047b4f1e6bSMatan Azrad u8 rx_hash_fn[0x4]; 30057b4f1e6bSMatan Azrad u8 reserved_at_124[0x2]; 30067b4f1e6bSMatan Azrad u8 self_lb_block[0x2]; 30077b4f1e6bSMatan Azrad u8 transport_domain[0x18]; 30087b4f1e6bSMatan Azrad u8 rx_hash_toeplitz_key[10][0x20]; 30097b4f1e6bSMatan Azrad struct mlx5_ifc_rx_hash_field_select_bits rx_hash_field_selector_outer; 30107b4f1e6bSMatan Azrad struct mlx5_ifc_rx_hash_field_select_bits rx_hash_field_selector_inner; 30117b4f1e6bSMatan Azrad u8 reserved_at_2c0[0x4c0]; 30127b4f1e6bSMatan Azrad }; 30137b4f1e6bSMatan Azrad 30147b4f1e6bSMatan Azrad struct mlx5_ifc_create_tir_out_bits { 30157b4f1e6bSMatan Azrad u8 status[0x8]; 30167b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 30177b4f1e6bSMatan Azrad u8 syndrome[0x20]; 30187b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 30197b4f1e6bSMatan Azrad u8 tirn[0x18]; 30207b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 30217b4f1e6bSMatan Azrad }; 30227b4f1e6bSMatan Azrad 30237b4f1e6bSMatan Azrad struct mlx5_ifc_create_tir_in_bits { 30247b4f1e6bSMatan Azrad u8 opcode[0x10]; 30257b4f1e6bSMatan Azrad u8 uid[0x10]; 30267b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 30277b4f1e6bSMatan Azrad u8 op_mod[0x10]; 30287b4f1e6bSMatan Azrad u8 reserved_at_40[0xc0]; 30297b4f1e6bSMatan Azrad struct mlx5_ifc_tirc_bits ctx; 30307b4f1e6bSMatan Azrad }; 30317b4f1e6bSMatan Azrad 30328712c80aSMatan Azrad enum { 3033847d9789SAndrey Vesnovaty MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_LRO = 1ULL << 0, 3034847d9789SAndrey Vesnovaty MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_INDIRECT_TABLE = 1ULL << 1, 3035847d9789SAndrey Vesnovaty MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_HASH = 1ULL << 2, 3036847d9789SAndrey Vesnovaty /* bit 3 - tunneled_offload_en modify not supported. */ 3037847d9789SAndrey Vesnovaty MLX5_MODIFY_TIR_IN_MODIFY_BITMASK_SELF_LB_EN = 1ULL << 4, 3038847d9789SAndrey Vesnovaty }; 3039847d9789SAndrey Vesnovaty 3040847d9789SAndrey Vesnovaty struct mlx5_ifc_modify_tir_out_bits { 3041847d9789SAndrey Vesnovaty u8 status[0x8]; 3042847d9789SAndrey Vesnovaty u8 reserved_at_8[0x18]; 3043847d9789SAndrey Vesnovaty u8 syndrome[0x20]; 3044847d9789SAndrey Vesnovaty u8 reserved_at_40[0x40]; 3045847d9789SAndrey Vesnovaty }; 3046847d9789SAndrey Vesnovaty 3047847d9789SAndrey Vesnovaty struct mlx5_ifc_modify_tir_in_bits { 3048847d9789SAndrey Vesnovaty u8 opcode[0x10]; 3049847d9789SAndrey Vesnovaty u8 uid[0x10]; 3050847d9789SAndrey Vesnovaty u8 reserved_at_20[0x10]; 3051847d9789SAndrey Vesnovaty u8 op_mod[0x10]; 3052847d9789SAndrey Vesnovaty u8 reserved_at_40[0x8]; 3053847d9789SAndrey Vesnovaty u8 tirn[0x18]; 3054847d9789SAndrey Vesnovaty u8 reserved_at_60[0x20]; 3055847d9789SAndrey Vesnovaty u8 modify_bitmask[0x40]; 3056847d9789SAndrey Vesnovaty u8 reserved_at_c0[0x40]; 3057847d9789SAndrey Vesnovaty struct mlx5_ifc_tirc_bits ctx; 3058847d9789SAndrey Vesnovaty }; 3059847d9789SAndrey Vesnovaty 3060847d9789SAndrey Vesnovaty enum { 30618712c80aSMatan Azrad MLX5_INLINE_Q_TYPE_RQ = 0x0, 30628712c80aSMatan Azrad MLX5_INLINE_Q_TYPE_VIRTQ = 0x1, 30638712c80aSMatan Azrad }; 30648712c80aSMatan Azrad 30657b4f1e6bSMatan Azrad struct mlx5_ifc_rq_num_bits { 30667b4f1e6bSMatan Azrad u8 reserved_at_0[0x8]; 30677b4f1e6bSMatan Azrad u8 rq_num[0x18]; 30687b4f1e6bSMatan Azrad }; 30697b4f1e6bSMatan Azrad 30707b4f1e6bSMatan Azrad struct mlx5_ifc_rqtc_bits { 30710eb60e67SMatan Azrad u8 reserved_at_0[0xa5]; 30720eb60e67SMatan Azrad u8 list_q_type[0x3]; 30730eb60e67SMatan Azrad u8 reserved_at_a8[0x8]; 30747b4f1e6bSMatan Azrad u8 rqt_max_size[0x10]; 30757b4f1e6bSMatan Azrad u8 reserved_at_c0[0x10]; 30767b4f1e6bSMatan Azrad u8 rqt_actual_size[0x10]; 30777b4f1e6bSMatan Azrad u8 reserved_at_e0[0x6a0]; 30787b4f1e6bSMatan Azrad struct mlx5_ifc_rq_num_bits rq_num[]; 30797b4f1e6bSMatan Azrad }; 30807b4f1e6bSMatan Azrad 30817b4f1e6bSMatan Azrad struct mlx5_ifc_create_rqt_out_bits { 30827b4f1e6bSMatan Azrad u8 status[0x8]; 30837b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 30847b4f1e6bSMatan Azrad u8 syndrome[0x20]; 30857b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 30867b4f1e6bSMatan Azrad u8 rqtn[0x18]; 30877b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 30887b4f1e6bSMatan Azrad }; 30897b4f1e6bSMatan Azrad 30907b4f1e6bSMatan Azrad #ifdef PEDANTIC 30917b4f1e6bSMatan Azrad #pragma GCC diagnostic ignored "-Wpedantic" 30927b4f1e6bSMatan Azrad #endif 30937b4f1e6bSMatan Azrad struct mlx5_ifc_create_rqt_in_bits { 30947b4f1e6bSMatan Azrad u8 opcode[0x10]; 30957b4f1e6bSMatan Azrad u8 uid[0x10]; 30967b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 30977b4f1e6bSMatan Azrad u8 op_mod[0x10]; 30987b4f1e6bSMatan Azrad u8 reserved_at_40[0xc0]; 30997b4f1e6bSMatan Azrad struct mlx5_ifc_rqtc_bits rqt_context; 31007b4f1e6bSMatan Azrad }; 3101e1da60a8SMatan Azrad 3102e1da60a8SMatan Azrad struct mlx5_ifc_modify_rqt_in_bits { 3103e1da60a8SMatan Azrad u8 opcode[0x10]; 3104e1da60a8SMatan Azrad u8 uid[0x10]; 3105e1da60a8SMatan Azrad u8 reserved_at_20[0x10]; 3106e1da60a8SMatan Azrad u8 op_mod[0x10]; 3107e1da60a8SMatan Azrad u8 reserved_at_40[0x8]; 3108e1da60a8SMatan Azrad u8 rqtn[0x18]; 3109e1da60a8SMatan Azrad u8 reserved_at_60[0x20]; 3110e1da60a8SMatan Azrad u8 modify_bitmask[0x40]; 3111e1da60a8SMatan Azrad u8 reserved_at_c0[0x40]; 3112e1da60a8SMatan Azrad struct mlx5_ifc_rqtc_bits rqt_context; 3113e1da60a8SMatan Azrad }; 31147b4f1e6bSMatan Azrad #ifdef PEDANTIC 31157b4f1e6bSMatan Azrad #pragma GCC diagnostic error "-Wpedantic" 31167b4f1e6bSMatan Azrad #endif 31177b4f1e6bSMatan Azrad 3118e1da60a8SMatan Azrad struct mlx5_ifc_modify_rqt_out_bits { 3119e1da60a8SMatan Azrad u8 status[0x8]; 3120e1da60a8SMatan Azrad u8 reserved_at_8[0x18]; 3121e1da60a8SMatan Azrad u8 syndrome[0x20]; 3122e1da60a8SMatan Azrad u8 reserved_at_40[0x40]; 3123e1da60a8SMatan Azrad }; 3124e1da60a8SMatan Azrad 31257b4f1e6bSMatan Azrad enum { 31267b4f1e6bSMatan Azrad MLX5_SQC_STATE_RST = 0x0, 31277b4f1e6bSMatan Azrad MLX5_SQC_STATE_RDY = 0x1, 31287b4f1e6bSMatan Azrad MLX5_SQC_STATE_ERR = 0x3, 31297b4f1e6bSMatan Azrad }; 31307b4f1e6bSMatan Azrad 3131e58c372dSDariusz Sosnowski enum { 3132e58c372dSDariusz Sosnowski MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_INTERNAL_BUFFER = 0x0, 3133e58c372dSDariusz Sosnowski MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_HOST_MEMORY = 0x1, 3134e58c372dSDariusz Sosnowski }; 3135e58c372dSDariusz Sosnowski 31367b4f1e6bSMatan Azrad struct mlx5_ifc_sqc_bits { 31377b4f1e6bSMatan Azrad u8 rlky[0x1]; 31387b4f1e6bSMatan Azrad u8 cd_master[0x1]; 31397b4f1e6bSMatan Azrad u8 fre[0x1]; 31407b4f1e6bSMatan Azrad u8 flush_in_error_en[0x1]; 31417b4f1e6bSMatan Azrad u8 allow_multi_pkt_send_wqe[0x1]; 31427b4f1e6bSMatan Azrad u8 min_wqe_inline_mode[0x3]; 31437b4f1e6bSMatan Azrad u8 state[0x4]; 31447b4f1e6bSMatan Azrad u8 reg_umr[0x1]; 31457b4f1e6bSMatan Azrad u8 allow_swp[0x1]; 31467b4f1e6bSMatan Azrad u8 hairpin[0x1]; 314779a7e409SViacheslav Ovsiienko u8 non_wire[0x1]; 314879a7e409SViacheslav Ovsiienko u8 static_sq_wq[0x1]; 3149e58c372dSDariusz Sosnowski u8 reserved_at_11[0x4]; 3150e58c372dSDariusz Sosnowski u8 hairpin_wq_buffer_type[0x3]; 3151e58c372dSDariusz Sosnowski u8 reserved_at_18[0x2]; 3152569ffbc9SViacheslav Ovsiienko u8 ts_format[0x02]; 3153569ffbc9SViacheslav Ovsiienko u8 reserved_at_1c[0x4]; 31547b4f1e6bSMatan Azrad u8 reserved_at_20[0x8]; 31557b4f1e6bSMatan Azrad u8 user_index[0x18]; 31567b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 31577b4f1e6bSMatan Azrad u8 cqn[0x18]; 31587b4f1e6bSMatan Azrad u8 reserved_at_60[0x8]; 31597b4f1e6bSMatan Azrad u8 hairpin_peer_rq[0x18]; 31607b4f1e6bSMatan Azrad u8 reserved_at_80[0x10]; 31617b4f1e6bSMatan Azrad u8 hairpin_peer_vhca[0x10]; 31627b4f1e6bSMatan Azrad u8 reserved_at_a0[0x50]; 31637b4f1e6bSMatan Azrad u8 packet_pacing_rate_limit_index[0x10]; 31647b4f1e6bSMatan Azrad u8 tis_lst_sz[0x10]; 31657b4f1e6bSMatan Azrad u8 reserved_at_110[0x10]; 31667b4f1e6bSMatan Azrad u8 reserved_at_120[0x40]; 31677b4f1e6bSMatan Azrad u8 reserved_at_160[0x8]; 31687b4f1e6bSMatan Azrad u8 tis_num_0[0x18]; 31697b4f1e6bSMatan Azrad struct mlx5_ifc_wq_bits wq; 31707b4f1e6bSMatan Azrad }; 31717b4f1e6bSMatan Azrad 31723dfa7877SKiran Vedere struct mlx5_ifc_query_sq_out_bits { 31733dfa7877SKiran Vedere u8 status[0x8]; 31743dfa7877SKiran Vedere u8 reserved_at_8[0x18]; 31753dfa7877SKiran Vedere u8 syndrome[0x20]; 31763dfa7877SKiran Vedere u8 reserved_at_40[0xc0]; 31773dfa7877SKiran Vedere struct mlx5_ifc_sqc_bits sq_context; 31783dfa7877SKiran Vedere }; 31793dfa7877SKiran Vedere 31807b4f1e6bSMatan Azrad struct mlx5_ifc_query_sq_in_bits { 31817b4f1e6bSMatan Azrad u8 opcode[0x10]; 31827b4f1e6bSMatan Azrad u8 reserved_at_10[0x10]; 31837b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 31847b4f1e6bSMatan Azrad u8 op_mod[0x10]; 31857b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 31867b4f1e6bSMatan Azrad u8 sqn[0x18]; 31877b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 31887b4f1e6bSMatan Azrad }; 31897b4f1e6bSMatan Azrad 31907b4f1e6bSMatan Azrad struct mlx5_ifc_modify_sq_out_bits { 31917b4f1e6bSMatan Azrad u8 status[0x8]; 31927b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 31937b4f1e6bSMatan Azrad u8 syndrome[0x20]; 31947b4f1e6bSMatan Azrad u8 reserved_at_40[0x40]; 31957b4f1e6bSMatan Azrad }; 31967b4f1e6bSMatan Azrad 31977b4f1e6bSMatan Azrad struct mlx5_ifc_modify_sq_in_bits { 31987b4f1e6bSMatan Azrad u8 opcode[0x10]; 31997b4f1e6bSMatan Azrad u8 uid[0x10]; 32007b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 32017b4f1e6bSMatan Azrad u8 op_mod[0x10]; 32027b4f1e6bSMatan Azrad u8 sq_state[0x4]; 32037b4f1e6bSMatan Azrad u8 reserved_at_44[0x4]; 32047b4f1e6bSMatan Azrad u8 sqn[0x18]; 32057b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 32067b4f1e6bSMatan Azrad u8 modify_bitmask[0x40]; 32077b4f1e6bSMatan Azrad u8 reserved_at_c0[0x40]; 32087b4f1e6bSMatan Azrad struct mlx5_ifc_sqc_bits ctx; 32097b4f1e6bSMatan Azrad }; 32107b4f1e6bSMatan Azrad 32117b4f1e6bSMatan Azrad struct mlx5_ifc_create_sq_out_bits { 32127b4f1e6bSMatan Azrad u8 status[0x8]; 32137b4f1e6bSMatan Azrad u8 reserved_at_8[0x18]; 32147b4f1e6bSMatan Azrad u8 syndrome[0x20]; 32157b4f1e6bSMatan Azrad u8 reserved_at_40[0x8]; 32167b4f1e6bSMatan Azrad u8 sqn[0x18]; 32177b4f1e6bSMatan Azrad u8 reserved_at_60[0x20]; 32187b4f1e6bSMatan Azrad }; 32197b4f1e6bSMatan Azrad 32207b4f1e6bSMatan Azrad struct mlx5_ifc_create_sq_in_bits { 32217b4f1e6bSMatan Azrad u8 opcode[0x10]; 32227b4f1e6bSMatan Azrad u8 uid[0x10]; 32237b4f1e6bSMatan Azrad u8 reserved_at_20[0x10]; 32247b4f1e6bSMatan Azrad u8 op_mod[0x10]; 32257b4f1e6bSMatan Azrad u8 reserved_at_40[0xc0]; 32267b4f1e6bSMatan Azrad struct mlx5_ifc_sqc_bits ctx; 32277b4f1e6bSMatan Azrad }; 32287b4f1e6bSMatan Azrad 32297b4f1e6bSMatan Azrad enum { 32307b4f1e6bSMatan Azrad MLX5_FLOW_METER_OBJ_MODIFY_FIELD_ACTIVE = (1ULL << 0), 32317b4f1e6bSMatan Azrad MLX5_FLOW_METER_OBJ_MODIFY_FIELD_CBS = (1ULL << 1), 32327b4f1e6bSMatan Azrad MLX5_FLOW_METER_OBJ_MODIFY_FIELD_CIR = (1ULL << 2), 32337b4f1e6bSMatan Azrad MLX5_FLOW_METER_OBJ_MODIFY_FIELD_EBS = (1ULL << 3), 32347b4f1e6bSMatan Azrad MLX5_FLOW_METER_OBJ_MODIFY_FIELD_EIR = (1ULL << 4), 32357b4f1e6bSMatan Azrad }; 32367b4f1e6bSMatan Azrad 32377b4f1e6bSMatan Azrad struct mlx5_ifc_flow_meter_parameters_bits { 323897dcf056SDekel Peled u8 valid[0x1]; 32397b4f1e6bSMatan Azrad u8 bucket_overflow[0x1]; 32407b4f1e6bSMatan Azrad u8 start_color[0x2]; 32417b4f1e6bSMatan Azrad u8 both_buckets_on_green[0x1]; 32427b4f1e6bSMatan Azrad u8 meter_mode[0x2]; 32437b4f1e6bSMatan Azrad u8 reserved_at_1[0x19]; 324497dcf056SDekel Peled u8 reserved_at_2[0x20]; 32457b4f1e6bSMatan Azrad u8 reserved_at_3[0x3]; 324697dcf056SDekel Peled u8 cbs_exponent[0x5]; 32477b4f1e6bSMatan Azrad u8 cbs_mantissa[0x8]; 32487b4f1e6bSMatan Azrad u8 reserved_at_4[0x3]; 32497b4f1e6bSMatan Azrad u8 cir_exponent[0x5]; 32507b4f1e6bSMatan Azrad u8 cir_mantissa[0x8]; 325197dcf056SDekel Peled u8 reserved_at_5[0x20]; 32527b4f1e6bSMatan Azrad u8 reserved_at_6[0x3]; 325397dcf056SDekel Peled u8 ebs_exponent[0x5]; 32547b4f1e6bSMatan Azrad u8 ebs_mantissa[0x8]; 32557b4f1e6bSMatan Azrad u8 reserved_at_7[0x3]; 32567b4f1e6bSMatan Azrad u8 eir_exponent[0x5]; 32577b4f1e6bSMatan Azrad u8 eir_mantissa[0x8]; 325897dcf056SDekel Peled u8 reserved_at_8[0x60]; 32597b4f1e6bSMatan Azrad }; 326049e0ccb5SLi Zhang #define MLX5_IFC_FLOW_METER_PARAM_MASK UINT64_C(0x80FFFFFF) 326149e0ccb5SLi Zhang #define MLX5_IFC_FLOW_METER_DISABLE_CBS_CIR_VAL 0x14BF00C8 32627b4f1e6bSMatan Azrad 326379a7e409SViacheslav Ovsiienko enum { 3264aa065a9cSLi Zhang MLX5_METER_MODE_IP_LEN = 0x0, 3265aa065a9cSLi Zhang MLX5_METER_MODE_L2_LEN = 0x1, 3266aa065a9cSLi Zhang MLX5_METER_MODE_L2_IPG_LEN = 0x2, 3267aa065a9cSLi Zhang MLX5_METER_MODE_PKT = 0x3, 3268aa065a9cSLi Zhang }; 3269aa065a9cSLi Zhang 3270aa065a9cSLi Zhang enum { 327179a7e409SViacheslav Ovsiienko MLX5_CQE_SIZE_64B = 0x0, 327279a7e409SViacheslav Ovsiienko MLX5_CQE_SIZE_128B = 0x1, 327379a7e409SViacheslav Ovsiienko }; 327479a7e409SViacheslav Ovsiienko 3275f9fe5a5bSDariusz Sosnowski enum { 3276f9fe5a5bSDariusz Sosnowski MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_UNLOCKED_INTERNAL_BUFFER = 0x0, 3277f9fe5a5bSDariusz Sosnowski MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_LOCKED_INTERNAL_BUFFER = 0x1, 3278f9fe5a5bSDariusz Sosnowski }; 3279f9fe5a5bSDariusz Sosnowski 3280446c3781SMatan Azrad struct mlx5_ifc_cqc_bits { 3281446c3781SMatan Azrad u8 status[0x4]; 3282446c3781SMatan Azrad u8 as_notify[0x1]; 3283446c3781SMatan Azrad u8 initiator_src_dct[0x1]; 3284446c3781SMatan Azrad u8 dbr_umem_valid[0x1]; 3285e4d88cf8SAlexander Kozyrev u8 ext_element[0x1]; 3286446c3781SMatan Azrad u8 cqe_sz[0x3]; 3287446c3781SMatan Azrad u8 cc[0x1]; 3288446c3781SMatan Azrad u8 reserved_at_c[0x1]; 3289446c3781SMatan Azrad u8 scqe_break_moderation_en[0x1]; 3290446c3781SMatan Azrad u8 oi[0x1]; 3291446c3781SMatan Azrad u8 cq_period_mode[0x2]; 3292446c3781SMatan Azrad u8 cqe_comp_en[0x1]; 3293446c3781SMatan Azrad u8 mini_cqe_res_format[0x2]; 3294446c3781SMatan Azrad u8 st[0x4]; 3295e4d88cf8SAlexander Kozyrev u8 always_armed_cq[0x1]; 3296e4d88cf8SAlexander Kozyrev u8 ext_element_type[0x3]; 3297e4d88cf8SAlexander Kozyrev u8 reserved_at_1c[0x2]; 3298e4d88cf8SAlexander Kozyrev u8 cqe_comp_layout[0x2]; 3299446c3781SMatan Azrad u8 dbr_umem_id[0x20]; 3300446c3781SMatan Azrad u8 reserved_at_40[0x14]; 3301446c3781SMatan Azrad u8 page_offset[0x6]; 330254c2d46bSAlexander Kozyrev u8 reserved_at_5a[0x2]; 330354c2d46bSAlexander Kozyrev u8 mini_cqe_res_format_ext[0x2]; 330454c2d46bSAlexander Kozyrev u8 cq_timestamp_format[0x2]; 3305446c3781SMatan Azrad u8 reserved_at_60[0x3]; 3306446c3781SMatan Azrad u8 log_cq_size[0x5]; 3307446c3781SMatan Azrad u8 uar_page[0x18]; 3308446c3781SMatan Azrad u8 reserved_at_80[0x4]; 3309446c3781SMatan Azrad u8 cq_period[0xc]; 3310446c3781SMatan Azrad u8 cq_max_count[0x10]; 3311446c3781SMatan Azrad u8 reserved_at_a0[0x18]; 3312446c3781SMatan Azrad u8 c_eqn[0x8]; 3313446c3781SMatan Azrad u8 reserved_at_c0[0x3]; 3314446c3781SMatan Azrad u8 log_page_size[0x5]; 3315446c3781SMatan Azrad u8 reserved_at_c8[0x18]; 3316446c3781SMatan Azrad u8 reserved_at_e0[0x20]; 3317446c3781SMatan Azrad u8 reserved_at_100[0x8]; 3318446c3781SMatan Azrad u8 last_notified_index[0x18]; 3319446c3781SMatan Azrad u8 reserved_at_120[0x8]; 3320446c3781SMatan Azrad u8 last_solicit_index[0x18]; 3321446c3781SMatan Azrad u8 reserved_at_140[0x8]; 3322446c3781SMatan Azrad u8 consumer_counter[0x18]; 3323446c3781SMatan Azrad u8 reserved_at_160[0x8]; 3324446c3781SMatan Azrad u8 producer_counter[0x18]; 3325446c3781SMatan Azrad u8 local_partition_id[0xc]; 3326446c3781SMatan Azrad u8 process_id[0x14]; 3327446c3781SMatan Azrad u8 reserved_at_1A0[0x20]; 3328446c3781SMatan Azrad u8 dbr_addr[0x40]; 3329446c3781SMatan Azrad }; 3330446c3781SMatan Azrad 33311137eceeSOphir Munk struct mlx5_ifc_health_buffer_bits { 33321137eceeSOphir Munk u8 reserved_0[0x100]; 33331137eceeSOphir Munk u8 assert_existptr[0x20]; 33341137eceeSOphir Munk u8 assert_callra[0x20]; 33351137eceeSOphir Munk u8 reserved_1[0x40]; 33361137eceeSOphir Munk u8 fw_version[0x20]; 33371137eceeSOphir Munk u8 hw_id[0x20]; 33381137eceeSOphir Munk u8 reserved_2[0x20]; 33391137eceeSOphir Munk u8 irisc_index[0x8]; 33401137eceeSOphir Munk u8 synd[0x8]; 33411137eceeSOphir Munk u8 ext_synd[0x10]; 33421137eceeSOphir Munk }; 33431137eceeSOphir Munk 33449b31fc90SViacheslav Ovsiienko /* HCA PCI BAR resource structure. */ 33451137eceeSOphir Munk struct mlx5_ifc_initial_seg_bits { 33461137eceeSOphir Munk u8 fw_rev_minor[0x10]; 33471137eceeSOphir Munk u8 fw_rev_major[0x10]; 33481137eceeSOphir Munk u8 cmd_interface_rev[0x10]; 33491137eceeSOphir Munk u8 fw_rev_subminor[0x10]; 33501137eceeSOphir Munk u8 reserved_0[0x40]; 33511137eceeSOphir Munk u8 cmdq_phy_addr_63_32[0x20]; 33521137eceeSOphir Munk u8 cmdq_phy_addr_31_12[0x14]; 33531137eceeSOphir Munk u8 reserved_1[0x2]; 33541137eceeSOphir Munk u8 nic_interface[0x2]; 33551137eceeSOphir Munk u8 log_cmdq_size[0x4]; 33561137eceeSOphir Munk u8 log_cmdq_stride[0x4]; 33571137eceeSOphir Munk u8 command_doorbell_vector[0x20]; 33581137eceeSOphir Munk u8 reserved_2[0xf00]; 33591137eceeSOphir Munk u8 initializing[0x1]; 33601137eceeSOphir Munk u8 nic_interface_supported[0x7]; 33611137eceeSOphir Munk u8 reserved_4[0x18]; 33621137eceeSOphir Munk struct mlx5_ifc_health_buffer_bits health_buffer; 33631137eceeSOphir Munk u8 no_dram_nic_offset[0x20]; 33641137eceeSOphir Munk u8 reserved_5[0x6de0]; 33651137eceeSOphir Munk u8 internal_timer_h[0x20]; 33661137eceeSOphir Munk u8 internal_timer_l[0x20]; 33671137eceeSOphir Munk u8 reserved_6[0x20]; 33681137eceeSOphir Munk u8 reserved_7[0x1f]; 33691137eceeSOphir Munk u8 clear_int[0x1]; 33701137eceeSOphir Munk u8 health_syndrome[0x8]; 33711137eceeSOphir Munk u8 health_counter[0x18]; 33729b31fc90SViacheslav Ovsiienko u8 reserved_8[0x160]; 33739b31fc90SViacheslav Ovsiienko u8 real_time[0x40]; 33749b31fc90SViacheslav Ovsiienko u8 reserved_9[0x17e20]; 33751137eceeSOphir Munk }; 33761137eceeSOphir Munk 3377446c3781SMatan Azrad struct mlx5_ifc_create_cq_out_bits { 3378446c3781SMatan Azrad u8 status[0x8]; 3379446c3781SMatan Azrad u8 reserved_at_8[0x18]; 3380446c3781SMatan Azrad u8 syndrome[0x20]; 3381446c3781SMatan Azrad u8 reserved_at_40[0x8]; 3382446c3781SMatan Azrad u8 cqn[0x18]; 3383446c3781SMatan Azrad u8 reserved_at_60[0x20]; 3384446c3781SMatan Azrad }; 3385446c3781SMatan Azrad 3386446c3781SMatan Azrad struct mlx5_ifc_create_cq_in_bits { 3387446c3781SMatan Azrad u8 opcode[0x10]; 3388446c3781SMatan Azrad u8 uid[0x10]; 3389446c3781SMatan Azrad u8 reserved_at_20[0x10]; 3390446c3781SMatan Azrad u8 op_mod[0x10]; 3391446c3781SMatan Azrad u8 reserved_at_40[0x40]; 3392446c3781SMatan Azrad struct mlx5_ifc_cqc_bits cq_context; 3393446c3781SMatan Azrad u8 cq_umem_offset[0x40]; 3394446c3781SMatan Azrad u8 cq_umem_id[0x20]; 3395446c3781SMatan Azrad u8 cq_umem_valid[0x1]; 3396446c3781SMatan Azrad u8 reserved_at_2e1[0x1f]; 3397446c3781SMatan Azrad u8 reserved_at_300[0x580]; 3398446c3781SMatan Azrad u8 pas[]; 3399446c3781SMatan Azrad }; 3400446c3781SMatan Azrad 34013dfa7877SKiran Vedere struct mlx5_ifc_query_cq_out_bits { 34023dfa7877SKiran Vedere u8 status[0x8]; 34033dfa7877SKiran Vedere u8 reserved_at_8[0x18]; 34043dfa7877SKiran Vedere u8 syndrome[0x20]; 34053dfa7877SKiran Vedere u8 reserved_at_40[0x40]; 34063dfa7877SKiran Vedere struct mlx5_ifc_cqc_bits cq_context; 34073dfa7877SKiran Vedere u8 reserved_at_280[0x600]; 34083dfa7877SKiran Vedere u8 pas[][0x40]; 34093dfa7877SKiran Vedere }; 34103dfa7877SKiran Vedere 34113dfa7877SKiran Vedere struct mlx5_ifc_query_cq_in_bits { 34123dfa7877SKiran Vedere u8 opcode[0x10]; 34133dfa7877SKiran Vedere u8 reserved_at_10[0x10]; 34143dfa7877SKiran Vedere u8 reserved_at_20[0x10]; 34153dfa7877SKiran Vedere u8 op_mod[0x10]; 34163dfa7877SKiran Vedere u8 reserved_at_40[0x8]; 34173dfa7877SKiran Vedere u8 cqn[0x18]; 34183dfa7877SKiran Vedere u8 reserved_at_60[0x20]; 34193dfa7877SKiran Vedere }; 34203dfa7877SKiran Vedere 34218712c80aSMatan Azrad enum { 3422753a7c08SDekel Peled MLX5_GENERAL_OBJ_TYPE_GENEVE_TLV_OPT = 0x000b, 3423178d8c50SDekel Peled MLX5_GENERAL_OBJ_TYPE_DEK = 0x000c, 34248712c80aSMatan Azrad MLX5_GENERAL_OBJ_TYPE_VIRTQ = 0x000d, 3425365cdf5fSErez Shitrit MLX5_GENERAL_OBJ_TYPE_DEFINER = 0x0018, 3426796ae7bbSMatan Azrad MLX5_GENERAL_OBJ_TYPE_VIRTIO_Q_COUNTERS = 0x001c, 342721ca2494SDekel Peled MLX5_GENERAL_OBJ_TYPE_IMPORT_KEK = 0x001d, 3428abda4fd9SDekel Peled MLX5_GENERAL_OBJ_TYPE_CREDENTIAL = 0x001e, 342938e4780bSDekel Peled MLX5_GENERAL_OBJ_TYPE_CRYPTO_LOGIN = 0x001f, 343038119ebeSBing Zhao MLX5_GENERAL_OBJ_TYPE_FLEX_PARSE_GRAPH = 0x0022, 343149e0ccb5SLi Zhang MLX5_GENERAL_OBJ_TYPE_FLOW_METER_ASO = 0x0024, 3432369e5092SDekel Peled MLX5_GENERAL_OBJ_TYPE_FLOW_HIT_ASO = 0x0025, 34330c6285b7SBing Zhao MLX5_GENERAL_OBJ_TYPE_CONN_TRACK_OFFLOAD = 0x0031, 3434365cdf5fSErez Shitrit MLX5_GENERAL_OBJ_TYPE_ARG = 0x0023, 3435365cdf5fSErez Shitrit MLX5_GENERAL_OBJ_TYPE_STC = 0x0040, 3436365cdf5fSErez Shitrit MLX5_GENERAL_OBJ_TYPE_RTC = 0x0041, 3437365cdf5fSErez Shitrit MLX5_GENERAL_OBJ_TYPE_STE = 0x0042, 3438365cdf5fSErez Shitrit MLX5_GENERAL_OBJ_TYPE_MODIFY_HEADER_PATTERN = 0x0043, 343971e22895SYevgeny Kliteynik MLX5_GENERAL_OBJ_TYPE_FT_ALIAS = 0xff15, 344071e22895SYevgeny Kliteynik MLX5_GENERAL_OBJ_TYPE_TIR_ALIAS = 0xff16, 34418712c80aSMatan Azrad }; 34428712c80aSMatan Azrad 34438712c80aSMatan Azrad struct mlx5_ifc_general_obj_in_cmd_hdr_bits { 34448712c80aSMatan Azrad u8 opcode[0x10]; 34458712c80aSMatan Azrad u8 reserved_at_10[0x20]; 34468712c80aSMatan Azrad u8 obj_type[0x10]; 34478712c80aSMatan Azrad u8 obj_id[0x20]; 3448365cdf5fSErez Shitrit union { 3449365cdf5fSErez Shitrit struct { 3450ed695274SYevgeny Kliteynik u8 alias_object[0x1]; 3451ed695274SYevgeny Kliteynik u8 reserved_at_61[0x2]; 345249e0ccb5SLi Zhang u8 log_obj_range[0x5]; 3453ed695274SYevgeny Kliteynik u8 reserved_at_68[0x18]; 34548712c80aSMatan Azrad }; 3455365cdf5fSErez Shitrit u8 obj_offset[0x20]; 3456365cdf5fSErez Shitrit }; 3457365cdf5fSErez Shitrit }; 34588712c80aSMatan Azrad 34598712c80aSMatan Azrad struct mlx5_ifc_general_obj_out_cmd_hdr_bits { 34608712c80aSMatan Azrad u8 status[0x8]; 34618712c80aSMatan Azrad u8 reserved_at_8[0x18]; 34628712c80aSMatan Azrad u8 syndrome[0x20]; 34638712c80aSMatan Azrad u8 obj_id[0x20]; 34648712c80aSMatan Azrad u8 reserved_at_60[0x20]; 34658712c80aSMatan Azrad }; 34668712c80aSMatan Azrad 3467720439d8SYevgeny Kliteynik struct mlx5_ifc_allow_other_vhca_access_in_bits { 3468720439d8SYevgeny Kliteynik u8 opcode[0x10]; 3469720439d8SYevgeny Kliteynik u8 uid[0x10]; 3470720439d8SYevgeny Kliteynik u8 reserved_at_20[0x10]; 3471720439d8SYevgeny Kliteynik u8 op_mod[0x10]; 3472720439d8SYevgeny Kliteynik u8 reserved_at_40[0x50]; 3473720439d8SYevgeny Kliteynik u8 object_type_to_be_accessed[0x10]; 3474720439d8SYevgeny Kliteynik u8 object_id_to_be_accessed[0x20]; 3475720439d8SYevgeny Kliteynik u8 reserved_at_c0[0x40]; 3476720439d8SYevgeny Kliteynik union { 3477720439d8SYevgeny Kliteynik u8 access_key_raw[0x100]; 3478720439d8SYevgeny Kliteynik u8 access_key[8][0x20]; 3479720439d8SYevgeny Kliteynik }; 3480720439d8SYevgeny Kliteynik }; 3481720439d8SYevgeny Kliteynik 3482720439d8SYevgeny Kliteynik struct mlx5_ifc_allow_other_vhca_access_out_bits { 3483720439d8SYevgeny Kliteynik u8 status[0x8]; 3484720439d8SYevgeny Kliteynik u8 reserved_at_8[0x18]; 3485720439d8SYevgeny Kliteynik u8 syndrome[0x20]; 3486720439d8SYevgeny Kliteynik u8 reserved_at_40[0x40]; 3487720439d8SYevgeny Kliteynik }; 3488720439d8SYevgeny Kliteynik 3489796ae7bbSMatan Azrad struct mlx5_ifc_virtio_q_counters_bits { 3490796ae7bbSMatan Azrad u8 modify_field_select[0x40]; 3491796ae7bbSMatan Azrad u8 reserved_at_40[0x40]; 3492796ae7bbSMatan Azrad u8 received_desc[0x40]; 3493796ae7bbSMatan Azrad u8 completed_desc[0x40]; 3494796ae7bbSMatan Azrad u8 error_cqes[0x20]; 3495796ae7bbSMatan Azrad u8 bad_desc_errors[0x20]; 3496796ae7bbSMatan Azrad u8 exceed_max_chain[0x20]; 3497796ae7bbSMatan Azrad u8 invalid_buffer[0x20]; 3498796ae7bbSMatan Azrad u8 reserved_at_180[0x50]; 3499796ae7bbSMatan Azrad }; 3500796ae7bbSMatan Azrad 35011324ff18SShiri Kuzin struct mlx5_ifc_geneve_tlv_option_bits { 35021324ff18SShiri Kuzin u8 modify_field_select[0x40]; 3503fd27b58dSMichael Baum u8 reserved_at_40[0x8]; 3504fd27b58dSMichael Baum u8 sample_offset[0x8]; 3505fd27b58dSMichael Baum u8 sample_id_valid[0x1]; 3506fd27b58dSMichael Baum u8 sample_offset_valid[0x1]; 3507fd27b58dSMichael Baum u8 option_class_ignore[0x1]; 3508fd27b58dSMichael Baum u8 reserved_at_53[0x5]; 35091324ff18SShiri Kuzin u8 geneve_option_fte_index[0x8]; 35101324ff18SShiri Kuzin u8 option_class[0x10]; 35111324ff18SShiri Kuzin u8 option_type[0x8]; 35121324ff18SShiri Kuzin u8 reserved_at_78[0x3]; 35131324ff18SShiri Kuzin u8 option_data_length[0x5]; 3514fd27b58dSMichael Baum u8 geneve_sample_field_id[0x20]; 3515fd27b58dSMichael Baum u8 reserved_at_a0[0x160]; 35161324ff18SShiri Kuzin }; 35171324ff18SShiri Kuzin 3518365cdf5fSErez Shitrit enum mlx5_ifc_rtc_update_mode { 3519365cdf5fSErez Shitrit MLX5_IFC_RTC_STE_UPDATE_MODE_BY_HASH = 0x0, 3520365cdf5fSErez Shitrit MLX5_IFC_RTC_STE_UPDATE_MODE_BY_OFFSET = 0x1, 3521365cdf5fSErez Shitrit }; 3522365cdf5fSErez Shitrit 352307f35716SYevgeny Kliteynik enum mlx5_ifc_rtc_access_mode { 352407f35716SYevgeny Kliteynik MLX5_IFC_RTC_STE_ACCESS_MODE_BY_HASH = 0x0, 352507f35716SYevgeny Kliteynik MLX5_IFC_RTC_STE_ACCESS_MODE_LINEAR = 0x1, 352607f35716SYevgeny Kliteynik }; 352707f35716SYevgeny Kliteynik 3528365cdf5fSErez Shitrit enum mlx5_ifc_rtc_ste_format { 3529365cdf5fSErez Shitrit MLX5_IFC_RTC_STE_FORMAT_8DW = 0x4, 3530365cdf5fSErez Shitrit MLX5_IFC_RTC_STE_FORMAT_11DW = 0x5, 353193ee3bd8SAlex Vesker MLX5_IFC_RTC_STE_FORMAT_RANGE = 0x7, 3532a5230507SHamdan Igbaria MLX5_IFC_RTC_STE_FORMAT_4DW_RANGE = 0x8, 3533365cdf5fSErez Shitrit }; 3534365cdf5fSErez Shitrit 3535365cdf5fSErez Shitrit enum mlx5_ifc_rtc_reparse_mode { 3536365cdf5fSErez Shitrit MLX5_IFC_RTC_REPARSE_NEVER = 0x0, 3537365cdf5fSErez Shitrit MLX5_IFC_RTC_REPARSE_ALWAYS = 0x1, 3538bbddd062SAlex Vesker MLX5_IFC_RTC_REPARSE_BY_STC = 0x2, 3539365cdf5fSErez Shitrit }; 3540365cdf5fSErez Shitrit 354107f35716SYevgeny Kliteynik #define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16 354207f35716SYevgeny Kliteynik 3543365cdf5fSErez Shitrit struct mlx5_ifc_rtc_bits { 3544365cdf5fSErez Shitrit u8 modify_field_select[0x40]; 3545365cdf5fSErez Shitrit u8 reserved_at_40[0x40]; 3546365cdf5fSErez Shitrit u8 update_index_mode[0x2]; 3547365cdf5fSErez Shitrit u8 reparse_mode[0x2]; 354893ee3bd8SAlex Vesker u8 num_match_ste[0x4]; 3549365cdf5fSErez Shitrit u8 pd[0x18]; 355007f35716SYevgeny Kliteynik u8 reserved_at_a0[0x9]; 355107f35716SYevgeny Kliteynik u8 access_index_mode[0x3]; 355207f35716SYevgeny Kliteynik u8 num_hash_definer[0x4]; 355393ee3bd8SAlex Vesker u8 update_method[0x1]; 355493ee3bd8SAlex Vesker u8 reserved_at_b1[0x2]; 3555365cdf5fSErez Shitrit u8 log_depth[0x5]; 3556365cdf5fSErez Shitrit u8 log_hash_size[0x8]; 355793ee3bd8SAlex Vesker u8 ste_format_0[0x8]; 3558365cdf5fSErez Shitrit u8 table_type[0x8]; 355993ee3bd8SAlex Vesker u8 ste_format_1[0x8]; 356093ee3bd8SAlex Vesker u8 reserved_at_d8[0x8]; 356193ee3bd8SAlex Vesker u8 match_definer_0[0x20]; 3562365cdf5fSErez Shitrit u8 stc_id[0x20]; 3563365cdf5fSErez Shitrit u8 ste_table_base_id[0x20]; 3564365cdf5fSErez Shitrit u8 ste_table_offset[0x20]; 3565365cdf5fSErez Shitrit u8 reserved_at_160[0x8]; 3566365cdf5fSErez Shitrit u8 miss_flow_table_id[0x18]; 356793ee3bd8SAlex Vesker u8 match_definer_1[0x20]; 356893ee3bd8SAlex Vesker u8 reserved_at_1a0[0x260]; 3569365cdf5fSErez Shitrit }; 3570365cdf5fSErez Shitrit 3571a5230507SHamdan Igbaria struct mlx5_ifc_ste_match_4dw_range_ctrl_dw_bits { 3572a5230507SHamdan Igbaria u8 match[0x1]; 3573a5230507SHamdan Igbaria u8 reserved_at_1[0x2]; 3574a5230507SHamdan Igbaria u8 base1[0x1]; 3575a5230507SHamdan Igbaria u8 inverse1[0x1]; 3576a5230507SHamdan Igbaria u8 reserved_at_5[0x1]; 3577a5230507SHamdan Igbaria u8 operator1[0x2]; 3578a5230507SHamdan Igbaria u8 reserved_at_8[0x3]; 3579a5230507SHamdan Igbaria u8 base0[0x1]; 3580a5230507SHamdan Igbaria u8 inverse0[0x1]; 3581a5230507SHamdan Igbaria u8 reserved_at_a[0x1]; 3582a5230507SHamdan Igbaria u8 operator0[0x2]; 3583a5230507SHamdan Igbaria u8 compare_delta[0x10]; 3584a5230507SHamdan Igbaria }; 3585a5230507SHamdan Igbaria 3586ed695274SYevgeny Kliteynik struct mlx5_ifc_alias_context_bits { 3587ed695274SYevgeny Kliteynik u8 vhca_id_to_be_accessed[0x10]; 3588ed695274SYevgeny Kliteynik u8 reserved_at_10[0xd]; 3589ed695274SYevgeny Kliteynik u8 status[0x3]; 3590ed695274SYevgeny Kliteynik u8 object_id_to_be_accessed[0x20]; 3591ed695274SYevgeny Kliteynik u8 reserved_at_40[0x40]; 3592ed695274SYevgeny Kliteynik union { 3593ed695274SYevgeny Kliteynik u8 access_key_raw[0x100]; 3594ed695274SYevgeny Kliteynik u8 access_key[8][0x20]; 3595ed695274SYevgeny Kliteynik }; 3596ed695274SYevgeny Kliteynik u8 metadata[0x80]; 3597ed695274SYevgeny Kliteynik }; 3598ed695274SYevgeny Kliteynik 3599365cdf5fSErez Shitrit enum mlx5_ifc_stc_action_type { 3600365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_NOP = 0x00, 3601365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_COPY = 0x05, 3602365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_SET = 0x06, 3603365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_ADD = 0x07, 3604365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_REMOVE_WORDS = 0x08, 3605365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_HEADER_REMOVE = 0x09, 3606365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_HEADER_INSERT = 0x0b, 3607365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_TAG = 0x0c, 3608365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST = 0x0e, 3609365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_ASO = 0x12, 3610365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_COUNTER = 0x14, 36111667b1d7SItamar Gozlan MLX5_IFC_STC_ACTION_TYPE_ADD_FIELD = 0x1b, 3612365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_STE_TABLE = 0x80, 3613365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_TIR = 0x81, 3614365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT = 0x82, 3615365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_DROP = 0x83, 3616365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_ALLOW = 0x84, 3617365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT = 0x85, 3618365cdf5fSErez Shitrit MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK = 0x86, 3619365cdf5fSErez Shitrit }; 3620365cdf5fSErez Shitrit 3621bbddd062SAlex Vesker enum mlx5_ifc_stc_reparse_mode { 3622bbddd062SAlex Vesker MLX5_IFC_STC_REPARSE_IGNORE = 0x0, 3623bbddd062SAlex Vesker MLX5_IFC_STC_REPARSE_NEVER = 0x1, 3624bbddd062SAlex Vesker MLX5_IFC_STC_REPARSE_ALWAYS = 0x2, 3625bbddd062SAlex Vesker }; 3626bbddd062SAlex Vesker 3627365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_ste_table_bits { 3628365cdf5fSErez Shitrit u8 ste_obj_id[0x20]; 3629365cdf5fSErez Shitrit u8 match_definer_id[0x20]; 3630365cdf5fSErez Shitrit u8 reserved_at_40[0x3]; 3631365cdf5fSErez Shitrit u8 log_hash_size[0x5]; 3632365cdf5fSErez Shitrit u8 reserved_at_48[0x38]; 3633365cdf5fSErez Shitrit }; 3634365cdf5fSErez Shitrit 3635365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_tir_bits { 3636365cdf5fSErez Shitrit u8 reserved_at_0[0x8]; 3637365cdf5fSErez Shitrit u8 tirn[0x18]; 3638365cdf5fSErez Shitrit u8 reserved_at_20[0x60]; 3639365cdf5fSErez Shitrit }; 3640365cdf5fSErez Shitrit 3641365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_table_bits { 3642365cdf5fSErez Shitrit u8 reserved_at_0[0x8]; 3643365cdf5fSErez Shitrit u8 table_id[0x18]; 3644365cdf5fSErez Shitrit u8 reserved_at_20[0x60]; 3645365cdf5fSErez Shitrit }; 3646365cdf5fSErez Shitrit 3647365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_flow_counter_bits { 3648365cdf5fSErez Shitrit u8 flow_counter_id[0x20]; 3649365cdf5fSErez Shitrit }; 3650365cdf5fSErez Shitrit 3651365cdf5fSErez Shitrit enum { 3652365cdf5fSErez Shitrit MLX5_ASO_CT_NUM_PER_OBJ = 1, 3653365cdf5fSErez Shitrit MLX5_ASO_METER_NUM_PER_OBJ = 2, 3654365cdf5fSErez Shitrit }; 3655365cdf5fSErez Shitrit 3656365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_execute_aso_bits { 3657365cdf5fSErez Shitrit u8 aso_object_id[0x20]; 3658365cdf5fSErez Shitrit u8 return_reg_id[0x4]; 3659365cdf5fSErez Shitrit u8 aso_type[0x4]; 3660365cdf5fSErez Shitrit u8 reserved_at_28[0x18]; 3661365cdf5fSErez Shitrit }; 3662365cdf5fSErez Shitrit 3663365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_header_modify_list_bits { 3664365cdf5fSErez Shitrit u8 header_modify_pattern_id[0x20]; 3665365cdf5fSErez Shitrit u8 header_modify_argument_id[0x20]; 3666365cdf5fSErez Shitrit }; 3667365cdf5fSErez Shitrit 3668365cdf5fSErez Shitrit enum mlx5_ifc_header_anchors { 3669365cdf5fSErez Shitrit MLX5_HEADER_ANCHOR_PACKET_START = 0x0, 3670365cdf5fSErez Shitrit MLX5_HEADER_ANCHOR_FIRST_VLAN_START = 0x2, 3671365cdf5fSErez Shitrit MLX5_HEADER_ANCHOR_IPV6_IPV4 = 0x07, 36720891355dSRongwei Liu MLX5_HEADER_ANCHOR_TCP_UDP = 0x09, 3673365cdf5fSErez Shitrit MLX5_HEADER_ANCHOR_INNER_MAC = 0x13, 3674365cdf5fSErez Shitrit MLX5_HEADER_ANCHOR_INNER_IPV6_IPV4 = 0x19, 3675365cdf5fSErez Shitrit }; 3676365cdf5fSErez Shitrit 3677365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_remove_bits { 3678365cdf5fSErez Shitrit u8 action_type[0x4]; 3679365cdf5fSErez Shitrit u8 decap[0x1]; 3680365cdf5fSErez Shitrit u8 reserved_at_5[0x5]; 3681365cdf5fSErez Shitrit u8 remove_start_anchor[0x6]; 3682365cdf5fSErez Shitrit u8 reserved_at_10[0x2]; 3683365cdf5fSErez Shitrit u8 remove_end_anchor[0x6]; 3684365cdf5fSErez Shitrit u8 reserved_at_18[0x8]; 3685365cdf5fSErez Shitrit }; 3686365cdf5fSErez Shitrit 3687365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_remove_words_bits { 3688365cdf5fSErez Shitrit u8 action_type[0x4]; 3689365cdf5fSErez Shitrit u8 reserved_at_4[0x6]; 3690365cdf5fSErez Shitrit u8 remove_start_anchor[0x6]; 3691365cdf5fSErez Shitrit u8 reserved_at_10[0x1]; 3692365cdf5fSErez Shitrit u8 remove_offset[0x7]; 3693365cdf5fSErez Shitrit u8 reserved_at_18[0x2]; 3694365cdf5fSErez Shitrit u8 remove_size[0x6]; 3695365cdf5fSErez Shitrit }; 3696365cdf5fSErez Shitrit 3697365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_insert_bits { 3698365cdf5fSErez Shitrit u8 action_type[0x4]; 3699365cdf5fSErez Shitrit u8 encap[0x1]; 3700365cdf5fSErez Shitrit u8 inline_data[0x1]; 3701525ac5efSHamdan Igbaria u8 push_esp[0x1]; 3702525ac5efSHamdan Igbaria u8 reserved_at_7[0x3]; 3703365cdf5fSErez Shitrit u8 insert_anchor[0x6]; 3704365cdf5fSErez Shitrit u8 reserved_at_10[0x1]; 3705365cdf5fSErez Shitrit u8 insert_offset[0x7]; 3706365cdf5fSErez Shitrit u8 reserved_at_18[0x1]; 3707365cdf5fSErez Shitrit u8 insert_size[0x7]; 3708365cdf5fSErez Shitrit u8 insert_argument[0x20]; 3709365cdf5fSErez Shitrit }; 3710365cdf5fSErez Shitrit 3711365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_vport_bits { 3712365cdf5fSErez Shitrit u8 eswitch_owner_vhca_id[0x10]; 3713365cdf5fSErez Shitrit u8 vport_number[0x10]; 3714365cdf5fSErez Shitrit u8 eswitch_owner_vhca_id_valid[0x1]; 371539b1cce5SYevgeny Kliteynik u8 reserved_at_21[0x5f]; 3716365cdf5fSErez Shitrit }; 3717365cdf5fSErez Shitrit 3718365cdf5fSErez Shitrit union mlx5_ifc_stc_param_bits { 3719365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_ste_table_bits ste_table; 3720365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_tir_bits tir; 3721365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_table_bits table; 3722365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_flow_counter_bits counter; 3723365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_header_modify_list_bits modify_header; 3724365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_execute_aso_bits aso; 3725365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_remove_bits remove_header; 3726365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_insert_bits insert_header; 3727365cdf5fSErez Shitrit struct mlx5_ifc_set_action_in_bits add; 3728365cdf5fSErez Shitrit struct mlx5_ifc_set_action_in_bits set; 3729365cdf5fSErez Shitrit struct mlx5_ifc_copy_action_in_bits copy; 3730365cdf5fSErez Shitrit struct mlx5_ifc_stc_ste_param_vport_bits vport; 3731365cdf5fSErez Shitrit u8 reserved_at_0[0x80]; 3732365cdf5fSErez Shitrit }; 3733365cdf5fSErez Shitrit 3734365cdf5fSErez Shitrit enum { 3735365cdf5fSErez Shitrit MLX5_IFC_MODIFY_STC_FIELD_SELECT_NEW_STC = 1 << 0, 3736365cdf5fSErez Shitrit }; 3737365cdf5fSErez Shitrit 3738365cdf5fSErez Shitrit struct mlx5_ifc_stc_bits { 3739365cdf5fSErez Shitrit u8 modify_field_select[0x40]; 3740bbddd062SAlex Vesker u8 reserved_at_40[0x46]; 3741bbddd062SAlex Vesker u8 reparse_mode[0x2]; 3742365cdf5fSErez Shitrit u8 table_type[0x8]; 3743365cdf5fSErez Shitrit u8 ste_action_offset[0x8]; 3744365cdf5fSErez Shitrit u8 action_type[0x8]; 3745365cdf5fSErez Shitrit u8 reserved_at_a0[0x60]; 3746365cdf5fSErez Shitrit union mlx5_ifc_stc_param_bits stc_param; 3747365cdf5fSErez Shitrit u8 reserved_at_180[0x280]; 3748365cdf5fSErez Shitrit }; 3749365cdf5fSErez Shitrit 3750365cdf5fSErez Shitrit struct mlx5_ifc_ste_bits { 3751365cdf5fSErez Shitrit u8 modify_field_select[0x40]; 3752365cdf5fSErez Shitrit u8 reserved_at_40[0x48]; 3753365cdf5fSErez Shitrit u8 table_type[0x8]; 3754365cdf5fSErez Shitrit u8 reserved_at_90[0x370]; 3755365cdf5fSErez Shitrit }; 3756365cdf5fSErez Shitrit 3757365cdf5fSErez Shitrit enum { 3758365cdf5fSErez Shitrit MLX5_IFC_DEFINER_FORMAT_ID_SELECT = 61, 3759365cdf5fSErez Shitrit }; 3760365cdf5fSErez Shitrit 3761365cdf5fSErez Shitrit struct mlx5_ifc_definer_bits { 3762365cdf5fSErez Shitrit u8 modify_field_select[0x40]; 3763365cdf5fSErez Shitrit u8 reserved_at_40[0x50]; 3764365cdf5fSErez Shitrit u8 format_id[0x10]; 3765365cdf5fSErez Shitrit u8 reserved_at_60[0x60]; 3766365cdf5fSErez Shitrit u8 format_select_dw3[0x8]; 3767365cdf5fSErez Shitrit u8 format_select_dw2[0x8]; 3768365cdf5fSErez Shitrit u8 format_select_dw1[0x8]; 3769365cdf5fSErez Shitrit u8 format_select_dw0[0x8]; 3770365cdf5fSErez Shitrit u8 format_select_dw7[0x8]; 3771365cdf5fSErez Shitrit u8 format_select_dw6[0x8]; 3772365cdf5fSErez Shitrit u8 format_select_dw5[0x8]; 3773365cdf5fSErez Shitrit u8 format_select_dw4[0x8]; 3774365cdf5fSErez Shitrit u8 reserved_at_100[0x18]; 3775365cdf5fSErez Shitrit u8 format_select_dw8[0x8]; 3776365cdf5fSErez Shitrit u8 reserved_at_120[0x20]; 3777365cdf5fSErez Shitrit u8 format_select_byte3[0x8]; 3778365cdf5fSErez Shitrit u8 format_select_byte2[0x8]; 3779365cdf5fSErez Shitrit u8 format_select_byte1[0x8]; 3780365cdf5fSErez Shitrit u8 format_select_byte0[0x8]; 3781365cdf5fSErez Shitrit u8 format_select_byte7[0x8]; 3782365cdf5fSErez Shitrit u8 format_select_byte6[0x8]; 3783365cdf5fSErez Shitrit u8 format_select_byte5[0x8]; 3784365cdf5fSErez Shitrit u8 format_select_byte4[0x8]; 3785365cdf5fSErez Shitrit u8 reserved_at_180[0x40]; 3786365cdf5fSErez Shitrit u8 ctrl[0xa0]; 3787365cdf5fSErez Shitrit u8 match_mask[0x160]; 3788365cdf5fSErez Shitrit }; 3789365cdf5fSErez Shitrit 3790365cdf5fSErez Shitrit struct mlx5_ifc_arg_bits { 3791365cdf5fSErez Shitrit u8 rsvd0[0x88]; 3792365cdf5fSErez Shitrit u8 access_pd[0x18]; 3793365cdf5fSErez Shitrit }; 3794365cdf5fSErez Shitrit 3795365cdf5fSErez Shitrit struct mlx5_ifc_header_modify_pattern_in_bits { 3796365cdf5fSErez Shitrit u8 modify_field_select[0x40]; 3797365cdf5fSErez Shitrit 3798365cdf5fSErez Shitrit u8 reserved_at_40[0x40]; 3799365cdf5fSErez Shitrit 3800365cdf5fSErez Shitrit u8 pattern_length[0x8]; 3801365cdf5fSErez Shitrit u8 reserved_at_88[0x18]; 3802365cdf5fSErez Shitrit 3803365cdf5fSErez Shitrit u8 reserved_at_a0[0x60]; 3804365cdf5fSErez Shitrit 3805365cdf5fSErez Shitrit u8 pattern_data[MAX_ACTIONS_DATA_IN_HEADER_MODIFY * 8]; 3806365cdf5fSErez Shitrit }; 3807365cdf5fSErez Shitrit 3808796ae7bbSMatan Azrad struct mlx5_ifc_create_virtio_q_counters_in_bits { 3809796ae7bbSMatan Azrad struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3810796ae7bbSMatan Azrad struct mlx5_ifc_virtio_q_counters_bits virtio_q_counters; 3811796ae7bbSMatan Azrad }; 3812796ae7bbSMatan Azrad 3813796ae7bbSMatan Azrad struct mlx5_ifc_query_virtio_q_counters_out_bits { 3814796ae7bbSMatan Azrad struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3815796ae7bbSMatan Azrad struct mlx5_ifc_virtio_q_counters_bits virtio_q_counters; 3816796ae7bbSMatan Azrad }; 38171324ff18SShiri Kuzin 38181324ff18SShiri Kuzin struct mlx5_ifc_create_geneve_tlv_option_in_bits { 38191324ff18SShiri Kuzin struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 38201324ff18SShiri Kuzin struct mlx5_ifc_geneve_tlv_option_bits geneve_tlv_opt; 38211324ff18SShiri Kuzin }; 38221324ff18SShiri Kuzin 382382d81794SMichael Baum struct mlx5_ifc_query_geneve_tlv_option_out_bits { 382482d81794SMichael Baum struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 382582d81794SMichael Baum struct mlx5_ifc_geneve_tlv_option_bits geneve_tlv_opt; 382682d81794SMichael Baum }; 382782d81794SMichael Baum 3828365cdf5fSErez Shitrit struct mlx5_ifc_create_rtc_in_bits { 3829365cdf5fSErez Shitrit struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3830365cdf5fSErez Shitrit struct mlx5_ifc_rtc_bits rtc; 3831365cdf5fSErez Shitrit }; 3832365cdf5fSErez Shitrit 3833365cdf5fSErez Shitrit struct mlx5_ifc_create_stc_in_bits { 3834365cdf5fSErez Shitrit struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3835365cdf5fSErez Shitrit struct mlx5_ifc_stc_bits stc; 3836365cdf5fSErez Shitrit }; 3837365cdf5fSErez Shitrit 3838365cdf5fSErez Shitrit struct mlx5_ifc_create_ste_in_bits { 3839365cdf5fSErez Shitrit struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3840365cdf5fSErez Shitrit struct mlx5_ifc_ste_bits ste; 3841365cdf5fSErez Shitrit }; 3842365cdf5fSErez Shitrit 3843365cdf5fSErez Shitrit struct mlx5_ifc_create_definer_in_bits { 3844365cdf5fSErez Shitrit struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3845365cdf5fSErez Shitrit struct mlx5_ifc_definer_bits definer; 3846365cdf5fSErez Shitrit }; 3847365cdf5fSErez Shitrit 3848365cdf5fSErez Shitrit struct mlx5_ifc_create_arg_in_bits { 3849365cdf5fSErez Shitrit struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3850365cdf5fSErez Shitrit struct mlx5_ifc_arg_bits arg; 3851365cdf5fSErez Shitrit }; 3852365cdf5fSErez Shitrit 3853365cdf5fSErez Shitrit struct mlx5_ifc_create_header_modify_pattern_in_bits { 3854365cdf5fSErez Shitrit struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3855365cdf5fSErez Shitrit struct mlx5_ifc_header_modify_pattern_in_bits pattern; 3856365cdf5fSErez Shitrit }; 3857365cdf5fSErez Shitrit 3858ed695274SYevgeny Kliteynik struct mlx5_ifc_create_alias_obj_in_bits { 3859ed695274SYevgeny Kliteynik struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3860ed695274SYevgeny Kliteynik struct mlx5_ifc_alias_context_bits alias_ctx; 3861ed695274SYevgeny Kliteynik }; 3862ed695274SYevgeny Kliteynik 386312802ab2SAlex Vesker struct mlx5_ifc_generate_wqe_in_bits { 386412802ab2SAlex Vesker u8 opcode[0x10]; 386512802ab2SAlex Vesker u8 uid[0x10]; 386612802ab2SAlex Vesker u8 reserved_at_20[0x10]; 386712802ab2SAlex Vesker u8 op_mode[0x10]; 386812802ab2SAlex Vesker u8 reserved_at_40[0x40]; 386912802ab2SAlex Vesker u8 reserved_at_80[0x8]; 387012802ab2SAlex Vesker u8 pdn[0x18]; 387112802ab2SAlex Vesker u8 reserved_at_a0[0x160]; 387212802ab2SAlex Vesker u8 wqe_ctrl[0x80]; 387312802ab2SAlex Vesker u8 wqe_gta_ctrl[0x180]; 387412802ab2SAlex Vesker u8 wqe_gta_data_0[0x200]; 387512802ab2SAlex Vesker u8 wqe_gta_data_1[0x200]; 387612802ab2SAlex Vesker }; 387712802ab2SAlex Vesker 387812802ab2SAlex Vesker struct mlx5_ifc_generate_wqe_out_bits { 387912802ab2SAlex Vesker u8 status[0x8]; 388012802ab2SAlex Vesker u8 reserved_at_8[0x18]; 388112802ab2SAlex Vesker u8 syndrome[0x20]; 388212802ab2SAlex Vesker u8 reserved_at_40[0x1c0]; 388312802ab2SAlex Vesker u8 cqe_data[0x200]; 388412802ab2SAlex Vesker }; 388512802ab2SAlex Vesker 38868712c80aSMatan Azrad enum { 3887178d8c50SDekel Peled MLX5_CRYPTO_KEY_SIZE_128b = 0x0, 3888178d8c50SDekel Peled MLX5_CRYPTO_KEY_SIZE_256b = 0x1, 3889178d8c50SDekel Peled }; 3890178d8c50SDekel Peled 3891178d8c50SDekel Peled enum { 3892178d8c50SDekel Peled MLX5_CRYPTO_KEY_PURPOSE_TLS = 0x1, 3893178d8c50SDekel Peled MLX5_CRYPTO_KEY_PURPOSE_IPSEC = 0x2, 3894178d8c50SDekel Peled MLX5_CRYPTO_KEY_PURPOSE_AES_XTS = 0x3, 3895178d8c50SDekel Peled MLX5_CRYPTO_KEY_PURPOSE_MACSEC = 0x4, 3896178d8c50SDekel Peled MLX5_CRYPTO_KEY_PURPOSE_GCM = 0x5, 3897178d8c50SDekel Peled MLX5_CRYPTO_KEY_PURPOSE_PSP = 0x6, 3898178d8c50SDekel Peled }; 3899178d8c50SDekel Peled 3900178d8c50SDekel Peled struct mlx5_ifc_dek_bits { 3901178d8c50SDekel Peled u8 modify_field_select[0x40]; 3902178d8c50SDekel Peled u8 state[0x8]; 3903178d8c50SDekel Peled u8 reserved_at_48[0xc]; 3904178d8c50SDekel Peled u8 key_size[0x4]; 3905178d8c50SDekel Peled u8 has_keytag[0x1]; 3906178d8c50SDekel Peled u8 reserved_at_59[0x3]; 3907178d8c50SDekel Peled u8 key_purpose[0x4]; 3908178d8c50SDekel Peled u8 reserved_at_60[0x8]; 3909178d8c50SDekel Peled u8 pd[0x18]; 3910178d8c50SDekel Peled u8 reserved_at_80[0x100]; 3911178d8c50SDekel Peled u8 opaque[0x40]; 3912178d8c50SDekel Peled u8 reserved_at_1c0[0x40]; 3913178d8c50SDekel Peled u8 key[0x400]; 3914178d8c50SDekel Peled u8 reserved_at_600[0x200]; 3915178d8c50SDekel Peled }; 3916178d8c50SDekel Peled 3917178d8c50SDekel Peled struct mlx5_ifc_create_dek_in_bits { 3918178d8c50SDekel Peled struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3919178d8c50SDekel Peled struct mlx5_ifc_dek_bits dek; 3920178d8c50SDekel Peled }; 3921178d8c50SDekel Peled 392221ca2494SDekel Peled struct mlx5_ifc_import_kek_bits { 392321ca2494SDekel Peled u8 modify_field_select[0x40]; 392421ca2494SDekel Peled u8 state[0x8]; 392521ca2494SDekel Peled u8 reserved_at_48[0xc]; 392621ca2494SDekel Peled u8 key_size[0x4]; 392721ca2494SDekel Peled u8 reserved_at_58[0x1a8]; 392821ca2494SDekel Peled u8 key[0x400]; 392921ca2494SDekel Peled u8 reserved_at_600[0x200]; 393021ca2494SDekel Peled }; 393121ca2494SDekel Peled 393221ca2494SDekel Peled struct mlx5_ifc_create_import_kek_in_bits { 393321ca2494SDekel Peled struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 393421ca2494SDekel Peled struct mlx5_ifc_import_kek_bits import_kek; 393521ca2494SDekel Peled }; 393621ca2494SDekel Peled 3937abda4fd9SDekel Peled enum { 3938abda4fd9SDekel Peled MLX5_CREDENTIAL_ROLE_OFFICER = 0x0, 3939abda4fd9SDekel Peled MLX5_CREDENTIAL_ROLE_USER = 0x1, 3940abda4fd9SDekel Peled }; 3941abda4fd9SDekel Peled 3942abda4fd9SDekel Peled struct mlx5_ifc_credential_bits { 3943abda4fd9SDekel Peled u8 modify_field_select[0x40]; 3944abda4fd9SDekel Peled u8 state[0x8]; 3945abda4fd9SDekel Peled u8 reserved_at_48[0x10]; 3946abda4fd9SDekel Peled u8 credential_role[0x8]; 3947abda4fd9SDekel Peled u8 reserved_at_60[0x1a0]; 3948abda4fd9SDekel Peled u8 credential[0x180]; 3949abda4fd9SDekel Peled u8 reserved_at_380[0x480]; 3950abda4fd9SDekel Peled }; 3951abda4fd9SDekel Peled 3952abda4fd9SDekel Peled struct mlx5_ifc_create_credential_in_bits { 3953abda4fd9SDekel Peled struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 3954abda4fd9SDekel Peled struct mlx5_ifc_credential_bits credential; 3955abda4fd9SDekel Peled }; 3956abda4fd9SDekel Peled 395738e4780bSDekel Peled struct mlx5_ifc_crypto_login_bits { 395838e4780bSDekel Peled u8 modify_field_select[0x40]; 395938e4780bSDekel Peled u8 reserved_at_40[0x48]; 396038e4780bSDekel Peled u8 credential_pointer[0x18]; 396138e4780bSDekel Peled u8 reserved_at_a0[0x8]; 396238e4780bSDekel Peled u8 session_import_kek_ptr[0x18]; 396338e4780bSDekel Peled u8 reserved_at_c0[0x140]; 396438e4780bSDekel Peled u8 credential[0x180]; 396538e4780bSDekel Peled u8 reserved_at_380[0x480]; 396638e4780bSDekel Peled }; 396738e4780bSDekel Peled 396838e4780bSDekel Peled struct mlx5_ifc_create_crypto_login_in_bits { 396938e4780bSDekel Peled struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 397038e4780bSDekel Peled struct mlx5_ifc_crypto_login_bits crypto_login; 397138e4780bSDekel Peled }; 397238e4780bSDekel Peled 3973178d8c50SDekel Peled enum { 39748712c80aSMatan Azrad MLX5_VIRTQ_STATE_INIT = 0, 39758712c80aSMatan Azrad MLX5_VIRTQ_STATE_RDY = 1, 39768712c80aSMatan Azrad MLX5_VIRTQ_STATE_SUSPEND = 2, 39778712c80aSMatan Azrad MLX5_VIRTQ_STATE_ERROR = 3, 39788712c80aSMatan Azrad }; 39798712c80aSMatan Azrad 39808712c80aSMatan Azrad enum { 39818712c80aSMatan Azrad MLX5_VIRTQ_MODIFY_TYPE_STATE = (1UL << 0), 39828712c80aSMatan Azrad MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_PARAMS = (1UL << 3), 39838712c80aSMatan Azrad MLX5_VIRTQ_MODIFY_TYPE_DIRTY_BITMAP_DUMP_ENABLE = (1UL << 4), 39842ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_QUEUE_PERIOD = (1UL << 5), 39852ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_ADDR = (1UL << 6), 39862ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_HW_AVAILABLE_INDEX = (1UL << 7), 39872ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_HW_USED_INDEX = (1UL << 8), 39882ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_Q_TYPE = (1UL << 9), 39892ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_VERSION_1_0 = (1UL << 10), 39902ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_Q_MKEY = (1UL << 11), 39912ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_QUEUE_FEATURE_BIT_MASK = (1UL << 12), 39922ac90aecSLi Zhang MLX5_VIRTQ_MODIFY_TYPE_EVENT_MODE = (1UL << 13), 39938712c80aSMatan Azrad }; 39948712c80aSMatan Azrad 39958712c80aSMatan Azrad struct mlx5_ifc_virtio_q_bits { 39968712c80aSMatan Azrad u8 virtio_q_type[0x8]; 39978712c80aSMatan Azrad u8 reserved_at_8[0x5]; 39988712c80aSMatan Azrad u8 event_mode[0x3]; 39998712c80aSMatan Azrad u8 queue_index[0x10]; 40008712c80aSMatan Azrad u8 full_emulation[0x1]; 40018712c80aSMatan Azrad u8 virtio_version_1_0[0x1]; 40028712c80aSMatan Azrad u8 reserved_at_22[0x2]; 40038712c80aSMatan Azrad u8 offload_type[0x4]; 40048712c80aSMatan Azrad u8 event_qpn_or_msix[0x18]; 40058712c80aSMatan Azrad u8 doorbell_stride_idx[0x10]; 40068712c80aSMatan Azrad u8 queue_size[0x10]; 40078712c80aSMatan Azrad u8 device_emulation_id[0x20]; 40088712c80aSMatan Azrad u8 desc_addr[0x40]; 40098712c80aSMatan Azrad u8 used_addr[0x40]; 40108712c80aSMatan Azrad u8 available_addr[0x40]; 40118712c80aSMatan Azrad u8 virtio_q_mkey[0x20]; 4012aed98b66SXueming Li u8 reserved_at_160[0x18]; 4013aed98b66SXueming Li u8 error_type[0x8]; 40148712c80aSMatan Azrad u8 umem_1_id[0x20]; 40158712c80aSMatan Azrad u8 umem_1_size[0x20]; 40168712c80aSMatan Azrad u8 umem_1_offset[0x40]; 40178712c80aSMatan Azrad u8 umem_2_id[0x20]; 40188712c80aSMatan Azrad u8 umem_2_size[0x20]; 40198712c80aSMatan Azrad u8 umem_2_offset[0x40]; 40208712c80aSMatan Azrad u8 umem_3_id[0x20]; 40218712c80aSMatan Azrad u8 umem_3_size[0x20]; 40228712c80aSMatan Azrad u8 umem_3_offset[0x40]; 4023796ae7bbSMatan Azrad u8 counter_set_id[0x20]; 4024473d8e67SMatan Azrad u8 reserved_at_320[0x8]; 4025473d8e67SMatan Azrad u8 pd[0x18]; 40266623dc2bSXueming Li u8 reserved_at_340[0x2]; 40276623dc2bSXueming Li u8 queue_period_mode[0x2]; 40286623dc2bSXueming Li u8 queue_period_us[0xc]; 40296623dc2bSXueming Li u8 queue_max_count[0x10]; 40306623dc2bSXueming Li u8 reserved_at_360[0xa0]; 40318712c80aSMatan Azrad }; 40328712c80aSMatan Azrad 40338712c80aSMatan Azrad struct mlx5_ifc_virtio_net_q_bits { 40348712c80aSMatan Azrad u8 modify_field_select[0x40]; 40358712c80aSMatan Azrad u8 reserved_at_40[0x40]; 40368712c80aSMatan Azrad u8 tso_ipv4[0x1]; 40378712c80aSMatan Azrad u8 tso_ipv6[0x1]; 40388712c80aSMatan Azrad u8 tx_csum[0x1]; 40398712c80aSMatan Azrad u8 rx_csum[0x1]; 40408712c80aSMatan Azrad u8 reserved_at_84[0x6]; 40418712c80aSMatan Azrad u8 dirty_bitmap_dump_enable[0x1]; 40428712c80aSMatan Azrad u8 vhost_log_page[0x5]; 40438712c80aSMatan Azrad u8 reserved_at_90[0xc]; 40448712c80aSMatan Azrad u8 state[0x4]; 4045aed98b66SXueming Li u8 reserved_at_a0[0x8]; 40468712c80aSMatan Azrad u8 tisn_or_qpn[0x18]; 40478712c80aSMatan Azrad u8 dirty_bitmap_mkey[0x20]; 40488712c80aSMatan Azrad u8 dirty_bitmap_size[0x20]; 40498712c80aSMatan Azrad u8 dirty_bitmap_addr[0x40]; 40508712c80aSMatan Azrad u8 hw_available_index[0x10]; 40518712c80aSMatan Azrad u8 hw_used_index[0x10]; 40528712c80aSMatan Azrad u8 reserved_at_160[0xa0]; 40538712c80aSMatan Azrad struct mlx5_ifc_virtio_q_bits virtio_q_context; 40548712c80aSMatan Azrad }; 40558712c80aSMatan Azrad 40568712c80aSMatan Azrad struct mlx5_ifc_create_virtq_in_bits { 40578712c80aSMatan Azrad struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 40588712c80aSMatan Azrad struct mlx5_ifc_virtio_net_q_bits virtq; 40598712c80aSMatan Azrad }; 40608712c80aSMatan Azrad 40618712c80aSMatan Azrad struct mlx5_ifc_query_virtq_out_bits { 40628712c80aSMatan Azrad struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 40638712c80aSMatan Azrad struct mlx5_ifc_virtio_net_q_bits virtq; 40648712c80aSMatan Azrad }; 40658712c80aSMatan Azrad 4066369e5092SDekel Peled struct mlx5_ifc_flow_hit_aso_bits { 4067369e5092SDekel Peled u8 modify_field_select[0x40]; 4068369e5092SDekel Peled u8 reserved_at_40[0x48]; 4069369e5092SDekel Peled u8 access_pd[0x18]; 4070369e5092SDekel Peled u8 reserved_at_a0[0x160]; 4071369e5092SDekel Peled u8 flag[0x200]; 4072369e5092SDekel Peled }; 4073369e5092SDekel Peled 4074369e5092SDekel Peled struct mlx5_ifc_create_flow_hit_aso_in_bits { 4075369e5092SDekel Peled struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 4076369e5092SDekel Peled struct mlx5_ifc_flow_hit_aso_bits flow_hit_aso; 4077369e5092SDekel Peled }; 4078369e5092SDekel Peled 407949e0ccb5SLi Zhang struct mlx5_ifc_flow_meter_aso_bits { 408049e0ccb5SLi Zhang u8 modify_field_select[0x40]; 408149e0ccb5SLi Zhang u8 reserved_at_40[0x48]; 408249e0ccb5SLi Zhang u8 access_pd[0x18]; 408349e0ccb5SLi Zhang u8 reserved_at_a0[0x160]; 408449e0ccb5SLi Zhang u8 parameters[0x200]; 408549e0ccb5SLi Zhang }; 408649e0ccb5SLi Zhang 408749e0ccb5SLi Zhang struct mlx5_ifc_create_flow_meter_aso_in_bits { 408849e0ccb5SLi Zhang struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 408949e0ccb5SLi Zhang struct mlx5_ifc_flow_meter_aso_bits flow_meter_aso; 409049e0ccb5SLi Zhang }; 4091dc4e9e82SBing Zhao 4092dc4e9e82SBing Zhao struct mlx5_ifc_tcp_window_params_bits { 4093dc4e9e82SBing Zhao u8 max_ack[0x20]; 4094dc4e9e82SBing Zhao u8 max_win[0x20]; 4095dc4e9e82SBing Zhao u8 reply_end[0x20]; 4096dc4e9e82SBing Zhao u8 sent_end[0x20]; 4097dc4e9e82SBing Zhao }; 4098dc4e9e82SBing Zhao 4099dc4e9e82SBing Zhao struct mlx5_ifc_conn_track_aso_bits { 4100dc4e9e82SBing Zhao struct mlx5_ifc_tcp_window_params_bits reply_dir; /* End of DW3. */ 4101dc4e9e82SBing Zhao struct mlx5_ifc_tcp_window_params_bits original_dir; /* End of DW7. */ 4102dc4e9e82SBing Zhao u8 last_end[0x20]; /* End of DW8. */ 4103dc4e9e82SBing Zhao u8 last_ack[0x20]; /* End of DW9. */ 4104dc4e9e82SBing Zhao u8 last_seq[0x20]; /* End of DW10. */ 4105dc4e9e82SBing Zhao u8 last_win[0x10]; 4106dc4e9e82SBing Zhao u8 reserved_at_170[0xa]; 4107dc4e9e82SBing Zhao u8 last_dir[0x1]; 4108dc4e9e82SBing Zhao u8 last_index[0x5]; /* End of DW11. */ 4109dc4e9e82SBing Zhao u8 reserved_at_180[0x40]; /* End of DW13. */ 4110dc4e9e82SBing Zhao u8 reply_direction_tcp_scale[0x4]; 4111dc4e9e82SBing Zhao u8 reply_direction_tcp_close_initiated[0x1]; 4112dc4e9e82SBing Zhao u8 reply_direction_tcp_liberal_enabled[0x1]; 4113dc4e9e82SBing Zhao u8 reply_direction_tcp_data_unacked[0x1]; 4114dc4e9e82SBing Zhao u8 reply_direction_tcp_max_ack[0x1]; 4115dc4e9e82SBing Zhao u8 reserved_at_1c8[0x8]; 4116dc4e9e82SBing Zhao u8 original_direction_tcp_scale[0x4]; 4117dc4e9e82SBing Zhao u8 original_direction_tcp_close_initiated[0x1]; 4118dc4e9e82SBing Zhao u8 original_direction_tcp_liberal_enabled[0x1]; 4119dc4e9e82SBing Zhao u8 original_direction_tcp_data_unacked[0x1]; 4120dc4e9e82SBing Zhao u8 original_direction_tcp_max_ack[0x1]; 4121dc4e9e82SBing Zhao u8 reserved_at_1d8[0x8]; /* End of DW14. */ 4122dc4e9e82SBing Zhao u8 valid[0x1]; 4123dc4e9e82SBing Zhao u8 state[0x3]; 4124dc4e9e82SBing Zhao u8 freeze_track[0x1]; 4125dc4e9e82SBing Zhao u8 reserved_at_1e5[0xb]; 4126dc4e9e82SBing Zhao u8 reserved_at_1f0[0x1]; 4127dc4e9e82SBing Zhao u8 connection_assured[0x1]; 4128dc4e9e82SBing Zhao u8 sack_permitted[0x1]; 4129dc4e9e82SBing Zhao u8 challenged_acked[0x1]; 4130dc4e9e82SBing Zhao u8 heartbeat[0x1]; 4131dc4e9e82SBing Zhao u8 max_ack_window[0x3]; 4132dc4e9e82SBing Zhao u8 reserved_at_1f8[0x1]; 4133dc4e9e82SBing Zhao u8 retransmission_counter[0x3]; 4134dc4e9e82SBing Zhao u8 retranmission_limit_exceeded[0x1]; 4135dc4e9e82SBing Zhao u8 retranmission_limit[0x3]; /* End of DW15. */ 4136dc4e9e82SBing Zhao }; 4137dc4e9e82SBing Zhao 4138dc4e9e82SBing Zhao struct mlx5_ifc_conn_track_offload_bits { 4139dc4e9e82SBing Zhao u8 modify_field_select[0x40]; 4140dc4e9e82SBing Zhao u8 reserved_at_40[0x40]; 4141dc4e9e82SBing Zhao u8 reserved_at_80[0x8]; 4142dc4e9e82SBing Zhao u8 conn_track_aso_access_pd[0x18]; 4143dc4e9e82SBing Zhao u8 reserved_at_a0[0x160]; 4144dc4e9e82SBing Zhao struct mlx5_ifc_conn_track_aso_bits conn_track_aso; 4145dc4e9e82SBing Zhao }; 4146dc4e9e82SBing Zhao 4147dc4e9e82SBing Zhao struct mlx5_ifc_create_conn_track_aso_in_bits { 4148dc4e9e82SBing Zhao struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 4149dc4e9e82SBing Zhao struct mlx5_ifc_conn_track_offload_bits conn_track_offload; 4150dc4e9e82SBing Zhao }; 4151dc4e9e82SBing Zhao 4152105d2149SDekel Peled enum mlx5_access_aso_opc_mod { 4153105d2149SDekel Peled ASO_OPC_MOD_IPSEC = 0x0, 4154105d2149SDekel Peled ASO_OPC_MOD_CONNECTION_TRACKING = 0x1, 4155105d2149SDekel Peled ASO_OPC_MOD_POLICER = 0x2, 4156105d2149SDekel Peled ASO_OPC_MOD_RACE_AVOIDANCE = 0x3, 4157105d2149SDekel Peled ASO_OPC_MOD_FLOW_HIT = 0x4, 41587f6e6beeSDekel Peled }; 41597f6e6beeSDekel Peled 4160f935ed4bSDekel Peled #define ASO_CSEG_DATA_MASK_MODE_OFFSET 30 4161f935ed4bSDekel Peled 41627f6e6beeSDekel Peled enum mlx5_aso_data_mask_mode { 41637f6e6beeSDekel Peled BITWISE_64BIT = 0x0, 41647f6e6beeSDekel Peled BYTEWISE_64BYTE = 0x1, 41657f6e6beeSDekel Peled CALCULATED_64BYTE = 0x2, 41667f6e6beeSDekel Peled }; 41677f6e6beeSDekel Peled 4168f935ed4bSDekel Peled #define ASO_CSEG_COND_0_OPER_OFFSET 20 4169f935ed4bSDekel Peled #define ASO_CSEG_COND_1_OPER_OFFSET 16 4170f935ed4bSDekel Peled 41717f6e6beeSDekel Peled enum mlx5_aso_pre_cond_op { 41727f6e6beeSDekel Peled ASO_OP_ALWAYS_FALSE = 0x0, 41737f6e6beeSDekel Peled ASO_OP_ALWAYS_TRUE = 0x1, 41747f6e6beeSDekel Peled ASO_OP_EQUAL = 0x2, 41757f6e6beeSDekel Peled ASO_OP_NOT_EQUAL = 0x3, 41767f6e6beeSDekel Peled ASO_OP_GREATER_OR_EQUAL = 0x4, 41777f6e6beeSDekel Peled ASO_OP_LESSER_OR_EQUAL = 0x5, 41787f6e6beeSDekel Peled ASO_OP_LESSER = 0x6, 41797f6e6beeSDekel Peled ASO_OP_GREATER = 0x7, 41807f6e6beeSDekel Peled ASO_OP_CYCLIC_GREATER = 0x8, 41817f6e6beeSDekel Peled ASO_OP_CYCLIC_LESSER = 0x9, 41827f6e6beeSDekel Peled }; 41837f6e6beeSDekel Peled 4184f935ed4bSDekel Peled #define ASO_CSEG_COND_OPER_OFFSET 6 4185f935ed4bSDekel Peled 41867f6e6beeSDekel Peled enum mlx5_aso_op { 41877f6e6beeSDekel Peled ASO_OPER_LOGICAL_AND = 0x0, 41887f6e6beeSDekel Peled ASO_OPER_LOGICAL_OR = 0x1, 41897f6e6beeSDekel Peled }; 41907f6e6beeSDekel Peled 4191c59df71bSGregory Etelson #define MLX5_ASO_CSEG_READ_ENABLE 1 4192c59df71bSGregory Etelson 41937f6e6beeSDekel Peled /* ASO WQE CTRL segment. */ 4194*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_aso_cseg { 41957f6e6beeSDekel Peled uint32_t va_h; 4196f935ed4bSDekel Peled uint32_t va_l_r; 41977f6e6beeSDekel Peled uint32_t lkey; 41987f6e6beeSDekel Peled uint32_t operand_masks; 41997f6e6beeSDekel Peled uint32_t condition_0_data; 42007f6e6beeSDekel Peled uint32_t condition_0_mask; 42017f6e6beeSDekel Peled uint32_t condition_1_data; 42027f6e6beeSDekel Peled uint32_t condition_1_mask; 42037f6e6beeSDekel Peled uint64_t bitwise_data; 42047f6e6beeSDekel Peled uint64_t data_mask; 4205*e7750639SAndre Muezerie } __rte_packed_end; 42067f6e6beeSDekel Peled 4207c59df71bSGregory Etelson #define MLX5_MTR_MAX_TOKEN_VALUE INT32_MAX 4208c59df71bSGregory Etelson 420949e0ccb5SLi Zhang /* A meter data segment - 2 per ASO WQE. */ 4210*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_aso_mtr_dseg { 421149e0ccb5SLi Zhang uint32_t v_bo_sc_bbog_mm; 421249e0ccb5SLi Zhang /* 421349e0ccb5SLi Zhang * bit 31: valid, 30: bucket overflow, 28-29: start color, 421449e0ccb5SLi Zhang * 27: both buckets on green, 24-25: meter mode. 421549e0ccb5SLi Zhang */ 421649e0ccb5SLi Zhang uint32_t reserved; 421749e0ccb5SLi Zhang uint32_t cbs_cir; 421849e0ccb5SLi Zhang /* 421949e0ccb5SLi Zhang * bit 24-28: cbs_exponent, bit 16-23 cbs_mantissa, 422049e0ccb5SLi Zhang * bit 8-12: cir_exponent, bit 0-7 cir_mantissa. 422149e0ccb5SLi Zhang */ 422249e0ccb5SLi Zhang uint32_t c_tokens; 422349e0ccb5SLi Zhang uint32_t ebs_eir; 422449e0ccb5SLi Zhang /* 422549e0ccb5SLi Zhang * bit 24-28: ebs_exponent, bit 16-23 ebs_mantissa, 422649e0ccb5SLi Zhang * bit 8-12: eir_exponent, bit 0-7 eir_mantissa. 422749e0ccb5SLi Zhang */ 422849e0ccb5SLi Zhang uint32_t e_tokens; 422949e0ccb5SLi Zhang uint64_t timestamp; 4230*e7750639SAndre Muezerie } __rte_packed_end; 42317f6e6beeSDekel Peled 423249e0ccb5SLi Zhang #define ASO_DSEG_VALID_OFFSET 31 423349e0ccb5SLi Zhang #define ASO_DSEG_BO_OFFSET 30 423449e0ccb5SLi Zhang #define ASO_DSEG_SC_OFFSET 28 423533a7493cSBing Zhao #define ASO_DSEG_BBOG_OFFSET 27 4236aa065a9cSLi Zhang #define ASO_DSEG_MTR_MODE 24 423749e0ccb5SLi Zhang #define ASO_DSEG_CBS_EXP_OFFSET 24 423849e0ccb5SLi Zhang #define ASO_DSEG_CBS_MAN_OFFSET 16 423933a7493cSBing Zhao #define ASO_DSEG_XIR_EXP_MASK 0x1F 424033a7493cSBing Zhao #define ASO_DSEG_XIR_EXP_OFFSET 8 424149e0ccb5SLi Zhang #define ASO_DSEG_EBS_EXP_OFFSET 24 424249e0ccb5SLi Zhang #define ASO_DSEG_EBS_MAN_OFFSET 16 424349e0ccb5SLi Zhang #define ASO_DSEG_EXP_MASK 0x1F 424449e0ccb5SLi Zhang #define ASO_DSEG_MAN_MASK 0xFF 424549e0ccb5SLi Zhang 424649e0ccb5SLi Zhang #define MLX5_ASO_WQE_DSEG_SIZE 0x40 424749e0ccb5SLi Zhang #define MLX5_ASO_METERS_PER_WQE 2 424849e0ccb5SLi Zhang #define MLX5_ASO_MTRS_PER_POOL 128 424949e0ccb5SLi Zhang 425049e0ccb5SLi Zhang /* ASO WQE data segment. */ 4251*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_aso_dseg { 425249e0ccb5SLi Zhang union { 42537f6e6beeSDekel Peled uint8_t data[MLX5_ASO_WQE_DSEG_SIZE]; 425449e0ccb5SLi Zhang struct mlx5_aso_mtr_dseg mtrs[MLX5_ASO_METERS_PER_WQE]; 425549e0ccb5SLi Zhang }; 4256*e7750639SAndre Muezerie } __rte_packed_end; 42577f6e6beeSDekel Peled 42587f6e6beeSDekel Peled /* ASO WQE. */ 4259*e7750639SAndre Muezerie struct __rte_packed_begin mlx5_aso_wqe { 42607f6e6beeSDekel Peled struct mlx5_wqe_cseg general_cseg; 42617f6e6beeSDekel Peled struct mlx5_aso_cseg aso_cseg; 42627f6e6beeSDekel Peled struct mlx5_aso_dseg aso_dseg; 4263*e7750639SAndre Muezerie } __rte_packed_end; 42647f6e6beeSDekel Peled 426515c3807eSMatan Azrad enum { 4266aed98b66SXueming Li MLX5_EVENT_TYPE_OBJECT_CHANGE = 0x27, 42675c9f3294SSpike Du MLX5_EVENT_TYPE_SRQ_LIMIT_REACHED = 0x14, 4268aed98b66SXueming Li }; 4269aed98b66SXueming Li 4270aed98b66SXueming Li enum { 427115c3807eSMatan Azrad MLX5_QP_ST_RC = 0x0, 427215c3807eSMatan Azrad }; 427315c3807eSMatan Azrad 427415c3807eSMatan Azrad enum { 427515c3807eSMatan Azrad MLX5_QP_PM_MIGRATED = 0x3, 427615c3807eSMatan Azrad }; 427715c3807eSMatan Azrad 427815c3807eSMatan Azrad enum { 427915c3807eSMatan Azrad MLX5_NON_ZERO_RQ = 0x0, 428015c3807eSMatan Azrad MLX5_SRQ_RQ = 0x1, 428115c3807eSMatan Azrad MLX5_CRQ_RQ = 0x2, 428215c3807eSMatan Azrad MLX5_ZERO_LEN_RQ = 0x3, 428315c3807eSMatan Azrad }; 428415c3807eSMatan Azrad 428515c3807eSMatan Azrad struct mlx5_ifc_ads_bits { 428615c3807eSMatan Azrad u8 fl[0x1]; 428715c3807eSMatan Azrad u8 free_ar[0x1]; 428815c3807eSMatan Azrad u8 reserved_at_2[0xe]; 428915c3807eSMatan Azrad u8 pkey_index[0x10]; 429015c3807eSMatan Azrad u8 reserved_at_20[0x8]; 429115c3807eSMatan Azrad u8 grh[0x1]; 429215c3807eSMatan Azrad u8 mlid[0x7]; 429315c3807eSMatan Azrad u8 rlid[0x10]; 429415c3807eSMatan Azrad u8 ack_timeout[0x5]; 429515c3807eSMatan Azrad u8 reserved_at_45[0x3]; 429615c3807eSMatan Azrad u8 src_addr_index[0x8]; 429715c3807eSMatan Azrad u8 reserved_at_50[0x4]; 429815c3807eSMatan Azrad u8 stat_rate[0x4]; 429915c3807eSMatan Azrad u8 hop_limit[0x8]; 430015c3807eSMatan Azrad u8 reserved_at_60[0x4]; 430115c3807eSMatan Azrad u8 tclass[0x8]; 430215c3807eSMatan Azrad u8 flow_label[0x14]; 430315c3807eSMatan Azrad u8 rgid_rip[16][0x8]; 430415c3807eSMatan Azrad u8 reserved_at_100[0x4]; 430515c3807eSMatan Azrad u8 f_dscp[0x1]; 430615c3807eSMatan Azrad u8 f_ecn[0x1]; 430715c3807eSMatan Azrad u8 reserved_at_106[0x1]; 430815c3807eSMatan Azrad u8 f_eth_prio[0x1]; 430915c3807eSMatan Azrad u8 ecn[0x2]; 431015c3807eSMatan Azrad u8 dscp[0x6]; 431115c3807eSMatan Azrad u8 udp_sport[0x10]; 431215c3807eSMatan Azrad u8 dei_cfi[0x1]; 431315c3807eSMatan Azrad u8 eth_prio[0x3]; 431415c3807eSMatan Azrad u8 sl[0x4]; 431515c3807eSMatan Azrad u8 vhca_port_num[0x8]; 431615c3807eSMatan Azrad u8 rmac_47_32[0x10]; 431715c3807eSMatan Azrad u8 rmac_31_0[0x20]; 431815c3807eSMatan Azrad }; 431915c3807eSMatan Azrad 432015c3807eSMatan Azrad struct mlx5_ifc_qpc_bits { 432115c3807eSMatan Azrad u8 state[0x4]; 432215c3807eSMatan Azrad u8 lag_tx_port_affinity[0x4]; 432315c3807eSMatan Azrad u8 st[0x8]; 432415c3807eSMatan Azrad u8 reserved_at_10[0x3]; 432515c3807eSMatan Azrad u8 pm_state[0x2]; 432615c3807eSMatan Azrad u8 reserved_at_15[0x1]; 432715c3807eSMatan Azrad u8 req_e2e_credit_mode[0x2]; 432815c3807eSMatan Azrad u8 offload_type[0x4]; 432915c3807eSMatan Azrad u8 end_padding_mode[0x2]; 433015c3807eSMatan Azrad u8 reserved_at_1e[0x2]; 433115c3807eSMatan Azrad u8 wq_signature[0x1]; 433215c3807eSMatan Azrad u8 block_lb_mc[0x1]; 433315c3807eSMatan Azrad u8 atomic_like_write_en[0x1]; 433415c3807eSMatan Azrad u8 latency_sensitive[0x1]; 433515c3807eSMatan Azrad u8 reserved_at_24[0x1]; 433615c3807eSMatan Azrad u8 drain_sigerr[0x1]; 433715c3807eSMatan Azrad u8 reserved_at_26[0x2]; 433815c3807eSMatan Azrad u8 pd[0x18]; 433915c3807eSMatan Azrad u8 mtu[0x3]; 434015c3807eSMatan Azrad u8 log_msg_max[0x5]; 434115c3807eSMatan Azrad u8 reserved_at_48[0x1]; 434215c3807eSMatan Azrad u8 log_rq_size[0x4]; 434315c3807eSMatan Azrad u8 log_rq_stride[0x3]; 434415c3807eSMatan Azrad u8 no_sq[0x1]; 434515c3807eSMatan Azrad u8 log_sq_size[0x4]; 4346569ffbc9SViacheslav Ovsiienko u8 reserved_at_55[0x3]; 4347569ffbc9SViacheslav Ovsiienko u8 ts_format[0x2]; 4348569ffbc9SViacheslav Ovsiienko u8 reserved_at_5a[0x1]; 434915c3807eSMatan Azrad u8 rlky[0x1]; 435015c3807eSMatan Azrad u8 ulp_stateless_offload_mode[0x4]; 435115c3807eSMatan Azrad u8 counter_set_id[0x8]; 435215c3807eSMatan Azrad u8 uar_page[0x18]; 435315c3807eSMatan Azrad u8 reserved_at_80[0x8]; 435415c3807eSMatan Azrad u8 user_index[0x18]; 435515c3807eSMatan Azrad u8 reserved_at_a0[0x3]; 435615c3807eSMatan Azrad u8 log_page_size[0x5]; 435715c3807eSMatan Azrad u8 remote_qpn[0x18]; 435815c3807eSMatan Azrad struct mlx5_ifc_ads_bits primary_address_path; 435915c3807eSMatan Azrad struct mlx5_ifc_ads_bits secondary_address_path; 436015c3807eSMatan Azrad u8 log_ack_req_freq[0x4]; 436115c3807eSMatan Azrad u8 reserved_at_384[0x4]; 436215c3807eSMatan Azrad u8 log_sra_max[0x3]; 436315c3807eSMatan Azrad u8 reserved_at_38b[0x2]; 436415c3807eSMatan Azrad u8 retry_count[0x3]; 436515c3807eSMatan Azrad u8 rnr_retry[0x3]; 436615c3807eSMatan Azrad u8 reserved_at_393[0x1]; 436715c3807eSMatan Azrad u8 fre[0x1]; 436815c3807eSMatan Azrad u8 cur_rnr_retry[0x3]; 436915c3807eSMatan Azrad u8 cur_retry_count[0x3]; 437015c3807eSMatan Azrad u8 reserved_at_39b[0x5]; 437115c3807eSMatan Azrad u8 reserved_at_3a0[0x20]; 437215c3807eSMatan Azrad u8 reserved_at_3c0[0x8]; 437315c3807eSMatan Azrad u8 next_send_psn[0x18]; 437415c3807eSMatan Azrad u8 reserved_at_3e0[0x8]; 437515c3807eSMatan Azrad u8 cqn_snd[0x18]; 437615c3807eSMatan Azrad u8 reserved_at_400[0x8]; 437715c3807eSMatan Azrad u8 deth_sqpn[0x18]; 437815c3807eSMatan Azrad u8 reserved_at_420[0x20]; 437915c3807eSMatan Azrad u8 reserved_at_440[0x8]; 438015c3807eSMatan Azrad u8 last_acked_psn[0x18]; 438115c3807eSMatan Azrad u8 reserved_at_460[0x8]; 438215c3807eSMatan Azrad u8 ssn[0x18]; 438315c3807eSMatan Azrad u8 reserved_at_480[0x8]; 438415c3807eSMatan Azrad u8 log_rra_max[0x3]; 438515c3807eSMatan Azrad u8 reserved_at_48b[0x1]; 438615c3807eSMatan Azrad u8 atomic_mode[0x4]; 438715c3807eSMatan Azrad u8 rre[0x1]; 438815c3807eSMatan Azrad u8 rwe[0x1]; 438915c3807eSMatan Azrad u8 rae[0x1]; 439015c3807eSMatan Azrad u8 reserved_at_493[0x1]; 439115c3807eSMatan Azrad u8 page_offset[0x6]; 439215c3807eSMatan Azrad u8 reserved_at_49a[0x3]; 439315c3807eSMatan Azrad u8 cd_slave_receive[0x1]; 439415c3807eSMatan Azrad u8 cd_slave_send[0x1]; 439515c3807eSMatan Azrad u8 cd_master[0x1]; 439615c3807eSMatan Azrad u8 reserved_at_4a0[0x3]; 439715c3807eSMatan Azrad u8 min_rnr_nak[0x5]; 439815c3807eSMatan Azrad u8 next_rcv_psn[0x18]; 439915c3807eSMatan Azrad u8 reserved_at_4c0[0x8]; 440015c3807eSMatan Azrad u8 xrcd[0x18]; 440115c3807eSMatan Azrad u8 reserved_at_4e0[0x8]; 440215c3807eSMatan Azrad u8 cqn_rcv[0x18]; 440315c3807eSMatan Azrad u8 dbr_addr[0x40]; 440415c3807eSMatan Azrad u8 q_key[0x20]; 440515c3807eSMatan Azrad u8 reserved_at_560[0x5]; 440615c3807eSMatan Azrad u8 rq_type[0x3]; 440715c3807eSMatan Azrad u8 srqn_rmpn_xrqn[0x18]; 440815c3807eSMatan Azrad u8 reserved_at_580[0x8]; 440915c3807eSMatan Azrad u8 rmsn[0x18]; 441015c3807eSMatan Azrad u8 hw_sq_wqebb_counter[0x10]; 441115c3807eSMatan Azrad u8 sw_sq_wqebb_counter[0x10]; 441215c3807eSMatan Azrad u8 hw_rq_counter[0x20]; 441315c3807eSMatan Azrad u8 sw_rq_counter[0x20]; 441415c3807eSMatan Azrad u8 reserved_at_600[0x20]; 441515c3807eSMatan Azrad u8 reserved_at_620[0xf]; 441615c3807eSMatan Azrad u8 cgs[0x1]; 441715c3807eSMatan Azrad u8 cs_req[0x8]; 441815c3807eSMatan Azrad u8 cs_res[0x8]; 441915c3807eSMatan Azrad u8 dc_access_key[0x40]; 442015c3807eSMatan Azrad u8 reserved_at_680[0x3]; 442115c3807eSMatan Azrad u8 dbr_umem_valid[0x1]; 442215c3807eSMatan Azrad u8 reserved_at_684[0x9c]; 442315c3807eSMatan Azrad u8 dbr_umem_id[0x20]; 442415c3807eSMatan Azrad }; 442515c3807eSMatan Azrad 442615c3807eSMatan Azrad struct mlx5_ifc_create_qp_out_bits { 442715c3807eSMatan Azrad u8 status[0x8]; 442815c3807eSMatan Azrad u8 reserved_at_8[0x18]; 442915c3807eSMatan Azrad u8 syndrome[0x20]; 443015c3807eSMatan Azrad u8 reserved_at_40[0x8]; 443115c3807eSMatan Azrad u8 qpn[0x18]; 443215c3807eSMatan Azrad u8 reserved_at_60[0x20]; 443315c3807eSMatan Azrad }; 443415c3807eSMatan Azrad 4435ddda0006SRaja Zidane struct mlx5_ifc_qpc_extension_bits { 4436ddda0006SRaja Zidane u8 reserved_at_0[0x2]; 4437ddda0006SRaja Zidane u8 mmo[0x1]; 4438ddda0006SRaja Zidane u8 reserved_at_3[0x5fd]; 4439ddda0006SRaja Zidane }; 4440ddda0006SRaja Zidane 4441ddda0006SRaja Zidane #ifdef PEDANTIC 4442ddda0006SRaja Zidane #pragma GCC diagnostic ignored "-Wpedantic" 4443ddda0006SRaja Zidane #endif 4444ddda0006SRaja Zidane struct mlx5_ifc_qpc_pas_list_bits { 4445ddda0006SRaja Zidane u8 pas[0][0x40]; 4446ddda0006SRaja Zidane }; 4447ddda0006SRaja Zidane 4448ddda0006SRaja Zidane #ifdef PEDANTIC 4449ddda0006SRaja Zidane #pragma GCC diagnostic ignored "-Wpedantic" 4450ddda0006SRaja Zidane #endif 4451ddda0006SRaja Zidane struct mlx5_ifc_qpc_extension_and_pas_list_bits { 4452ddda0006SRaja Zidane struct mlx5_ifc_qpc_extension_bits qpc_data_extension; 4453013b4c52SBruce Richardson u8 pas[][0x40]; 4454ddda0006SRaja Zidane }; 4455ddda0006SRaja Zidane 4456ddda0006SRaja Zidane 445715c3807eSMatan Azrad #ifdef PEDANTIC 445815c3807eSMatan Azrad #pragma GCC diagnostic ignored "-Wpedantic" 445915c3807eSMatan Azrad #endif 446015c3807eSMatan Azrad struct mlx5_ifc_create_qp_in_bits { 446115c3807eSMatan Azrad u8 opcode[0x10]; 446215c3807eSMatan Azrad u8 uid[0x10]; 446315c3807eSMatan Azrad u8 reserved_at_20[0x10]; 446415c3807eSMatan Azrad u8 op_mod[0x10]; 4465cbc4c13aSRaja Zidane u8 qpc_ext[0x1]; 4466cbc4c13aSRaja Zidane u8 reserved_at_41[0x3f]; 446715c3807eSMatan Azrad u8 opt_param_mask[0x20]; 446815c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 446915c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 447015c3807eSMatan Azrad u8 wq_umem_offset[0x40]; 447115c3807eSMatan Azrad u8 wq_umem_id[0x20]; 447215c3807eSMatan Azrad u8 wq_umem_valid[0x1]; 447315c3807eSMatan Azrad u8 reserved_at_861[0x1f]; 4474ddda0006SRaja Zidane union { 4475ddda0006SRaja Zidane struct mlx5_ifc_qpc_pas_list_bits qpc_pas_list; 4476ddda0006SRaja Zidane struct mlx5_ifc_qpc_extension_and_pas_list_bits 4477ddda0006SRaja Zidane qpc_extension_and_pas_list; 4478ddda0006SRaja Zidane }; 447915c3807eSMatan Azrad }; 448015c3807eSMatan Azrad #ifdef PEDANTIC 448115c3807eSMatan Azrad #pragma GCC diagnostic error "-Wpedantic" 448215c3807eSMatan Azrad #endif 448315c3807eSMatan Azrad 448415c3807eSMatan Azrad struct mlx5_ifc_sqerr2rts_qp_out_bits { 448515c3807eSMatan Azrad u8 status[0x8]; 448615c3807eSMatan Azrad u8 reserved_at_8[0x18]; 448715c3807eSMatan Azrad u8 syndrome[0x20]; 448815c3807eSMatan Azrad u8 reserved_at_40[0x40]; 448915c3807eSMatan Azrad }; 449015c3807eSMatan Azrad 449115c3807eSMatan Azrad struct mlx5_ifc_sqerr2rts_qp_in_bits { 449215c3807eSMatan Azrad u8 opcode[0x10]; 449315c3807eSMatan Azrad u8 uid[0x10]; 449415c3807eSMatan Azrad u8 reserved_at_20[0x10]; 449515c3807eSMatan Azrad u8 op_mod[0x10]; 449615c3807eSMatan Azrad u8 reserved_at_40[0x8]; 449715c3807eSMatan Azrad u8 qpn[0x18]; 449815c3807eSMatan Azrad u8 reserved_at_60[0x20]; 449915c3807eSMatan Azrad u8 opt_param_mask[0x20]; 450015c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 450115c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 450215c3807eSMatan Azrad u8 reserved_at_800[0x80]; 450315c3807eSMatan Azrad }; 450415c3807eSMatan Azrad 450515c3807eSMatan Azrad struct mlx5_ifc_sqd2rts_qp_out_bits { 450615c3807eSMatan Azrad u8 status[0x8]; 450715c3807eSMatan Azrad u8 reserved_at_8[0x18]; 450815c3807eSMatan Azrad u8 syndrome[0x20]; 450915c3807eSMatan Azrad u8 reserved_at_40[0x40]; 451015c3807eSMatan Azrad }; 451115c3807eSMatan Azrad 451215c3807eSMatan Azrad struct mlx5_ifc_sqd2rts_qp_in_bits { 451315c3807eSMatan Azrad u8 opcode[0x10]; 451415c3807eSMatan Azrad u8 uid[0x10]; 451515c3807eSMatan Azrad u8 reserved_at_20[0x10]; 451615c3807eSMatan Azrad u8 op_mod[0x10]; 451715c3807eSMatan Azrad u8 reserved_at_40[0x8]; 451815c3807eSMatan Azrad u8 qpn[0x18]; 451915c3807eSMatan Azrad u8 reserved_at_60[0x20]; 452015c3807eSMatan Azrad u8 opt_param_mask[0x20]; 452115c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 452215c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 452315c3807eSMatan Azrad u8 reserved_at_800[0x80]; 452415c3807eSMatan Azrad }; 452515c3807eSMatan Azrad 452615c3807eSMatan Azrad struct mlx5_ifc_rts2rts_qp_out_bits { 452715c3807eSMatan Azrad u8 status[0x8]; 452815c3807eSMatan Azrad u8 reserved_at_8[0x18]; 452915c3807eSMatan Azrad u8 syndrome[0x20]; 453015c3807eSMatan Azrad u8 reserved_at_40[0x40]; 453115c3807eSMatan Azrad }; 453215c3807eSMatan Azrad 453315c3807eSMatan Azrad struct mlx5_ifc_rts2rts_qp_in_bits { 453415c3807eSMatan Azrad u8 opcode[0x10]; 453515c3807eSMatan Azrad u8 uid[0x10]; 453615c3807eSMatan Azrad u8 reserved_at_20[0x10]; 453715c3807eSMatan Azrad u8 op_mod[0x10]; 453815c3807eSMatan Azrad u8 reserved_at_40[0x8]; 453915c3807eSMatan Azrad u8 qpn[0x18]; 454015c3807eSMatan Azrad u8 reserved_at_60[0x20]; 454115c3807eSMatan Azrad u8 opt_param_mask[0x20]; 454215c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 454315c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 454415c3807eSMatan Azrad u8 reserved_at_800[0x80]; 454515c3807eSMatan Azrad }; 454615c3807eSMatan Azrad 454715c3807eSMatan Azrad struct mlx5_ifc_rtr2rts_qp_out_bits { 454815c3807eSMatan Azrad u8 status[0x8]; 454915c3807eSMatan Azrad u8 reserved_at_8[0x18]; 455015c3807eSMatan Azrad u8 syndrome[0x20]; 455115c3807eSMatan Azrad u8 reserved_at_40[0x40]; 455215c3807eSMatan Azrad }; 455315c3807eSMatan Azrad 455415c3807eSMatan Azrad struct mlx5_ifc_rtr2rts_qp_in_bits { 455515c3807eSMatan Azrad u8 opcode[0x10]; 455615c3807eSMatan Azrad u8 uid[0x10]; 455715c3807eSMatan Azrad u8 reserved_at_20[0x10]; 455815c3807eSMatan Azrad u8 op_mod[0x10]; 455915c3807eSMatan Azrad u8 reserved_at_40[0x8]; 456015c3807eSMatan Azrad u8 qpn[0x18]; 456115c3807eSMatan Azrad u8 reserved_at_60[0x20]; 456215c3807eSMatan Azrad u8 opt_param_mask[0x20]; 456315c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 456415c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 456515c3807eSMatan Azrad u8 reserved_at_800[0x80]; 456615c3807eSMatan Azrad }; 456715c3807eSMatan Azrad 456815c3807eSMatan Azrad struct mlx5_ifc_rst2init_qp_out_bits { 456915c3807eSMatan Azrad u8 status[0x8]; 457015c3807eSMatan Azrad u8 reserved_at_8[0x18]; 457115c3807eSMatan Azrad u8 syndrome[0x20]; 457215c3807eSMatan Azrad u8 reserved_at_40[0x40]; 457315c3807eSMatan Azrad }; 457415c3807eSMatan Azrad 457515c3807eSMatan Azrad struct mlx5_ifc_rst2init_qp_in_bits { 457615c3807eSMatan Azrad u8 opcode[0x10]; 457715c3807eSMatan Azrad u8 uid[0x10]; 457815c3807eSMatan Azrad u8 reserved_at_20[0x10]; 457915c3807eSMatan Azrad u8 op_mod[0x10]; 458015c3807eSMatan Azrad u8 reserved_at_40[0x8]; 458115c3807eSMatan Azrad u8 qpn[0x18]; 458215c3807eSMatan Azrad u8 reserved_at_60[0x20]; 458315c3807eSMatan Azrad u8 opt_param_mask[0x20]; 458415c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 458515c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 458615c3807eSMatan Azrad u8 reserved_at_800[0x80]; 458715c3807eSMatan Azrad }; 458815c3807eSMatan Azrad 458915c3807eSMatan Azrad struct mlx5_ifc_init2rtr_qp_out_bits { 459015c3807eSMatan Azrad u8 status[0x8]; 459115c3807eSMatan Azrad u8 reserved_at_8[0x18]; 459215c3807eSMatan Azrad u8 syndrome[0x20]; 459315c3807eSMatan Azrad u8 reserved_at_40[0x40]; 459415c3807eSMatan Azrad }; 459515c3807eSMatan Azrad 459615c3807eSMatan Azrad struct mlx5_ifc_init2rtr_qp_in_bits { 459715c3807eSMatan Azrad u8 opcode[0x10]; 459815c3807eSMatan Azrad u8 uid[0x10]; 459915c3807eSMatan Azrad u8 reserved_at_20[0x10]; 460015c3807eSMatan Azrad u8 op_mod[0x10]; 460115c3807eSMatan Azrad u8 reserved_at_40[0x8]; 460215c3807eSMatan Azrad u8 qpn[0x18]; 460315c3807eSMatan Azrad u8 reserved_at_60[0x20]; 460415c3807eSMatan Azrad u8 opt_param_mask[0x20]; 460515c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 460615c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 460715c3807eSMatan Azrad u8 reserved_at_800[0x80]; 460815c3807eSMatan Azrad }; 460915c3807eSMatan Azrad 461015c3807eSMatan Azrad struct mlx5_ifc_init2init_qp_out_bits { 461115c3807eSMatan Azrad u8 status[0x8]; 461215c3807eSMatan Azrad u8 reserved_at_8[0x18]; 461315c3807eSMatan Azrad u8 syndrome[0x20]; 461415c3807eSMatan Azrad u8 reserved_at_40[0x40]; 461515c3807eSMatan Azrad }; 461615c3807eSMatan Azrad 461715c3807eSMatan Azrad struct mlx5_ifc_init2init_qp_in_bits { 461815c3807eSMatan Azrad u8 opcode[0x10]; 461915c3807eSMatan Azrad u8 uid[0x10]; 462015c3807eSMatan Azrad u8 reserved_at_20[0x10]; 462115c3807eSMatan Azrad u8 op_mod[0x10]; 462215c3807eSMatan Azrad u8 reserved_at_40[0x8]; 462315c3807eSMatan Azrad u8 qpn[0x18]; 462415c3807eSMatan Azrad u8 reserved_at_60[0x20]; 462515c3807eSMatan Azrad u8 opt_param_mask[0x20]; 462615c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 462715c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 462815c3807eSMatan Azrad u8 reserved_at_800[0x80]; 462915c3807eSMatan Azrad }; 463015c3807eSMatan Azrad 4631de45de90SYajun Wu struct mlx5_ifc_2rst_qp_out_bits { 4632de45de90SYajun Wu u8 status[0x8]; 4633de45de90SYajun Wu u8 reserved_at_8[0x18]; 4634de45de90SYajun Wu u8 syndrome[0x20]; 4635de45de90SYajun Wu u8 reserved_at_40[0x40]; 4636de45de90SYajun Wu }; 4637de45de90SYajun Wu 4638de45de90SYajun Wu struct mlx5_ifc_2rst_qp_in_bits { 4639de45de90SYajun Wu u8 opcode[0x10]; 4640de45de90SYajun Wu u8 uid[0x10]; 4641de45de90SYajun Wu u8 vhca_tunnel_id[0x10]; 4642de45de90SYajun Wu u8 op_mod[0x10]; 4643de45de90SYajun Wu u8 reserved_at_80[0x8]; 4644de45de90SYajun Wu u8 qpn[0x18]; 4645de45de90SYajun Wu u8 reserved_at_a0[0x20]; 4646de45de90SYajun Wu }; 4647de45de90SYajun Wu 46487ae7f458STal Shnaiderman struct mlx5_ifc_dealloc_pd_out_bits { 46497ae7f458STal Shnaiderman u8 status[0x8]; 46507ae7f458STal Shnaiderman u8 reserved_0[0x18]; 46517ae7f458STal Shnaiderman u8 syndrome[0x20]; 46527ae7f458STal Shnaiderman u8 reserved_1[0x40]; 46537ae7f458STal Shnaiderman }; 46547ae7f458STal Shnaiderman 46557ae7f458STal Shnaiderman struct mlx5_ifc_dealloc_pd_in_bits { 46567ae7f458STal Shnaiderman u8 opcode[0x10]; 46577ae7f458STal Shnaiderman u8 reserved_0[0x10]; 46587ae7f458STal Shnaiderman u8 reserved_1[0x10]; 46597ae7f458STal Shnaiderman u8 op_mod[0x10]; 46607ae7f458STal Shnaiderman u8 reserved_2[0x8]; 46617ae7f458STal Shnaiderman u8 pd[0x18]; 46627ae7f458STal Shnaiderman u8 reserved_3[0x20]; 46637ae7f458STal Shnaiderman }; 46647ae7f458STal Shnaiderman 46657ae7f458STal Shnaiderman struct mlx5_ifc_alloc_pd_out_bits { 46667ae7f458STal Shnaiderman u8 status[0x8]; 46677ae7f458STal Shnaiderman u8 reserved_0[0x18]; 46687ae7f458STal Shnaiderman u8 syndrome[0x20]; 46697ae7f458STal Shnaiderman u8 reserved_1[0x8]; 46707ae7f458STal Shnaiderman u8 pd[0x18]; 46717ae7f458STal Shnaiderman u8 reserved_2[0x20]; 46727ae7f458STal Shnaiderman }; 46737ae7f458STal Shnaiderman 46747ae7f458STal Shnaiderman struct mlx5_ifc_alloc_pd_in_bits { 46757ae7f458STal Shnaiderman u8 opcode[0x10]; 46767ae7f458STal Shnaiderman u8 reserved_0[0x10]; 46777ae7f458STal Shnaiderman u8 reserved_1[0x10]; 46787ae7f458STal Shnaiderman u8 op_mod[0x10]; 46797ae7f458STal Shnaiderman u8 reserved_2[0x40]; 46807ae7f458STal Shnaiderman }; 46817ae7f458STal Shnaiderman 468215c3807eSMatan Azrad #ifdef PEDANTIC 468315c3807eSMatan Azrad #pragma GCC diagnostic ignored "-Wpedantic" 468415c3807eSMatan Azrad #endif 468515c3807eSMatan Azrad struct mlx5_ifc_query_qp_out_bits { 468615c3807eSMatan Azrad u8 status[0x8]; 468715c3807eSMatan Azrad u8 reserved_at_8[0x18]; 468815c3807eSMatan Azrad u8 syndrome[0x20]; 468915c3807eSMatan Azrad u8 reserved_at_40[0x40]; 469015c3807eSMatan Azrad u8 opt_param_mask[0x20]; 469115c3807eSMatan Azrad u8 reserved_at_a0[0x20]; 469215c3807eSMatan Azrad struct mlx5_ifc_qpc_bits qpc; 469315c3807eSMatan Azrad u8 reserved_at_800[0x80]; 4694013b4c52SBruce Richardson u8 pas[][0x40]; 469515c3807eSMatan Azrad }; 469615c3807eSMatan Azrad #ifdef PEDANTIC 469715c3807eSMatan Azrad #pragma GCC diagnostic error "-Wpedantic" 469815c3807eSMatan Azrad #endif 469915c3807eSMatan Azrad 470015c3807eSMatan Azrad struct mlx5_ifc_query_qp_in_bits { 470115c3807eSMatan Azrad u8 opcode[0x10]; 470215c3807eSMatan Azrad u8 reserved_at_10[0x10]; 470315c3807eSMatan Azrad u8 reserved_at_20[0x10]; 470415c3807eSMatan Azrad u8 op_mod[0x10]; 470515c3807eSMatan Azrad u8 reserved_at_40[0x8]; 470615c3807eSMatan Azrad u8 qpn[0x18]; 470715c3807eSMatan Azrad u8 reserved_at_60[0x20]; 470815c3807eSMatan Azrad }; 470915c3807eSMatan Azrad 471079a7e409SViacheslav Ovsiienko enum { 471179a7e409SViacheslav Ovsiienko MLX5_DATA_RATE = 0x0, 471279a7e409SViacheslav Ovsiienko MLX5_WQE_RATE = 0x1, 471379a7e409SViacheslav Ovsiienko }; 471479a7e409SViacheslav Ovsiienko 471579a7e409SViacheslav Ovsiienko struct mlx5_ifc_set_pp_rate_limit_context_bits { 471679a7e409SViacheslav Ovsiienko u8 rate_limit[0x20]; 471779a7e409SViacheslav Ovsiienko u8 burst_upper_bound[0x20]; 471879a7e409SViacheslav Ovsiienko u8 reserved_at_40[0xC]; 471979a7e409SViacheslav Ovsiienko u8 rate_mode[0x4]; 472079a7e409SViacheslav Ovsiienko u8 typical_packet_size[0x10]; 472179a7e409SViacheslav Ovsiienko u8 reserved_at_60[0x120]; 472279a7e409SViacheslav Ovsiienko }; 472379a7e409SViacheslav Ovsiienko 4724bb7ef9a9SViacheslav Ovsiienko #define MLX5_ACCESS_REGISTER_DATA_DWORD_MAX 8u 4725bb7ef9a9SViacheslav Ovsiienko 4726bb7ef9a9SViacheslav Ovsiienko #ifdef PEDANTIC 4727bb7ef9a9SViacheslav Ovsiienko #pragma GCC diagnostic ignored "-Wpedantic" 4728bb7ef9a9SViacheslav Ovsiienko #endif 4729bb7ef9a9SViacheslav Ovsiienko struct mlx5_ifc_access_register_out_bits { 4730bb7ef9a9SViacheslav Ovsiienko u8 status[0x8]; 4731bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_8[0x18]; 4732bb7ef9a9SViacheslav Ovsiienko u8 syndrome[0x20]; 4733bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_40[0x40]; 4734013b4c52SBruce Richardson u8 register_data[][0x20]; 4735bb7ef9a9SViacheslav Ovsiienko }; 4736bb7ef9a9SViacheslav Ovsiienko 4737bb7ef9a9SViacheslav Ovsiienko struct mlx5_ifc_access_register_in_bits { 4738bb7ef9a9SViacheslav Ovsiienko u8 opcode[0x10]; 4739bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_10[0x10]; 4740bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_20[0x10]; 4741bb7ef9a9SViacheslav Ovsiienko u8 op_mod[0x10]; 4742bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_40[0x10]; 4743bb7ef9a9SViacheslav Ovsiienko u8 register_id[0x10]; 4744bb7ef9a9SViacheslav Ovsiienko u8 argument[0x20]; 4745013b4c52SBruce Richardson u8 register_data[][0x20]; 4746bb7ef9a9SViacheslav Ovsiienko }; 4747bb7ef9a9SViacheslav Ovsiienko #ifdef PEDANTIC 4748bb7ef9a9SViacheslav Ovsiienko #pragma GCC diagnostic error "-Wpedantic" 4749bb7ef9a9SViacheslav Ovsiienko #endif 4750bb7ef9a9SViacheslav Ovsiienko 4751bb7ef9a9SViacheslav Ovsiienko enum { 4752bb7ef9a9SViacheslav Ovsiienko MLX5_ACCESS_REGISTER_IN_OP_MOD_WRITE = 0x0, 4753bb7ef9a9SViacheslav Ovsiienko MLX5_ACCESS_REGISTER_IN_OP_MOD_READ = 0x1, 4754bb7ef9a9SViacheslav Ovsiienko }; 4755bb7ef9a9SViacheslav Ovsiienko 4756bb7ef9a9SViacheslav Ovsiienko enum { 4757bb7ef9a9SViacheslav Ovsiienko MLX5_REGISTER_ID_MTUTC = 0x9055, 4758f85e9a39SDekel Peled MLX5_CRYPTO_OPERATIONAL_REGISTER_ID = 0xC002, 4759f85e9a39SDekel Peled MLX5_CRYPTO_COMMISSIONING_REGISTER_ID = 0xC003, 4760f85e9a39SDekel Peled MLX5_IMPORT_KEK_HANDLE_REGISTER_ID = 0xC004, 4761f85e9a39SDekel Peled MLX5_CREDENTIAL_HANDLE_REGISTER_ID = 0xC005, 47622235fcdaSSpike Du MLX5_QSHR_REGISTER_ID = 0x4030, 4763bb7ef9a9SViacheslav Ovsiienko }; 4764bb7ef9a9SViacheslav Ovsiienko 4765bb7ef9a9SViacheslav Ovsiienko struct mlx5_ifc_register_mtutc_bits { 4766bb7ef9a9SViacheslav Ovsiienko u8 time_stamp_mode[0x2]; 4767bb7ef9a9SViacheslav Ovsiienko u8 time_stamp_state[0x2]; 4768bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_4[0x18]; 4769bb7ef9a9SViacheslav Ovsiienko u8 operation[0x4]; 4770bb7ef9a9SViacheslav Ovsiienko u8 freq_adjustment[0x20]; 4771bb7ef9a9SViacheslav Ovsiienko u8 reserved_at_40[0x40]; 4772bb7ef9a9SViacheslav Ovsiienko u8 utc_sec[0x20]; 4773bb7ef9a9SViacheslav Ovsiienko u8 utc_nsec[0x20]; 4774bb7ef9a9SViacheslav Ovsiienko u8 time_adjustment[0x20]; 4775bb7ef9a9SViacheslav Ovsiienko }; 4776bb7ef9a9SViacheslav Ovsiienko 47772235fcdaSSpike Du struct mlx5_ifc_ets_global_config_register_bits { 47782235fcdaSSpike Du u8 reserved_at_0[0x2]; 47792235fcdaSSpike Du u8 rate_limit_update[0x1]; 47802235fcdaSSpike Du u8 reserved_at_3[0x29]; 47812235fcdaSSpike Du u8 max_bw_units[0x4]; 47822235fcdaSSpike Du u8 reserved_at_48[0x8]; 47832235fcdaSSpike Du u8 max_bw_value[0x8]; 47842235fcdaSSpike Du }; 47852235fcdaSSpike Du 47862235fcdaSSpike Du #define ETS_GLOBAL_CONFIG_BW_UNIT_DISABLED 0x0 47872235fcdaSSpike Du #define ETS_GLOBAL_CONFIG_BW_UNIT_HUNDREDS_MBPS 0x3 47882235fcdaSSpike Du #define ETS_GLOBAL_CONFIG_BW_UNIT_GBPS 0x4 47892235fcdaSSpike Du 47902235fcdaSSpike Du struct mlx5_ifc_register_qshr_bits { 47912235fcdaSSpike Du u8 reserved_at_0[0x4]; 47922235fcdaSSpike Du u8 connected_host[0x1]; 47932235fcdaSSpike Du u8 vqos[0x1]; 47942235fcdaSSpike Du u8 fast_response[0x1]; 47952235fcdaSSpike Du u8 reserved_at_7[0x1]; 47962235fcdaSSpike Du u8 local_port[0x8]; 47972235fcdaSSpike Du u8 reserved_at_16[0x230]; 47982235fcdaSSpike Du struct mlx5_ifc_ets_global_config_register_bits global_config; 47992235fcdaSSpike Du }; 48002235fcdaSSpike Du 4801bb7ef9a9SViacheslav Ovsiienko #define MLX5_MTUTC_TIMESTAMP_MODE_INTERNAL_TIMER 0 4802bb7ef9a9SViacheslav Ovsiienko #define MLX5_MTUTC_TIMESTAMP_MODE_REAL_TIME 1 4803bb7ef9a9SViacheslav Ovsiienko 4804f85e9a39SDekel Peled struct mlx5_ifc_crypto_operational_register_bits { 4805f85e9a39SDekel Peled u8 wrapped_crypto_operational[0x1]; 4806f85e9a39SDekel Peled u8 reserved_at_1[0x1b]; 4807f85e9a39SDekel Peled u8 kek_size[0x4]; 4808f85e9a39SDekel Peled u8 reserved_at_20[0x20]; 4809f85e9a39SDekel Peled u8 credential[0x140]; 4810f85e9a39SDekel Peled u8 kek[0x100]; 4811f85e9a39SDekel Peled u8 reserved_at_280[0x180]; 4812f85e9a39SDekel Peled }; 4813f85e9a39SDekel Peled 4814f12c41bfSRaja Zidane struct mlx5_ifc_crypto_caps_bits { 4815f12c41bfSRaja Zidane u8 wrapped_crypto_operational[0x1]; 4816f12c41bfSRaja Zidane u8 wrapped_crypto_going_to_commissioning[0x1]; 4817f12c41bfSRaja Zidane u8 sw_wrapped_dek[0x1]; 4818f12c41bfSRaja Zidane u8 synchronize_dek[0x1]; 4819f12c41bfSRaja Zidane u8 int_kek_manual[0x1]; 4820f12c41bfSRaja Zidane u8 int_kek_auto[0x1]; 482104da07e6SSuanming Mou u8 reserved_at_6[0xd]; 482204da07e6SSuanming Mou u8 sw_wrapped_dek_key_purpose[0x1]; 482304da07e6SSuanming Mou u8 reserved_at_14[0x4]; 4824f12c41bfSRaja Zidane u8 wrapped_import_method[0x8]; 4825f12c41bfSRaja Zidane u8 reserved_at_20[0x3]; 4826f12c41bfSRaja Zidane u8 log_dek_max_alloc[0x5]; 4827f12c41bfSRaja Zidane u8 reserved_at_28[0x3]; 4828f12c41bfSRaja Zidane u8 log_max_num_deks[0x5]; 4829f12c41bfSRaja Zidane u8 reserved_at_30[0x3]; 4830f12c41bfSRaja Zidane u8 log_max_num_import_keks[0x5]; 4831f12c41bfSRaja Zidane u8 reserved_at_38[0x3]; 4832f12c41bfSRaja Zidane u8 log_max_num_creds[0x5]; 4833f12c41bfSRaja Zidane u8 failed_selftests[0x10]; 4834f12c41bfSRaja Zidane u8 num_nv_import_keks[0x8]; 4835f12c41bfSRaja Zidane u8 num_nv_credentials[0x8]; 4836f12c41bfSRaja Zidane u8 reserved_at_60[0x3]; 4837f12c41bfSRaja Zidane u8 log_dek_granularity[0x5]; 4838f12c41bfSRaja Zidane u8 reserved_at_68[0x3]; 4839f12c41bfSRaja Zidane u8 log_max_num_int_kek[0x5]; 484004da07e6SSuanming Mou u8 sw_wrapped_dek_new[0x10]; 484104da07e6SSuanming Mou u8 reserved_at_80[0x80]; 484204da07e6SSuanming Mou u8 crypto_mmo_qp[0x1]; 484304da07e6SSuanming Mou u8 crypto_aes_gcm_256_encrypt[0x1]; 484404da07e6SSuanming Mou u8 crypto_aes_gcm_128_encrypt[0x1]; 484504da07e6SSuanming Mou u8 crypto_aes_gcm_256_decrypt[0x1]; 484604da07e6SSuanming Mou u8 crypto_aes_gcm_128_decrypt[0x1]; 484704da07e6SSuanming Mou u8 gcm_auth_tag_128[0x1]; 484804da07e6SSuanming Mou u8 gcm_auth_tag_96[0x1]; 484904da07e6SSuanming Mou u8 reserved_at_107[0x3]; 485004da07e6SSuanming Mou u8 log_crypto_mmo_max_size[0x6]; 485104da07e6SSuanming Mou u8 reserved_at_110[0x10]; 485204da07e6SSuanming Mou u8 reserved_at_120[0x6e0]; 4853f12c41bfSRaja Zidane }; 4854f12c41bfSRaja Zidane 4855f85e9a39SDekel Peled struct mlx5_ifc_crypto_commissioning_register_bits { 4856f85e9a39SDekel Peled u8 token[0x1]; /* TODO: add size after PRM update */ 4857f85e9a39SDekel Peled }; 4858f85e9a39SDekel Peled 4859f85e9a39SDekel Peled struct mlx5_ifc_import_kek_handle_register_bits { 4860f85e9a39SDekel Peled struct mlx5_ifc_crypto_login_bits crypto_login_object; 4861f85e9a39SDekel Peled struct mlx5_ifc_import_kek_bits import_kek_object; 4862f85e9a39SDekel Peled u8 reserved_at_200[0x4]; 4863f85e9a39SDekel Peled u8 write_operation[0x4]; 4864f85e9a39SDekel Peled u8 import_kek_id[0x18]; 4865f85e9a39SDekel Peled u8 reserved_at_220[0xe0]; 4866f85e9a39SDekel Peled }; 4867f85e9a39SDekel Peled 4868f85e9a39SDekel Peled struct mlx5_ifc_credential_handle_register_bits { 4869f85e9a39SDekel Peled struct mlx5_ifc_crypto_login_bits crypto_login_object; 4870f85e9a39SDekel Peled struct mlx5_ifc_credential_bits credential_object; 4871f85e9a39SDekel Peled u8 reserved_at_200[0x4]; 4872f85e9a39SDekel Peled u8 write_operation[0x4]; 4873f85e9a39SDekel Peled u8 credential_id[0x18]; 4874f85e9a39SDekel Peled u8 reserved_at_220[0xe0]; 4875f85e9a39SDekel Peled }; 4876f85e9a39SDekel Peled 4877f85e9a39SDekel Peled enum { 4878f85e9a39SDekel Peled MLX5_REGISTER_ADD_OPERATION = 0x1, 4879f85e9a39SDekel Peled MLX5_REGISTER_DELETE_OPERATION = 0x2, 4880f85e9a39SDekel Peled }; 4881f85e9a39SDekel Peled 488238119ebeSBing Zhao struct mlx5_ifc_parse_graph_arc_bits { 488338119ebeSBing Zhao u8 start_inner_tunnel[0x1]; 488438119ebeSBing Zhao u8 reserved_at_1[0x7]; 488538119ebeSBing Zhao u8 arc_parse_graph_node[0x8]; 488638119ebeSBing Zhao u8 compare_condition_value[0x10]; 488738119ebeSBing Zhao u8 parse_graph_node_handle[0x20]; 488838119ebeSBing Zhao u8 reserved_at_40[0x40]; 488938119ebeSBing Zhao }; 489038119ebeSBing Zhao 489138119ebeSBing Zhao struct mlx5_ifc_parse_graph_flow_match_sample_bits { 489238119ebeSBing Zhao u8 flow_match_sample_en[0x1]; 489338119ebeSBing Zhao u8 reserved_at_1[0x3]; 489438119ebeSBing Zhao u8 flow_match_sample_offset_mode[0x4]; 489538119ebeSBing Zhao u8 reserved_at_5[0x8]; 489638119ebeSBing Zhao u8 flow_match_sample_field_offset[0x10]; 489738119ebeSBing Zhao u8 reserved_at_32[0x4]; 489838119ebeSBing Zhao u8 flow_match_sample_field_offset_shift[0x4]; 489938119ebeSBing Zhao u8 flow_match_sample_field_base_offset[0x8]; 490038119ebeSBing Zhao u8 reserved_at_48[0xd]; 490138119ebeSBing Zhao u8 flow_match_sample_tunnel_mode[0x3]; 490238119ebeSBing Zhao u8 flow_match_sample_field_offset_mask[0x20]; 490338119ebeSBing Zhao u8 flow_match_sample_field_id[0x20]; 490438119ebeSBing Zhao }; 490538119ebeSBing Zhao 490638119ebeSBing Zhao struct mlx5_ifc_parse_graph_flex_bits { 490738119ebeSBing Zhao u8 modify_field_select[0x40]; 490838119ebeSBing Zhao u8 reserved_at_64[0x20]; 490938119ebeSBing Zhao u8 header_length_base_value[0x10]; 491038119ebeSBing Zhao u8 reserved_at_112[0x4]; 491138119ebeSBing Zhao u8 header_length_field_shift[0x4]; 491238119ebeSBing Zhao u8 reserved_at_120[0x4]; 491338119ebeSBing Zhao u8 header_length_mode[0x4]; 491438119ebeSBing Zhao u8 header_length_field_offset[0x10]; 491538119ebeSBing Zhao u8 next_header_field_offset[0x10]; 4916f1324a17SRongwei Liu u8 reserved_at_160[0x12]; 4917f1324a17SRongwei Liu u8 head_anchor_id[0x6]; 4918f1324a17SRongwei Liu u8 reserved_at_178[0x3]; 491938119ebeSBing Zhao u8 next_header_field_size[0x5]; 492038119ebeSBing Zhao u8 header_length_field_mask[0x20]; 492138119ebeSBing Zhao u8 reserved_at_224[0x20]; 492238119ebeSBing Zhao struct mlx5_ifc_parse_graph_flow_match_sample_bits sample_table[0x8]; 492338119ebeSBing Zhao struct mlx5_ifc_parse_graph_arc_bits input_arc[0x8]; 492438119ebeSBing Zhao struct mlx5_ifc_parse_graph_arc_bits output_arc[0x8]; 492538119ebeSBing Zhao }; 492638119ebeSBing Zhao 492738119ebeSBing Zhao struct mlx5_ifc_create_flex_parser_in_bits { 492838119ebeSBing Zhao struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 492938119ebeSBing Zhao struct mlx5_ifc_parse_graph_flex_bits flex; 493038119ebeSBing Zhao }; 493138119ebeSBing Zhao 493238119ebeSBing Zhao struct mlx5_ifc_create_flex_parser_out_bits { 493338119ebeSBing Zhao struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; 493438119ebeSBing Zhao struct mlx5_ifc_parse_graph_flex_bits flex; 493538119ebeSBing Zhao }; 493638119ebeSBing Zhao 493738119ebeSBing Zhao struct mlx5_ifc_parse_graph_flex_out_bits { 493838119ebeSBing Zhao u8 status[0x8]; 493938119ebeSBing Zhao u8 reserved_at_8[0x18]; 494038119ebeSBing Zhao u8 syndrome[0x20]; 494138119ebeSBing Zhao u8 reserved_at_40[0x40]; 494238119ebeSBing Zhao struct mlx5_ifc_parse_graph_flex_bits capability; 494338119ebeSBing Zhao }; 494438119ebeSBing Zhao 49459428310aSOri Kam struct regexp_params_field_select_bits { 49461663c140SAdy Agbarih u8 reserved_at_0[0x1d]; 49471663c140SAdy Agbarih u8 rof_mkey[0x1]; 49489428310aSOri Kam u8 stop_engine[0x1]; 49491663c140SAdy Agbarih u8 reserved_at_1f[0x1]; 49509428310aSOri Kam }; 49519428310aSOri Kam 49529428310aSOri Kam struct mlx5_ifc_regexp_params_bits { 49539428310aSOri Kam u8 reserved_at_0[0x1f]; 49549428310aSOri Kam u8 stop_engine[0x1]; 49551663c140SAdy Agbarih u8 reserved_at_20[0x60]; 49561663c140SAdy Agbarih u8 rof_mkey[0x20]; 49571663c140SAdy Agbarih u8 rof_size[0x20]; 49581663c140SAdy Agbarih u8 rof_mkey_va[0x40]; 49591663c140SAdy Agbarih u8 reserved_at_100[0x80]; 49609428310aSOri Kam }; 49619428310aSOri Kam 49629428310aSOri Kam struct mlx5_ifc_set_regexp_params_in_bits { 49639428310aSOri Kam u8 opcode[0x10]; 49649428310aSOri Kam u8 uid[0x10]; 49659428310aSOri Kam u8 reserved_at_20[0x10]; 49669428310aSOri Kam u8 op_mod[0x10]; 49679428310aSOri Kam u8 reserved_at_40[0x18]; 49689428310aSOri Kam u8 engine_id[0x8]; 49699428310aSOri Kam struct regexp_params_field_select_bits field_select; 49709428310aSOri Kam struct mlx5_ifc_regexp_params_bits regexp_params; 49719428310aSOri Kam }; 49729428310aSOri Kam 49739428310aSOri Kam struct mlx5_ifc_set_regexp_params_out_bits { 49749428310aSOri Kam u8 status[0x8]; 49759428310aSOri Kam u8 reserved_at_8[0x18]; 49769428310aSOri Kam u8 syndrome[0x20]; 49779428310aSOri Kam u8 reserved_at_18[0x40]; 49789428310aSOri Kam }; 49799428310aSOri Kam 49809428310aSOri Kam struct mlx5_ifc_query_regexp_params_in_bits { 49819428310aSOri Kam u8 opcode[0x10]; 49829428310aSOri Kam u8 uid[0x10]; 49839428310aSOri Kam u8 reserved_at_20[0x10]; 49849428310aSOri Kam u8 op_mod[0x10]; 49859428310aSOri Kam u8 reserved_at_40[0x18]; 49869428310aSOri Kam u8 engine_id[0x8]; 49879428310aSOri Kam u8 reserved[0x20]; 49889428310aSOri Kam }; 49899428310aSOri Kam 49909428310aSOri Kam struct mlx5_ifc_query_regexp_params_out_bits { 49919428310aSOri Kam u8 status[0x8]; 49929428310aSOri Kam u8 reserved_at_8[0x18]; 49939428310aSOri Kam u8 syndrome[0x20]; 49949428310aSOri Kam u8 reserved[0x40]; 49959428310aSOri Kam struct mlx5_ifc_regexp_params_bits regexp_params; 49969428310aSOri Kam }; 49979428310aSOri Kam 49989428310aSOri Kam struct mlx5_ifc_set_regexp_register_in_bits { 49999428310aSOri Kam u8 opcode[0x10]; 50009428310aSOri Kam u8 uid[0x10]; 50019428310aSOri Kam u8 reserved_at_20[0x10]; 50029428310aSOri Kam u8 op_mod[0x10]; 50039428310aSOri Kam u8 reserved_at_40[0x18]; 50049428310aSOri Kam u8 engine_id[0x8]; 50059428310aSOri Kam u8 register_address[0x20]; 50069428310aSOri Kam u8 register_data[0x20]; 5007c044dfbdSYuval Avnery u8 reserved[0x60]; 50089428310aSOri Kam }; 50099428310aSOri Kam 50109428310aSOri Kam struct mlx5_ifc_set_regexp_register_out_bits { 50119428310aSOri Kam u8 status[0x8]; 50129428310aSOri Kam u8 reserved_at_8[0x18]; 50139428310aSOri Kam u8 syndrome[0x20]; 50149428310aSOri Kam u8 reserved[0x40]; 50159428310aSOri Kam }; 50169428310aSOri Kam 50179428310aSOri Kam struct mlx5_ifc_query_regexp_register_in_bits { 50189428310aSOri Kam u8 opcode[0x10]; 50199428310aSOri Kam u8 uid[0x10]; 50209428310aSOri Kam u8 reserved_at_20[0x10]; 50219428310aSOri Kam u8 op_mod[0x10]; 50229428310aSOri Kam u8 reserved_at_40[0x18]; 50239428310aSOri Kam u8 engine_id[0x8]; 50249428310aSOri Kam u8 register_address[0x20]; 50259428310aSOri Kam }; 50269428310aSOri Kam 50279428310aSOri Kam struct mlx5_ifc_query_regexp_register_out_bits { 50289428310aSOri Kam u8 status[0x8]; 50299428310aSOri Kam u8 reserved_at_8[0x18]; 50309428310aSOri Kam u8 syndrome[0x20]; 50319428310aSOri Kam u8 reserved[0x20]; 50329428310aSOri Kam u8 register_data[0x20]; 50339428310aSOri Kam }; 50349428310aSOri Kam 5035750e48c7SMatan Azrad /* Queue counters. */ 5036750e48c7SMatan Azrad struct mlx5_ifc_alloc_q_counter_out_bits { 5037750e48c7SMatan Azrad u8 status[0x8]; 5038750e48c7SMatan Azrad u8 reserved_at_8[0x18]; 5039750e48c7SMatan Azrad u8 syndrome[0x20]; 5040750e48c7SMatan Azrad u8 reserved_at_40[0x18]; 5041750e48c7SMatan Azrad u8 counter_set_id[0x8]; 5042750e48c7SMatan Azrad u8 reserved_at_60[0x20]; 5043750e48c7SMatan Azrad }; 5044750e48c7SMatan Azrad 5045750e48c7SMatan Azrad struct mlx5_ifc_alloc_q_counter_in_bits { 5046750e48c7SMatan Azrad u8 opcode[0x10]; 5047750e48c7SMatan Azrad u8 uid[0x10]; 5048750e48c7SMatan Azrad u8 reserved_at_20[0x10]; 5049750e48c7SMatan Azrad u8 op_mod[0x10]; 5050750e48c7SMatan Azrad u8 reserved_at_40[0x40]; 5051750e48c7SMatan Azrad }; 5052750e48c7SMatan Azrad 5053750e48c7SMatan Azrad struct mlx5_ifc_query_q_counter_out_bits { 5054750e48c7SMatan Azrad u8 status[0x8]; 5055750e48c7SMatan Azrad u8 reserved_at_8[0x18]; 5056750e48c7SMatan Azrad u8 syndrome[0x20]; 5057750e48c7SMatan Azrad u8 reserved_at_40[0x40]; 5058750e48c7SMatan Azrad u8 rx_write_requests[0x20]; 5059750e48c7SMatan Azrad u8 reserved_at_a0[0x20]; 5060750e48c7SMatan Azrad u8 rx_read_requests[0x20]; 5061750e48c7SMatan Azrad u8 reserved_at_e0[0x20]; 5062750e48c7SMatan Azrad u8 rx_atomic_requests[0x20]; 5063750e48c7SMatan Azrad u8 reserved_at_120[0x20]; 5064750e48c7SMatan Azrad u8 rx_dct_connect[0x20]; 5065750e48c7SMatan Azrad u8 reserved_at_160[0x20]; 5066750e48c7SMatan Azrad u8 out_of_buffer[0x20]; 5067750e48c7SMatan Azrad u8 reserved_at_1a0[0x20]; 5068750e48c7SMatan Azrad u8 out_of_sequence[0x20]; 5069750e48c7SMatan Azrad u8 reserved_at_1e0[0x20]; 5070750e48c7SMatan Azrad u8 duplicate_request[0x20]; 5071750e48c7SMatan Azrad u8 reserved_at_220[0x20]; 5072750e48c7SMatan Azrad u8 rnr_nak_retry_err[0x20]; 5073750e48c7SMatan Azrad u8 reserved_at_260[0x20]; 5074750e48c7SMatan Azrad u8 packet_seq_err[0x20]; 5075750e48c7SMatan Azrad u8 reserved_at_2a0[0x20]; 5076750e48c7SMatan Azrad u8 implied_nak_seq_err[0x20]; 5077750e48c7SMatan Azrad u8 reserved_at_2e0[0x20]; 5078750e48c7SMatan Azrad u8 local_ack_timeout_err[0x20]; 5079750e48c7SMatan Azrad u8 reserved_at_320[0xa0]; 5080750e48c7SMatan Azrad u8 resp_local_length_error[0x20]; 5081750e48c7SMatan Azrad u8 req_local_length_error[0x20]; 5082750e48c7SMatan Azrad u8 resp_local_qp_error[0x20]; 5083750e48c7SMatan Azrad u8 local_operation_error[0x20]; 5084750e48c7SMatan Azrad u8 resp_local_protection[0x20]; 5085750e48c7SMatan Azrad u8 req_local_protection[0x20]; 5086750e48c7SMatan Azrad u8 resp_cqe_error[0x20]; 5087750e48c7SMatan Azrad u8 req_cqe_error[0x20]; 5088750e48c7SMatan Azrad u8 req_mw_binding[0x20]; 5089750e48c7SMatan Azrad u8 req_bad_response[0x20]; 5090750e48c7SMatan Azrad u8 req_remote_invalid_request[0x20]; 5091750e48c7SMatan Azrad u8 resp_remote_invalid_request[0x20]; 5092750e48c7SMatan Azrad u8 req_remote_access_errors[0x20]; 5093750e48c7SMatan Azrad u8 resp_remote_access_errors[0x20]; 5094750e48c7SMatan Azrad u8 req_remote_operation_errors[0x20]; 5095750e48c7SMatan Azrad u8 req_transport_retries_exceeded[0x20]; 5096750e48c7SMatan Azrad u8 cq_overflow[0x20]; 5097750e48c7SMatan Azrad u8 resp_cqe_flush_error[0x20]; 5098750e48c7SMatan Azrad u8 req_cqe_flush_error[0x20]; 5099750e48c7SMatan Azrad u8 reserved_at_620[0x1e0]; 5100750e48c7SMatan Azrad }; 5101750e48c7SMatan Azrad 5102750e48c7SMatan Azrad struct mlx5_ifc_query_q_counter_in_bits { 5103750e48c7SMatan Azrad u8 opcode[0x10]; 5104750e48c7SMatan Azrad u8 uid[0x10]; 5105750e48c7SMatan Azrad u8 reserved_at_20[0x10]; 5106750e48c7SMatan Azrad u8 op_mod[0x10]; 5107750e48c7SMatan Azrad u8 reserved_at_40[0x80]; 5108750e48c7SMatan Azrad u8 clear[0x1]; 5109750e48c7SMatan Azrad u8 reserved_at_c1[0x1f]; 5110750e48c7SMatan Azrad u8 reserved_at_e0[0x18]; 5111750e48c7SMatan Azrad u8 counter_set_id[0x8]; 5112750e48c7SMatan Azrad }; 5113750e48c7SMatan Azrad 5114365cdf5fSErez Shitrit enum { 5115365cdf5fSErez Shitrit FS_FT_NIC_RX = 0x0, 5116365cdf5fSErez Shitrit FS_FT_NIC_TX = 0x1, 5117365cdf5fSErez Shitrit FS_FT_FDB = 0x4, 5118365cdf5fSErez Shitrit FS_FT_FDB_RX = 0xa, 5119365cdf5fSErez Shitrit FS_FT_FDB_TX = 0xb, 5120365cdf5fSErez Shitrit }; 5121365cdf5fSErez Shitrit 5122365cdf5fSErez Shitrit struct mlx5_ifc_flow_table_context_bits { 5123365cdf5fSErez Shitrit u8 reformat_en[0x1]; 5124365cdf5fSErez Shitrit u8 decap_en[0x1]; 5125365cdf5fSErez Shitrit u8 sw_owner[0x1]; 5126365cdf5fSErez Shitrit u8 termination_table[0x1]; 5127365cdf5fSErez Shitrit u8 table_miss_action[0x4]; 5128365cdf5fSErez Shitrit u8 level[0x8]; 5129365cdf5fSErez Shitrit u8 rtc_valid[0x1]; 5130365cdf5fSErez Shitrit u8 reserved_at_11[0x7]; 5131365cdf5fSErez Shitrit u8 log_size[0x8]; 5132365cdf5fSErez Shitrit 5133365cdf5fSErez Shitrit u8 reserved_at_20[0x8]; 5134365cdf5fSErez Shitrit u8 table_miss_id[0x18]; 5135365cdf5fSErez Shitrit 5136365cdf5fSErez Shitrit u8 reserved_at_40[0x8]; 5137365cdf5fSErez Shitrit u8 lag_master_next_table_id[0x18]; 5138365cdf5fSErez Shitrit 5139365cdf5fSErez Shitrit u8 reserved_at_60[0x60]; 5140365cdf5fSErez Shitrit 5141004edb48SHamdan Igbaria union { 5142004edb48SHamdan Igbaria struct { 5143365cdf5fSErez Shitrit u8 rtc_id_0[0x20]; 5144365cdf5fSErez Shitrit u8 rtc_id_1[0x20]; 5145365cdf5fSErez Shitrit u8 reserved_at_100[0x40]; 5146365cdf5fSErez Shitrit }; 5147004edb48SHamdan Igbaria struct { 5148004edb48SHamdan Igbaria u8 sw_owner_icm_root_1[0x40]; 5149004edb48SHamdan Igbaria u8 sw_owner_icm_root_0[0x40]; 5150004edb48SHamdan Igbaria }; 5151004edb48SHamdan Igbaria }; 5152004edb48SHamdan Igbaria }; 5153365cdf5fSErez Shitrit 5154365cdf5fSErez Shitrit struct mlx5_ifc_create_flow_table_in_bits { 5155365cdf5fSErez Shitrit u8 opcode[0x10]; 5156365cdf5fSErez Shitrit u8 uid[0x10]; 5157365cdf5fSErez Shitrit 5158365cdf5fSErez Shitrit u8 reserved_at_20[0x10]; 5159365cdf5fSErez Shitrit u8 op_mod[0x10]; 5160365cdf5fSErez Shitrit 5161365cdf5fSErez Shitrit u8 other_vport[0x1]; 5162365cdf5fSErez Shitrit u8 reserved_at_41[0xf]; 5163365cdf5fSErez Shitrit u8 vport_number[0x10]; 5164365cdf5fSErez Shitrit 5165365cdf5fSErez Shitrit u8 reserved_at_60[0x20]; 5166365cdf5fSErez Shitrit 5167365cdf5fSErez Shitrit u8 table_type[0x8]; 5168365cdf5fSErez Shitrit u8 reserved_at_88[0x18]; 5169365cdf5fSErez Shitrit 5170365cdf5fSErez Shitrit u8 reserved_at_a0[0x20]; 5171365cdf5fSErez Shitrit 5172365cdf5fSErez Shitrit struct mlx5_ifc_flow_table_context_bits flow_table_context; 5173365cdf5fSErez Shitrit }; 5174365cdf5fSErez Shitrit 5175365cdf5fSErez Shitrit struct mlx5_ifc_create_flow_table_out_bits { 5176365cdf5fSErez Shitrit u8 status[0x8]; 5177365cdf5fSErez Shitrit u8 icm_address_63_40[0x18]; 5178365cdf5fSErez Shitrit u8 syndrome[0x20]; 5179365cdf5fSErez Shitrit u8 icm_address_39_32[0x8]; 5180365cdf5fSErez Shitrit u8 table_id[0x18]; 5181365cdf5fSErez Shitrit u8 icm_address_31_0[0x20]; 5182365cdf5fSErez Shitrit }; 5183365cdf5fSErez Shitrit 5184004edb48SHamdan Igbaria struct mlx5_ifc_query_flow_table_in_bits { 5185004edb48SHamdan Igbaria u8 opcode[0x10]; 5186004edb48SHamdan Igbaria u8 uid[0x10]; 5187004edb48SHamdan Igbaria 5188004edb48SHamdan Igbaria u8 vhca_tunnel_id[0x10]; 5189004edb48SHamdan Igbaria u8 op_mod[0x10]; 5190004edb48SHamdan Igbaria 5191004edb48SHamdan Igbaria u8 other_vport[0x1]; 5192004edb48SHamdan Igbaria u8 reserved_at_41[0xf]; 5193004edb48SHamdan Igbaria u8 vport_number[0x10]; 5194004edb48SHamdan Igbaria 5195004edb48SHamdan Igbaria u8 reserved_at_60[0x20]; 5196004edb48SHamdan Igbaria 5197004edb48SHamdan Igbaria u8 table_type[0x8]; 5198004edb48SHamdan Igbaria u8 reserved_at_88[0x18]; 5199004edb48SHamdan Igbaria 5200004edb48SHamdan Igbaria u8 reserved_at_a0[0x8]; 5201004edb48SHamdan Igbaria u8 table_id[0x18]; 5202004edb48SHamdan Igbaria 5203004edb48SHamdan Igbaria u8 reserved_at_c0[0x140]; 5204004edb48SHamdan Igbaria }; 5205004edb48SHamdan Igbaria 5206004edb48SHamdan Igbaria struct mlx5_ifc_query_flow_table_out_bits { 5207004edb48SHamdan Igbaria u8 status[0x8]; 5208004edb48SHamdan Igbaria u8 reserved_at_8[0x18]; 5209004edb48SHamdan Igbaria 5210004edb48SHamdan Igbaria u8 syndrome[0x20]; 5211004edb48SHamdan Igbaria 5212004edb48SHamdan Igbaria u8 reserved_at_40[0x80]; 5213004edb48SHamdan Igbaria 5214004edb48SHamdan Igbaria struct mlx5_ifc_flow_table_context_bits flow_table_context; 5215004edb48SHamdan Igbaria }; 5216004edb48SHamdan Igbaria 5217365cdf5fSErez Shitrit enum mlx5_flow_destination_type { 5218365cdf5fSErez Shitrit MLX5_FLOW_DESTINATION_TYPE_VPORT = 0x0, 5219e1df1578SHamdan Igbaria MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE = 0x1, 5220eefaf43dSShun Hao MLX5_FLOW_DESTINATION_TYPE_TIR = 0x2, 5221365cdf5fSErez Shitrit }; 5222365cdf5fSErez Shitrit 5223e1df1578SHamdan Igbaria enum mlx5_flow_context_action { 52242b2ce5ddSHamdan Igbaria MLX5_FLOW_CONTEXT_ACTION_DROP = 1 << 1, 5225e1df1578SHamdan Igbaria MLX5_FLOW_CONTEXT_ACTION_FWD_DEST = 1 << 2, 52262b2ce5ddSHamdan Igbaria MLX5_FLOW_CONTEXT_ACTION_REFORMAT = 1 << 4, 52272b2ce5ddSHamdan Igbaria MLX5_FLOW_CONTEXT_ACTION_DECRYPT = 1 << 12, 52282b2ce5ddSHamdan Igbaria MLX5_FLOW_CONTEXT_ACTION_ENCRYPT = 1 << 13, 5229e1df1578SHamdan Igbaria }; 5230e1df1578SHamdan Igbaria 5231e1df1578SHamdan Igbaria enum mlx5_flow_context_flow_source { 5232e1df1578SHamdan Igbaria MLX5_FLOW_CONTEXT_FLOW_SOURCE_ANY_VPORT = 0x0, 5233e1df1578SHamdan Igbaria MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK = 0x1, 5234e1df1578SHamdan Igbaria MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT = 0x2, 5235365cdf5fSErez Shitrit }; 5236365cdf5fSErez Shitrit 5237365cdf5fSErez Shitrit struct mlx5_ifc_set_fte_out_bits { 5238365cdf5fSErez Shitrit u8 status[0x8]; 5239365cdf5fSErez Shitrit u8 reserved_at_8[0x18]; 5240365cdf5fSErez Shitrit u8 syndrome[0x20]; 5241365cdf5fSErez Shitrit u8 reserved_at_40[0x40]; 5242365cdf5fSErez Shitrit }; 5243365cdf5fSErez Shitrit 5244365cdf5fSErez Shitrit struct mlx5_ifc_dest_format_bits { 5245365cdf5fSErez Shitrit u8 destination_type[0x8]; 5246365cdf5fSErez Shitrit u8 destination_id[0x18]; 5247365cdf5fSErez Shitrit u8 destination_eswitch_owner_vhca_id_valid[0x1]; 5248365cdf5fSErez Shitrit u8 packet_reformat[0x1]; 5249365cdf5fSErez Shitrit u8 reserved_at_22[0xe]; 5250365cdf5fSErez Shitrit u8 destination_eswitch_owner_vhca_id[0x10]; 5251365cdf5fSErez Shitrit }; 5252365cdf5fSErez Shitrit 5253365cdf5fSErez Shitrit struct mlx5_ifc_flow_counter_list_bits { 5254365cdf5fSErez Shitrit u8 flow_counter_id[0x20]; 5255365cdf5fSErez Shitrit u8 reserved_at_20[0x20]; 5256365cdf5fSErez Shitrit }; 5257365cdf5fSErez Shitrit 5258365cdf5fSErez Shitrit union mlx5_ifc_dest_format_flow_counter_list_auto_bits { 5259365cdf5fSErez Shitrit struct mlx5_ifc_dest_format_bits dest_format; 5260365cdf5fSErez Shitrit struct mlx5_ifc_flow_counter_list_bits flow_counter_list; 5261365cdf5fSErez Shitrit u8 reserved_at_0[0x40]; 5262365cdf5fSErez Shitrit }; 5263365cdf5fSErez Shitrit 5264eefaf43dSShun Hao struct mlx5_ifc_extended_dest_format_bits { 5265eefaf43dSShun Hao struct mlx5_ifc_dest_format_bits destination_entry; 5266eefaf43dSShun Hao 5267eefaf43dSShun Hao u8 packet_reformat_id[0x20]; 5268eefaf43dSShun Hao 5269eefaf43dSShun Hao u8 reserved_at_60[0x20]; 5270eefaf43dSShun Hao }; 5271eefaf43dSShun Hao 5272eefaf43dSShun Hao #define MLX5_IFC_MULTI_PATH_FT_MAX_LEVEL 64 5273eefaf43dSShun Hao 5274eefaf43dSShun Hao #ifdef PEDANTIC 5275eefaf43dSShun Hao #pragma GCC diagnostic ignored "-Wpedantic" 5276eefaf43dSShun Hao #endif 5277365cdf5fSErez Shitrit struct mlx5_ifc_flow_context_bits { 5278365cdf5fSErez Shitrit u8 reserved_at_00[0x20]; 5279365cdf5fSErez Shitrit u8 group_id[0x20]; 5280365cdf5fSErez Shitrit u8 reserved_at_40[0x8]; 5281365cdf5fSErez Shitrit u8 flow_tag[0x18]; 5282365cdf5fSErez Shitrit u8 reserved_at_60[0x10]; 5283365cdf5fSErez Shitrit u8 action[0x10]; 5284365cdf5fSErez Shitrit u8 extended_destination[0x1]; 5285e1df1578SHamdan Igbaria u8 reserved_at_81[0x1]; 5286e1df1578SHamdan Igbaria u8 flow_source[0x2]; 5287e1df1578SHamdan Igbaria u8 encrypt_decrypt_type[0x4]; 5288365cdf5fSErez Shitrit u8 destination_list_size[0x18]; 5289365cdf5fSErez Shitrit u8 reserved_at_a0[0x8]; 5290365cdf5fSErez Shitrit u8 flow_counter_list_size[0x18]; 5291e1df1578SHamdan Igbaria u8 packet_reformat_id[0x20]; 5292e1df1578SHamdan Igbaria u8 reserved_at_e0[0x40]; 5293e1df1578SHamdan Igbaria u8 encrypt_decrypt_obj_id[0x20]; 5294e1df1578SHamdan Igbaria u8 reserved_at_140[0x16c0]; 52950fc536d5SStephen Hemminger union mlx5_ifc_dest_format_flow_counter_list_auto_bits destination[]; 5296365cdf5fSErez Shitrit }; 5297365cdf5fSErez Shitrit 5298365cdf5fSErez Shitrit struct mlx5_ifc_set_fte_in_bits { 5299365cdf5fSErez Shitrit u8 opcode[0x10]; 5300365cdf5fSErez Shitrit u8 reserved_at_10[0x10]; 5301365cdf5fSErez Shitrit u8 reserved_at_20[0x10]; 5302365cdf5fSErez Shitrit u8 op_mod[0x10]; 5303365cdf5fSErez Shitrit u8 other_vport[0x1]; 5304365cdf5fSErez Shitrit u8 reserved_at_41[0xf]; 5305365cdf5fSErez Shitrit u8 vport_number[0x10]; 5306365cdf5fSErez Shitrit u8 reserved_at_60[0x20]; 5307365cdf5fSErez Shitrit u8 table_type[0x8]; 5308365cdf5fSErez Shitrit u8 reserved_at_88[0x18]; 5309365cdf5fSErez Shitrit u8 reserved_at_a0[0x8]; 5310365cdf5fSErez Shitrit u8 table_id[0x18]; 5311365cdf5fSErez Shitrit u8 ignore_flow_level[0x1]; 5312365cdf5fSErez Shitrit u8 reserved_at_c1[0x17]; 5313365cdf5fSErez Shitrit u8 modify_enable_mask[0x8]; 5314365cdf5fSErez Shitrit u8 reserved_at_e0[0x20]; 5315365cdf5fSErez Shitrit u8 flow_index[0x20]; 5316365cdf5fSErez Shitrit u8 reserved_at_120[0xe0]; 5317365cdf5fSErez Shitrit struct mlx5_ifc_flow_context_bits flow_context; 5318365cdf5fSErez Shitrit }; 5319365cdf5fSErez Shitrit 5320365cdf5fSErez Shitrit struct mlx5_ifc_create_flow_group_in_bits { 5321365cdf5fSErez Shitrit u8 opcode[0x10]; 5322365cdf5fSErez Shitrit u8 reserved_at_10[0x10]; 5323365cdf5fSErez Shitrit u8 reserved_at_20[0x20]; 5324365cdf5fSErez Shitrit u8 other_vport[0x1]; 5325365cdf5fSErez Shitrit u8 reserved_at_41[0xf]; 5326365cdf5fSErez Shitrit u8 vport_number[0x10]; 5327365cdf5fSErez Shitrit u8 reserved_at_60[0x20]; 5328365cdf5fSErez Shitrit u8 table_type[0x8]; 5329365cdf5fSErez Shitrit u8 reserved_at_88[0x18]; 5330365cdf5fSErez Shitrit u8 reserved_at_a0[0x8]; 5331365cdf5fSErez Shitrit u8 table_id[0x18]; 5332365cdf5fSErez Shitrit u8 reserved_at_c0[0x1f40]; 5333365cdf5fSErez Shitrit }; 5334365cdf5fSErez Shitrit 5335365cdf5fSErez Shitrit struct mlx5_ifc_create_flow_group_out_bits { 5336365cdf5fSErez Shitrit u8 status[0x8]; 5337365cdf5fSErez Shitrit u8 reserved_at_8[0x18]; 5338365cdf5fSErez Shitrit u8 syndrome[0x20]; 5339365cdf5fSErez Shitrit u8 reserved_at_40[0x8]; 5340365cdf5fSErez Shitrit u8 group_id[0x18]; 5341365cdf5fSErez Shitrit u8 reserved_at_60[0x20]; 5342365cdf5fSErez Shitrit }; 5343365cdf5fSErez Shitrit 5344365cdf5fSErez Shitrit enum { 5345365cdf5fSErez Shitrit MLX5_IFC_MODIFY_FLOW_TABLE_MISS_ACTION = 1 << 0, 5346365cdf5fSErez Shitrit MLX5_IFC_MODIFY_FLOW_TABLE_RTC_ID = 1 << 1, 5347365cdf5fSErez Shitrit }; 5348365cdf5fSErez Shitrit 5349365cdf5fSErez Shitrit enum { 5350365cdf5fSErez Shitrit MLX5_IFC_MODIFY_FLOW_TABLE_MISS_ACTION_DEFAULT = 0, 5351365cdf5fSErez Shitrit MLX5_IFC_MODIFY_FLOW_TABLE_MISS_ACTION_GOTO_TBL = 1, 5352365cdf5fSErez Shitrit }; 5353365cdf5fSErez Shitrit 5354365cdf5fSErez Shitrit struct mlx5_ifc_modify_flow_table_in_bits { 5355365cdf5fSErez Shitrit u8 opcode[0x10]; 5356365cdf5fSErez Shitrit u8 uid[0x10]; 5357365cdf5fSErez Shitrit 5358365cdf5fSErez Shitrit u8 reserved_at_20[0x10]; 5359365cdf5fSErez Shitrit u8 op_mod[0x10]; 5360365cdf5fSErez Shitrit 5361365cdf5fSErez Shitrit u8 reserved_at_40[0x10]; 5362365cdf5fSErez Shitrit u8 vport_number[0x10]; 5363365cdf5fSErez Shitrit 5364365cdf5fSErez Shitrit u8 reserved_at_60[0x10]; 5365365cdf5fSErez Shitrit u8 modify_field_select[0x10]; 5366365cdf5fSErez Shitrit 5367365cdf5fSErez Shitrit u8 table_type[0x8]; 5368365cdf5fSErez Shitrit u8 reserved_at_88[0x18]; 5369365cdf5fSErez Shitrit 5370365cdf5fSErez Shitrit u8 reserved_at_a0[0x8]; 5371365cdf5fSErez Shitrit u8 table_id[0x18]; 5372365cdf5fSErez Shitrit 5373365cdf5fSErez Shitrit struct mlx5_ifc_flow_table_context_bits flow_table_context; 5374365cdf5fSErez Shitrit }; 5375365cdf5fSErez Shitrit 5376365cdf5fSErez Shitrit struct mlx5_ifc_modify_flow_table_out_bits { 5377365cdf5fSErez Shitrit u8 status[0x8]; 5378365cdf5fSErez Shitrit u8 reserved_at_8[0x18]; 5379365cdf5fSErez Shitrit 5380365cdf5fSErez Shitrit u8 syndrome[0x20]; 5381365cdf5fSErez Shitrit 5382365cdf5fSErez Shitrit u8 reserved_at_40[0x60]; 5383365cdf5fSErez Shitrit }; 5384365cdf5fSErez Shitrit 538525cb2d2aSHamdan Igbaria struct mlx5_ifc_packet_reformat_context_in_bits { 538625cb2d2aSHamdan Igbaria u8 reformat_type[0x8]; 538725cb2d2aSHamdan Igbaria u8 reserved_at_8[0x4]; 538825cb2d2aSHamdan Igbaria u8 reformat_param_0[0x4]; 538925cb2d2aSHamdan Igbaria u8 reserved_at_16[0x6]; 539025cb2d2aSHamdan Igbaria u8 reformat_data_size[0xa]; 539125cb2d2aSHamdan Igbaria 539225cb2d2aSHamdan Igbaria u8 reformat_param_1[0x8]; 539325cb2d2aSHamdan Igbaria u8 reserved_at_40[0x8]; 539425cb2d2aSHamdan Igbaria u8 reformat_data[6][0x8]; 539525cb2d2aSHamdan Igbaria 539625cb2d2aSHamdan Igbaria u8 more_reformat_data[][0x8]; 539725cb2d2aSHamdan Igbaria }; 539825cb2d2aSHamdan Igbaria 539925cb2d2aSHamdan Igbaria struct mlx5_ifc_alloc_packet_reformat_context_in_bits { 540025cb2d2aSHamdan Igbaria u8 opcode[0x10]; 540125cb2d2aSHamdan Igbaria u8 uid[0x10]; 540225cb2d2aSHamdan Igbaria 540325cb2d2aSHamdan Igbaria u8 reserved_at_20[0x10]; 540425cb2d2aSHamdan Igbaria u8 op_mod[0x10]; 540525cb2d2aSHamdan Igbaria 540625cb2d2aSHamdan Igbaria u8 reserved_at_40[0xa0]; 540725cb2d2aSHamdan Igbaria 540825cb2d2aSHamdan Igbaria u8 packet_reformat_context[]; 540925cb2d2aSHamdan Igbaria }; 541025cb2d2aSHamdan Igbaria 541125cb2d2aSHamdan Igbaria struct mlx5_ifc_alloc_packet_reformat_out_bits { 541225cb2d2aSHamdan Igbaria u8 status[0x8]; 541325cb2d2aSHamdan Igbaria u8 reserved_at_8[0x18]; 541425cb2d2aSHamdan Igbaria 541525cb2d2aSHamdan Igbaria u8 syndrome[0x20]; 541625cb2d2aSHamdan Igbaria 541725cb2d2aSHamdan Igbaria u8 packet_reformat_id[0x20]; 541825cb2d2aSHamdan Igbaria 541925cb2d2aSHamdan Igbaria u8 reserved_at_60[0x20]; 542025cb2d2aSHamdan Igbaria }; 542125cb2d2aSHamdan Igbaria 54227b4f1e6bSMatan Azrad /* CQE format mask. */ 54237b4f1e6bSMatan Azrad #define MLX5E_CQE_FORMAT_MASK 0xc 54247b4f1e6bSMatan Azrad 54257b4f1e6bSMatan Azrad /* MPW opcode. */ 54267b4f1e6bSMatan Azrad #define MLX5_OPC_MOD_MPW 0x01 54277b4f1e6bSMatan Azrad 54287b4f1e6bSMatan Azrad /* Compressed Rx CQE structure. */ 54297b4f1e6bSMatan Azrad struct mlx5_mini_cqe8 { 54307b4f1e6bSMatan Azrad union { 54317b4f1e6bSMatan Azrad uint32_t rx_hash_result; 54327b4f1e6bSMatan Azrad struct { 543354c2d46bSAlexander Kozyrev union { 54347b4f1e6bSMatan Azrad uint16_t checksum; 543554c2d46bSAlexander Kozyrev uint16_t flow_tag_high; 543654c2d46bSAlexander Kozyrev struct { 543754c2d46bSAlexander Kozyrev uint8_t reserved; 543854c2d46bSAlexander Kozyrev uint8_t hdr_type; 543954c2d46bSAlexander Kozyrev }; 544054c2d46bSAlexander Kozyrev }; 54417b4f1e6bSMatan Azrad uint16_t stride_idx; 54427b4f1e6bSMatan Azrad }; 54437b4f1e6bSMatan Azrad struct { 54447b4f1e6bSMatan Azrad uint16_t wqe_counter; 5445a7da07e5SAlexander Kozyrev uint8_t validity_iteration_count; 54467b4f1e6bSMatan Azrad uint8_t s_wqe_opcode; 54477b4f1e6bSMatan Azrad } s_wqe_info; 54487b4f1e6bSMatan Azrad }; 544954c2d46bSAlexander Kozyrev union { 545054c2d46bSAlexander Kozyrev uint32_t byte_cnt_flow; 54517b4f1e6bSMatan Azrad uint32_t byte_cnt; 54527b4f1e6bSMatan Azrad }; 545354c2d46bSAlexander Kozyrev }; 54547b4f1e6bSMatan Azrad 545538f9369dSDekel Peled /* Mini CQE responder format. */ 545638f9369dSDekel Peled enum { 545738f9369dSDekel Peled MLX5_CQE_RESP_FORMAT_HASH = 0x0, 545838f9369dSDekel Peled MLX5_CQE_RESP_FORMAT_CSUM = 0x1, 545954c2d46bSAlexander Kozyrev MLX5_CQE_RESP_FORMAT_FTAG_STRIDX = 0x2, 546038f9369dSDekel Peled MLX5_CQE_RESP_FORMAT_CSUM_STRIDX = 0x3, 546154c2d46bSAlexander Kozyrev MLX5_CQE_RESP_FORMAT_L34H_STRIDX = 0x4, 546238f9369dSDekel Peled }; 546338f9369dSDekel Peled 54647b4f1e6bSMatan Azrad /* srTCM PRM flow meter parameters. */ 54657b4f1e6bSMatan Azrad enum { 54667b4f1e6bSMatan Azrad MLX5_FLOW_COLOR_RED = 0, 54677b4f1e6bSMatan Azrad MLX5_FLOW_COLOR_YELLOW, 54687b4f1e6bSMatan Azrad MLX5_FLOW_COLOR_GREEN, 54697b4f1e6bSMatan Azrad MLX5_FLOW_COLOR_UNDEFINED, 54707b4f1e6bSMatan Azrad }; 54717b4f1e6bSMatan Azrad 54728a0fca11SBing Zhao /* Maximum value of srTCM & trTCM metering parameters. */ 54738a0fca11SBing Zhao #define MLX5_SRTCM_XBS_MAX (0xFF * (1ULL << 0x1F)) 54748a0fca11SBing Zhao #define MLX5_SRTCM_XIR_MAX (8 * (1ULL << 30) * 0xFF) 54757b4f1e6bSMatan Azrad 54767b4f1e6bSMatan Azrad /* The bits meter color use. */ 54777b4f1e6bSMatan Azrad #define MLX5_MTR_COLOR_BITS 8 54787b4f1e6bSMatan Azrad 547921091abaSShun Hao /* The bit size of one register. */ 548021091abaSShun Hao #define MLX5_REG_BITS 32 548121091abaSShun Hao 548221091abaSShun Hao /* Idle bits for non-color usage in color register. */ 548321091abaSShun Hao #define MLX5_MTR_IDLE_BITS_IN_COLOR_REG (MLX5_REG_BITS - MLX5_MTR_COLOR_BITS) 548421091abaSShun Hao 5485711aedf1SBing Zhao /* Length mode of dynamic flex parser graph node. */ 5486711aedf1SBing Zhao enum mlx5_parse_graph_node_len_mode { 5487711aedf1SBing Zhao MLX5_GRAPH_NODE_LEN_FIXED = 0x0, 5488711aedf1SBing Zhao MLX5_GRAPH_NODE_LEN_FIELD = 0x1, 5489711aedf1SBing Zhao MLX5_GRAPH_NODE_LEN_BITMASK = 0x2, 5490711aedf1SBing Zhao }; 5491711aedf1SBing Zhao 5492711aedf1SBing Zhao /* Offset mode of the samples of flex parser. */ 5493711aedf1SBing Zhao enum mlx5_parse_graph_flow_match_sample_offset_mode { 5494711aedf1SBing Zhao MLX5_GRAPH_SAMPLE_OFFSET_FIXED = 0x0, 5495711aedf1SBing Zhao MLX5_GRAPH_SAMPLE_OFFSET_FIELD = 0x1, 5496711aedf1SBing Zhao MLX5_GRAPH_SAMPLE_OFFSET_BITMASK = 0x2, 5497711aedf1SBing Zhao }; 5498711aedf1SBing Zhao 549965be2ca6SGregory Etelson enum mlx5_parse_graph_flow_match_sample_tunnel_mode { 550065be2ca6SGregory Etelson MLX5_GRAPH_SAMPLE_TUNNEL_OUTER = 0x0, 550165be2ca6SGregory Etelson MLX5_GRAPH_SAMPLE_TUNNEL_INNER = 0x1, 550265be2ca6SGregory Etelson MLX5_GRAPH_SAMPLE_TUNNEL_FIRST = 0x2 550365be2ca6SGregory Etelson }; 550465be2ca6SGregory Etelson 5505711aedf1SBing Zhao /* Node index for an input / output arc of the flex parser graph. */ 5506711aedf1SBing Zhao enum mlx5_parse_graph_arc_node_index { 5507711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_NULL = 0x0, 5508711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_HEAD = 0x1, 5509711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_MAC = 0x2, 5510711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_IP = 0x3, 5511711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_GRE = 0x4, 5512711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_UDP = 0x5, 5513711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_MPLS = 0x6, 5514711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_TCP = 0x7, 5515711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_VXLAN_GPE = 0x8, 5516711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_GENEVE = 0x9, 5517711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_IPSEC_ESP = 0xa, 551865be2ca6SGregory Etelson MLX5_GRAPH_ARC_NODE_IPV4 = 0xb, 551965be2ca6SGregory Etelson MLX5_GRAPH_ARC_NODE_IPV6 = 0xc, 5520711aedf1SBing Zhao MLX5_GRAPH_ARC_NODE_PROGRAMMABLE = 0x1f, 5521711aedf1SBing Zhao }; 5522711aedf1SBing Zhao 552371ad5095SHaifei Luo enum mlx5_packet_reformat_context_reformat_type { 552471ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x2, 552571ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L2_TO_L3_TUNNEL = 0x4, 552671ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV4 = 0x5, 552771ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L2_TO_L3_ESP_TUNNEL = 0x6, 552871ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_UDPV4 = 0x7, 552971ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_DEL_ESP_TRANSPORT = 0x8, 553071ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_L3_ESP_TUNNEL_TO_L2 = 0x9, 553171ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_DEL_ESP_TRANSPORT_OVER_UDP = 0xA, 553271ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_IPV6 = 0xB, 553371ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_ESP_TRANSPORT_OVER_UDPV6 = 0xC, 553471ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_ADD_NISP_TNL = 0xD, 553571ad5095SHaifei Luo MLX5_PACKET_REFORMAT_CONTEXT_REFORMAT_TYPE_REMOVE_NISP_TNL = 0xE, 553671ad5095SHaifei Luo }; 553771ad5095SHaifei Luo 553865be2ca6SGregory Etelson #define MLX5_PARSE_GRAPH_FLOW_SAMPLE_MAX 8 553965be2ca6SGregory Etelson #define MLX5_PARSE_GRAPH_IN_ARC_MAX 8 554065be2ca6SGregory Etelson #define MLX5_PARSE_GRAPH_OUT_ARC_MAX 8 554165be2ca6SGregory Etelson 55427b4f1e6bSMatan Azrad /** 55437b4f1e6bSMatan Azrad * Convert a user mark to flow mark. 55447b4f1e6bSMatan Azrad * 55457b4f1e6bSMatan Azrad * @param val 55467b4f1e6bSMatan Azrad * Mark value to convert. 55477b4f1e6bSMatan Azrad * 55487b4f1e6bSMatan Azrad * @return 55497b4f1e6bSMatan Azrad * Converted mark value. 55507b4f1e6bSMatan Azrad */ 55517b4f1e6bSMatan Azrad static inline uint32_t 55527b4f1e6bSMatan Azrad mlx5_flow_mark_set(uint32_t val) 55537b4f1e6bSMatan Azrad { 55547b4f1e6bSMatan Azrad uint32_t ret; 55557b4f1e6bSMatan Azrad 55567b4f1e6bSMatan Azrad /* 55577b4f1e6bSMatan Azrad * Add one to the user value to differentiate un-marked flows from 55587b4f1e6bSMatan Azrad * marked flows, if the ID is equal to MLX5_FLOW_MARK_DEFAULT it 55597b4f1e6bSMatan Azrad * remains untouched. 55607b4f1e6bSMatan Azrad */ 55617b4f1e6bSMatan Azrad if (val != MLX5_FLOW_MARK_DEFAULT) 55627b4f1e6bSMatan Azrad ++val; 55637b4f1e6bSMatan Azrad #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN 55647b4f1e6bSMatan Azrad /* 55657b4f1e6bSMatan Azrad * Mark is 24 bits (minus reserved values) but is stored on a 32 bit 55667b4f1e6bSMatan Azrad * word, byte-swapped by the kernel on little-endian systems. In this 55677b4f1e6bSMatan Azrad * case, left-shifting the resulting big-endian value ensures the 55687b4f1e6bSMatan Azrad * least significant 24 bits are retained when converting it back. 55697b4f1e6bSMatan Azrad */ 55707b4f1e6bSMatan Azrad ret = rte_cpu_to_be_32(val) >> 8; 55717b4f1e6bSMatan Azrad #else 55727b4f1e6bSMatan Azrad ret = val; 55737b4f1e6bSMatan Azrad #endif 55747b4f1e6bSMatan Azrad return ret; 55757b4f1e6bSMatan Azrad } 55767b4f1e6bSMatan Azrad 55777b4f1e6bSMatan Azrad /** 55787b4f1e6bSMatan Azrad * Convert a mark to user mark. 55797b4f1e6bSMatan Azrad * 55807b4f1e6bSMatan Azrad * @param val 55817b4f1e6bSMatan Azrad * Mark value to convert. 55827b4f1e6bSMatan Azrad * 55837b4f1e6bSMatan Azrad * @return 55847b4f1e6bSMatan Azrad * Converted mark value. 55857b4f1e6bSMatan Azrad */ 55867b4f1e6bSMatan Azrad static inline uint32_t 55877b4f1e6bSMatan Azrad mlx5_flow_mark_get(uint32_t val) 55887b4f1e6bSMatan Azrad { 55897b4f1e6bSMatan Azrad /* 55907b4f1e6bSMatan Azrad * Subtract one from the retrieved value. It was added by 55917b4f1e6bSMatan Azrad * mlx5_flow_mark_set() to distinguish unmarked flows. 55927b4f1e6bSMatan Azrad */ 55937b4f1e6bSMatan Azrad #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN 55947b4f1e6bSMatan Azrad return (val >> 8) - 1; 55957b4f1e6bSMatan Azrad #else 55967b4f1e6bSMatan Azrad return val - 1; 55977b4f1e6bSMatan Azrad #endif 55987b4f1e6bSMatan Azrad } 55997b4f1e6bSMatan Azrad 5600569ffbc9SViacheslav Ovsiienko /** 5601569ffbc9SViacheslav Ovsiienko * Convert a timestamp format to configure settings in the queue context. 5602569ffbc9SViacheslav Ovsiienko * 5603569ffbc9SViacheslav Ovsiienko * @param val 5604569ffbc9SViacheslav Ovsiienko * timestamp format supported by the queue. 5605569ffbc9SViacheslav Ovsiienko * 5606569ffbc9SViacheslav Ovsiienko * @return 56077be78d02SJosh Soref * Converted timestamp format settings. 5608569ffbc9SViacheslav Ovsiienko */ 5609569ffbc9SViacheslav Ovsiienko static inline uint32_t 5610569ffbc9SViacheslav Ovsiienko mlx5_ts_format_conv(uint32_t ts_format) 5611569ffbc9SViacheslav Ovsiienko { 5612569ffbc9SViacheslav Ovsiienko return ts_format == MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR ? 5613569ffbc9SViacheslav Ovsiienko MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING : 5614569ffbc9SViacheslav Ovsiienko MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; 5615569ffbc9SViacheslav Ovsiienko } 5616569ffbc9SViacheslav Ovsiienko 56177b4f1e6bSMatan Azrad #endif /* RTE_PMD_MLX5_PRM_H_ */ 5618