vcap_ag_api.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. /* Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries.
  3. * Microchip VCAP API
  4. */
  5. /* This file is autogenerated by cml-utils 2023-03-13 10:16:42 +0100.
  6. * Commit ID: 259f0efd6d6d91bfbf62858de153cc757b6bffa3 (dirty)
  7. */
  8. #ifndef __VCAP_AG_API__
  9. #define __VCAP_AG_API__
  10. enum vcap_type {
  11. VCAP_TYPE_ES0,
  12. VCAP_TYPE_ES2,
  13. VCAP_TYPE_IS0,
  14. VCAP_TYPE_IS1,
  15. VCAP_TYPE_IS2,
  16. VCAP_TYPE_MAX
  17. };
  18. /* Keyfieldset names with origin information */
  19. enum vcap_keyfield_set {
  20. VCAP_KFS_NO_VALUE, /* initial value */
  21. VCAP_KFS_5TUPLE_IP4, /* lan966x is1 X2 */
  22. VCAP_KFS_5TUPLE_IP6, /* lan966x is1 X4 */
  23. VCAP_KFS_7TUPLE, /* lan966x is1 X4 */
  24. VCAP_KFS_ARP, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
  25. VCAP_KFS_DBL_VID, /* lan966x is1 X1 */
  26. VCAP_KFS_DMAC_VID, /* lan966x is1 X1 */
  27. VCAP_KFS_ETAG, /* sparx5 is0 X2 */
  28. VCAP_KFS_IP4_OTHER, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
  29. VCAP_KFS_IP4_TCP_UDP, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
  30. VCAP_KFS_IP4_VID, /* sparx5 es2 X3 */
  31. VCAP_KFS_IP6_OTHER, /* lan966x is2 X4 */
  32. VCAP_KFS_IP6_STD, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
  33. VCAP_KFS_IP6_TCP_UDP, /* lan966x is2 X4 */
  34. VCAP_KFS_IP6_VID, /* sparx5 es2 X6 */
  35. VCAP_KFS_IP_7TUPLE, /* sparx5 is2 X12, sparx5 es2 X12 */
  36. VCAP_KFS_ISDX, /* sparx5 es0 X1 */
  37. VCAP_KFS_LL_FULL, /* sparx5 is0 X6 */
  38. VCAP_KFS_MAC_ETYPE, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */
  39. VCAP_KFS_MAC_LLC, /* lan966x is2 X2 */
  40. VCAP_KFS_MAC_SNAP, /* lan966x is2 X2 */
  41. VCAP_KFS_NORMAL, /* lan966x is1 X2 */
  42. VCAP_KFS_NORMAL_5TUPLE_IP4, /* sparx5 is0 X6 */
  43. VCAP_KFS_NORMAL_7TUPLE, /* sparx5 is0 X12 */
  44. VCAP_KFS_NORMAL_IP6, /* lan966x is1 X4 */
  45. VCAP_KFS_OAM, /* lan966x is2 X2 */
  46. VCAP_KFS_PURE_5TUPLE_IP4, /* sparx5 is0 X3 */
  47. VCAP_KFS_RT, /* lan966x is1 X1 */
  48. VCAP_KFS_SMAC_SIP4, /* lan966x is2 X1 */
  49. VCAP_KFS_SMAC_SIP6, /* lan966x is2 X2 */
  50. VCAP_KFS_VID, /* lan966x es0 X1 */
  51. };
  52. /* List of keyfields with description
  53. *
  54. * Keys ending in _IS are booleans derived from frame data
  55. * Keys ending in _CLS are classified frame data
  56. *
  57. * VCAP_KF_8021BR_ECID_BASE: W12, sparx5: is0
  58. * Used by 802.1BR Bridge Port Extension in an E-Tag
  59. * VCAP_KF_8021BR_ECID_EXT: W8, sparx5: is0
  60. * Used by 802.1BR Bridge Port Extension in an E-Tag
  61. * VCAP_KF_8021BR_E_TAGGED: W1, sparx5: is0
  62. * Set for frames containing an E-TAG (802.1BR Ethertype 893f)
  63. * VCAP_KF_8021BR_GRP: W2, sparx5: is0
  64. * E-Tag group bits in 802.1BR Bridge Port Extension
  65. * VCAP_KF_8021BR_IGR_ECID_BASE: W12, sparx5: is0
  66. * Used by 802.1BR Bridge Port Extension in an E-Tag
  67. * VCAP_KF_8021BR_IGR_ECID_EXT: W8, sparx5: is0
  68. * Used by 802.1BR Bridge Port Extension in an E-Tag
  69. * VCAP_KF_8021CB_R_TAGGED_IS: W1, lan966x: is1
  70. * Set if frame contains an RTAG: IEEE 802.1CB (FRER Redundancy tag, Ethertype
  71. * 0xf1c1)
  72. * VCAP_KF_8021Q_DEI0: W1, sparx5: is0, lan966x: is1
  73. * First DEI in multiple vlan tags (outer tag or default port tag)
  74. * VCAP_KF_8021Q_DEI1: W1, sparx5: is0, lan966x: is1
  75. * Second DEI in multiple vlan tags (inner tag)
  76. * VCAP_KF_8021Q_DEI2: W1, sparx5: is0
  77. * Third DEI in multiple vlan tags (not always available)
  78. * VCAP_KF_8021Q_DEI_CLS: W1, sparx5: is2/es2, lan966x: is2/es0
  79. * Classified DEI
  80. * VCAP_KF_8021Q_PCP0: W3, sparx5: is0, lan966x: is1
  81. * First PCP in multiple vlan tags (outer tag or default port tag)
  82. * VCAP_KF_8021Q_PCP1: W3, sparx5: is0, lan966x: is1
  83. * Second PCP in multiple vlan tags (inner tag)
  84. * VCAP_KF_8021Q_PCP2: W3, sparx5: is0
  85. * Third PCP in multiple vlan tags (not always available)
  86. * VCAP_KF_8021Q_PCP_CLS: W3, sparx5: is2/es2, lan966x: is2/es0
  87. * Classified PCP
  88. * VCAP_KF_8021Q_TPID: W3, sparx5: es0
  89. * TPID for outer tag: 0: Customer TPID 1: Service TPID (88A8 or programmable)
  90. * VCAP_KF_8021Q_TPID0: sparx5 is0 W3, lan966x is1 W1
  91. * First TPIC in multiple vlan tags (outer tag or default port tag)
  92. * VCAP_KF_8021Q_TPID1: sparx5 is0 W3, lan966x is1 W1
  93. * Second TPID in multiple vlan tags (inner tag)
  94. * VCAP_KF_8021Q_TPID2: W3, sparx5: is0
  95. * Third TPID in multiple vlan tags (not always available)
  96. * VCAP_KF_8021Q_VID0: W12, sparx5: is0, lan966x: is1
  97. * First VID in multiple vlan tags (outer tag or default port tag)
  98. * VCAP_KF_8021Q_VID1: W12, sparx5: is0, lan966x: is1
  99. * Second VID in multiple vlan tags (inner tag)
  100. * VCAP_KF_8021Q_VID2: W12, sparx5: is0
  101. * Third VID in multiple vlan tags (not always available)
  102. * VCAP_KF_8021Q_VID_CLS: sparx5 is2 W13, sparx5 es0 W13, sparx5 es2 W13,
  103. * lan966x is2 W12, lan966x es0 W12
  104. * Classified VID
  105. * VCAP_KF_8021Q_VLAN_DBL_TAGGED_IS: W1, lan966x: is1
  106. * Set if frame has two or more Q-tags. Independent of port VLAN awareness
  107. * VCAP_KF_8021Q_VLAN_TAGGED_IS: W1, sparx5: is2/es2, lan966x: is1/is2
  108. * Sparx5: Set if frame was received with a VLAN tag, LAN966x: Set if frame has
  109. * one or more Q-tags. Independent of port VLAN awareness
  110. * VCAP_KF_8021Q_VLAN_TAGS: W3, sparx5: is0
  111. * Number of VLAN tags in frame: 0: Untagged, 1: Single tagged, 3: Double
  112. * tagged, 7: Triple tagged
  113. * VCAP_KF_ACL_GRP_ID: W8, sparx5: es2
  114. * Used in interface map table
  115. * VCAP_KF_ARP_ADDR_SPACE_OK_IS: W1, sparx5: is2/es2, lan966x: is2
  116. * Set if hardware address is Ethernet
  117. * VCAP_KF_ARP_LEN_OK_IS: W1, sparx5: is2/es2, lan966x: is2
  118. * Set if hardware address length = 6 (Ethernet) and IP address length = 4 (IP).
  119. * VCAP_KF_ARP_OPCODE: W2, sparx5: is2/es2, lan966x: is2
  120. * ARP opcode
  121. * VCAP_KF_ARP_OPCODE_UNKNOWN_IS: W1, sparx5: is2/es2, lan966x: is2
  122. * Set if not one of the codes defined in VCAP_KF_ARP_OPCODE
  123. * VCAP_KF_ARP_PROTO_SPACE_OK_IS: W1, sparx5: is2/es2, lan966x: is2
  124. * Set if protocol address space is 0x0800
  125. * VCAP_KF_ARP_SENDER_MATCH_IS: W1, sparx5: is2/es2, lan966x: is2
  126. * Sender Hardware Address = SMAC (ARP)
  127. * VCAP_KF_ARP_TGT_MATCH_IS: W1, sparx5: is2/es2, lan966x: is2
  128. * Target Hardware Address = SMAC (RARP)
  129. * VCAP_KF_COSID_CLS: W3, sparx5: es0/es2
  130. * Class of service
  131. * VCAP_KF_ES0_ISDX_KEY_ENA: W1, sparx5: es2
  132. * The value taken from the IFH .FWD.ES0_ISDX_KEY_ENA
  133. * VCAP_KF_ETYPE: W16, sparx5: is0/is2/es2, lan966x: is1/is2
  134. * Ethernet type
  135. * VCAP_KF_ETYPE_LEN_IS: W1, sparx5: is0/is2/es2, lan966x: is1
  136. * Set if frame has EtherType >= 0x600
  137. * VCAP_KF_HOST_MATCH: W1, lan966x: is2
  138. * The action from the SMAC_SIP4 or SMAC_SIP6 lookups. Used for IP source
  139. * guarding.
  140. * VCAP_KF_IF_EGR_PORT_MASK: W32, sparx5: es2
  141. * Egress port mask, one bit per port
  142. * VCAP_KF_IF_EGR_PORT_MASK_RNG: W3, sparx5: es2
  143. * Select which 32 port group is available in IF_EGR_PORT (or virtual ports or
  144. * CPU queue)
  145. * VCAP_KF_IF_EGR_PORT_NO: sparx5 es0 W7, lan966x es0 W4
  146. * Egress port number
  147. * VCAP_KF_IF_IGR_PORT: sparx5 is0 W7, sparx5 es2 W9, lan966x is1 W3, lan966x
  148. * is2 W4, lan966x es0 W4
  149. * Sparx5: Logical ingress port number retrieved from
  150. * ANA_CL::PORT_ID_CFG.LPORT_NUM or ERLEG, LAN966x: ingress port nunmber
  151. * VCAP_KF_IF_IGR_PORT_MASK: sparx5 is0 W65, sparx5 is2 W32, sparx5 is2 W65,
  152. * lan966x is1 W9, lan966x is2 W9
  153. * Ingress port mask, one bit per port/erleg
  154. * VCAP_KF_IF_IGR_PORT_MASK_L3: W1, sparx5: is2
  155. * If set, IF_IGR_PORT_MASK, IF_IGR_PORT_MASK_RNG, and IF_IGR_PORT_MASK_SEL are
  156. * used to specify L3 interfaces
  157. * VCAP_KF_IF_IGR_PORT_MASK_RNG: W4, sparx5: is2
  158. * Range selector for IF_IGR_PORT_MASK. Specifies which group of 32 ports are
  159. * available in IF_IGR_PORT_MASK
  160. * VCAP_KF_IF_IGR_PORT_MASK_SEL: W2, sparx5: is0/is2
  161. * Mode selector for IF_IGR_PORT_MASK, applicable when IF_IGR_PORT_MASK_L3 == 0.
  162. * Mapping: 0: DEFAULT 1: LOOPBACK 2: MASQUERADE 3: CPU_VD
  163. * VCAP_KF_IF_IGR_PORT_SEL: W1, sparx5: es2
  164. * Selector for IF_IGR_PORT: physical port number or ERLEG
  165. * VCAP_KF_IP4_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
  166. * Set if frame has EtherType = 0x800 and IP version = 4
  167. * VCAP_KF_IP_MC_IS: W1, sparx5: is0, lan966x: is1
  168. * Set if frame is IPv4 frame and frame's destination MAC address is an IPv4
  169. * multicast address (0x01005E0 /25). Set if frame is IPv6 frame and frame's
  170. * destination MAC address is an IPv6 multicast address (0x3333/16).
  171. * VCAP_KF_IP_PAYLOAD_5TUPLE: W32, sparx5: is0, lan966x: is1
  172. * Payload bytes after IP header
  173. * VCAP_KF_IP_PAYLOAD_S1_IP6: W112, lan966x: is1
  174. * Payload after IPv6 header
  175. * VCAP_KF_IP_SNAP_IS: W1, sparx5: is0, lan966x: is1
  176. * Set if frame is IPv4, IPv6, or SNAP frame
  177. * VCAP_KF_ISDX_CLS: sparx5 is2 W12, sparx5 es0 W12, sparx5 es2 W12, lan966x es0
  178. * W8
  179. * Classified ISDX
  180. * VCAP_KF_ISDX_GT0_IS: W1, sparx5: is2/es0/es2, lan966x: is2/es0
  181. * Set if classified ISDX > 0
  182. * VCAP_KF_L2_BC_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2/es0
  183. * Set if frame's destination MAC address is the broadcast address
  184. * (FF-FF-FF-FF-FF-FF).
  185. * VCAP_KF_L2_DMAC: W48, sparx5: is0/is2/es2, lan966x: is1/is2
  186. * Destination MAC address
  187. * VCAP_KF_L2_FRM_TYPE: W4, lan966x: is2
  188. * Frame subtype for specific EtherTypes (MRP, DLR)
  189. * VCAP_KF_L2_FWD_IS: W1, sparx5: is2
  190. * Set if the frame is allowed to be forwarded to front ports
  191. * VCAP_KF_L2_LLC: W40, lan966x: is2
  192. * LLC header and data after up to two VLAN tags and the type/length field
  193. * VCAP_KF_L2_MAC: W48, lan966x: is1
  194. * MAC address (FIRST=1: SMAC, FIRST=0: DMAC)
  195. * VCAP_KF_L2_MC_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2/es0
  196. * Set if frame's destination MAC address is a multicast address (bit 40 = 1).
  197. * VCAP_KF_L2_PAYLOAD0: W16, lan966x: is2
  198. * Payload bytes 0-1 after the frame's EtherType
  199. * VCAP_KF_L2_PAYLOAD1: W8, lan966x: is2
  200. * Payload byte 4 after the frame's EtherType. This is specifically for PTP
  201. * frames.
  202. * VCAP_KF_L2_PAYLOAD2: W3, lan966x: is2
  203. * Bits 7, 2, and 1 from payload byte 6 after the frame's EtherType. This is
  204. * specifically for PTP frames.
  205. * VCAP_KF_L2_PAYLOAD_ETYPE: W64, sparx5: is2/es2
  206. * Byte 0-7 of L2 payload after Type/Len field and overloading for OAM
  207. * VCAP_KF_L2_SMAC: W48, sparx5: is0/is2/es2, lan966x: is1/is2
  208. * Source MAC address
  209. * VCAP_KF_L2_SNAP: W40, lan966x: is2
  210. * SNAP header after LLC header (AA-AA-03)
  211. * VCAP_KF_L3_DIP_EQ_SIP_IS: W1, sparx5: is2/es2, lan966x: is2
  212. * Set if Src IP matches Dst IP address
  213. * VCAP_KF_L3_DPL_CLS: W1, sparx5: es0/es2, lan966x: es0
  214. * The frames drop precedence level
  215. * VCAP_KF_L3_DSCP: W6, sparx5: is0, lan966x: is1
  216. * Frame's DSCP value
  217. * VCAP_KF_L3_DST_IS: W1, sparx5: is2
  218. * Set if lookup is done for egress router leg
  219. * VCAP_KF_L3_FRAGMENT: W1, lan966x: is1/is2
  220. * Set if IPv4 frame is fragmented
  221. * VCAP_KF_L3_FRAGMENT_TYPE: W2, sparx5: is0/is2/es2
  222. * L3 Fragmentation type (none, initial, suspicious, valid follow up)
  223. * VCAP_KF_L3_FRAG_INVLD_L4_LEN: W1, sparx5: is0/is2
  224. * Set if frame's L4 length is less than ANA_CL:COMMON:CLM_FRAGMENT_CFG.L4_MIN_L
  225. * EN
  226. * VCAP_KF_L3_FRAG_OFS_GT0: W1, lan966x: is1/is2
  227. * Set if IPv4 frame is fragmented and it is not the first fragment
  228. * VCAP_KF_L3_IP4_DIP: W32, sparx5: is0/is2/es2, lan966x: is1/is2
  229. * Destination IPv4 Address
  230. * VCAP_KF_L3_IP4_SIP: W32, sparx5: is0/is2/es2, lan966x: is1/is2
  231. * Source IPv4 Address
  232. * VCAP_KF_L3_IP6_DIP: sparx5 is0 W128, sparx5 is2 W128, sparx5 es2 W128,
  233. * lan966x is1 W64, lan966x is1 W128, lan966x is2 W128
  234. * Sparx5: Full IPv6 DIP, LAN966x: Either Full IPv6 DIP or a subset depending on
  235. * frame type
  236. * VCAP_KF_L3_IP6_DIP_MSB: W16, lan966x: is1
  237. * MS 16bits of IPv6 DIP
  238. * VCAP_KF_L3_IP6_SIP: sparx5 is0 W128, sparx5 is2 W128, sparx5 es2 W128,
  239. * lan966x is1 W128, lan966x is1 W64, lan966x is2 W128
  240. * Sparx5: Full IPv6 SIP, LAN966x: Either Full IPv6 SIP or a subset depending on
  241. * frame type
  242. * VCAP_KF_L3_IP6_SIP_MSB: W16, lan966x: is1
  243. * MS 16bits of IPv6 DIP
  244. * VCAP_KF_L3_IP_PROTO: W8, sparx5: is0/is2/es2, lan966x: is1/is2
  245. * IPv4 frames: IP protocol. IPv6 frames: Next header, same as for IPV4
  246. * VCAP_KF_L3_OPTIONS_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
  247. * Set if IPv4 frame contains options (IP len > 5)
  248. * VCAP_KF_L3_PAYLOAD: sparx5 is2 W96, sparx5 is2 W40, sparx5 es2 W96, sparx5
  249. * es2 W40, lan966x is2 W56
  250. * Sparx5: Payload bytes after IP header. IPv4: IPv4 options are not parsed so
  251. * payload is always taken 20 bytes after the start of the IPv4 header, LAN966x:
  252. * Bytes 0-6 after IP header
  253. * VCAP_KF_L3_RT_IS: W1, sparx5: is2/es2
  254. * Set if frame has hit a router leg
  255. * VCAP_KF_L3_TOS: W8, sparx5: is2/es2, lan966x: is2
  256. * Sparx5: Frame's IPv4/IPv6 DSCP and ECN fields, LAN966x: IP TOS field
  257. * VCAP_KF_L3_TTL_GT0: W1, sparx5: is2/es2, lan966x: is2
  258. * Set if IPv4 TTL / IPv6 hop limit is greater than 0
  259. * VCAP_KF_L4_1588_DOM: W8, lan966x: is2
  260. * PTP over UDP: domainNumber
  261. * VCAP_KF_L4_1588_VER: W4, lan966x: is2
  262. * PTP over UDP: version
  263. * VCAP_KF_L4_ACK: W1, sparx5: is2/es2, lan966x: is2
  264. * Sparx5 and LAN966x: TCP flag ACK, LAN966x only: PTP over UDP: flagField bit 2
  265. * (unicastFlag)
  266. * VCAP_KF_L4_DPORT: W16, sparx5: is2/es2, lan966x: is2
  267. * Sparx5: TCP/UDP destination port. Overloading for IP_7TUPLE: Non-TCP/UDP IP
  268. * frames: L4_DPORT = L3_IP_PROTO, LAN966x: TCP/UDP destination port
  269. * VCAP_KF_L4_FIN: W1, sparx5: is2/es2, lan966x: is2
  270. * TCP flag FIN, LAN966x: TCP flag FIN, and for PTP over UDP: messageType bit 1
  271. * VCAP_KF_L4_PAYLOAD: W64, sparx5: is2/es2
  272. * Payload bytes after TCP/UDP header Overloading for IP_7TUPLE: Non TCP/UDP
  273. * frames: Payload bytes 0-7 after IP header. IPv4 options are not parsed so
  274. * payload is always taken 20 bytes after the start of the IPv4 header for non
  275. * TCP/UDP IPv4 frames
  276. * VCAP_KF_L4_PSH: W1, sparx5: is2/es2, lan966x: is2
  277. * Sparx5: TCP flag PSH, LAN966x: TCP: TCP flag PSH. PTP over UDP: flagField bit
  278. * 1 (twoStepFlag)
  279. * VCAP_KF_L4_RNG: sparx5 is0 W8, sparx5 is2 W16, sparx5 es2 W16, lan966x is1
  280. * W8, lan966x is2 W8
  281. * Range checker bitmask (one for each range checker). Input into range checkers
  282. * is taken from classified results (VID, DSCP) and frame (SPORT, DPORT, ETYPE,
  283. * outer VID, inner VID)
  284. * VCAP_KF_L4_RST: W1, sparx5: is2/es2, lan966x: is2
  285. * Sparx5: TCP flag RST , LAN966x: TCP: TCP flag RST. PTP over UDP: messageType
  286. * bit 3
  287. * VCAP_KF_L4_SEQUENCE_EQ0_IS: W1, sparx5: is2/es2, lan966x: is2
  288. * Set if TCP sequence number is 0, LAN966x: Overlaid with PTP over UDP:
  289. * messageType bit 0
  290. * VCAP_KF_L4_SPORT: W16, sparx5: is0/is2/es2, lan966x: is1/is2
  291. * TCP/UDP source port
  292. * VCAP_KF_L4_SPORT_EQ_DPORT_IS: W1, sparx5: is2/es2, lan966x: is2
  293. * Set if UDP or TCP source port equals UDP or TCP destination port
  294. * VCAP_KF_L4_SYN: W1, sparx5: is2/es2, lan966x: is2
  295. * Sparx5: TCP flag SYN, LAN966x: TCP: TCP flag SYN. PTP over UDP: messageType
  296. * bit 2
  297. * VCAP_KF_L4_URG: W1, sparx5: is2/es2, lan966x: is2
  298. * Sparx5: TCP flag URG, LAN966x: TCP: TCP flag URG. PTP over UDP: flagField bit
  299. * 7 (reserved)
  300. * VCAP_KF_LOOKUP_FIRST_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
  301. * Selects between entries relevant for first and second lookup. Set for first
  302. * lookup, cleared for second lookup.
  303. * VCAP_KF_LOOKUP_GEN_IDX: W12, sparx5: is0
  304. * Generic index - for chaining CLM instances
  305. * VCAP_KF_LOOKUP_GEN_IDX_SEL: W2, sparx5: is0
  306. * Select the mode of the Generic Index
  307. * VCAP_KF_LOOKUP_INDEX: W2, lan966x: is1
  308. * 0: First lookup, 1: Second lookup, 2: Third lookup, Similar to VCAP_KF_FIRST
  309. * but with extra info
  310. * VCAP_KF_LOOKUP_PAG: W8, sparx5: is2, lan966x: is2
  311. * Classified Policy Association Group: chains rules from IS1/CLM to IS2
  312. * VCAP_KF_MIRROR_PROBE: W2, sparx5: es2
  313. * Identifies frame copies generated as a result of mirroring
  314. * VCAP_KF_OAM_CCM_CNTS_EQ0: W1, sparx5: is2/es2, lan966x: is2
  315. * Dual-ended loss measurement counters in CCM frames are all zero
  316. * VCAP_KF_OAM_DETECTED: W1, lan966x: is2
  317. * This is missing in the datasheet, but present in the OAM keyset in XML
  318. * VCAP_KF_OAM_FLAGS: W8, lan966x: is2
  319. * Frame's OAM flags
  320. * VCAP_KF_OAM_MEL_FLAGS: W7, lan966x: is2
  321. * Encoding of MD level/MEG level (MEL)
  322. * VCAP_KF_OAM_MEPID: W16, lan966x: is2
  323. * CCM frame's OAM MEP ID
  324. * VCAP_KF_OAM_OPCODE: W8, lan966x: is2
  325. * Frame's OAM opcode
  326. * VCAP_KF_OAM_VER: W5, lan966x: is2
  327. * Frame's OAM version
  328. * VCAP_KF_OAM_Y1731_IS: W1, sparx5: is2/es2, lan966x: is2
  329. * Set if frame's EtherType = 0x8902
  330. * VCAP_KF_PDU_TYPE: W4, lan966x: es0
  331. * PDU type value (none, OAM CCM, MRP, DLR, RTE, IPv4, IPv6, OAM non-CCM)
  332. * VCAP_KF_PROT_ACTIVE: W1, sparx5: es0/es2
  333. * Protection is active
  334. * VCAP_KF_RTP_ID: W10, lan966x: es0
  335. * Classified RTP_ID
  336. * VCAP_KF_RT_FRMID: W32, lan966x: is1
  337. * Profinet or OPC-UA FrameId
  338. * VCAP_KF_RT_TYPE: W2, lan966x: is1
  339. * Encoding of frame's EtherType: 0: Other, 1: Profinet, 2: OPC-UA, 3: Custom
  340. * (ANA::RT_CUSTOM)
  341. * VCAP_KF_RT_VLAN_IDX: W3, lan966x: is1
  342. * Real-time VLAN index from ANA::RT_VLAN_PCP
  343. * VCAP_KF_TCP_IS: W1, sparx5: is0/is2/es2, lan966x: is1/is2
  344. * Set if frame is IPv4 TCP frame (IP protocol = 6) or IPv6 TCP frames (Next
  345. * header = 6)
  346. * VCAP_KF_TCP_UDP_IS: W1, sparx5: is0/is2/es2, lan966x: is1
  347. * Set if frame is IPv4/IPv6 TCP or UDP frame (IP protocol/next header equals 6
  348. * or 17)
  349. * VCAP_KF_TYPE: sparx5 is0 W2, sparx5 is0 W1, sparx5 is2 W4, sparx5 is2 W2,
  350. * sparx5 es0 W1, sparx5 es2 W3, lan966x is1 W1, lan966x is1 W2, lan966x is2 W4,
  351. * lan966x is2 W2
  352. * Keyset type id - set by the API
  353. */
  354. /* Keyfield names */
  355. enum vcap_key_field {
  356. VCAP_KF_NO_VALUE, /* initial value */
  357. VCAP_KF_8021BR_ECID_BASE,
  358. VCAP_KF_8021BR_ECID_EXT,
  359. VCAP_KF_8021BR_E_TAGGED,
  360. VCAP_KF_8021BR_GRP,
  361. VCAP_KF_8021BR_IGR_ECID_BASE,
  362. VCAP_KF_8021BR_IGR_ECID_EXT,
  363. VCAP_KF_8021CB_R_TAGGED_IS,
  364. VCAP_KF_8021Q_DEI0,
  365. VCAP_KF_8021Q_DEI1,
  366. VCAP_KF_8021Q_DEI2,
  367. VCAP_KF_8021Q_DEI_CLS,
  368. VCAP_KF_8021Q_PCP0,
  369. VCAP_KF_8021Q_PCP1,
  370. VCAP_KF_8021Q_PCP2,
  371. VCAP_KF_8021Q_PCP_CLS,
  372. VCAP_KF_8021Q_TPID,
  373. VCAP_KF_8021Q_TPID0,
  374. VCAP_KF_8021Q_TPID1,
  375. VCAP_KF_8021Q_TPID2,
  376. VCAP_KF_8021Q_VID0,
  377. VCAP_KF_8021Q_VID1,
  378. VCAP_KF_8021Q_VID2,
  379. VCAP_KF_8021Q_VID_CLS,
  380. VCAP_KF_8021Q_VLAN_DBL_TAGGED_IS,
  381. VCAP_KF_8021Q_VLAN_TAGGED_IS,
  382. VCAP_KF_8021Q_VLAN_TAGS,
  383. VCAP_KF_ACL_GRP_ID,
  384. VCAP_KF_ARP_ADDR_SPACE_OK_IS,
  385. VCAP_KF_ARP_LEN_OK_IS,
  386. VCAP_KF_ARP_OPCODE,
  387. VCAP_KF_ARP_OPCODE_UNKNOWN_IS,
  388. VCAP_KF_ARP_PROTO_SPACE_OK_IS,
  389. VCAP_KF_ARP_SENDER_MATCH_IS,
  390. VCAP_KF_ARP_TGT_MATCH_IS,
  391. VCAP_KF_COSID_CLS,
  392. VCAP_KF_ES0_ISDX_KEY_ENA,
  393. VCAP_KF_ETYPE,
  394. VCAP_KF_ETYPE_LEN_IS,
  395. VCAP_KF_HOST_MATCH,
  396. VCAP_KF_IF_EGR_PORT_MASK,
  397. VCAP_KF_IF_EGR_PORT_MASK_RNG,
  398. VCAP_KF_IF_EGR_PORT_NO,
  399. VCAP_KF_IF_IGR_PORT,
  400. VCAP_KF_IF_IGR_PORT_MASK,
  401. VCAP_KF_IF_IGR_PORT_MASK_L3,
  402. VCAP_KF_IF_IGR_PORT_MASK_RNG,
  403. VCAP_KF_IF_IGR_PORT_MASK_SEL,
  404. VCAP_KF_IF_IGR_PORT_SEL,
  405. VCAP_KF_IP4_IS,
  406. VCAP_KF_IP_MC_IS,
  407. VCAP_KF_IP_PAYLOAD_5TUPLE,
  408. VCAP_KF_IP_PAYLOAD_S1_IP6,
  409. VCAP_KF_IP_SNAP_IS,
  410. VCAP_KF_ISDX_CLS,
  411. VCAP_KF_ISDX_GT0_IS,
  412. VCAP_KF_L2_BC_IS,
  413. VCAP_KF_L2_DMAC,
  414. VCAP_KF_L2_FRM_TYPE,
  415. VCAP_KF_L2_FWD_IS,
  416. VCAP_KF_L2_LLC,
  417. VCAP_KF_L2_MAC,
  418. VCAP_KF_L2_MC_IS,
  419. VCAP_KF_L2_PAYLOAD0,
  420. VCAP_KF_L2_PAYLOAD1,
  421. VCAP_KF_L2_PAYLOAD2,
  422. VCAP_KF_L2_PAYLOAD_ETYPE,
  423. VCAP_KF_L2_SMAC,
  424. VCAP_KF_L2_SNAP,
  425. VCAP_KF_L3_DIP_EQ_SIP_IS,
  426. VCAP_KF_L3_DPL_CLS,
  427. VCAP_KF_L3_DSCP,
  428. VCAP_KF_L3_DST_IS,
  429. VCAP_KF_L3_FRAGMENT,
  430. VCAP_KF_L3_FRAGMENT_TYPE,
  431. VCAP_KF_L3_FRAG_INVLD_L4_LEN,
  432. VCAP_KF_L3_FRAG_OFS_GT0,
  433. VCAP_KF_L3_IP4_DIP,
  434. VCAP_KF_L3_IP4_SIP,
  435. VCAP_KF_L3_IP6_DIP,
  436. VCAP_KF_L3_IP6_DIP_MSB,
  437. VCAP_KF_L3_IP6_SIP,
  438. VCAP_KF_L3_IP6_SIP_MSB,
  439. VCAP_KF_L3_IP_PROTO,
  440. VCAP_KF_L3_OPTIONS_IS,
  441. VCAP_KF_L3_PAYLOAD,
  442. VCAP_KF_L3_RT_IS,
  443. VCAP_KF_L3_TOS,
  444. VCAP_KF_L3_TTL_GT0,
  445. VCAP_KF_L4_1588_DOM,
  446. VCAP_KF_L4_1588_VER,
  447. VCAP_KF_L4_ACK,
  448. VCAP_KF_L4_DPORT,
  449. VCAP_KF_L4_FIN,
  450. VCAP_KF_L4_PAYLOAD,
  451. VCAP_KF_L4_PSH,
  452. VCAP_KF_L4_RNG,
  453. VCAP_KF_L4_RST,
  454. VCAP_KF_L4_SEQUENCE_EQ0_IS,
  455. VCAP_KF_L4_SPORT,
  456. VCAP_KF_L4_SPORT_EQ_DPORT_IS,
  457. VCAP_KF_L4_SYN,
  458. VCAP_KF_L4_URG,
  459. VCAP_KF_LOOKUP_FIRST_IS,
  460. VCAP_KF_LOOKUP_GEN_IDX,
  461. VCAP_KF_LOOKUP_GEN_IDX_SEL,
  462. VCAP_KF_LOOKUP_INDEX,
  463. VCAP_KF_LOOKUP_PAG,
  464. VCAP_KF_MIRROR_PROBE,
  465. VCAP_KF_OAM_CCM_CNTS_EQ0,
  466. VCAP_KF_OAM_DETECTED,
  467. VCAP_KF_OAM_FLAGS,
  468. VCAP_KF_OAM_MEL_FLAGS,
  469. VCAP_KF_OAM_MEPID,
  470. VCAP_KF_OAM_OPCODE,
  471. VCAP_KF_OAM_VER,
  472. VCAP_KF_OAM_Y1731_IS,
  473. VCAP_KF_PDU_TYPE,
  474. VCAP_KF_PROT_ACTIVE,
  475. VCAP_KF_RTP_ID,
  476. VCAP_KF_RT_FRMID,
  477. VCAP_KF_RT_TYPE,
  478. VCAP_KF_RT_VLAN_IDX,
  479. VCAP_KF_TCP_IS,
  480. VCAP_KF_TCP_UDP_IS,
  481. VCAP_KF_TYPE,
  482. };
  483. /* Actionset names with origin information */
  484. enum vcap_actionfield_set {
  485. VCAP_AFS_NO_VALUE, /* initial value */
  486. VCAP_AFS_BASE_TYPE, /* sparx5 is2 X3, sparx5 es2 X3, lan966x is2 X2 */
  487. VCAP_AFS_CLASSIFICATION, /* sparx5 is0 X2 */
  488. VCAP_AFS_CLASS_REDUCED, /* sparx5 is0 X1 */
  489. VCAP_AFS_ES0, /* sparx5 es0 X1 */
  490. VCAP_AFS_FULL, /* sparx5 is0 X3 */
  491. VCAP_AFS_S1, /* lan966x is1 X1 */
  492. VCAP_AFS_SMAC_SIP, /* lan966x is2 X1 */
  493. VCAP_AFS_VID, /* lan966x es0 X1 */
  494. };
  495. /* List of actionfields with description
  496. *
  497. * VCAP_AF_ACL_ID: W6, lan966x: is2
  498. * Logical ID for the entry. This ID is extracted together with the frame in the
  499. * CPU extraction header. Only applicable to actions with CPU_COPY_ENA or
  500. * HIT_ME_ONCE set.
  501. * VCAP_AF_CLS_VID_SEL: W3, sparx5: is0
  502. * Controls the classified VID: 0: VID_NONE: No action. 1: VID_ADD: New VID =
  503. * old VID + VID_VAL. 2: VID_REPLACE: New VID = VID_VAL. 3: VID_FIRST_TAG: New
  504. * VID = VID from frame's first tag (outer tag) if available, otherwise VID_VAL.
  505. * 4: VID_SECOND_TAG: New VID = VID from frame's second tag (middle tag) if
  506. * available, otherwise VID_VAL. 5: VID_THIRD_TAG: New VID = VID from frame's
  507. * third tag (inner tag) if available, otherwise VID_VAL.
  508. * VCAP_AF_CNT_ID: sparx5 is2 W12, sparx5 es2 W11
  509. * Counter ID, used per lookup to index the 4K frame counters (ANA_ACL:CNT_TBL).
  510. * Multiple VCAP IS2 entries can use the same counter.
  511. * VCAP_AF_COPY_PORT_NUM: W7, sparx5: es2
  512. * QSYS port number when FWD_MODE is redirect or copy
  513. * VCAP_AF_COPY_QUEUE_NUM: W16, sparx5: es2
  514. * QSYS queue number when FWD_MODE is redirect or copy
  515. * VCAP_AF_CPU_COPY_ENA: W1, sparx5: is2/es2, lan966x: is2
  516. * Setting this bit to 1 causes all frames that hit this action to be copied to
  517. * the CPU extraction queue specified in CPU_QUEUE_NUM.
  518. * VCAP_AF_CPU_QU: W3, sparx5: es0
  519. * CPU extraction queue. Used when FWD_SEL >0 and PIPELINE_ACT = XTR.
  520. * VCAP_AF_CPU_QUEUE_NUM: W3, sparx5: is2/es2, lan966x: is2
  521. * CPU queue number. Used when CPU_COPY_ENA is set.
  522. * VCAP_AF_CUSTOM_ACE_TYPE_ENA: W4, lan966x: is1
  523. * Enables use of custom keys in IS2. Bits 3:2 control second lookup in IS2
  524. * while bits 1:0 control first lookup. Encoding per lookup: 0: Disabled. 1:
  525. * Extract 40 bytes after position corresponding to the location of the IPv4
  526. * header and use as key. 2: Extract 40 bytes after SMAC and use as key
  527. * VCAP_AF_DEI_A_VAL: W1, sparx5: es0, lan966x: es0
  528. * DEI used in ES0 tag A. See TAG_A_DEI_SEL.
  529. * VCAP_AF_DEI_B_VAL: W1, sparx5: es0, lan966x: es0
  530. * DEI used in ES0 tag B. See TAG_B_DEI_SEL.
  531. * VCAP_AF_DEI_C_VAL: W1, sparx5: es0
  532. * DEI used in ES0 tag C. See TAG_C_DEI_SEL.
  533. * VCAP_AF_DEI_ENA: W1, sparx5: is0, lan966x: is1
  534. * If set, use DEI_VAL as classified DEI value. Otherwise, DEI from basic
  535. * classification is used
  536. * VCAP_AF_DEI_VAL: W1, sparx5: is0, lan966x: is1
  537. * See DEI_ENA
  538. * VCAP_AF_DLR_SEL: W2, lan966x: is1
  539. * 0: No changes to port-based selection in ANA:PORT:OAM_CFG.DLR_ENA. 1: Enable
  540. * DLR frame processing 2: Disable DLR processing
  541. * VCAP_AF_DP_ENA: W1, sparx5: is0, lan966x: is1
  542. * If set, use DP_VAL as classified drop precedence level. Otherwise, drop
  543. * precedence level from basic classification is used.
  544. * VCAP_AF_DP_VAL: sparx5 is0 W2, lan966x is1 W1
  545. * See DP_ENA.
  546. * VCAP_AF_DSCP_ENA: W1, sparx5: is0, lan966x: is1
  547. * If set, use DSCP_VAL as classified DSCP value. Otherwise, DSCP value from
  548. * basic classification is used.
  549. * VCAP_AF_DSCP_SEL: W3, sparx5: es0
  550. * Selects source for DSCP. 0: Controlled by port configuration and IFH. 1:
  551. * Classified DSCP via IFH. 2: DSCP_VAL. 3: Reserved. 4: Mapped using mapping
  552. * table 0, otherwise use DSCP_VAL. 5: Mapped using mapping table 1, otherwise
  553. * use mapping table 0. 6: Mapped using mapping table 2, otherwise use DSCP_VAL.
  554. * 7: Mapped using mapping table 3, otherwise use mapping table 2
  555. * VCAP_AF_DSCP_VAL: W6, sparx5: is0/es0, lan966x: is1
  556. * See DSCP_ENA.
  557. * VCAP_AF_ES2_REW_CMD: W3, sparx5: es2
  558. * Command forwarded to REW: 0: No action. 1: SWAP MAC addresses. 2: Do L2CP
  559. * DMAC translation when entering or leaving a tunnel.
  560. * VCAP_AF_ESDX: sparx5 es0 W13, lan966x es0 W8
  561. * Egress counter index. Used to index egress counter set as defined in
  562. * REW::STAT_CFG.
  563. * VCAP_AF_FWD_KILL_ENA: W1, lan966x: is2
  564. * Setting this bit to 1 denies forwarding of the frame forwarding to any front
  565. * port. The frame can still be copied to the CPU by other actions.
  566. * VCAP_AF_FWD_MODE: W2, sparx5: es2
  567. * Forward selector: 0: Forward. 1: Discard. 2: Redirect. 3: Copy.
  568. * VCAP_AF_FWD_SEL: W2, sparx5: es0
  569. * ES0 Forward selector. 0: No action. 1: Copy to loopback interface. 2:
  570. * Redirect to loopback interface. 3: Discard
  571. * VCAP_AF_HIT_ME_ONCE: W1, sparx5: is2/es2, lan966x: is2
  572. * Setting this bit to 1 causes the first frame that hits this action where the
  573. * HIT_CNT counter is zero to be copied to the CPU extraction queue specified in
  574. * CPU_QUEUE_NUM. The HIT_CNT counter is then incremented and any frames that
  575. * hit this action later are not copied to the CPU. To re-enable the HIT_ME_ONCE
  576. * functionality, the HIT_CNT counter must be cleared.
  577. * VCAP_AF_HOST_MATCH: W1, lan966x: is2
  578. * Used for IP source guarding. If set, it signals that the host is a valid (for
  579. * instance a valid combination of source MAC address and source IP address).
  580. * HOST_MATCH is input to the IS2 keys.
  581. * VCAP_AF_IGNORE_PIPELINE_CTRL: W1, sparx5: is2/es2
  582. * Ignore ingress pipeline control. This enforces the use of the VCAP IS2 action
  583. * even when the pipeline control has terminated the frame before VCAP IS2.
  584. * VCAP_AF_INTR_ENA: W1, sparx5: is2/es2
  585. * If set, an interrupt is triggered when this rule is hit
  586. * VCAP_AF_ISDX_ADD_REPLACE_SEL: W1, sparx5: is0
  587. * Controls the classified ISDX. 0: New ISDX = old ISDX + ISDX_VAL. 1: New ISDX
  588. * = ISDX_VAL.
  589. * VCAP_AF_ISDX_ADD_VAL: W8, lan966x: is1
  590. * If ISDX_REPLACE_ENA is set, ISDX_ADD_VAL is used directly as the new ISDX.
  591. * Encoding: ISDX_REPLACE_ENA=0, ISDX_ADD_VAL=0: Disabled ISDX_EPLACE_ENA=0,
  592. * ISDX_ADD_VAL>0: Add value to classified ISDX. ISDX_REPLACE_ENA=1: Replace
  593. * with ISDX_ADD_VAL value.
  594. * VCAP_AF_ISDX_ENA: W1, lan966x: is2
  595. * Setting this bit to 1 causes the classified ISDX to be set to the value of
  596. * POLICE_IDX[8:0].
  597. * VCAP_AF_ISDX_REPLACE_ENA: W1, lan966x: is1
  598. * If set, classified ISDX is set to ISDX_ADD_VAL.
  599. * VCAP_AF_ISDX_VAL: W12, sparx5: is0
  600. * See isdx_add_replace_sel
  601. * VCAP_AF_LOOP_ENA: W1, sparx5: es0
  602. * 0: Forward based on PIPELINE_PT and FWD_SEL
  603. * VCAP_AF_LRN_DIS: W1, sparx5: is2, lan966x: is2
  604. * Setting this bit to 1 disables learning of frames hitting this action.
  605. * VCAP_AF_MAP_IDX: W9, sparx5: is0
  606. * Index for QoS mapping table lookup
  607. * VCAP_AF_MAP_KEY: W3, sparx5: is0
  608. * Key type for QoS mapping table lookup. 0: DEI0, PCP0 (outer tag). 1: DEI1,
  609. * PCP1 (middle tag). 2: DEI2, PCP2 (inner tag). 3: MPLS TC. 4: PCP0 (outer
  610. * tag). 5: E-DEI, E-PCP (E-TAG). 6: DSCP if available, otherwise none. 7: DSCP
  611. * if available, otherwise DEI0, PCP0 (outer tag) if available using MAP_IDX+8,
  612. * otherwise none
  613. * VCAP_AF_MAP_LOOKUP_SEL: W2, sparx5: is0
  614. * Selects which of the two QoS Mapping Table lookups that MAP_KEY and MAP_IDX
  615. * are applied to. 0: No changes to the QoS Mapping Table lookup. 1: Update key
  616. * type and index for QoS Mapping Table lookup #0. 2: Update key type and index
  617. * for QoS Mapping Table lookup #1. 3: Reserved.
  618. * VCAP_AF_MASK_MODE: sparx5 is0 W3, sparx5 is2 W3, lan966x is2 W2
  619. * Controls the PORT_MASK use. Sparx5: 0: OR_DSTMASK, 1: AND_VLANMASK, 2:
  620. * REPLACE_PGID, 3: REPLACE_ALL, 4: REDIR_PGID, 5: OR_PGID_MASK, 6: VSTAX, 7:
  621. * Not applicable. LAN966X: 0: No action, 1: Permit/deny (AND), 2: Policy
  622. * forwarding (DMAC lookup), 3: Redirect. The CPU port is untouched by
  623. * MASK_MODE.
  624. * VCAP_AF_MATCH_ID: W16, sparx5: is2
  625. * Logical ID for the entry. The MATCH_ID is extracted together with the frame
  626. * if the frame is forwarded to the CPU (CPU_COPY_ENA). The result is placed in
  627. * IFH.CL_RSLT.
  628. * VCAP_AF_MATCH_ID_MASK: W16, sparx5: is2
  629. * Mask used by MATCH_ID.
  630. * VCAP_AF_MIRROR_ENA: W1, lan966x: is2
  631. * Setting this bit to 1 causes frames to be mirrored to the mirror target port
  632. * (ANA::MIRRPORPORTS).
  633. * VCAP_AF_MIRROR_PROBE: W2, sparx5: is2
  634. * Mirroring performed according to configuration of a mirror probe. 0: No
  635. * mirroring. 1: Mirror probe 0. 2: Mirror probe 1. 3: Mirror probe 2
  636. * VCAP_AF_MIRROR_PROBE_ID: W2, sparx5: es2
  637. * Signals a mirror probe to be placed in the IFH. Only possible when FWD_MODE
  638. * is copy. 0: No mirroring. 1-3: Use mirror probe 0-2.
  639. * VCAP_AF_MRP_SEL: W2, lan966x: is1
  640. * 0: No changes to port-based selection in ANA:PORT:OAM_CFG.MRP_ENA. 1: Enable
  641. * MRP frame processing 2: Disable MRP processing
  642. * VCAP_AF_NXT_IDX: W12, sparx5: is0
  643. * Index used as part of key (field G_IDX) in the next lookup.
  644. * VCAP_AF_NXT_IDX_CTRL: W3, sparx5: is0
  645. * Controls the generation of the G_IDX used in the VCAP CLM next lookup
  646. * VCAP_AF_OAM_SEL: W3, lan966x: is1
  647. * 0: No changes to port-based selection in ANA:PORT:OAM_CFG.OAM_CFG 1: Enable
  648. * OAM frame processing for untagged frames 2: Enable OAM frame processing for
  649. * single frames 3: Enable OAM frame processing for double frames 4: Disable OAM
  650. * frame processing
  651. * VCAP_AF_PAG_OVERRIDE_MASK: W8, sparx5: is0, lan966x: is1
  652. * Bits set in this mask will override PAG_VAL from port profile. New PAG = (PAG
  653. * (input) AND ~PAG_OVERRIDE_MASK) OR (PAG_VAL AND PAG_OVERRIDE_MASK)
  654. * VCAP_AF_PAG_VAL: W8, sparx5: is0, lan966x: is1
  655. * See PAG_OVERRIDE_MASK.
  656. * VCAP_AF_PCP_A_VAL: W3, sparx5: es0, lan966x: es0
  657. * PCP used in ES0 tag A. See TAG_A_PCP_SEL.
  658. * VCAP_AF_PCP_B_VAL: W3, sparx5: es0, lan966x: es0
  659. * PCP used in ES0 tag B. See TAG_B_PCP_SEL.
  660. * VCAP_AF_PCP_C_VAL: W3, sparx5: es0
  661. * PCP used in ES0 tag C. See TAG_C_PCP_SEL.
  662. * VCAP_AF_PCP_ENA: W1, sparx5: is0, lan966x: is1
  663. * If set, use PCP_VAL as classified PCP value. Otherwise, PCP from basic
  664. * classification is used.
  665. * VCAP_AF_PCP_VAL: W3, sparx5: is0, lan966x: is1
  666. * See PCP_ENA.
  667. * VCAP_AF_PIPELINE_ACT: W1, sparx5: es0
  668. * Pipeline action when FWD_SEL > 0. 0: XTR. CPU_QU selects CPU extraction queue
  669. * 1: LBK_ASM.
  670. * VCAP_AF_PIPELINE_FORCE_ENA: W1, sparx5: is2
  671. * If set, use PIPELINE_PT unconditionally and set PIPELINE_ACT = NONE if
  672. * PIPELINE_PT == NONE. Overrules previous settings of pipeline point.
  673. * VCAP_AF_PIPELINE_PT: sparx5 is2 W5, sparx5 es0 W2
  674. * Pipeline point used if PIPELINE_FORCE_ENA is set
  675. * VCAP_AF_POLICE_ENA: W1, sparx5: is2/es2, lan966x: is1/is2
  676. * If set, POLICE_IDX is used to lookup ANA::POL.
  677. * VCAP_AF_POLICE_IDX: sparx5 is2 W6, sparx5 es2 W6, lan966x is1 W9, lan966x is2
  678. * W9
  679. * Policer index.
  680. * VCAP_AF_POLICE_REMARK: W1, sparx5: es2
  681. * If set, frames exceeding policer rates are marked as yellow but not
  682. * discarded.
  683. * VCAP_AF_POLICE_VCAP_ONLY: W1, lan966x: is2
  684. * Disable policing from QoS, and port policers. Only the VCAP policer selected
  685. * by POLICE_IDX is active. Only applies to the second lookup.
  686. * VCAP_AF_POP_VAL: W2, sparx5: es0
  687. * Controls popping of Q-tags. The final number of Q-tags popped is calculated
  688. * as shown in section 4.28.7.2 VLAN Pop Decision.
  689. * VCAP_AF_PORT_MASK: sparx5 is0 W65, sparx5 is2 W68, lan966x is2 W8
  690. * Port mask applied to the forwarding decision based on MASK_MODE.
  691. * VCAP_AF_PUSH_CUSTOMER_TAG: W2, sparx5: es0
  692. * Selects tag C mode: 0: Do not push tag C. 1: Push tag C if
  693. * IFH.VSTAX.TAG.WAS_TAGGED = 1. 2: Push tag C if IFH.VSTAX.TAG.WAS_TAGGED = 0.
  694. * 3: Push tag C if UNTAG_VID_ENA = 0 or (C-TAG.VID ! = VID_C_VAL).
  695. * VCAP_AF_PUSH_INNER_TAG: W1, sparx5: es0, lan966x: es0
  696. * Controls inner tagging. 0: Do not push ES0 tag B as inner tag. 1: Push ES0
  697. * tag B as inner tag.
  698. * VCAP_AF_PUSH_OUTER_TAG: W2, sparx5: es0, lan966x: es0
  699. * Controls outer tagging. 0: No ES0 tag A: Port tag is allowed if enabled on
  700. * port. 1: ES0 tag A: Push ES0 tag A. No port tag. 2: Force port tag: Always
  701. * push port tag. No ES0 tag A. 3: Force untag: Never push port tag or ES0 tag
  702. * A.
  703. * VCAP_AF_QOS_ENA: W1, sparx5: is0, lan966x: is1
  704. * If set, use QOS_VAL as classified QoS class. Otherwise, QoS class from basic
  705. * classification is used.
  706. * VCAP_AF_QOS_VAL: W3, sparx5: is0, lan966x: is1
  707. * See QOS_ENA.
  708. * VCAP_AF_REW_OP: W16, lan966x: is2
  709. * Rewriter operation command.
  710. * VCAP_AF_RT_DIS: W1, sparx5: is2
  711. * If set, routing is disallowed. Only applies when IS_INNER_ACL is 0. See also
  712. * IGR_ACL_ENA, EGR_ACL_ENA, and RLEG_STAT_IDX.
  713. * VCAP_AF_SFID_ENA: W1, lan966x: is1
  714. * If set, SFID_VAL is used to lookup ANA::SFID.
  715. * VCAP_AF_SFID_VAL: W8, lan966x: is1
  716. * Stream filter identifier.
  717. * VCAP_AF_SGID_ENA: W1, lan966x: is1
  718. * If set, SGID_VAL is used to lookup ANA::SGID.
  719. * VCAP_AF_SGID_VAL: W8, lan966x: is1
  720. * Stream gate identifier.
  721. * VCAP_AF_SWAP_MACS_ENA: W1, sparx5: es0
  722. * This setting is only active when FWD_SEL = 1 or FWD_SEL = 2 and PIPELINE_ACT
  723. * = LBK_ASM. 0: No action. 1: Swap MACs and clear bit 40 in new SMAC.
  724. * VCAP_AF_TAG_A_DEI_SEL: sparx5 es0 W3, lan966x es0 W2
  725. * Selects PCP for ES0 tag A. 0: Classified DEI. 1: DEI_A_VAL. 2: DP and QoS
  726. * mapped to PCP (per port table). 3: DP.
  727. * VCAP_AF_TAG_A_PCP_SEL: sparx5 es0 W3, lan966x es0 W2
  728. * Selects PCP for ES0 tag A. 0: Classified PCP. 1: PCP_A_VAL. 2: DP and QoS
  729. * mapped to PCP (per port table). 3: QoS class.
  730. * VCAP_AF_TAG_A_TPID_SEL: sparx5 es0 W3, lan966x es0 W2
  731. * Selects TPID for ES0 tag A: 0: 0x8100. 1: 0x88A8. 2: Custom
  732. * (REW:PORT:PORT_VLAN_CFG.PORT_TPID). 3: If IFH.TAG_TYPE = 0 then 0x8100 else
  733. * custom.
  734. * VCAP_AF_TAG_A_VID_SEL: sparx5 es0 W2, lan966x es0 W1
  735. * Selects VID for ES0 tag A. 0: Classified VID + VID_A_VAL. 1: VID_A_VAL.
  736. * VCAP_AF_TAG_B_DEI_SEL: sparx5 es0 W3, lan966x es0 W2
  737. * Selects PCP for ES0 tag B. 0: Classified DEI. 1: DEI_B_VAL. 2: DP and QoS
  738. * mapped to PCP (per port table). 3: DP.
  739. * VCAP_AF_TAG_B_PCP_SEL: sparx5 es0 W3, lan966x es0 W2
  740. * Selects PCP for ES0 tag B. 0: Classified PCP. 1: PCP_B_VAL. 2: DP and QoS
  741. * mapped to PCP (per port table). 3: QoS class.
  742. * VCAP_AF_TAG_B_TPID_SEL: sparx5 es0 W3, lan966x es0 W2
  743. * Selects TPID for ES0 tag B. 0: 0x8100. 1: 0x88A8. 2: Custom
  744. * (REW:PORT:PORT_VLAN_CFG.PORT_TPID). 3: If IFH.TAG_TYPE = 0 then 0x8100 else
  745. * custom.
  746. * VCAP_AF_TAG_B_VID_SEL: sparx5 es0 W2, lan966x es0 W1
  747. * Selects VID for ES0 tag B. 0: Classified VID + VID_B_VAL. 1: VID_B_VAL.
  748. * VCAP_AF_TAG_C_DEI_SEL: W3, sparx5: es0
  749. * Selects DEI source for ES0 tag C. 0: Classified DEI. 1: DEI_C_VAL. 2:
  750. * REW::DP_MAP.DP [IFH.VSTAX.QOS.DP]. 3: DEI of popped VLAN tag if available
  751. * (IFH.VSTAX.TAG.WAS_TAGGED = 1 and tot_pop_cnt>0) else DEI_C_VAL. 4: Mapped
  752. * using mapping table 0, otherwise use DEI_C_VAL. 5: Mapped using mapping table
  753. * 1, otherwise use mapping table 0. 6: Mapped using mapping table 2, otherwise
  754. * use DEI_C_VAL. 7: Mapped using mapping table 3, otherwise use mapping table
  755. * 2.
  756. * VCAP_AF_TAG_C_PCP_SEL: W3, sparx5: es0
  757. * Selects PCP source for ES0 tag C. 0: Classified PCP. 1: PCP_C_VAL. 2:
  758. * Reserved. 3: PCP of popped VLAN tag if available (IFH.VSTAX.TAG.WAS_TAGGED=1
  759. * and tot_pop_cnt>0) else PCP_C_VAL. 4: Mapped using mapping table 0, otherwise
  760. * use PCP_C_VAL. 5: Mapped using mapping table 1, otherwise use mapping table
  761. * 0. 6: Mapped using mapping table 2, otherwise use PCP_C_VAL. 7: Mapped using
  762. * mapping table 3, otherwise use mapping table 2.
  763. * VCAP_AF_TAG_C_TPID_SEL: W3, sparx5: es0
  764. * Selects TPID for ES0 tag C. 0: 0x8100. 1: 0x88A8. 2: Custom 1. 3: Custom 2.
  765. * 4: Custom 3. 5: See TAG_A_TPID_SEL.
  766. * VCAP_AF_TAG_C_VID_SEL: W2, sparx5: es0
  767. * Selects VID for ES0 tag C. The resulting VID is termed C-TAG.VID. 0:
  768. * Classified VID. 1: VID_C_VAL. 2: IFH.ENCAP.GVID. 3: Reserved.
  769. * VCAP_AF_TYPE: W1, sparx5: is0, lan966x: is1
  770. * Actionset type id - Set by the API
  771. * VCAP_AF_UNTAG_VID_ENA: W1, sparx5: es0
  772. * Controls insertion of tag C. Untag or insert mode can be selected. See
  773. * PUSH_CUSTOMER_TAG.
  774. * VCAP_AF_VID_A_VAL: W12, sparx5: es0, lan966x: es0
  775. * VID used in ES0 tag A. See TAG_A_VID_SEL.
  776. * VCAP_AF_VID_B_VAL: W12, sparx5: es0, lan966x: es0
  777. * VID used in ES0 tag B. See TAG_B_VID_SEL.
  778. * VCAP_AF_VID_C_VAL: W12, sparx5: es0
  779. * VID used in ES0 tag C. See TAG_C_VID_SEL.
  780. * VCAP_AF_VID_REPLACE_ENA: W1, lan966x: is1
  781. * Controls the classified VID: VID_REPLACE_ENA=0: Add VID_ADD_VAL to basic
  782. * classified VID and use result as new classified VID. VID_REPLACE_ENA = 1:
  783. * Replace basic classified VID with VID_VAL value and use as new classified
  784. * VID.
  785. * VCAP_AF_VID_VAL: sparx5 is0 W13, lan966x is1 W12
  786. * New VID Value
  787. * VCAP_AF_VLAN_POP_CNT: W2, lan966x: is1
  788. * See VLAN_POP_CNT_ENA
  789. * VCAP_AF_VLAN_POP_CNT_ENA: W1, lan966x: is1
  790. * If set, use VLAN_POP_CNT as the number of VLAN tags to pop from the incoming
  791. * frame. This number is used by the Rewriter. Otherwise, VLAN_POP_CNT from
  792. * ANA:PORT:VLAN_CFG.VLAN_POP_CNT is used
  793. */
  794. /* Actionfield names */
  795. enum vcap_action_field {
  796. VCAP_AF_NO_VALUE, /* initial value */
  797. VCAP_AF_ACL_ID,
  798. VCAP_AF_CLS_VID_SEL,
  799. VCAP_AF_CNT_ID,
  800. VCAP_AF_COPY_PORT_NUM,
  801. VCAP_AF_COPY_QUEUE_NUM,
  802. VCAP_AF_CPU_COPY_ENA,
  803. VCAP_AF_CPU_QU,
  804. VCAP_AF_CPU_QUEUE_NUM,
  805. VCAP_AF_CUSTOM_ACE_TYPE_ENA,
  806. VCAP_AF_DEI_A_VAL,
  807. VCAP_AF_DEI_B_VAL,
  808. VCAP_AF_DEI_C_VAL,
  809. VCAP_AF_DEI_ENA,
  810. VCAP_AF_DEI_VAL,
  811. VCAP_AF_DLR_SEL,
  812. VCAP_AF_DP_ENA,
  813. VCAP_AF_DP_VAL,
  814. VCAP_AF_DSCP_ENA,
  815. VCAP_AF_DSCP_SEL,
  816. VCAP_AF_DSCP_VAL,
  817. VCAP_AF_ES2_REW_CMD,
  818. VCAP_AF_ESDX,
  819. VCAP_AF_FWD_KILL_ENA,
  820. VCAP_AF_FWD_MODE,
  821. VCAP_AF_FWD_SEL,
  822. VCAP_AF_HIT_ME_ONCE,
  823. VCAP_AF_HOST_MATCH,
  824. VCAP_AF_IGNORE_PIPELINE_CTRL,
  825. VCAP_AF_INTR_ENA,
  826. VCAP_AF_ISDX_ADD_REPLACE_SEL,
  827. VCAP_AF_ISDX_ADD_VAL,
  828. VCAP_AF_ISDX_ENA,
  829. VCAP_AF_ISDX_REPLACE_ENA,
  830. VCAP_AF_ISDX_VAL,
  831. VCAP_AF_LOOP_ENA,
  832. VCAP_AF_LRN_DIS,
  833. VCAP_AF_MAP_IDX,
  834. VCAP_AF_MAP_KEY,
  835. VCAP_AF_MAP_LOOKUP_SEL,
  836. VCAP_AF_MASK_MODE,
  837. VCAP_AF_MATCH_ID,
  838. VCAP_AF_MATCH_ID_MASK,
  839. VCAP_AF_MIRROR_ENA,
  840. VCAP_AF_MIRROR_PROBE,
  841. VCAP_AF_MIRROR_PROBE_ID,
  842. VCAP_AF_MRP_SEL,
  843. VCAP_AF_NXT_IDX,
  844. VCAP_AF_NXT_IDX_CTRL,
  845. VCAP_AF_OAM_SEL,
  846. VCAP_AF_PAG_OVERRIDE_MASK,
  847. VCAP_AF_PAG_VAL,
  848. VCAP_AF_PCP_A_VAL,
  849. VCAP_AF_PCP_B_VAL,
  850. VCAP_AF_PCP_C_VAL,
  851. VCAP_AF_PCP_ENA,
  852. VCAP_AF_PCP_VAL,
  853. VCAP_AF_PIPELINE_ACT,
  854. VCAP_AF_PIPELINE_FORCE_ENA,
  855. VCAP_AF_PIPELINE_PT,
  856. VCAP_AF_POLICE_ENA,
  857. VCAP_AF_POLICE_IDX,
  858. VCAP_AF_POLICE_REMARK,
  859. VCAP_AF_POLICE_VCAP_ONLY,
  860. VCAP_AF_POP_VAL,
  861. VCAP_AF_PORT_MASK,
  862. VCAP_AF_PUSH_CUSTOMER_TAG,
  863. VCAP_AF_PUSH_INNER_TAG,
  864. VCAP_AF_PUSH_OUTER_TAG,
  865. VCAP_AF_QOS_ENA,
  866. VCAP_AF_QOS_VAL,
  867. VCAP_AF_REW_OP,
  868. VCAP_AF_RT_DIS,
  869. VCAP_AF_SFID_ENA,
  870. VCAP_AF_SFID_VAL,
  871. VCAP_AF_SGID_ENA,
  872. VCAP_AF_SGID_VAL,
  873. VCAP_AF_SWAP_MACS_ENA,
  874. VCAP_AF_TAG_A_DEI_SEL,
  875. VCAP_AF_TAG_A_PCP_SEL,
  876. VCAP_AF_TAG_A_TPID_SEL,
  877. VCAP_AF_TAG_A_VID_SEL,
  878. VCAP_AF_TAG_B_DEI_SEL,
  879. VCAP_AF_TAG_B_PCP_SEL,
  880. VCAP_AF_TAG_B_TPID_SEL,
  881. VCAP_AF_TAG_B_VID_SEL,
  882. VCAP_AF_TAG_C_DEI_SEL,
  883. VCAP_AF_TAG_C_PCP_SEL,
  884. VCAP_AF_TAG_C_TPID_SEL,
  885. VCAP_AF_TAG_C_VID_SEL,
  886. VCAP_AF_TYPE,
  887. VCAP_AF_UNTAG_VID_ENA,
  888. VCAP_AF_VID_A_VAL,
  889. VCAP_AF_VID_B_VAL,
  890. VCAP_AF_VID_C_VAL,
  891. VCAP_AF_VID_REPLACE_ENA,
  892. VCAP_AF_VID_VAL,
  893. VCAP_AF_VLAN_POP_CNT,
  894. VCAP_AF_VLAN_POP_CNT_ENA,
  895. };
  896. #endif /* __VCAP_AG_API__ */