ocelot_vcap.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. /* SPDX-License-Identifier: (GPL-2.0 OR MIT)
  2. * Microsemi Ocelot Switch driver
  3. * Copyright (c) 2019 Microsemi Corporation
  4. */
  5. #ifndef _OCELOT_VCAP_H_
  6. #define _OCELOT_VCAP_H_
  7. /* =================================================================
  8. * VCAP Common
  9. * =================================================================
  10. */
  11. /* VCAP Type-Group values */
  12. #define VCAP_TG_NONE 0 /* Entry is invalid */
  13. #define VCAP_TG_FULL 1 /* Full entry */
  14. #define VCAP_TG_HALF 2 /* Half entry */
  15. #define VCAP_TG_QUARTER 3 /* Quarter entry */
  16. /* =================================================================
  17. * VCAP IS2
  18. * =================================================================
  19. */
  20. #define VCAP_IS2_CNT 64
  21. #define VCAP_IS2_ENTRY_WIDTH 376
  22. #define VCAP_IS2_ACTION_WIDTH 99
  23. #define VCAP_PORT_CNT 11
  24. /* IS2 half key types */
  25. #define IS2_TYPE_ETYPE 0
  26. #define IS2_TYPE_LLC 1
  27. #define IS2_TYPE_SNAP 2
  28. #define IS2_TYPE_ARP 3
  29. #define IS2_TYPE_IP_UDP_TCP 4
  30. #define IS2_TYPE_IP_OTHER 5
  31. #define IS2_TYPE_IPV6 6
  32. #define IS2_TYPE_OAM 7
  33. #define IS2_TYPE_SMAC_SIP6 8
  34. #define IS2_TYPE_ANY 100 /* Pseudo type */
  35. /* IS2 half key type mask for matching any IP */
  36. #define IS2_TYPE_MASK_IP_ANY 0xe
  37. /* IS2 action types */
  38. #define IS2_ACTION_TYPE_NORMAL 0
  39. #define IS2_ACTION_TYPE_SMAC_SIP 1
  40. /* IS2 MASK_MODE values */
  41. #define IS2_ACT_MASK_MODE_NONE 0
  42. #define IS2_ACT_MASK_MODE_FILTER 1
  43. #define IS2_ACT_MASK_MODE_POLICY 2
  44. #define IS2_ACT_MASK_MODE_REDIR 3
  45. /* IS2 REW_OP values */
  46. #define IS2_ACT_REW_OP_NONE 0
  47. #define IS2_ACT_REW_OP_PTP_ONE 2
  48. #define IS2_ACT_REW_OP_PTP_TWO 3
  49. #define IS2_ACT_REW_OP_SPECIAL 8
  50. #define IS2_ACT_REW_OP_PTP_ORG 9
  51. #define IS2_ACT_REW_OP_PTP_ONE_SUB_DELAY_1 (IS2_ACT_REW_OP_PTP_ONE | (1 << 3))
  52. #define IS2_ACT_REW_OP_PTP_ONE_SUB_DELAY_2 (IS2_ACT_REW_OP_PTP_ONE | (2 << 3))
  53. #define IS2_ACT_REW_OP_PTP_ONE_ADD_DELAY (IS2_ACT_REW_OP_PTP_ONE | (1 << 5))
  54. #define IS2_ACT_REW_OP_PTP_ONE_ADD_SUB BIT(7)
  55. #define VCAP_PORT_WIDTH 4
  56. /* IS2 quarter key - SMAC_SIP4 */
  57. #define IS2_QKO_IGR_PORT 0
  58. #define IS2_QKL_IGR_PORT VCAP_PORT_WIDTH
  59. #define IS2_QKO_L2_SMAC (IS2_QKO_IGR_PORT + IS2_QKL_IGR_PORT)
  60. #define IS2_QKL_L2_SMAC 48
  61. #define IS2_QKO_L3_IP4_SIP (IS2_QKO_L2_SMAC + IS2_QKL_L2_SMAC)
  62. #define IS2_QKL_L3_IP4_SIP 32
  63. /* IS2 half key - common */
  64. #define IS2_HKO_TYPE 0
  65. #define IS2_HKL_TYPE 4
  66. #define IS2_HKO_FIRST (IS2_HKO_TYPE + IS2_HKL_TYPE)
  67. #define IS2_HKL_FIRST 1
  68. #define IS2_HKO_PAG (IS2_HKO_FIRST + IS2_HKL_FIRST)
  69. #define IS2_HKL_PAG 8
  70. #define IS2_HKO_IGR_PORT_MASK (IS2_HKO_PAG + IS2_HKL_PAG)
  71. #define IS2_HKL_IGR_PORT_MASK (VCAP_PORT_CNT + 1)
  72. #define IS2_HKO_SERVICE_FRM (IS2_HKO_IGR_PORT_MASK + IS2_HKL_IGR_PORT_MASK)
  73. #define IS2_HKL_SERVICE_FRM 1
  74. #define IS2_HKO_HOST_MATCH (IS2_HKO_SERVICE_FRM + IS2_HKL_SERVICE_FRM)
  75. #define IS2_HKL_HOST_MATCH 1
  76. #define IS2_HKO_L2_MC (IS2_HKO_HOST_MATCH + IS2_HKL_HOST_MATCH)
  77. #define IS2_HKL_L2_MC 1
  78. #define IS2_HKO_L2_BC (IS2_HKO_L2_MC + IS2_HKL_L2_MC)
  79. #define IS2_HKL_L2_BC 1
  80. #define IS2_HKO_VLAN_TAGGED (IS2_HKO_L2_BC + IS2_HKL_L2_BC)
  81. #define IS2_HKL_VLAN_TAGGED 1
  82. #define IS2_HKO_VID (IS2_HKO_VLAN_TAGGED + IS2_HKL_VLAN_TAGGED)
  83. #define IS2_HKL_VID 12
  84. #define IS2_HKO_DEI (IS2_HKO_VID + IS2_HKL_VID)
  85. #define IS2_HKL_DEI 1
  86. #define IS2_HKO_PCP (IS2_HKO_DEI + IS2_HKL_DEI)
  87. #define IS2_HKL_PCP 3
  88. /* IS2 half key - MAC_ETYPE/MAC_LLC/MAC_SNAP/OAM common */
  89. #define IS2_HKO_L2_DMAC (IS2_HKO_PCP + IS2_HKL_PCP)
  90. #define IS2_HKL_L2_DMAC 48
  91. #define IS2_HKO_L2_SMAC (IS2_HKO_L2_DMAC + IS2_HKL_L2_DMAC)
  92. #define IS2_HKL_L2_SMAC 48
  93. /* IS2 half key - MAC_ETYPE */
  94. #define IS2_HKO_MAC_ETYPE_ETYPE (IS2_HKO_L2_SMAC + IS2_HKL_L2_SMAC)
  95. #define IS2_HKL_MAC_ETYPE_ETYPE 16
  96. #define IS2_HKO_MAC_ETYPE_L2_PAYLOAD \
  97. (IS2_HKO_MAC_ETYPE_ETYPE + IS2_HKL_MAC_ETYPE_ETYPE)
  98. #define IS2_HKL_MAC_ETYPE_L2_PAYLOAD 27
  99. /* IS2 half key - MAC_LLC */
  100. #define IS2_HKO_MAC_LLC_L2_LLC IS2_HKO_MAC_ETYPE_ETYPE
  101. #define IS2_HKL_MAC_LLC_L2_LLC 40
  102. /* IS2 half key - MAC_SNAP */
  103. #define IS2_HKO_MAC_SNAP_L2_SNAP IS2_HKO_MAC_ETYPE_ETYPE
  104. #define IS2_HKL_MAC_SNAP_L2_SNAP 40
  105. /* IS2 half key - ARP */
  106. #define IS2_HKO_MAC_ARP_L2_SMAC IS2_HKO_L2_DMAC
  107. #define IS2_HKL_MAC_ARP_L2_SMAC 48
  108. #define IS2_HKO_MAC_ARP_ARP_ADDR_SPACE_OK \
  109. (IS2_HKO_MAC_ARP_L2_SMAC + IS2_HKL_MAC_ARP_L2_SMAC)
  110. #define IS2_HKL_MAC_ARP_ARP_ADDR_SPACE_OK 1
  111. #define IS2_HKO_MAC_ARP_ARP_PROTO_SPACE_OK \
  112. (IS2_HKO_MAC_ARP_ARP_ADDR_SPACE_OK + IS2_HKL_MAC_ARP_ARP_ADDR_SPACE_OK)
  113. #define IS2_HKL_MAC_ARP_ARP_PROTO_SPACE_OK 1
  114. #define IS2_HKO_MAC_ARP_ARP_LEN_OK \
  115. (IS2_HKO_MAC_ARP_ARP_PROTO_SPACE_OK + \
  116. IS2_HKL_MAC_ARP_ARP_PROTO_SPACE_OK)
  117. #define IS2_HKL_MAC_ARP_ARP_LEN_OK 1
  118. #define IS2_HKO_MAC_ARP_ARP_TGT_MATCH \
  119. (IS2_HKO_MAC_ARP_ARP_LEN_OK + IS2_HKL_MAC_ARP_ARP_LEN_OK)
  120. #define IS2_HKL_MAC_ARP_ARP_TGT_MATCH 1
  121. #define IS2_HKO_MAC_ARP_ARP_SENDER_MATCH \
  122. (IS2_HKO_MAC_ARP_ARP_TGT_MATCH + IS2_HKL_MAC_ARP_ARP_TGT_MATCH)
  123. #define IS2_HKL_MAC_ARP_ARP_SENDER_MATCH 1
  124. #define IS2_HKO_MAC_ARP_ARP_OPCODE_UNKNOWN \
  125. (IS2_HKO_MAC_ARP_ARP_SENDER_MATCH + IS2_HKL_MAC_ARP_ARP_SENDER_MATCH)
  126. #define IS2_HKL_MAC_ARP_ARP_OPCODE_UNKNOWN 1
  127. #define IS2_HKO_MAC_ARP_ARP_OPCODE \
  128. (IS2_HKO_MAC_ARP_ARP_OPCODE_UNKNOWN + \
  129. IS2_HKL_MAC_ARP_ARP_OPCODE_UNKNOWN)
  130. #define IS2_HKL_MAC_ARP_ARP_OPCODE 2
  131. #define IS2_HKO_MAC_ARP_L3_IP4_DIP \
  132. (IS2_HKO_MAC_ARP_ARP_OPCODE + IS2_HKL_MAC_ARP_ARP_OPCODE)
  133. #define IS2_HKL_MAC_ARP_L3_IP4_DIP 32
  134. #define IS2_HKO_MAC_ARP_L3_IP4_SIP \
  135. (IS2_HKO_MAC_ARP_L3_IP4_DIP + IS2_HKL_MAC_ARP_L3_IP4_DIP)
  136. #define IS2_HKL_MAC_ARP_L3_IP4_SIP 32
  137. #define IS2_HKO_MAC_ARP_DIP_EQ_SIP \
  138. (IS2_HKO_MAC_ARP_L3_IP4_SIP + IS2_HKL_MAC_ARP_L3_IP4_SIP)
  139. #define IS2_HKL_MAC_ARP_DIP_EQ_SIP 1
  140. /* IS2 half key - IP4_TCP_UDP/IP4_OTHER common */
  141. #define IS2_HKO_IP4 IS2_HKO_L2_DMAC
  142. #define IS2_HKL_IP4 1
  143. #define IS2_HKO_L3_FRAGMENT (IS2_HKO_IP4 + IS2_HKL_IP4)
  144. #define IS2_HKL_L3_FRAGMENT 1
  145. #define IS2_HKO_L3_FRAG_OFS_GT0 (IS2_HKO_L3_FRAGMENT + IS2_HKL_L3_FRAGMENT)
  146. #define IS2_HKL_L3_FRAG_OFS_GT0 1
  147. #define IS2_HKO_L3_OPTIONS (IS2_HKO_L3_FRAG_OFS_GT0 + IS2_HKL_L3_FRAG_OFS_GT0)
  148. #define IS2_HKL_L3_OPTIONS 1
  149. #define IS2_HKO_L3_TTL_GT0 (IS2_HKO_L3_OPTIONS + IS2_HKL_L3_OPTIONS)
  150. #define IS2_HKL_L3_TTL_GT0 1
  151. #define IS2_HKO_L3_TOS (IS2_HKO_L3_TTL_GT0 + IS2_HKL_L3_TTL_GT0)
  152. #define IS2_HKL_L3_TOS 8
  153. #define IS2_HKO_L3_IP4_DIP (IS2_HKO_L3_TOS + IS2_HKL_L3_TOS)
  154. #define IS2_HKL_L3_IP4_DIP 32
  155. #define IS2_HKO_L3_IP4_SIP (IS2_HKO_L3_IP4_DIP + IS2_HKL_L3_IP4_DIP)
  156. #define IS2_HKL_L3_IP4_SIP 32
  157. #define IS2_HKO_DIP_EQ_SIP (IS2_HKO_L3_IP4_SIP + IS2_HKL_L3_IP4_SIP)
  158. #define IS2_HKL_DIP_EQ_SIP 1
  159. /* IS2 half key - IP4_TCP_UDP */
  160. #define IS2_HKO_IP4_TCP_UDP_TCP (IS2_HKO_DIP_EQ_SIP + IS2_HKL_DIP_EQ_SIP)
  161. #define IS2_HKL_IP4_TCP_UDP_TCP 1
  162. #define IS2_HKO_IP4_TCP_UDP_L4_DPORT \
  163. (IS2_HKO_IP4_TCP_UDP_TCP + IS2_HKL_IP4_TCP_UDP_TCP)
  164. #define IS2_HKL_IP4_TCP_UDP_L4_DPORT 16
  165. #define IS2_HKO_IP4_TCP_UDP_L4_SPORT \
  166. (IS2_HKO_IP4_TCP_UDP_L4_DPORT + IS2_HKL_IP4_TCP_UDP_L4_DPORT)
  167. #define IS2_HKL_IP4_TCP_UDP_L4_SPORT 16
  168. #define IS2_HKO_IP4_TCP_UDP_L4_RNG \
  169. (IS2_HKO_IP4_TCP_UDP_L4_SPORT + IS2_HKL_IP4_TCP_UDP_L4_SPORT)
  170. #define IS2_HKL_IP4_TCP_UDP_L4_RNG 8
  171. #define IS2_HKO_IP4_TCP_UDP_SPORT_EQ_DPORT \
  172. (IS2_HKO_IP4_TCP_UDP_L4_RNG + IS2_HKL_IP4_TCP_UDP_L4_RNG)
  173. #define IS2_HKL_IP4_TCP_UDP_SPORT_EQ_DPORT 1
  174. #define IS2_HKO_IP4_TCP_UDP_SEQUENCE_EQ0 \
  175. (IS2_HKO_IP4_TCP_UDP_SPORT_EQ_DPORT + \
  176. IS2_HKL_IP4_TCP_UDP_SPORT_EQ_DPORT)
  177. #define IS2_HKL_IP4_TCP_UDP_SEQUENCE_EQ0 1
  178. #define IS2_HKO_IP4_TCP_UDP_L4_FIN \
  179. (IS2_HKO_IP4_TCP_UDP_SEQUENCE_EQ0 + IS2_HKL_IP4_TCP_UDP_SEQUENCE_EQ0)
  180. #define IS2_HKL_IP4_TCP_UDP_L4_FIN 1
  181. #define IS2_HKO_IP4_TCP_UDP_L4_SYN \
  182. (IS2_HKO_IP4_TCP_UDP_L4_FIN + IS2_HKL_IP4_TCP_UDP_L4_FIN)
  183. #define IS2_HKL_IP4_TCP_UDP_L4_SYN 1
  184. #define IS2_HKO_IP4_TCP_UDP_L4_RST \
  185. (IS2_HKO_IP4_TCP_UDP_L4_SYN + IS2_HKL_IP4_TCP_UDP_L4_SYN)
  186. #define IS2_HKL_IP4_TCP_UDP_L4_RST 1
  187. #define IS2_HKO_IP4_TCP_UDP_L4_PSH \
  188. (IS2_HKO_IP4_TCP_UDP_L4_RST + IS2_HKL_IP4_TCP_UDP_L4_RST)
  189. #define IS2_HKL_IP4_TCP_UDP_L4_PSH 1
  190. #define IS2_HKO_IP4_TCP_UDP_L4_ACK \
  191. (IS2_HKO_IP4_TCP_UDP_L4_PSH + IS2_HKL_IP4_TCP_UDP_L4_PSH)
  192. #define IS2_HKL_IP4_TCP_UDP_L4_ACK 1
  193. #define IS2_HKO_IP4_TCP_UDP_L4_URG \
  194. (IS2_HKO_IP4_TCP_UDP_L4_ACK + IS2_HKL_IP4_TCP_UDP_L4_ACK)
  195. #define IS2_HKL_IP4_TCP_UDP_L4_URG 1
  196. #define IS2_HKO_IP4_TCP_UDP_L4_1588_DOM \
  197. (IS2_HKO_IP4_TCP_UDP_L4_URG + IS2_HKL_IP4_TCP_UDP_L4_URG)
  198. #define IS2_HKL_IP4_TCP_UDP_L4_1588_DOM 8
  199. #define IS2_HKO_IP4_TCP_UDP_L4_1588_VER \
  200. (IS2_HKO_IP4_TCP_UDP_L4_1588_DOM + IS2_HKL_IP4_TCP_UDP_L4_1588_DOM)
  201. #define IS2_HKL_IP4_TCP_UDP_L4_1588_VER 4
  202. /* IS2 half key - IP4_OTHER */
  203. #define IS2_HKO_IP4_OTHER_L3_PROTO IS2_HKO_IP4_TCP_UDP_TCP
  204. #define IS2_HKL_IP4_OTHER_L3_PROTO 8
  205. #define IS2_HKO_IP4_OTHER_L3_PAYLOAD \
  206. (IS2_HKO_IP4_OTHER_L3_PROTO + IS2_HKL_IP4_OTHER_L3_PROTO)
  207. #define IS2_HKL_IP4_OTHER_L3_PAYLOAD 56
  208. /* IS2 half key - IP6_STD */
  209. #define IS2_HKO_IP6_STD_L3_TTL_GT0 IS2_HKO_L2_DMAC
  210. #define IS2_HKL_IP6_STD_L3_TTL_GT0 1
  211. #define IS2_HKO_IP6_STD_L3_IP6_SIP \
  212. (IS2_HKO_IP6_STD_L3_TTL_GT0 + IS2_HKL_IP6_STD_L3_TTL_GT0)
  213. #define IS2_HKL_IP6_STD_L3_IP6_SIP 128
  214. #define IS2_HKO_IP6_STD_L3_PROTO \
  215. (IS2_HKO_IP6_STD_L3_IP6_SIP + IS2_HKL_IP6_STD_L3_IP6_SIP)
  216. #define IS2_HKL_IP6_STD_L3_PROTO 8
  217. /* IS2 half key - OAM */
  218. #define IS2_HKO_OAM_OAM_MEL_FLAGS IS2_HKO_MAC_ETYPE_ETYPE
  219. #define IS2_HKL_OAM_OAM_MEL_FLAGS 7
  220. #define IS2_HKO_OAM_OAM_VER \
  221. (IS2_HKO_OAM_OAM_MEL_FLAGS + IS2_HKL_OAM_OAM_MEL_FLAGS)
  222. #define IS2_HKL_OAM_OAM_VER 5
  223. #define IS2_HKO_OAM_OAM_OPCODE (IS2_HKO_OAM_OAM_VER + IS2_HKL_OAM_OAM_VER)
  224. #define IS2_HKL_OAM_OAM_OPCODE 8
  225. #define IS2_HKO_OAM_OAM_FLAGS (IS2_HKO_OAM_OAM_OPCODE + IS2_HKL_OAM_OAM_OPCODE)
  226. #define IS2_HKL_OAM_OAM_FLAGS 8
  227. #define IS2_HKO_OAM_OAM_MEPID (IS2_HKO_OAM_OAM_FLAGS + IS2_HKL_OAM_OAM_FLAGS)
  228. #define IS2_HKL_OAM_OAM_MEPID 16
  229. #define IS2_HKO_OAM_OAM_CCM_CNTS_EQ0 \
  230. (IS2_HKO_OAM_OAM_MEPID + IS2_HKL_OAM_OAM_MEPID)
  231. #define IS2_HKL_OAM_OAM_CCM_CNTS_EQ0 1
  232. /* IS2 half key - SMAC_SIP6 */
  233. #define IS2_HKO_SMAC_SIP6_IGR_PORT IS2_HKL_TYPE
  234. #define IS2_HKL_SMAC_SIP6_IGR_PORT VCAP_PORT_WIDTH
  235. #define IS2_HKO_SMAC_SIP6_L2_SMAC \
  236. (IS2_HKO_SMAC_SIP6_IGR_PORT + IS2_HKL_SMAC_SIP6_IGR_PORT)
  237. #define IS2_HKL_SMAC_SIP6_L2_SMAC 48
  238. #define IS2_HKO_SMAC_SIP6_L3_IP6_SIP \
  239. (IS2_HKO_SMAC_SIP6_L2_SMAC + IS2_HKL_SMAC_SIP6_L2_SMAC)
  240. #define IS2_HKL_SMAC_SIP6_L3_IP6_SIP 128
  241. /* IS2 full key - common */
  242. #define IS2_FKO_TYPE 0
  243. #define IS2_FKL_TYPE 2
  244. #define IS2_FKO_FIRST (IS2_FKO_TYPE + IS2_FKL_TYPE)
  245. #define IS2_FKL_FIRST 1
  246. #define IS2_FKO_PAG (IS2_FKO_FIRST + IS2_FKL_FIRST)
  247. #define IS2_FKL_PAG 8
  248. #define IS2_FKO_IGR_PORT_MASK (IS2_FKO_PAG + IS2_FKL_PAG)
  249. #define IS2_FKL_IGR_PORT_MASK (VCAP_PORT_CNT + 1)
  250. #define IS2_FKO_SERVICE_FRM (IS2_FKO_IGR_PORT_MASK + IS2_FKL_IGR_PORT_MASK)
  251. #define IS2_FKL_SERVICE_FRM 1
  252. #define IS2_FKO_HOST_MATCH (IS2_FKO_SERVICE_FRM + IS2_FKL_SERVICE_FRM)
  253. #define IS2_FKL_HOST_MATCH 1
  254. #define IS2_FKO_L2_MC (IS2_FKO_HOST_MATCH + IS2_FKL_HOST_MATCH)
  255. #define IS2_FKL_L2_MC 1
  256. #define IS2_FKO_L2_BC (IS2_FKO_L2_MC + IS2_FKL_L2_MC)
  257. #define IS2_FKL_L2_BC 1
  258. #define IS2_FKO_VLAN_TAGGED (IS2_FKO_L2_BC + IS2_FKL_L2_BC)
  259. #define IS2_FKL_VLAN_TAGGED 1
  260. #define IS2_FKO_VID (IS2_FKO_VLAN_TAGGED + IS2_FKL_VLAN_TAGGED)
  261. #define IS2_FKL_VID 12
  262. #define IS2_FKO_DEI (IS2_FKO_VID + IS2_FKL_VID)
  263. #define IS2_FKL_DEI 1
  264. #define IS2_FKO_PCP (IS2_FKO_DEI + IS2_FKL_DEI)
  265. #define IS2_FKL_PCP 3
  266. /* IS2 full key - IP6_TCP_UDP/IP6_OTHER common */
  267. #define IS2_FKO_L3_TTL_GT0 (IS2_FKO_PCP + IS2_FKL_PCP)
  268. #define IS2_FKL_L3_TTL_GT0 1
  269. #define IS2_FKO_L3_TOS (IS2_FKO_L3_TTL_GT0 + IS2_FKL_L3_TTL_GT0)
  270. #define IS2_FKL_L3_TOS 8
  271. #define IS2_FKO_L3_IP6_DIP (IS2_FKO_L3_TOS + IS2_FKL_L3_TOS)
  272. #define IS2_FKL_L3_IP6_DIP 128
  273. #define IS2_FKO_L3_IP6_SIP (IS2_FKO_L3_IP6_DIP + IS2_FKL_L3_IP6_DIP)
  274. #define IS2_FKL_L3_IP6_SIP 128
  275. #define IS2_FKO_DIP_EQ_SIP (IS2_FKO_L3_IP6_SIP + IS2_FKL_L3_IP6_SIP)
  276. #define IS2_FKL_DIP_EQ_SIP 1
  277. /* IS2 full key - IP6_TCP_UDP */
  278. #define IS2_FKO_IP6_TCP_UDP_TCP (IS2_FKO_DIP_EQ_SIP + IS2_FKL_DIP_EQ_SIP)
  279. #define IS2_FKL_IP6_TCP_UDP_TCP 1
  280. #define IS2_FKO_IP6_TCP_UDP_L4_DPORT \
  281. (IS2_FKO_IP6_TCP_UDP_TCP + IS2_FKL_IP6_TCP_UDP_TCP)
  282. #define IS2_FKL_IP6_TCP_UDP_L4_DPORT 16
  283. #define IS2_FKO_IP6_TCP_UDP_L4_SPORT \
  284. (IS2_FKO_IP6_TCP_UDP_L4_DPORT + IS2_FKL_IP6_TCP_UDP_L4_DPORT)
  285. #define IS2_FKL_IP6_TCP_UDP_L4_SPORT 16
  286. #define IS2_FKO_IP6_TCP_UDP_L4_RNG \
  287. (IS2_FKO_IP6_TCP_UDP_L4_SPORT + IS2_FKL_IP6_TCP_UDP_L4_SPORT)
  288. #define IS2_FKL_IP6_TCP_UDP_L4_RNG 8
  289. #define IS2_FKO_IP6_TCP_UDP_SPORT_EQ_DPORT \
  290. (IS2_FKO_IP6_TCP_UDP_L4_RNG + IS2_FKL_IP6_TCP_UDP_L4_RNG)
  291. #define IS2_FKL_IP6_TCP_UDP_SPORT_EQ_DPORT 1
  292. #define IS2_FKO_IP6_TCP_UDP_SEQUENCE_EQ0 \
  293. (IS2_FKO_IP6_TCP_UDP_SPORT_EQ_DPORT + \
  294. IS2_FKL_IP6_TCP_UDP_SPORT_EQ_DPORT)
  295. #define IS2_FKL_IP6_TCP_UDP_SEQUENCE_EQ0 1
  296. #define IS2_FKO_IP6_TCP_UDP_L4_FIN \
  297. (IS2_FKO_IP6_TCP_UDP_SEQUENCE_EQ0 + IS2_FKL_IP6_TCP_UDP_SEQUENCE_EQ0)
  298. #define IS2_FKL_IP6_TCP_UDP_L4_FIN 1
  299. #define IS2_FKO_IP6_TCP_UDP_L4_SYN \
  300. (IS2_FKO_IP6_TCP_UDP_L4_FIN + IS2_FKL_IP6_TCP_UDP_L4_FIN)
  301. #define IS2_FKL_IP6_TCP_UDP_L4_SYN 1
  302. #define IS2_FKO_IP6_TCP_UDP_L4_RST \
  303. (IS2_FKO_IP6_TCP_UDP_L4_SYN + IS2_FKL_IP6_TCP_UDP_L4_SYN)
  304. #define IS2_FKL_IP6_TCP_UDP_L4_RST 1
  305. #define IS2_FKO_IP6_TCP_UDP_L4_PSH \
  306. (IS2_FKO_IP6_TCP_UDP_L4_RST + IS2_FKL_IP6_TCP_UDP_L4_RST)
  307. #define IS2_FKL_IP6_TCP_UDP_L4_PSH 1
  308. #define IS2_FKO_IP6_TCP_UDP_L4_ACK \
  309. (IS2_FKO_IP6_TCP_UDP_L4_PSH + IS2_FKL_IP6_TCP_UDP_L4_PSH)
  310. #define IS2_FKL_IP6_TCP_UDP_L4_ACK 1
  311. #define IS2_FKO_IP6_TCP_UDP_L4_URG \
  312. (IS2_FKO_IP6_TCP_UDP_L4_ACK + IS2_FKL_IP6_TCP_UDP_L4_ACK)
  313. #define IS2_FKL_IP6_TCP_UDP_L4_URG 1
  314. #define IS2_FKO_IP6_TCP_UDP_L4_1588_DOM \
  315. (IS2_FKO_IP6_TCP_UDP_L4_URG + IS2_FKL_IP6_TCP_UDP_L4_URG)
  316. #define IS2_FKL_IP6_TCP_UDP_L4_1588_DOM 8
  317. #define IS2_FKO_IP6_TCP_UDP_L4_1588_VER \
  318. (IS2_FKO_IP6_TCP_UDP_L4_1588_DOM + IS2_FKL_IP6_TCP_UDP_L4_1588_DOM)
  319. #define IS2_FKL_IP6_TCP_UDP_L4_1588_VER 4
  320. /* IS2 full key - IP6_OTHER */
  321. #define IS2_FKO_IP6_OTHER_L3_PROTO IS2_FKO_IP6_TCP_UDP_TCP
  322. #define IS2_FKL_IP6_OTHER_L3_PROTO 8
  323. #define IS2_FKO_IP6_OTHER_L3_PAYLOAD \
  324. (IS2_FKO_IP6_OTHER_L3_PROTO + IS2_FKL_IP6_OTHER_L3_PROTO)
  325. #define IS2_FKL_IP6_OTHER_L3_PAYLOAD 56
  326. /* IS2 full key - CUSTOM */
  327. #define IS2_FKO_CUSTOM_CUSTOM_TYPE IS2_FKO_L3_TTL_GT0
  328. #define IS2_FKL_CUSTOM_CUSTOM_TYPE 1
  329. #define IS2_FKO_CUSTOM_CUSTOM \
  330. (IS2_FKO_CUSTOM_CUSTOM_TYPE + IS2_FKL_CUSTOM_CUSTOM_TYPE)
  331. #define IS2_FKL_CUSTOM_CUSTOM 320
  332. /* IS2 action - BASE_TYPE */
  333. #define IS2_AO_HIT_ME_ONCE 0
  334. #define IS2_AL_HIT_ME_ONCE 1
  335. #define IS2_AO_CPU_COPY_ENA (IS2_AO_HIT_ME_ONCE + IS2_AL_HIT_ME_ONCE)
  336. #define IS2_AL_CPU_COPY_ENA 1
  337. #define IS2_AO_CPU_QU_NUM (IS2_AO_CPU_COPY_ENA + IS2_AL_CPU_COPY_ENA)
  338. #define IS2_AL_CPU_QU_NUM 3
  339. #define IS2_AO_MASK_MODE (IS2_AO_CPU_QU_NUM + IS2_AL_CPU_QU_NUM)
  340. #define IS2_AL_MASK_MODE 2
  341. #define IS2_AO_MIRROR_ENA (IS2_AO_MASK_MODE + IS2_AL_MASK_MODE)
  342. #define IS2_AL_MIRROR_ENA 1
  343. #define IS2_AO_LRN_DIS (IS2_AO_MIRROR_ENA + IS2_AL_MIRROR_ENA)
  344. #define IS2_AL_LRN_DIS 1
  345. #define IS2_AO_POLICE_ENA (IS2_AO_LRN_DIS + IS2_AL_LRN_DIS)
  346. #define IS2_AL_POLICE_ENA 1
  347. #define IS2_AO_POLICE_IDX (IS2_AO_POLICE_ENA + IS2_AL_POLICE_ENA)
  348. #define IS2_AL_POLICE_IDX 9
  349. #define IS2_AO_POLICE_VCAP_ONLY (IS2_AO_POLICE_IDX + IS2_AL_POLICE_IDX)
  350. #define IS2_AL_POLICE_VCAP_ONLY 1
  351. #define IS2_AO_PORT_MASK (IS2_AO_POLICE_VCAP_ONLY + IS2_AL_POLICE_VCAP_ONLY)
  352. #define IS2_AL_PORT_MASK VCAP_PORT_CNT
  353. #define IS2_AO_REW_OP (IS2_AO_PORT_MASK + IS2_AL_PORT_MASK)
  354. #define IS2_AL_REW_OP 9
  355. #define IS2_AO_LM_CNT_DIS (IS2_AO_REW_OP + IS2_AL_REW_OP)
  356. #define IS2_AL_LM_CNT_DIS 1
  357. #define IS2_AO_ISDX_ENA \
  358. (IS2_AO_LM_CNT_DIS + IS2_AL_LM_CNT_DIS + 1) /* Reserved bit */
  359. #define IS2_AL_ISDX_ENA 1
  360. #define IS2_AO_ACL_ID (IS2_AO_ISDX_ENA + IS2_AL_ISDX_ENA)
  361. #define IS2_AL_ACL_ID 6
  362. /* IS2 action - SMAC_SIP */
  363. #define IS2_AO_SMAC_SIP_CPU_COPY_ENA 0
  364. #define IS2_AL_SMAC_SIP_CPU_COPY_ENA 1
  365. #define IS2_AO_SMAC_SIP_CPU_QU_NUM 1
  366. #define IS2_AL_SMAC_SIP_CPU_QU_NUM 3
  367. #define IS2_AO_SMAC_SIP_FWD_KILL_ENA 4
  368. #define IS2_AL_SMAC_SIP_FWD_KILL_ENA 1
  369. #define IS2_AO_SMAC_SIP_HOST_MATCH 5
  370. #define IS2_AL_SMAC_SIP_HOST_MATCH 1
  371. #endif /* _OCELOT_VCAP_H_ */