1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 Broadcom
6 #ifndef _HCAPI_CFA_P58_H_
7 #define _HCAPI_CFA_P58_H_
12 #define CFA_P58_EEM_KEY_MAX_SIZE 80
13 #define CFA_P58_EEM_KEY_RECORD_SIZE 80
15 #define CFA_P58_EM_FKB_NUM_WORDS 4
16 #define CFA_P58_EM_FKB_NUM_ENTRIES 64
17 #define CFA_P58_WC_TCAM_FKB_NUM_WORDS 4
18 #define CFA_P58_WC_TCAM_FKB_NUM_ENTRIES 64
20 /** CFA phase 5.8 fix formatted table(layout) ID definition
25 CFA_P58_TBL_L2CTXT_TCAM,
26 CFA_P58_TBL_L2CTXT_REMAP,
27 CFA_P58_TBL_PROF_TCAM,
28 CFA_P58_TBL_PROF_TCAM_REMAP,
30 CFA_P58_TBL_WC_TCAM_REC,
33 /** Default Profile TCAM/Lookup Action Record Pointer Table */
34 CFA_P58_TBL_PROF_PARIF_DFLT_ACT_REC_PTR,
35 /** Error Profile TCAM Miss Action Record Pointer Table */
36 CFA_P58_TBL_PROF_PARIF_ERR_ACT_REC_PTR,
37 /** VNIC/SVIF Properties Table */
42 #define CFA_P58_PROF_MAX_KEYS 4
43 enum cfa_p58_mac_sel_mode {
44 CFA_P58_MAC_SEL_MODE_FIRST = 0,
45 CFA_P58_MAC_SEL_MODE_LOWEST = 1,
48 struct cfa_p58_prof_key_cfg {
49 uint8_t mac_sel[CFA_P58_PROF_MAX_KEYS];
50 #define CFA_P58_PROF_MAC_SEL_DMAC0 (1 << 0)
51 #define CFA_P58_PROF_MAC_SEL_T_MAC0 (1 << 1)
52 #define CFA_P58_PROF_MAC_SEL_OUTERMOST_MAC0 (1 << 2)
53 #define CFA_P58_PROF_MAC_SEL_DMAC1 (1 << 3)
54 #define CFA_P58_PROF_MAC_SEL_T_MAC1 (1 << 4)
55 #define CFA_P58_PROF_MAC_OUTERMOST_MAC1 (1 << 5)
56 uint8_t vlan_sel[CFA_P58_PROF_MAX_KEYS];
57 #define CFA_P58_PROFILER_VLAN_SEL_INNER_HDR 0
58 #define CFA_P58_PROFILER_VLAN_SEL_TUNNEL_HDR 1
59 #define CFA_P58_PROFILER_VLAN_SEL_OUTERMOST_HDR 2
61 enum cfa_p58_mac_sel_mode mode;
65 * Enumeration of SRAM entry types, used for allocation of
66 * fixed SRAM entities. The memory model for CFA HCAPI
67 * determines if an SRAM entry type is supported.
69 enum cfa_p58_action_sram_entry_type {
70 /* NOTE: Any additions to this enum must be reflected on FW
74 /** SRAM Action Record */
75 CFA_P58_ACTION_SRAM_ENTRY_TYPE_ACT,
76 /** SRAM Action Encap 8 Bytes */
77 CFA_P58_ACTION_SRAM_ENTRY_TYPE_ENCAP_8B,
78 /** SRAM Action Encap 16 Bytes */
79 CFA_P58_ACTION_SRAM_ENTRY_TYPE_ENCAP_16B,
80 /** SRAM Action Encap 64 Bytes */
81 CFA_P58_ACTION_SRAM_ENTRY_TYPE_ENCAP_64B,
82 /** SRAM Action Modify IPv4 Source */
83 CFA_P58_ACTION_SRAM_ENTRY_TYPE_MODIFY_IPV4_SRC,
84 /** SRAM Action Modify IPv4 Destination */
85 CFA_P58_ACTION_SRAM_ENTRY_TYPE_MODIFY_IPV4_DEST,
86 /** SRAM Action Source Properties SMAC */
87 CFA_P58_ACTION_SRAM_ENTRY_TYPE_SP_SMAC,
88 /** SRAM Action Source Properties SMAC IPv4 */
89 CFA_P58_ACTION_SRAM_ENTRY_TYPE_SP_SMAC_IPV4,
90 /** SRAM Action Source Properties SMAC IPv6 */
91 CFA_P58_ACTION_SRAM_ENTRY_TYPE_SP_SMAC_IPV6,
92 /** SRAM Action Statistics 64 Bits */
93 CFA_P58_ACTION_SRAM_ENTRY_TYPE_STATS_64,
94 CFA_P58_ACTION_SRAM_ENTRY_TYPE_MAX
98 * SRAM Action Record structure holding either an action index or an
101 union cfa_p58_action_sram_act_record {
102 /** SRAM Action idx specifies the offset of the SRAM
103 * element within its SRAM Entry Type block. This
104 * index can be written into i.e. an L2 Context. Use
105 * this type for all SRAM Action Record types except
106 * SRAM Full Action records. Use act_ptr instead.
109 /** SRAM Full Action is special in that it needs an
110 * action record pointer. This pointer can be written
111 * into i.e. a Wildcard TCAM entry.
117 * cfa_p58_action_param parameter definition
119 struct cfa_p58_action_param {
121 * [in] receive or transmit direction
125 * [in] type of the sram allocation type
127 enum cfa_p58_action_sram_entry_type type;
129 * [in] action record to set. The 'type' specified lists the
130 * record definition to use in the passed in record.
132 union cfa_p58_action_sram_act_record record;
134 * [in] number of elements in act_data
138 * [in] ptr to array of action data
142 #endif /* _CFA_HW_P58_H_ */