xref: /openbmc/linux/drivers/net/ethernet/microchip/vcap/vcap_ag_api.h (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
18beef08fSSteen Hegelund /* SPDX-License-Identifier: BSD-3-Clause */
29d712b8dSSteen Hegelund /* Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries.
38beef08fSSteen Hegelund  * Microchip VCAP API
48beef08fSSteen Hegelund  */
58beef08fSSteen Hegelund 
6*99ce286dSHoratiu Vultur /* This file is autogenerated by cml-utils 2023-03-13 10:16:42 +0100.
7*99ce286dSHoratiu Vultur  * Commit ID: 259f0efd6d6d91bfbf62858de153cc757b6bffa3 (dirty)
88beef08fSSteen Hegelund  */
98beef08fSSteen Hegelund 
108beef08fSSteen Hegelund #ifndef __VCAP_AG_API__
118beef08fSSteen Hegelund #define __VCAP_AG_API__
128beef08fSSteen Hegelund 
138beef08fSSteen Hegelund enum vcap_type {
14a5cc98adSSteen Hegelund 	VCAP_TYPE_ES0,
150a335db8SHoratiu Vultur 	VCAP_TYPE_ES2,
160a335db8SHoratiu Vultur 	VCAP_TYPE_IS0,
17*99ce286dSHoratiu Vultur 	VCAP_TYPE_IS1,
188beef08fSSteen Hegelund 	VCAP_TYPE_IS2,
198beef08fSSteen Hegelund 	VCAP_TYPE_MAX
208beef08fSSteen Hegelund };
218beef08fSSteen Hegelund 
228beef08fSSteen Hegelund /* Keyfieldset names with origin information */
238beef08fSSteen Hegelund enum vcap_keyfield_set {
248beef08fSSteen Hegelund 	VCAP_KFS_NO_VALUE,          /* initial value */
25*99ce286dSHoratiu Vultur 	VCAP_KFS_5TUPLE_IP4,        /* lan966x is1 X2 */
26*99ce286dSHoratiu Vultur 	VCAP_KFS_5TUPLE_IP6,        /* lan966x is1 X4 */
27*99ce286dSHoratiu Vultur 	VCAP_KFS_7TUPLE,            /* lan966x is1 X4 */
28f274a659SSteen Hegelund 	VCAP_KFS_ARP,               /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
29*99ce286dSHoratiu Vultur 	VCAP_KFS_DBL_VID,           /* lan966x is1 X1 */
30*99ce286dSHoratiu Vultur 	VCAP_KFS_DMAC_VID,          /* lan966x is1 X1 */
310a335db8SHoratiu Vultur 	VCAP_KFS_ETAG,              /* sparx5 is0 X2 */
32f274a659SSteen Hegelund 	VCAP_KFS_IP4_OTHER,         /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
33f274a659SSteen Hegelund 	VCAP_KFS_IP4_TCP_UDP,       /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
340a335db8SHoratiu Vultur 	VCAP_KFS_IP4_VID,           /* sparx5 es2 X3 */
35f274a659SSteen Hegelund 	VCAP_KFS_IP6_OTHER,         /* lan966x is2 X4 */
36a5cc98adSSteen Hegelund 	VCAP_KFS_IP6_STD,           /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
37f274a659SSteen Hegelund 	VCAP_KFS_IP6_TCP_UDP,       /* lan966x is2 X4 */
38f274a659SSteen Hegelund 	VCAP_KFS_IP6_VID,           /* sparx5 es2 X6 */
390a335db8SHoratiu Vultur 	VCAP_KFS_IP_7TUPLE,         /* sparx5 is2 X12, sparx5 es2 X12 */
40a5cc98adSSteen Hegelund 	VCAP_KFS_ISDX,              /* sparx5 es0 X1 */
410a335db8SHoratiu Vultur 	VCAP_KFS_LL_FULL,           /* sparx5 is0 X6 */
42f274a659SSteen Hegelund 	VCAP_KFS_MAC_ETYPE,         /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
43ee72d90bSHoratiu Vultur 	VCAP_KFS_MAC_LLC,           /* lan966x is2 X2 */
44ee72d90bSHoratiu Vultur 	VCAP_KFS_MAC_SNAP,          /* lan966x is2 X2 */
45*99ce286dSHoratiu Vultur 	VCAP_KFS_NORMAL,            /* lan966x is1 X2 */
46f274a659SSteen Hegelund 	VCAP_KFS_NORMAL_5TUPLE_IP4,  /* sparx5 is0 X6 */
47f274a659SSteen Hegelund 	VCAP_KFS_NORMAL_7TUPLE,     /* sparx5 is0 X12 */
48*99ce286dSHoratiu Vultur 	VCAP_KFS_NORMAL_IP6,        /* lan966x is1 X4 */
49ee72d90bSHoratiu Vultur 	VCAP_KFS_OAM,               /* lan966x is2 X2 */
50f274a659SSteen Hegelund 	VCAP_KFS_PURE_5TUPLE_IP4,   /* sparx5 is0 X3 */
51*99ce286dSHoratiu Vultur 	VCAP_KFS_RT,                /* lan966x is1 X1 */
52ee72d90bSHoratiu Vultur 	VCAP_KFS_SMAC_SIP4,         /* lan966x is2 X1 */
53ee72d90bSHoratiu Vultur 	VCAP_KFS_SMAC_SIP6,         /* lan966x is2 X2 */
548beef08fSSteen Hegelund 	VCAP_KFS_VID,               /* lan966x es0 X1 */
558beef08fSSteen Hegelund };
568beef08fSSteen Hegelund 
578beef08fSSteen Hegelund /* List of keyfields with description
588beef08fSSteen Hegelund  *
598beef08fSSteen Hegelund  * Keys ending in _IS are booleans derived from frame data
608beef08fSSteen Hegelund  * Keys ending in _CLS are classified frame data
610a335db8SHoratiu Vultur  *
620a335db8SHoratiu Vultur  * VCAP_KF_8021BR_ECID_BASE: W12, sparx5: is0
630a335db8SHoratiu Vultur  *   Used by 802.1BR Bridge Port Extension in an E-Tag
640a335db8SHoratiu Vultur  * VCAP_KF_8021BR_ECID_EXT: W8, sparx5: is0
650a335db8SHoratiu Vultur  *   Used by 802.1BR Bridge Port Extension in an E-Tag
660a335db8SHoratiu Vultur  * VCAP_KF_8021BR_E_TAGGED: W1, sparx5: is0
670a335db8SHoratiu Vultur  *   Set for frames containing an E-TAG (802.1BR Ethertype 893f)
680a335db8SHoratiu Vultur  * VCAP_KF_8021BR_GRP: W2, sparx5: is0
690a335db8SHoratiu Vultur  *   E-Tag group bits in 802.1BR Bridge Port Extension
700a335db8SHoratiu Vultur  * VCAP_KF_8021BR_IGR_ECID_BASE: W12, sparx5: is0
710a335db8SHoratiu Vultur  *   Used by 802.1BR Bridge Port Extension in an E-Tag
720a335db8SHoratiu Vultur  * VCAP_KF_8021BR_IGR_ECID_EXT: W8, sparx5: is0
73*99ce286dSHoratiu Vultur  *   Used by 802.1BR Bridge Port Extension in an E-Tag
74*99ce286dSHoratiu Vultur  * VCAP_KF_8021CB_R_TAGGED_IS: W1, lan966x: is1
75*99ce286dSHoratiu Vultur  *   Set if frame contains an RTAG: IEEE 802.1CB (FRER Redundancy tag, Ethertype
76*99ce286dSHoratiu Vultur  *   0xf1c1)
770a335db8SHoratiu Vultur  * VCAP_KF_8021Q_DEI0: W1, sparx5: is0, lan966x: is1
78*99ce286dSHoratiu Vultur  *   First DEI in multiple vlan tags (outer tag or default port tag)
790a335db8SHoratiu Vultur  * VCAP_KF_8021Q_DEI1: W1, sparx5: is0, lan966x: is1
800a335db8SHoratiu Vultur  *   Second DEI in multiple vlan tags (inner tag)
810a335db8SHoratiu Vultur  * VCAP_KF_8021Q_DEI2: W1, sparx5: is0
82ee72d90bSHoratiu Vultur  *   Third DEI in multiple vlan tags (not always available)
838beef08fSSteen Hegelund  * VCAP_KF_8021Q_DEI_CLS: W1, sparx5: is2/es2, lan966x: is2/es0
84*99ce286dSHoratiu Vultur  *   Classified DEI
850a335db8SHoratiu Vultur  * VCAP_KF_8021Q_PCP0: W3, sparx5: is0, lan966x: is1
86*99ce286dSHoratiu Vultur  *   First PCP in multiple vlan tags (outer tag or default port tag)
870a335db8SHoratiu Vultur  * VCAP_KF_8021Q_PCP1: W3, sparx5: is0, lan966x: is1
880a335db8SHoratiu Vultur  *   Second PCP in multiple vlan tags (inner tag)
890a335db8SHoratiu Vultur  * VCAP_KF_8021Q_PCP2: W3, sparx5: is0
90ee72d90bSHoratiu Vultur  *   Third PCP in multiple vlan tags (not always available)
918beef08fSSteen Hegelund  * VCAP_KF_8021Q_PCP_CLS: W3, sparx5: is2/es2, lan966x: is2/es0
92a5cc98adSSteen Hegelund  *   Classified PCP
93a5cc98adSSteen Hegelund  * VCAP_KF_8021Q_TPID: W3, sparx5: es0
94*99ce286dSHoratiu Vultur  *   TPID for outer tag: 0: Customer TPID 1: Service TPID (88A8 or programmable)
950a335db8SHoratiu Vultur  * VCAP_KF_8021Q_TPID0: sparx5 is0 W3, lan966x is1 W1
96*99ce286dSHoratiu Vultur  *   First TPIC in multiple vlan tags (outer tag or default port tag)
970a335db8SHoratiu Vultur  * VCAP_KF_8021Q_TPID1: sparx5 is0 W3, lan966x is1 W1
980a335db8SHoratiu Vultur  *   Second TPID in multiple vlan tags (inner tag)
990a335db8SHoratiu Vultur  * VCAP_KF_8021Q_TPID2: W3, sparx5: is0
100*99ce286dSHoratiu Vultur  *   Third TPID in multiple vlan tags (not always available)
1010a335db8SHoratiu Vultur  * VCAP_KF_8021Q_VID0: W12, sparx5: is0, lan966x: is1
102*99ce286dSHoratiu Vultur  *   First VID in multiple vlan tags (outer tag or default port tag)
1030a335db8SHoratiu Vultur  * VCAP_KF_8021Q_VID1: W12, sparx5: is0, lan966x: is1
1040a335db8SHoratiu Vultur  *   Second VID in multiple vlan tags (inner tag)
1050a335db8SHoratiu Vultur  * VCAP_KF_8021Q_VID2: W12, sparx5: is0
106a5cc98adSSteen Hegelund  *   Third VID in multiple vlan tags (not always available)
107a5cc98adSSteen Hegelund  * VCAP_KF_8021Q_VID_CLS: sparx5 is2 W13, sparx5 es0 W13, sparx5 es2 W13,
1088beef08fSSteen Hegelund  *   lan966x is2 W12, lan966x es0 W12
109*99ce286dSHoratiu Vultur  *   Classified VID
110*99ce286dSHoratiu Vultur  * VCAP_KF_8021Q_VLAN_DBL_TAGGED_IS: W1, lan966x: is1
111*99ce286dSHoratiu Vultur  *   Set if frame has two or more Q-tags. Independent of port VLAN awareness
1128beef08fSSteen Hegelund  * VCAP_KF_8021Q_VLAN_TAGGED_IS: W1, sparx5: is2/es2, lan966x: is1/is2
1138beef08fSSteen Hegelund  *   Sparx5: Set if frame was received with a VLAN tag, LAN966x: Set if frame has
1140a335db8SHoratiu Vultur  *   one or more Q-tags. Independent of port VLAN awareness
1150a335db8SHoratiu Vultur  * VCAP_KF_8021Q_VLAN_TAGS: W3, sparx5: is0
1160a335db8SHoratiu Vultur  *   Number of VLAN tags in frame: 0: Untagged, 1: Single tagged, 3: Double
1170a335db8SHoratiu Vultur  *   tagged, 7: Triple tagged
1180a335db8SHoratiu Vultur  * VCAP_KF_ACL_GRP_ID: W8, sparx5: es2
119ee72d90bSHoratiu Vultur  *   Used in interface map table
1208beef08fSSteen Hegelund  * VCAP_KF_ARP_ADDR_SPACE_OK_IS: W1, sparx5: is2/es2, lan966x: is2
121ee72d90bSHoratiu Vultur  *   Set if hardware address is Ethernet
1228beef08fSSteen Hegelund  * VCAP_KF_ARP_LEN_OK_IS: W1, sparx5: is2/es2, lan966x: is2
123f274a659SSteen Hegelund  *   Set if hardware address length = 6 (Ethernet) and IP address length = 4 (IP).
1248beef08fSSteen Hegelund  * VCAP_KF_ARP_OPCODE: W2, sparx5: is2/es2, lan966x: is2
125ee72d90bSHoratiu Vultur  *   ARP opcode
1268beef08fSSteen Hegelund  * VCAP_KF_ARP_OPCODE_UNKNOWN_IS: W1, sparx5: is2/es2, lan966x: is2
127ee72d90bSHoratiu Vultur  *   Set if not one of the codes defined in VCAP_KF_ARP_OPCODE
1288beef08fSSteen Hegelund  * VCAP_KF_ARP_PROTO_SPACE_OK_IS: W1, sparx5: is2/es2, lan966x: is2
129ee72d90bSHoratiu Vultur  *   Set if protocol address space is 0x0800
1308beef08fSSteen Hegelund  * VCAP_KF_ARP_SENDER_MATCH_IS: W1, sparx5: is2/es2, lan966x: is2
131ee72d90bSHoratiu Vultur  *   Sender Hardware Address = SMAC (ARP)
1328beef08fSSteen Hegelund  * VCAP_KF_ARP_TGT_MATCH_IS: W1, sparx5: is2/es2, lan966x: is2
133a5cc98adSSteen Hegelund  *   Target Hardware Address = SMAC (RARP)
1340a335db8SHoratiu Vultur  * VCAP_KF_COSID_CLS: W3, sparx5: es0/es2
1350a335db8SHoratiu Vultur  *   Class of service
1360a335db8SHoratiu Vultur  * VCAP_KF_ES0_ISDX_KEY_ENA: W1, sparx5: es2
137*99ce286dSHoratiu Vultur  *   The value taken from the IFH .FWD.ES0_ISDX_KEY_ENA
1388beef08fSSteen Hegelund  * VCAP_KF_ETYPE: W16, sparx5: is0/is2/es2, lan966x: is1/is2
139*99ce286dSHoratiu Vultur  *   Ethernet type
1408beef08fSSteen Hegelund  * VCAP_KF_ETYPE_LEN_IS: W1, sparx5: is0/is2/es2, lan966x: is1
141f274a659SSteen Hegelund  *   Set if frame has EtherType >= 0x600
142f274a659SSteen Hegelund  * VCAP_KF_HOST_MATCH: W1, lan966x: is2
143f274a659SSteen Hegelund  *   The action from the SMAC_SIP4 or SMAC_SIP6 lookups. Used for IP source
1440a335db8SHoratiu Vultur  *   guarding.
1450a335db8SHoratiu Vultur  * VCAP_KF_IF_EGR_PORT_MASK: W32, sparx5: es2
1460a335db8SHoratiu Vultur  *   Egress port mask, one bit per port
1470a335db8SHoratiu Vultur  * VCAP_KF_IF_EGR_PORT_MASK_RNG: W3, sparx5: es2
1480a335db8SHoratiu Vultur  *   Select which 32 port group is available in IF_EGR_PORT (or virtual ports or
149a5cc98adSSteen Hegelund  *   CPU queue)
150a5cc98adSSteen Hegelund  * VCAP_KF_IF_EGR_PORT_NO: sparx5 es0 W7, lan966x es0 W4
151*99ce286dSHoratiu Vultur  *   Egress port number
152*99ce286dSHoratiu Vultur  * VCAP_KF_IF_IGR_PORT: sparx5 is0 W7, sparx5 es2 W9, lan966x is1 W3, lan966x
1530a335db8SHoratiu Vultur  *   is2 W4, lan966x es0 W4
1540a335db8SHoratiu Vultur  *   Sparx5: Logical ingress port number retrieved from
155ee72d90bSHoratiu Vultur  *   ANA_CL::PORT_ID_CFG.LPORT_NUM or ERLEG, LAN966x: ingress port nunmber
156*99ce286dSHoratiu Vultur  * VCAP_KF_IF_IGR_PORT_MASK: sparx5 is0 W65, sparx5 is2 W32, sparx5 is2 W65,
1578beef08fSSteen Hegelund  *   lan966x is1 W9, lan966x is2 W9
1588beef08fSSteen Hegelund  *   Ingress port mask, one bit per port/erleg
1598beef08fSSteen Hegelund  * VCAP_KF_IF_IGR_PORT_MASK_L3: W1, sparx5: is2
1608beef08fSSteen Hegelund  *   If set, IF_IGR_PORT_MASK, IF_IGR_PORT_MASK_RNG, and IF_IGR_PORT_MASK_SEL are
1618beef08fSSteen Hegelund  *   used to specify L3 interfaces
1628beef08fSSteen Hegelund  * VCAP_KF_IF_IGR_PORT_MASK_RNG: W4, sparx5: is2
1638beef08fSSteen Hegelund  *   Range selector for IF_IGR_PORT_MASK.  Specifies which group of 32 ports are
1640a335db8SHoratiu Vultur  *   available in IF_IGR_PORT_MASK
1658beef08fSSteen Hegelund  * VCAP_KF_IF_IGR_PORT_MASK_SEL: W2, sparx5: is0/is2
1668beef08fSSteen Hegelund  *   Mode selector for IF_IGR_PORT_MASK, applicable when IF_IGR_PORT_MASK_L3 == 0.
1670a335db8SHoratiu Vultur  *   Mapping: 0: DEFAULT 1: LOOPBACK 2: MASQUERADE 3: CPU_VD
1680a335db8SHoratiu Vultur  * VCAP_KF_IF_IGR_PORT_SEL: W1, sparx5: es2
169*99ce286dSHoratiu Vultur  *   Selector for IF_IGR_PORT: physical port number or ERLEG
1708beef08fSSteen Hegelund  * VCAP_KF_IP4_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
171*99ce286dSHoratiu Vultur  *   Set if frame has EtherType = 0x800 and IP version = 4
172f274a659SSteen Hegelund  * VCAP_KF_IP_MC_IS: W1, sparx5: is0, lan966x: is1
173f274a659SSteen Hegelund  *   Set if frame is IPv4 frame and frame's destination MAC address is an IPv4
1740a335db8SHoratiu Vultur  *   multicast address (0x01005E0 /25). Set if frame is IPv6 frame and frame's
175*99ce286dSHoratiu Vultur  *   destination MAC address is an IPv6 multicast address (0x3333/16).
1760a335db8SHoratiu Vultur  * VCAP_KF_IP_PAYLOAD_5TUPLE: W32, sparx5: is0, lan966x: is1
177*99ce286dSHoratiu Vultur  *   Payload bytes after IP header
178*99ce286dSHoratiu Vultur  * VCAP_KF_IP_PAYLOAD_S1_IP6: W112, lan966x: is1
179*99ce286dSHoratiu Vultur  *   Payload after IPv6 header
1800a335db8SHoratiu Vultur  * VCAP_KF_IP_SNAP_IS: W1, sparx5: is0, lan966x: is1
181a5cc98adSSteen Hegelund  *   Set if frame is IPv4, IPv6, or SNAP frame
1828beef08fSSteen Hegelund  * VCAP_KF_ISDX_CLS: sparx5 is2 W12, sparx5 es0 W12, sparx5 es2 W12, lan966x es0
183a5cc98adSSteen Hegelund  *   W8
1848beef08fSSteen Hegelund  *   Classified ISDX
185*99ce286dSHoratiu Vultur  * VCAP_KF_ISDX_GT0_IS: W1, sparx5: is2/es0/es2, lan966x: is2/es0
186f274a659SSteen Hegelund  *   Set if classified ISDX > 0
1878beef08fSSteen Hegelund  * VCAP_KF_L2_BC_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2/es0
188*99ce286dSHoratiu Vultur  *   Set if frame's destination MAC address is the broadcast address
1898beef08fSSteen Hegelund  *   (FF-FF-FF-FF-FF-FF).
190f274a659SSteen Hegelund  * VCAP_KF_L2_DMAC: W48, sparx5: is0/is2/es2, lan966x: is1/is2
191f274a659SSteen Hegelund  *   Destination MAC address
1928beef08fSSteen Hegelund  * VCAP_KF_L2_FRM_TYPE: W4, lan966x: is2
1938beef08fSSteen Hegelund  *   Frame subtype for specific EtherTypes (MRP, DLR)
194f274a659SSteen Hegelund  * VCAP_KF_L2_FWD_IS: W1, sparx5: is2
195f274a659SSteen Hegelund  *   Set if the frame is allowed to be forwarded to front ports
196*99ce286dSHoratiu Vultur  * VCAP_KF_L2_LLC: W40, lan966x: is2
197*99ce286dSHoratiu Vultur  *   LLC header and data after up to two VLAN tags and the type/length field
198*99ce286dSHoratiu Vultur  * VCAP_KF_L2_MAC: W48, lan966x: is1
199f274a659SSteen Hegelund  *   MAC address (FIRST=1: SMAC, FIRST=0: DMAC)
200f274a659SSteen Hegelund  * VCAP_KF_L2_MC_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2/es0
201f274a659SSteen Hegelund  *   Set if frame's destination MAC address is a multicast address (bit 40 = 1).
202f274a659SSteen Hegelund  * VCAP_KF_L2_PAYLOAD0: W16, lan966x: is2
203f274a659SSteen Hegelund  *   Payload bytes 0-1 after the frame's EtherType
204f274a659SSteen Hegelund  * VCAP_KF_L2_PAYLOAD1: W8, lan966x: is2
205f274a659SSteen Hegelund  *   Payload byte 4 after the frame's EtherType. This is specifically for PTP
206f274a659SSteen Hegelund  *   frames.
207f274a659SSteen Hegelund  * VCAP_KF_L2_PAYLOAD2: W3, lan966x: is2
2080a335db8SHoratiu Vultur  *   Bits 7, 2, and 1 from payload byte 6 after the frame's EtherType. This is
2098beef08fSSteen Hegelund  *   specifically for PTP frames.
210*99ce286dSHoratiu Vultur  * VCAP_KF_L2_PAYLOAD_ETYPE: W64, sparx5: is2/es2
2118beef08fSSteen Hegelund  *   Byte 0-7 of L2 payload after Type/Len field and overloading for OAM
212f274a659SSteen Hegelund  * VCAP_KF_L2_SMAC: W48, sparx5: is0/is2/es2, lan966x: is1/is2
213f274a659SSteen Hegelund  *   Source MAC address
214ee72d90bSHoratiu Vultur  * VCAP_KF_L2_SNAP: W40, lan966x: is2
2158beef08fSSteen Hegelund  *   SNAP header after LLC header (AA-AA-03)
216a5cc98adSSteen Hegelund  * VCAP_KF_L3_DIP_EQ_SIP_IS: W1, sparx5: is2/es2, lan966x: is2
2170a335db8SHoratiu Vultur  *   Set if Src IP matches Dst IP address
218*99ce286dSHoratiu Vultur  * VCAP_KF_L3_DPL_CLS: W1, sparx5: es0/es2, lan966x: es0
219f274a659SSteen Hegelund  *   The frames drop precedence level
2208beef08fSSteen Hegelund  * VCAP_KF_L3_DSCP: W6, sparx5: is0, lan966x: is1
2218beef08fSSteen Hegelund  *   Frame's DSCP value
222*99ce286dSHoratiu Vultur  * VCAP_KF_L3_DST_IS: W1, sparx5: is2
223f274a659SSteen Hegelund  *   Set if lookup is done for egress router leg
2240a335db8SHoratiu Vultur  * VCAP_KF_L3_FRAGMENT: W1, lan966x: is1/is2
2258beef08fSSteen Hegelund  *   Set if IPv4 frame is fragmented
2260a335db8SHoratiu Vultur  * VCAP_KF_L3_FRAGMENT_TYPE: W2, sparx5: is0/is2/es2
2278beef08fSSteen Hegelund  *   L3 Fragmentation type (none, initial, suspicious, valid follow up)
2288beef08fSSteen Hegelund  * VCAP_KF_L3_FRAG_INVLD_L4_LEN: W1, sparx5: is0/is2
229*99ce286dSHoratiu Vultur  *   Set if frame's L4 length is less than ANA_CL:COMMON:CLM_FRAGMENT_CFG.L4_MIN_L
230f274a659SSteen Hegelund  *   EN
231*99ce286dSHoratiu Vultur  * VCAP_KF_L3_FRAG_OFS_GT0: W1, lan966x: is1/is2
2328beef08fSSteen Hegelund  *   Set if IPv4 frame is fragmented and it is not the first fragment
233*99ce286dSHoratiu Vultur  * VCAP_KF_L3_IP4_DIP: W32, sparx5: is0/is2/es2, lan966x: is1/is2
2348beef08fSSteen Hegelund  *   Destination IPv4 Address
235*99ce286dSHoratiu Vultur  * VCAP_KF_L3_IP4_SIP: W32, sparx5: is0/is2/es2, lan966x: is1/is2
236*99ce286dSHoratiu Vultur  *   Source IPv4 Address
2378beef08fSSteen Hegelund  * VCAP_KF_L3_IP6_DIP: sparx5 is0 W128, sparx5 is2 W128, sparx5 es2 W128,
2388beef08fSSteen Hegelund  *   lan966x is1 W64, lan966x is1 W128, lan966x is2 W128
239*99ce286dSHoratiu Vultur  *   Sparx5: Full IPv6 DIP, LAN966x: Either Full IPv6 DIP or a subset depending on
240*99ce286dSHoratiu Vultur  *   frame type
241*99ce286dSHoratiu Vultur  * VCAP_KF_L3_IP6_DIP_MSB: W16, lan966x: is1
242*99ce286dSHoratiu Vultur  *   MS 16bits of IPv6 DIP
2438beef08fSSteen Hegelund  * VCAP_KF_L3_IP6_SIP: sparx5 is0 W128, sparx5 is2 W128, sparx5 es2 W128,
2448beef08fSSteen Hegelund  *   lan966x is1 W128, lan966x is1 W64, lan966x is2 W128
245*99ce286dSHoratiu Vultur  *   Sparx5: Full IPv6 SIP, LAN966x: Either Full IPv6 SIP or a subset depending on
246*99ce286dSHoratiu Vultur  *   frame type
247*99ce286dSHoratiu Vultur  * VCAP_KF_L3_IP6_SIP_MSB: W16, lan966x: is1
2488beef08fSSteen Hegelund  *   MS 16bits of IPv6 DIP
249*99ce286dSHoratiu Vultur  * VCAP_KF_L3_IP_PROTO: W8, sparx5: is0/is2/es2, lan966x: is1/is2
2508beef08fSSteen Hegelund  *   IPv4 frames: IP protocol. IPv6 frames: Next header, same as for IPV4
251a5cc98adSSteen Hegelund  * VCAP_KF_L3_OPTIONS_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
252a5cc98adSSteen Hegelund  *   Set if IPv4 frame contains options (IP len > 5)
2538beef08fSSteen Hegelund  * VCAP_KF_L3_PAYLOAD: sparx5 is2 W96, sparx5 is2 W40, sparx5 es2 W96, sparx5
2548beef08fSSteen Hegelund  *   es2 W40, lan966x is2 W56
2558beef08fSSteen Hegelund  *   Sparx5: Payload bytes after IP header. IPv4: IPv4 options are not parsed so
2560a335db8SHoratiu Vultur  *   payload is always taken 20 bytes after the start of the IPv4 header, LAN966x:
2578beef08fSSteen Hegelund  *   Bytes 0-6 after IP header
258ee72d90bSHoratiu Vultur  * VCAP_KF_L3_RT_IS: W1, sparx5: is2/es2
2598beef08fSSteen Hegelund  *   Set if frame has hit a router leg
260ee72d90bSHoratiu Vultur  * VCAP_KF_L3_TOS: W8, sparx5: is2/es2, lan966x: is2
2618beef08fSSteen Hegelund  *   Sparx5: Frame's IPv4/IPv6 DSCP and ECN fields, LAN966x: IP TOS field
262f274a659SSteen Hegelund  * VCAP_KF_L3_TTL_GT0: W1, sparx5: is2/es2, lan966x: is2
263f274a659SSteen Hegelund  *   Set if IPv4 TTL / IPv6 hop limit is greater than 0
264f274a659SSteen Hegelund  * VCAP_KF_L4_1588_DOM: W8, lan966x: is2
265f274a659SSteen Hegelund  *   PTP over UDP: domainNumber
266ee72d90bSHoratiu Vultur  * VCAP_KF_L4_1588_VER: W4, lan966x: is2
2678beef08fSSteen Hegelund  *   PTP over UDP: version
2688beef08fSSteen Hegelund  * VCAP_KF_L4_ACK: W1, sparx5: is2/es2, lan966x: is2
269ee72d90bSHoratiu Vultur  *   Sparx5 and LAN966x: TCP flag ACK, LAN966x only: PTP over UDP: flagField bit 2
2708beef08fSSteen Hegelund  *   (unicastFlag)
2718beef08fSSteen Hegelund  * VCAP_KF_L4_DPORT: W16, sparx5: is2/es2, lan966x: is2
272f274a659SSteen Hegelund  *   Sparx5: TCP/UDP destination port. Overloading for IP_7TUPLE: Non-TCP/UDP IP
2738beef08fSSteen Hegelund  *   frames: L4_DPORT = L3_IP_PROTO, LAN966x: TCP/UDP destination port
2740a335db8SHoratiu Vultur  * VCAP_KF_L4_FIN: W1, sparx5: is2/es2, lan966x: is2
2758beef08fSSteen Hegelund  *   TCP flag FIN, LAN966x: TCP flag FIN, and for PTP over UDP: messageType bit 1
276f274a659SSteen Hegelund  * VCAP_KF_L4_PAYLOAD: W64, sparx5: is2/es2
2778beef08fSSteen Hegelund  *   Payload bytes after TCP/UDP header Overloading for IP_7TUPLE: Non TCP/UDP
2788beef08fSSteen Hegelund  *   frames: Payload bytes 0-7 after IP header. IPv4 options are not parsed so
279ee72d90bSHoratiu Vultur  *   payload is always taken 20 bytes after the start of the IPv4 header for non
2808beef08fSSteen Hegelund  *   TCP/UDP IPv4 frames
2818beef08fSSteen Hegelund  * VCAP_KF_L4_PSH: W1, sparx5: is2/es2, lan966x: is2
282*99ce286dSHoratiu Vultur  *   Sparx5: TCP flag PSH, LAN966x: TCP: TCP flag PSH. PTP over UDP: flagField bit
283*99ce286dSHoratiu Vultur  *   1 (twoStepFlag)
2848beef08fSSteen Hegelund  * VCAP_KF_L4_RNG: sparx5 is0 W8, sparx5 is2 W16, sparx5 es2 W16, lan966x is1
2858beef08fSSteen Hegelund  *   W8, lan966x is2 W8
2868beef08fSSteen Hegelund  *   Range checker bitmask (one for each range checker). Input into range checkers
287ee72d90bSHoratiu Vultur  *   is taken from classified results (VID, DSCP) and frame (SPORT, DPORT, ETYPE,
2888beef08fSSteen Hegelund  *   outer VID, inner VID)
2898beef08fSSteen Hegelund  * VCAP_KF_L4_RST: W1, sparx5: is2/es2, lan966x: is2
290ee72d90bSHoratiu Vultur  *   Sparx5: TCP flag RST , LAN966x: TCP: TCP flag RST. PTP over UDP: messageType
2918beef08fSSteen Hegelund  *   bit 3
2928beef08fSSteen Hegelund  * VCAP_KF_L4_SEQUENCE_EQ0_IS: W1, sparx5: is2/es2, lan966x: is2
293*99ce286dSHoratiu Vultur  *   Set if TCP sequence number is 0, LAN966x: Overlayed with PTP over UDP:
2948beef08fSSteen Hegelund  *   messageType bit 0
295ee72d90bSHoratiu Vultur  * VCAP_KF_L4_SPORT: W16, sparx5: is0/is2/es2, lan966x: is1/is2
2968beef08fSSteen Hegelund  *   TCP/UDP source port
297ee72d90bSHoratiu Vultur  * VCAP_KF_L4_SPORT_EQ_DPORT_IS: W1, sparx5: is2/es2, lan966x: is2
2988beef08fSSteen Hegelund  *   Set if UDP or TCP source port equals UDP or TCP destination port
2998beef08fSSteen Hegelund  * VCAP_KF_L4_SYN: W1, sparx5: is2/es2, lan966x: is2
300ee72d90bSHoratiu Vultur  *   Sparx5: TCP flag SYN, LAN966x: TCP: TCP flag SYN. PTP over UDP: messageType
3018beef08fSSteen Hegelund  *   bit 2
3028beef08fSSteen Hegelund  * VCAP_KF_L4_URG: W1, sparx5: is2/es2, lan966x: is2
303*99ce286dSHoratiu Vultur  *   Sparx5: TCP flag URG, LAN966x: TCP: TCP flag URG. PTP over UDP: flagField bit
3048beef08fSSteen Hegelund  *   7 (reserved)
3058beef08fSSteen Hegelund  * VCAP_KF_LOOKUP_FIRST_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
3060a335db8SHoratiu Vultur  *   Selects between entries relevant for first and second lookup. Set for first
3070a335db8SHoratiu Vultur  *   lookup, cleared for second lookup.
3080a335db8SHoratiu Vultur  * VCAP_KF_LOOKUP_GEN_IDX: W12, sparx5: is0
3090a335db8SHoratiu Vultur  *   Generic index - for chaining CLM instances
310*99ce286dSHoratiu Vultur  * VCAP_KF_LOOKUP_GEN_IDX_SEL: W2, sparx5: is0
311*99ce286dSHoratiu Vultur  *   Select the mode of the Generic Index
312*99ce286dSHoratiu Vultur  * VCAP_KF_LOOKUP_INDEX: W2, lan966x: is1
313ee72d90bSHoratiu Vultur  *   0: First lookup, 1: Second lookup, 2: Third lookup, Similar to VCAP_KF_FIRST
3148beef08fSSteen Hegelund  *   but with extra info
3159d712b8dSSteen Hegelund  * VCAP_KF_LOOKUP_PAG: W8, sparx5: is2, lan966x: is2
3169d712b8dSSteen Hegelund  *   Classified Policy Association Group: chains rules from IS1/CLM to IS2
317ee72d90bSHoratiu Vultur  * VCAP_KF_MIRROR_PROBE: W2, sparx5: es2
3188beef08fSSteen Hegelund  *   Identifies frame copies generated as a result of mirroring
319f274a659SSteen Hegelund  * VCAP_KF_OAM_CCM_CNTS_EQ0: W1, sparx5: is2/es2, lan966x: is2
320f274a659SSteen Hegelund  *   Dual-ended loss measurement counters in CCM frames are all zero
321f274a659SSteen Hegelund  * VCAP_KF_OAM_DETECTED: W1, lan966x: is2
322f274a659SSteen Hegelund  *   This is missing in the datasheet, but present in the OAM keyset in XML
323f274a659SSteen Hegelund  * VCAP_KF_OAM_FLAGS: W8, lan966x: is2
3240a335db8SHoratiu Vultur  *   Frame's OAM flags
325f274a659SSteen Hegelund  * VCAP_KF_OAM_MEL_FLAGS: W7, lan966x: is2
326f274a659SSteen Hegelund  *   Encoding of MD level/MEG level (MEL)
327f274a659SSteen Hegelund  * VCAP_KF_OAM_MEPID: W16, lan966x: is2
328f274a659SSteen Hegelund  *   CCM frame's OAM MEP ID
329f274a659SSteen Hegelund  * VCAP_KF_OAM_OPCODE: W8, lan966x: is2
330f274a659SSteen Hegelund  *   Frame's OAM opcode
331f274a659SSteen Hegelund  * VCAP_KF_OAM_VER: W5, lan966x: is2
332f274a659SSteen Hegelund  *   Frame's OAM version
333a5cc98adSSteen Hegelund  * VCAP_KF_OAM_Y1731_IS: W1, sparx5: is2/es2, lan966x: is2
3340a335db8SHoratiu Vultur  *   Set if frame's EtherType = 0x8902
335*99ce286dSHoratiu Vultur  * VCAP_KF_PDU_TYPE: W4, lan966x: es0
336*99ce286dSHoratiu Vultur  *   PDU type value (none, OAM CCM, MRP, DLR, RTE, IPv4, IPv6, OAM non-CCM)
337*99ce286dSHoratiu Vultur  * VCAP_KF_PROT_ACTIVE: W1, sparx5: es0/es2
338*99ce286dSHoratiu Vultur  *   Protection is active
339*99ce286dSHoratiu Vultur  * VCAP_KF_RTP_ID: W10, lan966x: es0
340*99ce286dSHoratiu Vultur  *   Classified RTP_ID
341*99ce286dSHoratiu Vultur  * VCAP_KF_RT_FRMID: W32, lan966x: is1
342*99ce286dSHoratiu Vultur  *   Profinet or OPC-UA FrameId
3438beef08fSSteen Hegelund  * VCAP_KF_RT_TYPE: W2, lan966x: is1
3448beef08fSSteen Hegelund  *   Encoding of frame's EtherType: 0: Other, 1: Profinet, 2: OPC-UA, 3: Custom
345*99ce286dSHoratiu Vultur  *   (ANA::RT_CUSTOM)
3468beef08fSSteen Hegelund  * VCAP_KF_RT_VLAN_IDX: W3, lan966x: is1
3478beef08fSSteen Hegelund  *   Real-time VLAN index from ANA::RT_VLAN_PCP
3480a335db8SHoratiu Vultur  * VCAP_KF_TCP_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
349*99ce286dSHoratiu Vultur  *   Set if frame is IPv4 TCP frame (IP protocol = 6) or IPv6 TCP frames (Next
350*99ce286dSHoratiu Vultur  *   header = 6)
3518beef08fSSteen Hegelund  * VCAP_KF_TCP_UDP_IS: W1, sparx5: is0/is2/es2, lan966x: is1
3528beef08fSSteen Hegelund  *   Set if frame is IPv4/IPv6 TCP or UDP frame (IP protocol/next header equals 6
3538beef08fSSteen Hegelund  *   or 17)
3548beef08fSSteen Hegelund  * VCAP_KF_TYPE: sparx5 is0 W2, sparx5 is0 W1, sparx5 is2 W4, sparx5 is2 W2,
3558beef08fSSteen Hegelund  *   sparx5 es0 W1, sparx5 es2 W3, lan966x is1 W1, lan966x is1 W2, lan966x is2 W4,
3568beef08fSSteen Hegelund  *   lan966x is2 W2
3570a335db8SHoratiu Vultur  *   Keyset type id - set by the API
3580a335db8SHoratiu Vultur  */
3590a335db8SHoratiu Vultur 
3600a335db8SHoratiu Vultur /* Keyfield names */
3610a335db8SHoratiu Vultur enum vcap_key_field {
3620a335db8SHoratiu Vultur 	VCAP_KF_NO_VALUE,  /* initial value */
363*99ce286dSHoratiu Vultur 	VCAP_KF_8021BR_ECID_BASE,
3640a335db8SHoratiu Vultur 	VCAP_KF_8021BR_ECID_EXT,
3650a335db8SHoratiu Vultur 	VCAP_KF_8021BR_E_TAGGED,
3660a335db8SHoratiu Vultur 	VCAP_KF_8021BR_GRP,
3678beef08fSSteen Hegelund 	VCAP_KF_8021BR_IGR_ECID_BASE,
3680a335db8SHoratiu Vultur 	VCAP_KF_8021BR_IGR_ECID_EXT,
3690a335db8SHoratiu Vultur 	VCAP_KF_8021CB_R_TAGGED_IS,
3700a335db8SHoratiu Vultur 	VCAP_KF_8021Q_DEI0,
3718beef08fSSteen Hegelund 	VCAP_KF_8021Q_DEI1,
372a5cc98adSSteen Hegelund 	VCAP_KF_8021Q_DEI2,
3730a335db8SHoratiu Vultur 	VCAP_KF_8021Q_DEI_CLS,
3740a335db8SHoratiu Vultur 	VCAP_KF_8021Q_PCP0,
3750a335db8SHoratiu Vultur 	VCAP_KF_8021Q_PCP1,
3760a335db8SHoratiu Vultur 	VCAP_KF_8021Q_PCP2,
3770a335db8SHoratiu Vultur 	VCAP_KF_8021Q_PCP_CLS,
3780a335db8SHoratiu Vultur 	VCAP_KF_8021Q_TPID,
3798beef08fSSteen Hegelund 	VCAP_KF_8021Q_TPID0,
380*99ce286dSHoratiu Vultur 	VCAP_KF_8021Q_TPID1,
3818beef08fSSteen Hegelund 	VCAP_KF_8021Q_TPID2,
3820a335db8SHoratiu Vultur 	VCAP_KF_8021Q_VID0,
3830a335db8SHoratiu Vultur 	VCAP_KF_8021Q_VID1,
3848beef08fSSteen Hegelund 	VCAP_KF_8021Q_VID2,
3858beef08fSSteen Hegelund 	VCAP_KF_8021Q_VID_CLS,
3868beef08fSSteen Hegelund 	VCAP_KF_8021Q_VLAN_DBL_TAGGED_IS,
3878beef08fSSteen Hegelund 	VCAP_KF_8021Q_VLAN_TAGGED_IS,
3888beef08fSSteen Hegelund 	VCAP_KF_8021Q_VLAN_TAGS,
3898beef08fSSteen Hegelund 	VCAP_KF_ACL_GRP_ID,
3908beef08fSSteen Hegelund 	VCAP_KF_ARP_ADDR_SPACE_OK_IS,
3910a335db8SHoratiu Vultur 	VCAP_KF_ARP_LEN_OK_IS,
3920a335db8SHoratiu Vultur 	VCAP_KF_ARP_OPCODE,
3938beef08fSSteen Hegelund 	VCAP_KF_ARP_OPCODE_UNKNOWN_IS,
3948beef08fSSteen Hegelund 	VCAP_KF_ARP_PROTO_SPACE_OK_IS,
395f274a659SSteen Hegelund 	VCAP_KF_ARP_SENDER_MATCH_IS,
3960a335db8SHoratiu Vultur 	VCAP_KF_ARP_TGT_MATCH_IS,
3970a335db8SHoratiu Vultur 	VCAP_KF_COSID_CLS,
398a5cc98adSSteen Hegelund 	VCAP_KF_ES0_ISDX_KEY_ENA,
3990a335db8SHoratiu Vultur 	VCAP_KF_ETYPE,
4008beef08fSSteen Hegelund 	VCAP_KF_ETYPE_LEN_IS,
4018beef08fSSteen Hegelund 	VCAP_KF_HOST_MATCH,
4028beef08fSSteen Hegelund 	VCAP_KF_IF_EGR_PORT_MASK,
4038beef08fSSteen Hegelund 	VCAP_KF_IF_EGR_PORT_MASK_RNG,
4040a335db8SHoratiu Vultur 	VCAP_KF_IF_EGR_PORT_NO,
4058beef08fSSteen Hegelund 	VCAP_KF_IF_IGR_PORT,
4060a335db8SHoratiu Vultur 	VCAP_KF_IF_IGR_PORT_MASK,
4070a335db8SHoratiu Vultur 	VCAP_KF_IF_IGR_PORT_MASK_L3,
408*99ce286dSHoratiu Vultur 	VCAP_KF_IF_IGR_PORT_MASK_RNG,
4090a335db8SHoratiu Vultur 	VCAP_KF_IF_IGR_PORT_MASK_SEL,
4108beef08fSSteen Hegelund 	VCAP_KF_IF_IGR_PORT_SEL,
4118beef08fSSteen Hegelund 	VCAP_KF_IP4_IS,
4128beef08fSSteen Hegelund 	VCAP_KF_IP_MC_IS,
4138beef08fSSteen Hegelund 	VCAP_KF_IP_PAYLOAD_5TUPLE,
414f274a659SSteen Hegelund 	VCAP_KF_IP_PAYLOAD_S1_IP6,
4158beef08fSSteen Hegelund 	VCAP_KF_IP_SNAP_IS,
416f274a659SSteen Hegelund 	VCAP_KF_ISDX_CLS,
417*99ce286dSHoratiu Vultur 	VCAP_KF_ISDX_GT0_IS,
4188beef08fSSteen Hegelund 	VCAP_KF_L2_BC_IS,
419f274a659SSteen Hegelund 	VCAP_KF_L2_DMAC,
420f274a659SSteen Hegelund 	VCAP_KF_L2_FRM_TYPE,
421f274a659SSteen Hegelund 	VCAP_KF_L2_FWD_IS,
4228beef08fSSteen Hegelund 	VCAP_KF_L2_LLC,
4238beef08fSSteen Hegelund 	VCAP_KF_L2_MAC,
424f274a659SSteen Hegelund 	VCAP_KF_L2_MC_IS,
4258beef08fSSteen Hegelund 	VCAP_KF_L2_PAYLOAD0,
4260a335db8SHoratiu Vultur 	VCAP_KF_L2_PAYLOAD1,
4270a335db8SHoratiu Vultur 	VCAP_KF_L2_PAYLOAD2,
4288beef08fSSteen Hegelund 	VCAP_KF_L2_PAYLOAD_ETYPE,
429f274a659SSteen Hegelund 	VCAP_KF_L2_SMAC,
4308beef08fSSteen Hegelund 	VCAP_KF_L2_SNAP,
4318beef08fSSteen Hegelund 	VCAP_KF_L3_DIP_EQ_SIP_IS,
432f274a659SSteen Hegelund 	VCAP_KF_L3_DPL_CLS,
4338beef08fSSteen Hegelund 	VCAP_KF_L3_DSCP,
4348beef08fSSteen Hegelund 	VCAP_KF_L3_DST_IS,
4358beef08fSSteen Hegelund 	VCAP_KF_L3_FRAGMENT,
436*99ce286dSHoratiu Vultur 	VCAP_KF_L3_FRAGMENT_TYPE,
4378beef08fSSteen Hegelund 	VCAP_KF_L3_FRAG_INVLD_L4_LEN,
438*99ce286dSHoratiu Vultur 	VCAP_KF_L3_FRAG_OFS_GT0,
4398beef08fSSteen Hegelund 	VCAP_KF_L3_IP4_DIP,
4408beef08fSSteen Hegelund 	VCAP_KF_L3_IP4_SIP,
4418beef08fSSteen Hegelund 	VCAP_KF_L3_IP6_DIP,
4428beef08fSSteen Hegelund 	VCAP_KF_L3_IP6_DIP_MSB,
4438beef08fSSteen Hegelund 	VCAP_KF_L3_IP6_SIP,
4448beef08fSSteen Hegelund 	VCAP_KF_L3_IP6_SIP_MSB,
445f274a659SSteen Hegelund 	VCAP_KF_L3_IP_PROTO,
446f274a659SSteen Hegelund 	VCAP_KF_L3_OPTIONS_IS,
4478beef08fSSteen Hegelund 	VCAP_KF_L3_PAYLOAD,
4488beef08fSSteen Hegelund 	VCAP_KF_L3_RT_IS,
4498beef08fSSteen Hegelund 	VCAP_KF_L3_TOS,
4508beef08fSSteen Hegelund 	VCAP_KF_L3_TTL_GT0,
4518beef08fSSteen Hegelund 	VCAP_KF_L4_1588_DOM,
4528beef08fSSteen Hegelund 	VCAP_KF_L4_1588_VER,
4538beef08fSSteen Hegelund 	VCAP_KF_L4_ACK,
4548beef08fSSteen Hegelund 	VCAP_KF_L4_DPORT,
4558beef08fSSteen Hegelund 	VCAP_KF_L4_FIN,
4568beef08fSSteen Hegelund 	VCAP_KF_L4_PAYLOAD,
4578beef08fSSteen Hegelund 	VCAP_KF_L4_PSH,
4588beef08fSSteen Hegelund 	VCAP_KF_L4_RNG,
4598beef08fSSteen Hegelund 	VCAP_KF_L4_RST,
4600a335db8SHoratiu Vultur 	VCAP_KF_L4_SEQUENCE_EQ0_IS,
4610a335db8SHoratiu Vultur 	VCAP_KF_L4_SPORT,
462*99ce286dSHoratiu Vultur 	VCAP_KF_L4_SPORT_EQ_DPORT_IS,
4638beef08fSSteen Hegelund 	VCAP_KF_L4_SYN,
4649d712b8dSSteen Hegelund 	VCAP_KF_L4_URG,
4658beef08fSSteen Hegelund 	VCAP_KF_LOOKUP_FIRST_IS,
466f274a659SSteen Hegelund 	VCAP_KF_LOOKUP_GEN_IDX,
467f274a659SSteen Hegelund 	VCAP_KF_LOOKUP_GEN_IDX_SEL,
4680a335db8SHoratiu Vultur 	VCAP_KF_LOOKUP_INDEX,
469f274a659SSteen Hegelund 	VCAP_KF_LOOKUP_PAG,
470f274a659SSteen Hegelund 	VCAP_KF_MIRROR_PROBE,
471f274a659SSteen Hegelund 	VCAP_KF_OAM_CCM_CNTS_EQ0,
4728beef08fSSteen Hegelund 	VCAP_KF_OAM_DETECTED,
4730a335db8SHoratiu Vultur 	VCAP_KF_OAM_FLAGS,
474*99ce286dSHoratiu Vultur 	VCAP_KF_OAM_MEL_FLAGS,
475*99ce286dSHoratiu Vultur 	VCAP_KF_OAM_MEPID,
476*99ce286dSHoratiu Vultur 	VCAP_KF_OAM_OPCODE,
4778beef08fSSteen Hegelund 	VCAP_KF_OAM_VER,
4788beef08fSSteen Hegelund 	VCAP_KF_OAM_Y1731_IS,
4798beef08fSSteen Hegelund 	VCAP_KF_PDU_TYPE,
4808beef08fSSteen Hegelund 	VCAP_KF_PROT_ACTIVE,
4818beef08fSSteen Hegelund 	VCAP_KF_RTP_ID,
4828beef08fSSteen Hegelund 	VCAP_KF_RT_FRMID,
4838beef08fSSteen Hegelund 	VCAP_KF_RT_TYPE,
4848beef08fSSteen Hegelund 	VCAP_KF_RT_VLAN_IDX,
485ee72d90bSHoratiu Vultur 	VCAP_KF_TCP_IS,
4860a335db8SHoratiu Vultur 	VCAP_KF_TCP_UDP_IS,
4870a335db8SHoratiu Vultur 	VCAP_KF_TYPE,
488a5cc98adSSteen Hegelund };
4890a335db8SHoratiu Vultur 
490*99ce286dSHoratiu Vultur /* Actionset names with origin information */
491f274a659SSteen Hegelund enum vcap_actionfield_set {
4928beef08fSSteen Hegelund 	VCAP_AFS_NO_VALUE,          /* initial value */
4938beef08fSSteen Hegelund 	VCAP_AFS_BASE_TYPE,         /* sparx5 is2 X3, sparx5 es2 X3, lan966x is2 X2 */
4948beef08fSSteen Hegelund 	VCAP_AFS_CLASSIFICATION,    /* sparx5 is0 X2 */
4958beef08fSSteen Hegelund 	VCAP_AFS_CLASS_REDUCED,     /* sparx5 is0 X1 */
496f274a659SSteen Hegelund 	VCAP_AFS_ES0,               /* sparx5 es0 X1 */
497f274a659SSteen Hegelund 	VCAP_AFS_FULL,              /* sparx5 is0 X3 */
498f274a659SSteen Hegelund 	VCAP_AFS_S1,                /* lan966x is1 X1 */
499f274a659SSteen Hegelund 	VCAP_AFS_SMAC_SIP,          /* lan966x is2 X1 */
5000a335db8SHoratiu Vultur 	VCAP_AFS_VID,               /* lan966x es0 X1 */
5010a335db8SHoratiu Vultur };
5020a335db8SHoratiu Vultur 
5030a335db8SHoratiu Vultur /* List of actionfields with description
5040a335db8SHoratiu Vultur  *
5050a335db8SHoratiu Vultur  * VCAP_AF_ACL_ID: W6, lan966x: is2
5060a335db8SHoratiu Vultur  *   Logical ID for the entry. This ID is extracted together with the frame in the
5070a335db8SHoratiu Vultur  *   CPU extraction header. Only applicable to actions with CPU_COPY_ENA or
5088beef08fSSteen Hegelund  *   HIT_ME_ONCE set.
5098beef08fSSteen Hegelund  * VCAP_AF_CLS_VID_SEL: W3, sparx5: is0
5100a335db8SHoratiu Vultur  *   Controls the classified VID: 0: VID_NONE: No action. 1: VID_ADD: New VID =
5110a335db8SHoratiu Vultur  *   old VID + VID_VAL. 2: VID_REPLACE: New VID = VID_VAL. 3: VID_FIRST_TAG: New
5120a335db8SHoratiu Vultur  *   VID = VID from frame's first tag (outer tag) if available, otherwise VID_VAL.
5130a335db8SHoratiu Vultur  *   4: VID_SECOND_TAG: New VID = VID from frame's second tag (middle tag) if
514ee72d90bSHoratiu Vultur  *   available, otherwise VID_VAL. 5: VID_THIRD_TAG: New VID = VID from frame's
5158beef08fSSteen Hegelund  *   third tag (inner tag) if available, otherwise VID_VAL.
5168beef08fSSteen Hegelund  * VCAP_AF_CNT_ID: sparx5 is2 W12, sparx5 es2 W11
517a5cc98adSSteen Hegelund  *   Counter ID, used per lookup to index the 4K frame counters (ANA_ACL:CNT_TBL).
518a5cc98adSSteen Hegelund  *   Multiple VCAP IS2 entries can use the same counter.
519ee72d90bSHoratiu Vultur  * VCAP_AF_COPY_PORT_NUM: W7, sparx5: es2
5208beef08fSSteen Hegelund  *   QSYS port number when FWD_MODE is redirect or copy
521*99ce286dSHoratiu Vultur  * VCAP_AF_COPY_QUEUE_NUM: W16, sparx5: es2
522*99ce286dSHoratiu Vultur  *   QSYS queue number when FWD_MODE is redirect or copy
523*99ce286dSHoratiu Vultur  * VCAP_AF_CPU_COPY_ENA: W1, sparx5: is2/es2, lan966x: is2
524*99ce286dSHoratiu Vultur  *   Setting this bit to 1 causes all frames that hit this action to be copied to
525*99ce286dSHoratiu Vultur  *   the CPU extraction queue specified in CPU_QUEUE_NUM.
526a5cc98adSSteen Hegelund  * VCAP_AF_CPU_QU: W3, sparx5: es0
527a5cc98adSSteen Hegelund  *   CPU extraction queue. Used when FWD_SEL >0 and PIPELINE_ACT = XTR.
528a5cc98adSSteen Hegelund  * VCAP_AF_CPU_QUEUE_NUM: W3, sparx5: is2/es2, lan966x: is2
529a5cc98adSSteen Hegelund  *   CPU queue number. Used when CPU_COPY_ENA is set.
530a5cc98adSSteen Hegelund  * VCAP_AF_CUSTOM_ACE_TYPE_ENA: W4, lan966x: is1
531a5cc98adSSteen Hegelund  *   Enables use of custom keys in IS2. Bits 3:2 control second lookup in IS2
532*99ce286dSHoratiu Vultur  *   while bits 1:0 control first lookup. Encoding per lookup: 0: Disabled.  1:
5330a335db8SHoratiu Vultur  *   Extract 40 bytes after position corresponding to the location of the IPv4
5340a335db8SHoratiu Vultur  *   header and use as key.  2: Extract 40 bytes after SMAC and use as key
535*99ce286dSHoratiu Vultur  * VCAP_AF_DEI_A_VAL: W1, sparx5: es0, lan966x: es0
5360a335db8SHoratiu Vultur  *   DEI used in ES0 tag A. See TAG_A_DEI_SEL.
537*99ce286dSHoratiu Vultur  * VCAP_AF_DEI_B_VAL: W1, sparx5: es0, lan966x: es0
538*99ce286dSHoratiu Vultur  *   DEI used in ES0 tag B. See TAG_B_DEI_SEL.
539*99ce286dSHoratiu Vultur  * VCAP_AF_DEI_C_VAL: W1, sparx5: es0
540*99ce286dSHoratiu Vultur  *   DEI used in ES0 tag C. See TAG_C_DEI_SEL.
5410a335db8SHoratiu Vultur  * VCAP_AF_DEI_ENA: W1, sparx5: is0, lan966x: is1
5420a335db8SHoratiu Vultur  *   If set, use DEI_VAL as classified DEI value. Otherwise, DEI from basic
543*99ce286dSHoratiu Vultur  *   classification is used
5440a335db8SHoratiu Vultur  * VCAP_AF_DEI_VAL: W1, sparx5: is0, lan966x: is1
545*99ce286dSHoratiu Vultur  *   See DEI_ENA
5460a335db8SHoratiu Vultur  * VCAP_AF_DLR_SEL: W2, lan966x: is1
5470a335db8SHoratiu Vultur  *   0: No changes to port-based selection in ANA:PORT:OAM_CFG.DLR_ENA.  1: Enable
548a5cc98adSSteen Hegelund  *   DLR frame processing 2: Disable DLR processing
549a5cc98adSSteen Hegelund  * VCAP_AF_DP_ENA: W1, sparx5: is0, lan966x: is1
550a5cc98adSSteen Hegelund  *   If set, use DP_VAL as classified drop precedence level. Otherwise, drop
551a5cc98adSSteen Hegelund  *   precedence level from basic classification is used.
552a5cc98adSSteen Hegelund  * VCAP_AF_DP_VAL: sparx5 is0 W2, lan966x is1 W1
553a5cc98adSSteen Hegelund  *   See DP_ENA.
554*99ce286dSHoratiu Vultur  * VCAP_AF_DSCP_ENA: W1, sparx5: is0, lan966x: is1
5550a335db8SHoratiu Vultur  *   If set, use DSCP_VAL as classified DSCP value. Otherwise, DSCP value from
5560a335db8SHoratiu Vultur  *   basic classification is used.
5570a335db8SHoratiu Vultur  * VCAP_AF_DSCP_SEL: W3, sparx5: es0
5580a335db8SHoratiu Vultur  *   Selects source for DSCP. 0: Controlled by port configuration and IFH. 1:
559a5cc98adSSteen Hegelund  *   Classified DSCP via IFH. 2: DSCP_VAL. 3: Reserved. 4: Mapped using mapping
560a5cc98adSSteen Hegelund  *   table 0, otherwise use DSCP_VAL. 5: Mapped using mapping table 1, otherwise
561a5cc98adSSteen Hegelund  *   use mapping table 0. 6: Mapped using mapping table 2, otherwise use DSCP_VAL.
562f274a659SSteen Hegelund  *   7: Mapped using mapping table 3, otherwise use mapping table 2
563f274a659SSteen Hegelund  * VCAP_AF_DSCP_VAL: W6, sparx5: is0/es0, lan966x: is1
564f274a659SSteen Hegelund  *   See DSCP_ENA.
5650a335db8SHoratiu Vultur  * VCAP_AF_ES2_REW_CMD: W3, sparx5: es2
5660a335db8SHoratiu Vultur  *   Command forwarded to REW: 0: No action. 1: SWAP MAC addresses. 2: Do L2CP
567a5cc98adSSteen Hegelund  *   DMAC translation when entering or leaving a tunnel.
568a5cc98adSSteen Hegelund  * VCAP_AF_ESDX: sparx5 es0 W13, lan966x es0 W8
569a5cc98adSSteen Hegelund  *   Egress counter index. Used to index egress counter set as defined in
570ee72d90bSHoratiu Vultur  *   REW::STAT_CFG.
5718beef08fSSteen Hegelund  * VCAP_AF_FWD_KILL_ENA: W1, lan966x: is2
5728beef08fSSteen Hegelund  *   Setting this bit to 1 denies forwarding of the frame forwarding to any front
5738beef08fSSteen Hegelund  *   port. The frame can still be copied to the CPU by other actions.
5748beef08fSSteen Hegelund  * VCAP_AF_FWD_MODE: W2, sparx5: es2
5758beef08fSSteen Hegelund  *   Forward selector: 0: Forward. 1: Discard. 2: Redirect. 3: Copy.
576f274a659SSteen Hegelund  * VCAP_AF_FWD_SEL: W2, sparx5: es0
577f274a659SSteen Hegelund  *   ES0 Forward selector. 0: No action. 1: Copy to loopback interface. 2:
578f274a659SSteen Hegelund  *   Redirect to loopback interface. 3: Discard
579f274a659SSteen Hegelund  * VCAP_AF_HIT_ME_ONCE: W1, sparx5: is2/es2, lan966x: is2
5800a335db8SHoratiu Vultur  *   Setting this bit to 1 causes the first frame that hits this action where the
5818beef08fSSteen Hegelund  *   HIT_CNT counter is zero to be copied to the CPU extraction queue specified in
5828beef08fSSteen Hegelund  *   CPU_QUEUE_NUM. The HIT_CNT counter is then incremented and any frames that
5830a335db8SHoratiu Vultur  *   hit this action later are not copied to the CPU. To re-enable the HIT_ME_ONCE
5848beef08fSSteen Hegelund  *   functionality, the HIT_CNT counter must be cleared.
5850a335db8SHoratiu Vultur  * VCAP_AF_HOST_MATCH: W1, lan966x: is2
5860a335db8SHoratiu Vultur  *   Used for IP source guarding. If set, it signals that the host is a valid (for
5870a335db8SHoratiu Vultur  *   instance a valid combination of source MAC address and source IP address).
588*99ce286dSHoratiu Vultur  *   HOST_MATCH is input to the IS2 keys.
589*99ce286dSHoratiu Vultur  * VCAP_AF_IGNORE_PIPELINE_CTRL: W1, sparx5: is2/es2
590*99ce286dSHoratiu Vultur  *   Ignore ingress pipeline control. This enforces the use of the VCAP IS2 action
591*99ce286dSHoratiu Vultur  *   even when the pipeline control has terminated the frame before VCAP IS2.
592*99ce286dSHoratiu Vultur  * VCAP_AF_INTR_ENA: W1, sparx5: is2/es2
593f274a659SSteen Hegelund  *   If set, an interrupt is triggered when this rule is hit
594f274a659SSteen Hegelund  * VCAP_AF_ISDX_ADD_REPLACE_SEL: W1, sparx5: is0
595f274a659SSteen Hegelund  *   Controls the classified ISDX. 0: New ISDX = old ISDX + ISDX_VAL. 1: New ISDX
596*99ce286dSHoratiu Vultur  *   = ISDX_VAL.
597*99ce286dSHoratiu Vultur  * VCAP_AF_ISDX_ADD_VAL: W8, lan966x: is1
5980a335db8SHoratiu Vultur  *   If ISDX_REPLACE_ENA is set, ISDX_ADD_VAL is used directly as the new ISDX.
5990a335db8SHoratiu Vultur  *   Encoding: ISDX_REPLACE_ENA=0, ISDX_ADD_VAL=0: Disabled ISDX_EPLACE_ENA=0,
600a5cc98adSSteen Hegelund  *   ISDX_ADD_VAL>0: Add value to classified ISDX. ISDX_REPLACE_ENA=1: Replace
601a5cc98adSSteen Hegelund  *   with ISDX_ADD_VAL value.
602ee72d90bSHoratiu Vultur  * VCAP_AF_ISDX_ENA: W1, lan966x: is2
6038beef08fSSteen Hegelund  *   Setting this bit to 1 causes the classified ISDX to be set to the value of
6040a335db8SHoratiu Vultur  *   POLICE_IDX[8:0].
6050a335db8SHoratiu Vultur  * VCAP_AF_ISDX_REPLACE_ENA: W1, lan966x: is1
6060a335db8SHoratiu Vultur  *   If set, classified ISDX is set to ISDX_ADD_VAL.
6070a335db8SHoratiu Vultur  * VCAP_AF_ISDX_VAL: W12, sparx5: is0
6080a335db8SHoratiu Vultur  *   See isdx_add_replace_sel
6090a335db8SHoratiu Vultur  * VCAP_AF_LOOP_ENA: W1, sparx5: es0
6100a335db8SHoratiu Vultur  *   0: Forward based on PIPELINE_PT and FWD_SEL
6110a335db8SHoratiu Vultur  * VCAP_AF_LRN_DIS: W1, sparx5: is2, lan966x: is2
6120a335db8SHoratiu Vultur  *   Setting this bit to 1 disables learning of frames hitting this action.
6130a335db8SHoratiu Vultur  * VCAP_AF_MAP_IDX: W9, sparx5: is0
6140a335db8SHoratiu Vultur  *   Index for QoS mapping table lookup
6150a335db8SHoratiu Vultur  * VCAP_AF_MAP_KEY: W3, sparx5: is0
6160a335db8SHoratiu Vultur  *   Key type for QoS mapping table lookup. 0: DEI0, PCP0 (outer tag). 1: DEI1,
617f274a659SSteen Hegelund  *   PCP1 (middle tag). 2: DEI2, PCP2 (inner tag). 3: MPLS TC. 4: PCP0 (outer
6188beef08fSSteen Hegelund  *   tag). 5: E-DEI, E-PCP (E-TAG). 6: DSCP if available, otherwise none. 7: DSCP
6198beef08fSSteen Hegelund  *   if available, otherwise DEI0, PCP0 (outer tag) if available using MAP_IDX+8,
6208beef08fSSteen Hegelund  *   otherwise none
6218beef08fSSteen Hegelund  * VCAP_AF_MAP_LOOKUP_SEL: W2, sparx5: is0
6228beef08fSSteen Hegelund  *   Selects which of the two QoS Mapping Table lookups that MAP_KEY and MAP_IDX
623f274a659SSteen Hegelund  *   are applied to. 0: No changes to the QoS Mapping Table lookup. 1: Update key
6248beef08fSSteen Hegelund  *   type and index for QoS Mapping Table lookup #0. 2: Update key type and index
6258beef08fSSteen Hegelund  *   for QoS Mapping Table lookup #1. 3: Reserved.
6268beef08fSSteen Hegelund  * VCAP_AF_MASK_MODE: sparx5 is0 W3, sparx5 is2 W3, lan966x is2 W2
627f274a659SSteen Hegelund  *   Controls the PORT_MASK use. Sparx5: 0: OR_DSTMASK, 1: AND_VLANMASK, 2:
6288beef08fSSteen Hegelund  *   REPLACE_PGID, 3: REPLACE_ALL, 4: REDIR_PGID, 5: OR_PGID_MASK, 6: VSTAX, 7:
629f274a659SSteen Hegelund  *   Not applicable. LAN966X: 0: No action, 1: Permit/deny (AND), 2: Policy
630f274a659SSteen Hegelund  *   forwarding (DMAC lookup), 3: Redirect. The CPU port is untouched by
631f274a659SSteen Hegelund  *   MASK_MODE.
6328beef08fSSteen Hegelund  * VCAP_AF_MATCH_ID: W16, sparx5: is2
6338beef08fSSteen Hegelund  *   Logical ID for the entry. The MATCH_ID is extracted together with the frame
6348beef08fSSteen Hegelund  *   if the frame is forwarded to the CPU (CPU_COPY_ENA). The result is placed in
6350a335db8SHoratiu Vultur  *   IFH.CL_RSLT.
6360a335db8SHoratiu Vultur  * VCAP_AF_MATCH_ID_MASK: W16, sparx5: is2
637f274a659SSteen Hegelund  *   Mask used by MATCH_ID.
638*99ce286dSHoratiu Vultur  * VCAP_AF_MIRROR_ENA: W1, lan966x: is2
639*99ce286dSHoratiu Vultur  *   Setting this bit to 1 causes frames to be mirrored to the mirror target port
640*99ce286dSHoratiu Vultur  *   (ANA::MIRRPORPORTS).
6410a335db8SHoratiu Vultur  * VCAP_AF_MIRROR_PROBE: W2, sparx5: is2
6420a335db8SHoratiu Vultur  *   Mirroring performed according to configuration of a mirror probe. 0: No
6430a335db8SHoratiu Vultur  *   mirroring. 1: Mirror probe 0. 2: Mirror probe 1. 3: Mirror probe 2
6440a335db8SHoratiu Vultur  * VCAP_AF_MIRROR_PROBE_ID: W2, sparx5: es2
645*99ce286dSHoratiu Vultur  *   Signals a mirror probe to be placed in the IFH. Only possible when FWD_MODE
646*99ce286dSHoratiu Vultur  *   is copy. 0: No mirroring. 1-3: Use mirror probe 0-2.
647*99ce286dSHoratiu Vultur  * VCAP_AF_MRP_SEL: W2, lan966x: is1
648*99ce286dSHoratiu Vultur  *   0: No changes to port-based selection in ANA:PORT:OAM_CFG.MRP_ENA.  1: Enable
649*99ce286dSHoratiu Vultur  *   MRP frame processing 2: Disable MRP processing
650*99ce286dSHoratiu Vultur  * VCAP_AF_NXT_IDX: W12, sparx5: is0
651f274a659SSteen Hegelund  *   Index used as part of key (field G_IDX) in the next lookup.
652f274a659SSteen Hegelund  * VCAP_AF_NXT_IDX_CTRL: W3, sparx5: is0
653*99ce286dSHoratiu Vultur  *   Controls the generation of the G_IDX used in the VCAP CLM next lookup
6540a335db8SHoratiu Vultur  * VCAP_AF_OAM_SEL: W3, lan966x: is1
655a5cc98adSSteen Hegelund  *   0: No changes to port-based selection in ANA:PORT:OAM_CFG.OAM_CFG 1: Enable
656a5cc98adSSteen Hegelund  *   OAM frame processing for untagged frames 2: Enable OAM frame processing for
657a5cc98adSSteen Hegelund  *   single frames 3: Enable OAM frame processing for double frames 4: Disable OAM
658a5cc98adSSteen Hegelund  *   frame processing
659a5cc98adSSteen Hegelund  * VCAP_AF_PAG_OVERRIDE_MASK: W8, sparx5: is0, lan966x: is1
660a5cc98adSSteen Hegelund  *   Bits set in this mask will override PAG_VAL from port profile. New PAG = (PAG
661*99ce286dSHoratiu Vultur  *   (input) AND ~PAG_OVERRIDE_MASK) OR (PAG_VAL AND PAG_OVERRIDE_MASK)
6620a335db8SHoratiu Vultur  * VCAP_AF_PAG_VAL: W8, sparx5: is0, lan966x: is1
6630a335db8SHoratiu Vultur  *   See PAG_OVERRIDE_MASK.
664*99ce286dSHoratiu Vultur  * VCAP_AF_PCP_A_VAL: W3, sparx5: es0, lan966x: es0
6650a335db8SHoratiu Vultur  *   PCP used in ES0 tag A. See TAG_A_PCP_SEL.
666a5cc98adSSteen Hegelund  * VCAP_AF_PCP_B_VAL: W3, sparx5: es0, lan966x: es0
667a5cc98adSSteen Hegelund  *   PCP used in ES0 tag B. See TAG_B_PCP_SEL.
668a5cc98adSSteen Hegelund  * VCAP_AF_PCP_C_VAL: W3, sparx5: es0
669f274a659SSteen Hegelund  *   PCP used in ES0 tag C. See TAG_C_PCP_SEL.
6708beef08fSSteen Hegelund  * VCAP_AF_PCP_ENA: W1, sparx5: is0, lan966x: is1
6718beef08fSSteen Hegelund  *   If set, use PCP_VAL as classified PCP value. Otherwise, PCP from basic
672a5cc98adSSteen Hegelund  *   classification is used.
6738beef08fSSteen Hegelund  * VCAP_AF_PCP_VAL: W3, sparx5: is0, lan966x: is1
674*99ce286dSHoratiu Vultur  *   See PCP_ENA.
675*99ce286dSHoratiu Vultur  * VCAP_AF_PIPELINE_ACT: W1, sparx5: es0
676*99ce286dSHoratiu Vultur  *   Pipeline action when FWD_SEL > 0. 0: XTR. CPU_QU selects CPU extraction queue
677*99ce286dSHoratiu Vultur  *   1: LBK_ASM.
678*99ce286dSHoratiu Vultur  * VCAP_AF_PIPELINE_FORCE_ENA: W1, sparx5: is2
6790a335db8SHoratiu Vultur  *   If set, use PIPELINE_PT unconditionally and set PIPELINE_ACT = NONE if
6800a335db8SHoratiu Vultur  *   PIPELINE_PT == NONE. Overrules previous settings of pipeline point.
6810a335db8SHoratiu Vultur  * VCAP_AF_PIPELINE_PT: sparx5 is2 W5, sparx5 es0 W2
682f274a659SSteen Hegelund  *   Pipeline point used if PIPELINE_FORCE_ENA is set
683f274a659SSteen Hegelund  * VCAP_AF_POLICE_ENA: W1, sparx5: is2/es2, lan966x: is1/is2
684f274a659SSteen Hegelund  *   If set, POLICE_IDX is used to lookup ANA::POL.
685a5cc98adSSteen Hegelund  * VCAP_AF_POLICE_IDX: sparx5 is2 W6, sparx5 es2 W6, lan966x is1 W9, lan966x is2
686a5cc98adSSteen Hegelund  *   W9
687a5cc98adSSteen Hegelund  *   Policer index.
688ee72d90bSHoratiu Vultur  * VCAP_AF_POLICE_REMARK: W1, sparx5: es2
6898beef08fSSteen Hegelund  *   If set, frames exceeding policer rates are marked as yellow but not
690a5cc98adSSteen Hegelund  *   discarded.
691a5cc98adSSteen Hegelund  * VCAP_AF_POLICE_VCAP_ONLY: W1, lan966x: is2
692a5cc98adSSteen Hegelund  *   Disable policing from QoS, and port policers. Only the VCAP policer selected
693a5cc98adSSteen Hegelund  *   by POLICE_IDX is active. Only applies to the second lookup.
694a5cc98adSSteen Hegelund  * VCAP_AF_POP_VAL: W2, sparx5: es0
695a5cc98adSSteen Hegelund  *   Controls popping of Q-tags. The final number of Q-tags popped is calculated
696a5cc98adSSteen Hegelund  *   as shown in section 4.28.7.2 VLAN Pop Decision.
697a5cc98adSSteen Hegelund  * VCAP_AF_PORT_MASK: sparx5 is0 W65, sparx5 is2 W68, lan966x is2 W8
698a5cc98adSSteen Hegelund  *   Port mask applied to the forwarding decision based on MASK_MODE.
699a5cc98adSSteen Hegelund  * VCAP_AF_PUSH_CUSTOMER_TAG: W2, sparx5: es0
700a5cc98adSSteen Hegelund  *   Selects tag C mode: 0: Do not push tag C. 1: Push tag C if
701a5cc98adSSteen Hegelund  *   IFH.VSTAX.TAG.WAS_TAGGED = 1. 2: Push tag C if IFH.VSTAX.TAG.WAS_TAGGED = 0.
702*99ce286dSHoratiu Vultur  *   3: Push tag C if UNTAG_VID_ENA = 0 or (C-TAG.VID ! = VID_C_VAL).
7030a335db8SHoratiu Vultur  * VCAP_AF_PUSH_INNER_TAG: W1, sparx5: es0, lan966x: es0
7040a335db8SHoratiu Vultur  *   Controls inner tagging. 0: Do not push ES0 tag B as inner tag. 1: Push ES0
705*99ce286dSHoratiu Vultur  *   tag B as inner tag.
7060a335db8SHoratiu Vultur  * VCAP_AF_PUSH_OUTER_TAG: W2, sparx5: es0, lan966x: es0
707f274a659SSteen Hegelund  *   Controls outer tagging. 0: No ES0 tag A: Port tag is allowed if enabled on
708f274a659SSteen Hegelund  *   port. 1: ES0 tag A: Push ES0 tag A. No port tag. 2: Force port tag: Always
7098beef08fSSteen Hegelund  *   push port tag. No ES0 tag A. 3: Force untag: Never push port tag or ES0 tag
7108beef08fSSteen Hegelund  *   A.
7118beef08fSSteen Hegelund  * VCAP_AF_QOS_ENA: W1, sparx5: is0, lan966x: is1
712*99ce286dSHoratiu Vultur  *   If set, use QOS_VAL as classified QoS class. Otherwise, QoS class from basic
713*99ce286dSHoratiu Vultur  *   classification is used.
714*99ce286dSHoratiu Vultur  * VCAP_AF_QOS_VAL: W3, sparx5: is0, lan966x: is1
715*99ce286dSHoratiu Vultur  *   See QOS_ENA.
716*99ce286dSHoratiu Vultur  * VCAP_AF_REW_OP: W16, lan966x: is2
717*99ce286dSHoratiu Vultur  *   Rewriter operation command.
718*99ce286dSHoratiu Vultur  * VCAP_AF_RT_DIS: W1, sparx5: is2
719*99ce286dSHoratiu Vultur  *   If set, routing is disallowed. Only applies when IS_INNER_ACL is 0. See also
720a5cc98adSSteen Hegelund  *   IGR_ACL_ENA, EGR_ACL_ENA, and RLEG_STAT_IDX.
721a5cc98adSSteen Hegelund  * VCAP_AF_SFID_ENA: W1, lan966x: is1
722a5cc98adSSteen Hegelund  *   If set, SFID_VAL is used to lookup ANA::SFID.
723a5cc98adSSteen Hegelund  * VCAP_AF_SFID_VAL: W8, lan966x: is1
724a5cc98adSSteen Hegelund  *   Stream filter identifier.
725a5cc98adSSteen Hegelund  * VCAP_AF_SGID_ENA: W1, lan966x: is1
726a5cc98adSSteen Hegelund  *   If set, SGID_VAL is used to lookup ANA::SGID.
727a5cc98adSSteen Hegelund  * VCAP_AF_SGID_VAL: W8, lan966x: is1
728a5cc98adSSteen Hegelund  *   Stream gate identifier.
729a5cc98adSSteen Hegelund  * VCAP_AF_SWAP_MACS_ENA: W1, sparx5: es0
730a5cc98adSSteen Hegelund  *   This setting is only active when FWD_SEL = 1 or FWD_SEL = 2 and PIPELINE_ACT
731a5cc98adSSteen Hegelund  *   = LBK_ASM. 0: No action. 1: Swap MACs and clear bit 40 in new SMAC.
732a5cc98adSSteen Hegelund  * VCAP_AF_TAG_A_DEI_SEL: sparx5 es0 W3, lan966x es0 W2
733a5cc98adSSteen Hegelund  *   Selects PCP for ES0 tag A. 0: Classified DEI. 1: DEI_A_VAL. 2: DP and QoS
734a5cc98adSSteen Hegelund  *   mapped to PCP (per port table). 3: DP.
735a5cc98adSSteen Hegelund  * VCAP_AF_TAG_A_PCP_SEL: sparx5 es0 W3, lan966x es0 W2
736a5cc98adSSteen Hegelund  *   Selects PCP for ES0 tag A. 0: Classified PCP. 1: PCP_A_VAL. 2: DP and QoS
737a5cc98adSSteen Hegelund  *   mapped to PCP (per port table). 3: QoS class.
738a5cc98adSSteen Hegelund  * VCAP_AF_TAG_A_TPID_SEL: sparx5 es0 W3, lan966x es0 W2
739a5cc98adSSteen Hegelund  *   Selects TPID for ES0 tag A: 0: 0x8100. 1: 0x88A8. 2: Custom
740a5cc98adSSteen Hegelund  *   (REW:PORT:PORT_VLAN_CFG.PORT_TPID). 3: If IFH.TAG_TYPE = 0 then 0x8100 else
741a5cc98adSSteen Hegelund  *   custom.
742a5cc98adSSteen Hegelund  * VCAP_AF_TAG_A_VID_SEL: sparx5 es0 W2, lan966x es0 W1
743a5cc98adSSteen Hegelund  *   Selects VID for ES0 tag A. 0: Classified VID + VID_A_VAL. 1: VID_A_VAL.
744a5cc98adSSteen Hegelund  * VCAP_AF_TAG_B_DEI_SEL: sparx5 es0 W3, lan966x es0 W2
745a5cc98adSSteen Hegelund  *   Selects PCP for ES0 tag B. 0: Classified DEI. 1: DEI_B_VAL. 2: DP and QoS
746a5cc98adSSteen Hegelund  *   mapped to PCP (per port table). 3: DP.
747a5cc98adSSteen Hegelund  * VCAP_AF_TAG_B_PCP_SEL: sparx5 es0 W3, lan966x es0 W2
748a5cc98adSSteen Hegelund  *   Selects PCP for ES0 tag B. 0: Classified PCP. 1: PCP_B_VAL. 2: DP and QoS
749a5cc98adSSteen Hegelund  *   mapped to PCP (per port table). 3: QoS class.
750a5cc98adSSteen Hegelund  * VCAP_AF_TAG_B_TPID_SEL: sparx5 es0 W3, lan966x es0 W2
751a5cc98adSSteen Hegelund  *   Selects TPID for ES0 tag B. 0: 0x8100. 1: 0x88A8. 2: Custom
752a5cc98adSSteen Hegelund  *   (REW:PORT:PORT_VLAN_CFG.PORT_TPID). 3: If IFH.TAG_TYPE = 0 then 0x8100 else
753a5cc98adSSteen Hegelund  *   custom.
754a5cc98adSSteen Hegelund  * VCAP_AF_TAG_B_VID_SEL: sparx5 es0 W2, lan966x es0 W1
755a5cc98adSSteen Hegelund  *   Selects VID for ES0 tag B. 0: Classified VID + VID_B_VAL. 1: VID_B_VAL.
756a5cc98adSSteen Hegelund  * VCAP_AF_TAG_C_DEI_SEL: W3, sparx5: es0
757a5cc98adSSteen Hegelund  *   Selects DEI source for ES0 tag C. 0: Classified DEI. 1: DEI_C_VAL. 2:
758a5cc98adSSteen Hegelund  *   REW::DP_MAP.DP [IFH.VSTAX.QOS.DP]. 3: DEI of popped VLAN tag if available
759a5cc98adSSteen Hegelund  *   (IFH.VSTAX.TAG.WAS_TAGGED = 1 and tot_pop_cnt>0) else DEI_C_VAL. 4: Mapped
760a5cc98adSSteen Hegelund  *   using mapping table 0, otherwise use DEI_C_VAL. 5: Mapped using mapping table
761a5cc98adSSteen Hegelund  *   1, otherwise use mapping table 0. 6: Mapped using mapping table 2, otherwise
762a5cc98adSSteen Hegelund  *   use DEI_C_VAL. 7: Mapped using mapping table 3, otherwise use mapping table
763a5cc98adSSteen Hegelund  *   2.
764a5cc98adSSteen Hegelund  * VCAP_AF_TAG_C_PCP_SEL: W3, sparx5: es0
765a5cc98adSSteen Hegelund  *   Selects PCP source for ES0 tag C. 0: Classified PCP. 1: PCP_C_VAL. 2:
766a5cc98adSSteen Hegelund  *   Reserved. 3: PCP of popped VLAN tag if available (IFH.VSTAX.TAG.WAS_TAGGED=1
767a5cc98adSSteen Hegelund  *   and tot_pop_cnt>0) else PCP_C_VAL. 4: Mapped using mapping table 0, otherwise
768*99ce286dSHoratiu Vultur  *   use PCP_C_VAL. 5: Mapped using mapping table 1, otherwise use mapping table
7690a335db8SHoratiu Vultur  *   0. 6: Mapped using mapping table 2, otherwise use PCP_C_VAL. 7: Mapped using
770a5cc98adSSteen Hegelund  *   mapping table 3, otherwise use mapping table 2.
771a5cc98adSSteen Hegelund  * VCAP_AF_TAG_C_TPID_SEL: W3, sparx5: es0
772a5cc98adSSteen Hegelund  *   Selects TPID for ES0 tag C. 0: 0x8100. 1: 0x88A8. 2: Custom 1. 3: Custom 2.
773a5cc98adSSteen Hegelund  *   4: Custom 3. 5: See TAG_A_TPID_SEL.
774a5cc98adSSteen Hegelund  * VCAP_AF_TAG_C_VID_SEL: W2, sparx5: es0
775a5cc98adSSteen Hegelund  *   Selects VID for ES0 tag C. The resulting VID is termed C-TAG.VID. 0:
776a5cc98adSSteen Hegelund  *   Classified VID. 1: VID_C_VAL. 2: IFH.ENCAP.GVID. 3: Reserved.
777a5cc98adSSteen Hegelund  * VCAP_AF_TYPE: W1, sparx5: is0, lan966x: is1
778a5cc98adSSteen Hegelund  *   Actionset type id - Set by the API
779*99ce286dSHoratiu Vultur  * VCAP_AF_UNTAG_VID_ENA: W1, sparx5: es0
780*99ce286dSHoratiu Vultur  *   Controls insertion of tag C. Untag or insert mode can be selected. See
781*99ce286dSHoratiu Vultur  *   PUSH_CUSTOMER_TAG.
782*99ce286dSHoratiu Vultur  * VCAP_AF_VID_A_VAL: W12, sparx5: es0, lan966x: es0
783*99ce286dSHoratiu Vultur  *   VID used in ES0 tag A. See TAG_A_VID_SEL.
784*99ce286dSHoratiu Vultur  * VCAP_AF_VID_B_VAL: W12, sparx5: es0, lan966x: es0
7850a335db8SHoratiu Vultur  *   VID used in ES0 tag B. See TAG_B_VID_SEL.
786*99ce286dSHoratiu Vultur  * VCAP_AF_VID_C_VAL: W12, sparx5: es0
787*99ce286dSHoratiu Vultur  *   VID used in ES0 tag C. See TAG_C_VID_SEL.
788*99ce286dSHoratiu Vultur  * VCAP_AF_VID_REPLACE_ENA: W1, lan966x: is1
789*99ce286dSHoratiu Vultur  *   Controls the classified VID: VID_REPLACE_ENA=0: Add VID_ADD_VAL to basic
790*99ce286dSHoratiu Vultur  *   classified VID and use result as new classified VID. VID_REPLACE_ENA = 1:
791*99ce286dSHoratiu Vultur  *   Replace basic classified VID with VID_VAL value and use as new classified
7928beef08fSSteen Hegelund  *   VID.
7938beef08fSSteen Hegelund  * VCAP_AF_VID_VAL: sparx5 is0 W13, lan966x is1 W12
7948beef08fSSteen Hegelund  *   New VID Value
7958beef08fSSteen Hegelund  * VCAP_AF_VLAN_POP_CNT: W2, lan966x: is1
7968beef08fSSteen Hegelund  *   See VLAN_POP_CNT_ENA
797f274a659SSteen Hegelund  * VCAP_AF_VLAN_POP_CNT_ENA: W1, lan966x: is1
7980a335db8SHoratiu Vultur  *   If set, use VLAN_POP_CNT as the number of VLAN tags to pop from the incoming
7998beef08fSSteen Hegelund  *   frame. This number is used by the Rewriter. Otherwise, VLAN_POP_CNT from
8000a335db8SHoratiu Vultur  *   ANA:PORT:VLAN_CFG.VLAN_POP_CNT is used
8010a335db8SHoratiu Vultur  */
8028beef08fSSteen Hegelund 
803a5cc98adSSteen Hegelund /* Actionfield names */
8048beef08fSSteen Hegelund enum vcap_action_field {
805*99ce286dSHoratiu Vultur 	VCAP_AF_NO_VALUE,  /* initial value */
806a5cc98adSSteen Hegelund 	VCAP_AF_ACL_ID,
807a5cc98adSSteen Hegelund 	VCAP_AF_CLS_VID_SEL,
808a5cc98adSSteen Hegelund 	VCAP_AF_CNT_ID,
8090a335db8SHoratiu Vultur 	VCAP_AF_COPY_PORT_NUM,
8100a335db8SHoratiu Vultur 	VCAP_AF_COPY_QUEUE_NUM,
811*99ce286dSHoratiu Vultur 	VCAP_AF_CPU_COPY_ENA,
8120a335db8SHoratiu Vultur 	VCAP_AF_CPU_QU,
8130a335db8SHoratiu Vultur 	VCAP_AF_CPU_QUEUE_NUM,
8140a335db8SHoratiu Vultur 	VCAP_AF_CUSTOM_ACE_TYPE_ENA,
815a5cc98adSSteen Hegelund 	VCAP_AF_DEI_A_VAL,
8160a335db8SHoratiu Vultur 	VCAP_AF_DEI_B_VAL,
8170a335db8SHoratiu Vultur 	VCAP_AF_DEI_C_VAL,
818a5cc98adSSteen Hegelund 	VCAP_AF_DEI_ENA,
819f274a659SSteen Hegelund 	VCAP_AF_DEI_VAL,
8200a335db8SHoratiu Vultur 	VCAP_AF_DLR_SEL,
821a5cc98adSSteen Hegelund 	VCAP_AF_DP_ENA,
8228beef08fSSteen Hegelund 	VCAP_AF_DP_VAL,
823f274a659SSteen Hegelund 	VCAP_AF_DSCP_ENA,
8248beef08fSSteen Hegelund 	VCAP_AF_DSCP_SEL,
8258beef08fSSteen Hegelund 	VCAP_AF_DSCP_VAL,
8260a335db8SHoratiu Vultur 	VCAP_AF_ES2_REW_CMD,
827*99ce286dSHoratiu Vultur 	VCAP_AF_ESDX,
828f274a659SSteen Hegelund 	VCAP_AF_FWD_KILL_ENA,
829*99ce286dSHoratiu Vultur 	VCAP_AF_FWD_MODE,
8300a335db8SHoratiu Vultur 	VCAP_AF_FWD_SEL,
831a5cc98adSSteen Hegelund 	VCAP_AF_HIT_ME_ONCE,
8328beef08fSSteen Hegelund 	VCAP_AF_HOST_MATCH,
8330a335db8SHoratiu Vultur 	VCAP_AF_IGNORE_PIPELINE_CTRL,
8340a335db8SHoratiu Vultur 	VCAP_AF_INTR_ENA,
8350a335db8SHoratiu Vultur 	VCAP_AF_ISDX_ADD_REPLACE_SEL,
8368beef08fSSteen Hegelund 	VCAP_AF_ISDX_ADD_VAL,
8378beef08fSSteen Hegelund 	VCAP_AF_ISDX_ENA,
8388beef08fSSteen Hegelund 	VCAP_AF_ISDX_REPLACE_ENA,
839f274a659SSteen Hegelund 	VCAP_AF_ISDX_VAL,
8408beef08fSSteen Hegelund 	VCAP_AF_LOOP_ENA,
8410a335db8SHoratiu Vultur 	VCAP_AF_LRN_DIS,
842*99ce286dSHoratiu Vultur 	VCAP_AF_MAP_IDX,
8430a335db8SHoratiu Vultur 	VCAP_AF_MAP_KEY,
8440a335db8SHoratiu Vultur 	VCAP_AF_MAP_LOOKUP_SEL,
845*99ce286dSHoratiu Vultur 	VCAP_AF_MASK_MODE,
8460a335db8SHoratiu Vultur 	VCAP_AF_MATCH_ID,
8470a335db8SHoratiu Vultur 	VCAP_AF_MATCH_ID_MASK,
848a5cc98adSSteen Hegelund 	VCAP_AF_MIRROR_ENA,
849a5cc98adSSteen Hegelund 	VCAP_AF_MIRROR_PROBE,
850a5cc98adSSteen Hegelund 	VCAP_AF_MIRROR_PROBE_ID,
8510a335db8SHoratiu Vultur 	VCAP_AF_MRP_SEL,
8520a335db8SHoratiu Vultur 	VCAP_AF_NXT_IDX,
853a5cc98adSSteen Hegelund 	VCAP_AF_NXT_IDX_CTRL,
8548beef08fSSteen Hegelund 	VCAP_AF_OAM_SEL,
8558beef08fSSteen Hegelund 	VCAP_AF_PAG_OVERRIDE_MASK,
8568beef08fSSteen Hegelund 	VCAP_AF_PAG_VAL,
8578beef08fSSteen Hegelund 	VCAP_AF_PCP_A_VAL,
8580a335db8SHoratiu Vultur 	VCAP_AF_PCP_B_VAL,
859f274a659SSteen Hegelund 	VCAP_AF_PCP_C_VAL,
860a5cc98adSSteen Hegelund 	VCAP_AF_PCP_ENA,
8618beef08fSSteen Hegelund 	VCAP_AF_PCP_VAL,
862a5cc98adSSteen Hegelund 	VCAP_AF_PIPELINE_ACT,
863a5cc98adSSteen Hegelund 	VCAP_AF_PIPELINE_FORCE_ENA,
864a5cc98adSSteen Hegelund 	VCAP_AF_PIPELINE_PT,
8650a335db8SHoratiu Vultur 	VCAP_AF_POLICE_ENA,
8660a335db8SHoratiu Vultur 	VCAP_AF_POLICE_IDX,
867f274a659SSteen Hegelund 	VCAP_AF_POLICE_REMARK,
8688beef08fSSteen Hegelund 	VCAP_AF_POLICE_VCAP_ONLY,
869*99ce286dSHoratiu Vultur 	VCAP_AF_POP_VAL,
870*99ce286dSHoratiu Vultur 	VCAP_AF_PORT_MASK,
871*99ce286dSHoratiu Vultur 	VCAP_AF_PUSH_CUSTOMER_TAG,
872*99ce286dSHoratiu Vultur 	VCAP_AF_PUSH_INNER_TAG,
873a5cc98adSSteen Hegelund 	VCAP_AF_PUSH_OUTER_TAG,
874a5cc98adSSteen Hegelund 	VCAP_AF_QOS_ENA,
875a5cc98adSSteen Hegelund 	VCAP_AF_QOS_VAL,
876a5cc98adSSteen Hegelund 	VCAP_AF_REW_OP,
877a5cc98adSSteen Hegelund 	VCAP_AF_RT_DIS,
878a5cc98adSSteen Hegelund 	VCAP_AF_SFID_ENA,
879a5cc98adSSteen Hegelund 	VCAP_AF_SFID_VAL,
880a5cc98adSSteen Hegelund 	VCAP_AF_SGID_ENA,
881a5cc98adSSteen Hegelund 	VCAP_AF_SGID_VAL,
882a5cc98adSSteen Hegelund 	VCAP_AF_SWAP_MACS_ENA,
883a5cc98adSSteen Hegelund 	VCAP_AF_TAG_A_DEI_SEL,
884a5cc98adSSteen Hegelund 	VCAP_AF_TAG_A_PCP_SEL,
885a5cc98adSSteen Hegelund 	VCAP_AF_TAG_A_TPID_SEL,
8860a335db8SHoratiu Vultur 	VCAP_AF_TAG_A_VID_SEL,
887a5cc98adSSteen Hegelund 	VCAP_AF_TAG_B_DEI_SEL,
888a5cc98adSSteen Hegelund 	VCAP_AF_TAG_B_PCP_SEL,
889a5cc98adSSteen Hegelund 	VCAP_AF_TAG_B_TPID_SEL,
890a5cc98adSSteen Hegelund 	VCAP_AF_TAG_B_VID_SEL,
891*99ce286dSHoratiu Vultur 	VCAP_AF_TAG_C_DEI_SEL,
8920a335db8SHoratiu Vultur 	VCAP_AF_TAG_C_PCP_SEL,
893*99ce286dSHoratiu Vultur 	VCAP_AF_TAG_C_TPID_SEL,
894*99ce286dSHoratiu Vultur 	VCAP_AF_TAG_C_VID_SEL,
8958beef08fSSteen Hegelund 	VCAP_AF_TYPE,
8968beef08fSSteen Hegelund 	VCAP_AF_UNTAG_VID_ENA,
8978beef08fSSteen Hegelund 	VCAP_AF_VID_A_VAL,
898 	VCAP_AF_VID_B_VAL,
899 	VCAP_AF_VID_C_VAL,
900 	VCAP_AF_VID_REPLACE_ENA,
901 	VCAP_AF_VID_VAL,
902 	VCAP_AF_VLAN_POP_CNT,
903 	VCAP_AF_VLAN_POP_CNT_ENA,
904 };
905 
906 #endif /* __VCAP_AG_API__ */
907