1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
5 #ifndef _IAVF_GENERIC_FLOW_H_
6 #define _IAVF_GENERIC_FLOW_H_
8 #include <rte_flow_driver.h>
12 #define IAVF_PROT_MAC_INNER (1ULL << 1)
13 #define IAVF_PROT_MAC_OUTER (1ULL << 2)
14 #define IAVF_PROT_VLAN_INNER (1ULL << 3)
15 #define IAVF_PROT_VLAN_OUTER (1ULL << 4)
16 #define IAVF_PROT_IPV4_INNER (1ULL << 5)
17 #define IAVF_PROT_IPV4_OUTER (1ULL << 6)
18 #define IAVF_PROT_IPV6_INNER (1ULL << 7)
19 #define IAVF_PROT_IPV6_OUTER (1ULL << 8)
20 #define IAVF_PROT_TCP_INNER (1ULL << 9)
21 #define IAVF_PROT_TCP_OUTER (1ULL << 10)
22 #define IAVF_PROT_UDP_INNER (1ULL << 11)
23 #define IAVF_PROT_UDP_OUTER (1ULL << 12)
24 #define IAVF_PROT_SCTP_INNER (1ULL << 13)
25 #define IAVF_PROT_SCTP_OUTER (1ULL << 14)
26 #define IAVF_PROT_ICMP4_INNER (1ULL << 15)
27 #define IAVF_PROT_ICMP4_OUTER (1ULL << 16)
28 #define IAVF_PROT_ICMP6_INNER (1ULL << 17)
29 #define IAVF_PROT_ICMP6_OUTER (1ULL << 18)
30 #define IAVF_PROT_VXLAN (1ULL << 19)
31 #define IAVF_PROT_NVGRE (1ULL << 20)
32 #define IAVF_PROT_GTPU (1ULL << 21)
33 #define IAVF_PROT_ESP (1ULL << 22)
34 #define IAVF_PROT_AH (1ULL << 23)
35 #define IAVF_PROT_L2TPV3OIP (1ULL << 24)
36 #define IAVF_PROT_PFCP (1ULL << 25)
37 #define IAVF_PROT_ECPRI (1ULL << 26)
42 #define IAVF_SMAC (1ULL << 63)
43 #define IAVF_DMAC (1ULL << 62)
44 #define IAVF_ETHERTYPE (1ULL << 61)
45 #define IAVF_IP_SRC (1ULL << 60)
46 #define IAVF_IP_DST (1ULL << 59)
47 #define IAVF_IP_PROTO (1ULL << 58)
48 #define IAVF_IP_TTL (1ULL << 57)
49 #define IAVF_IP_TOS (1ULL << 56)
50 #define IAVF_SPORT (1ULL << 55)
51 #define IAVF_DPORT (1ULL << 54)
52 #define IAVF_ICMP_TYPE (1ULL << 53)
53 #define IAVF_ICMP_CODE (1ULL << 52)
54 #define IAVF_VXLAN_VNI (1ULL << 51)
55 #define IAVF_NVGRE_TNI (1ULL << 50)
56 #define IAVF_GTPU_TEID (1ULL << 49)
57 #define IAVF_GTPU_QFI (1ULL << 48)
58 #define IAVF_ESP_SPI (1ULL << 47)
59 #define IAVF_AH_SPI (1ULL << 46)
60 #define IAVF_L2TPV3OIP_SESSION_ID (1ULL << 45)
61 #define IAVF_PFCP_S_FIELD (1ULL << 44)
62 #define IAVF_PFCP_SEID (1ULL << 43)
63 #define IAVF_ECPRI_PC_RTC_ID (1ULL << 42)
64 #define IAVF_IP_PKID (1ULL << 41)
68 #define IAVF_INSET_NONE 0ULL
72 #define IAVF_INSET_SMAC (IAVF_PROT_MAC_OUTER | IAVF_SMAC)
73 #define IAVF_INSET_DMAC (IAVF_PROT_MAC_OUTER | IAVF_DMAC)
74 #define IAVF_INSET_VLAN_INNER (IAVF_PROT_VLAN_INNER)
75 #define IAVF_INSET_VLAN_OUTER (IAVF_PROT_VLAN_OUTER)
76 #define IAVF_INSET_ETHERTYPE (IAVF_ETHERTYPE)
78 #define IAVF_INSET_IPV4_SRC \
79 (IAVF_PROT_IPV4_OUTER | IAVF_IP_SRC)
80 #define IAVF_INSET_IPV4_DST \
81 (IAVF_PROT_IPV4_OUTER | IAVF_IP_DST)
82 #define IAVF_INSET_IPV4_TOS \
83 (IAVF_PROT_IPV4_OUTER | IAVF_IP_TOS)
84 #define IAVF_INSET_IPV4_PROTO \
85 (IAVF_PROT_IPV4_OUTER | IAVF_IP_PROTO)
86 #define IAVF_INSET_IPV4_TTL \
87 (IAVF_PROT_IPV4_OUTER | IAVF_IP_TTL)
88 #define IAVF_INSET_IPV4_ID \
89 (IAVF_PROT_IPV4_OUTER | IAVF_IP_PKID)
90 #define IAVF_INSET_IPV6_SRC \
91 (IAVF_PROT_IPV6_OUTER | IAVF_IP_SRC)
92 #define IAVF_INSET_IPV6_DST \
93 (IAVF_PROT_IPV6_OUTER | IAVF_IP_DST)
94 #define IAVF_INSET_IPV6_NEXT_HDR \
95 (IAVF_PROT_IPV6_OUTER | IAVF_IP_PROTO)
96 #define IAVF_INSET_IPV6_HOP_LIMIT \
97 (IAVF_PROT_IPV6_OUTER | IAVF_IP_TTL)
98 #define IAVF_INSET_IPV6_TC \
99 (IAVF_PROT_IPV6_OUTER | IAVF_IP_TOS)
100 #define IAVF_INSET_IPV6_ID \
101 (IAVF_PROT_IPV6_OUTER | IAVF_IP_PKID)
103 #define IAVF_INSET_TUN_IPV4_SRC \
104 (IAVF_PROT_IPV4_INNER | IAVF_IP_SRC)
105 #define IAVF_INSET_TUN_IPV4_DST \
106 (IAVF_PROT_IPV4_INNER | IAVF_IP_DST)
107 #define IAVF_INSET_TUN_IPV4_TOS \
108 (IAVF_PROT_IPV4_INNER | IAVF_IP_TOS)
109 #define IAVF_INSET_TUN_IPV4_PROTO \
110 (IAVF_PROT_IPV4_INNER | IAVF_IP_PROTO)
111 #define IAVF_INSET_TUN_IPV4_TTL \
112 (IAVF_PROT_IPV4_INNER | IAVF_IP_TTL)
113 #define IAVF_INSET_TUN_IPV6_SRC \
114 (IAVF_PROT_IPV6_INNER | IAVF_IP_SRC)
115 #define IAVF_INSET_TUN_IPV6_DST \
116 (IAVF_PROT_IPV6_INNER | IAVF_IP_DST)
117 #define IAVF_INSET_TUN_IPV6_NEXT_HDR \
118 (IAVF_PROT_IPV6_INNER | IAVF_IP_PROTO)
119 #define IAVF_INSET_TUN_IPV6_HOP_LIMIT \
120 (IAVF_PROT_IPV6_INNER | IAVF_IP_TTL)
121 #define IAVF_INSET_TUN_IPV6_TC \
122 (IAVF_PROT_IPV6_INNER | IAVF_IP_TOS)
124 #define IAVF_INSET_TCP_SRC_PORT \
125 (IAVF_PROT_TCP_OUTER | IAVF_SPORT)
126 #define IAVF_INSET_TCP_DST_PORT \
127 (IAVF_PROT_TCP_OUTER | IAVF_DPORT)
128 #define IAVF_INSET_UDP_SRC_PORT \
129 (IAVF_PROT_UDP_OUTER | IAVF_SPORT)
130 #define IAVF_INSET_UDP_DST_PORT \
131 (IAVF_PROT_UDP_OUTER | IAVF_DPORT)
133 #define IAVF_INSET_TUN_TCP_SRC_PORT \
134 (IAVF_PROT_TCP_INNER | IAVF_SPORT)
135 #define IAVF_INSET_TUN_TCP_DST_PORT \
136 (IAVF_PROT_TCP_INNER | IAVF_DPORT)
137 #define IAVF_INSET_TUN_UDP_SRC_PORT \
138 (IAVF_PROT_UDP_INNER | IAVF_SPORT)
139 #define IAVF_INSET_TUN_UDP_DST_PORT \
140 (IAVF_PROT_UDP_INNER | IAVF_DPORT)
142 #define IAVF_INSET_SCTP_SRC_PORT \
143 (IAVF_PROT_SCTP_OUTER | IAVF_SPORT)
144 #define IAVF_INSET_SCTP_DST_PORT \
145 (IAVF_PROT_SCTP_OUTER | IAVF_DPORT)
146 #define IAVF_INSET_ICMP4_SRC_PORT \
147 (IAVF_PROT_ICMP4_OUTER | IAVF_SPORT)
148 #define IAVF_INSET_ICMP4_DST_PORT \
149 (IAVF_PROT_ICMP4_OUTER | IAVF_DPORT)
150 #define IAVF_INSET_ICMP6_SRC_PORT \
151 (IAVF_PROT_ICMP6_OUTER | IAVF_SPORT)
152 #define IAVF_INSET_ICMP6_DST_PORT \
153 (IAVF_PROT_ICMP6_OUTER | IAVF_DPORT)
154 #define IAVF_INSET_ICMP4_TYPE \
155 (IAVF_PROT_ICMP4_OUTER | IAVF_ICMP_TYPE)
156 #define IAVF_INSET_ICMP4_CODE \
157 (IAVF_PROT_ICMP4_OUTER | IAVF_ICMP_CODE)
158 #define IAVF_INSET_ICMP6_TYPE \
159 (IAVF_PROT_ICMP6_OUTER | IAVF_ICMP_TYPE)
160 #define IAVF_INSET_ICMP6_CODE \
161 (IAVF_PROT_ICMP6_OUTER | IAVF_ICMP_CODE)
162 #define IAVF_INSET_GTPU_TEID \
163 (IAVF_PROT_GTPU | IAVF_GTPU_TEID)
164 #define IAVF_INSET_GTPU_QFI \
165 (IAVF_PROT_GTPU | IAVF_GTPU_QFI)
166 #define IAVF_INSET_ESP_SPI \
167 (IAVF_PROT_ESP | IAVF_ESP_SPI)
168 #define IAVF_INSET_AH_SPI \
169 (IAVF_PROT_AH | IAVF_AH_SPI)
170 #define IAVF_INSET_L2TPV3OIP_SESSION_ID \
171 (IAVF_PROT_L2TPV3OIP | IAVF_L2TPV3OIP_SESSION_ID)
172 #define IAVF_INSET_PFCP_S_FIELD \
173 (IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD)
174 #define IAVF_INSET_PFCP_SEID \
175 (IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
176 #define IAVF_INSET_ECPRI \
177 (IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
180 extern enum rte_flow_item_type iavf_pattern_empty[];
183 extern enum rte_flow_item_type iavf_pattern_ethertype[];
184 extern enum rte_flow_item_type iavf_pattern_ethertype_vlan[];
185 extern enum rte_flow_item_type iavf_pattern_ethertype_qinq[];
188 extern enum rte_flow_item_type iavf_pattern_eth_arp[];
190 /* non-tunnel IPv4 */
191 extern enum rte_flow_item_type iavf_pattern_eth_ipv4[];
192 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4[];
193 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4[];
194 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp[];
195 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_udp[];
196 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_udp[];
197 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_tcp[];
198 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_tcp[];
199 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_tcp[];
200 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_sctp[];
201 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_sctp[];
202 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_sctp[];
203 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_icmp[];
204 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_icmp[];
205 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_icmp[];
207 /* non-tunnel IPv6 */
208 extern enum rte_flow_item_type iavf_pattern_eth_ipv6[];
209 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6[];
210 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6[];
211 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_frag_ext[];
212 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_frag_ext[];
213 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_frag_ext[];
214 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp[];
215 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_udp[];
216 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_udp[];
217 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_tcp[];
218 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_tcp[];
219 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_tcp[];
220 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_sctp[];
221 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_sctp[];
222 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_sctp[];
223 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_icmp6[];
224 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[];
225 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[];
228 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[];
231 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[];
232 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[];
235 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[];
238 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[];
239 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[];
242 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4[];
243 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4_udp[];
244 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4_tcp[];
245 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4_icmp[];
247 /* IPv4 GRE IPv4 UDP GTPU IPv4 */
248 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu[];
249 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv4[];
250 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv4_udp[];
251 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv4_tcp[];
253 /* IPv4 GRE IPv4 UDP GTPU IPv6 */
254 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv6[];
255 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv6_udp[];
256 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv6_tcp[];
258 /* IPv4 GRE IPv6 UDP GTPU IPv4 */
259 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu[];
260 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv4[];
261 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv4_udp[];
262 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv4_tcp[];
264 /* IPv4 GRE IPv6 UDP GTPU IPv6 */
265 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv6[];
266 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv6_udp[];
267 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv6_tcp[];
269 /* IPv6 GRE IPv4 UDP GTPU IPv4 */
270 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu[];
271 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv4[];
272 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv4_udp[];
273 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv4_tcp[];
275 /* IPv6 GRE IPv4 UDP GTPU IPv6 */
276 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv6[];
277 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv6_udp[];
278 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv6_tcp[];
280 /* IPv6 GRE IPv6 UDP GTPU IPv4 */
281 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu[];
282 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv4[];
283 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv4_udp[];
284 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv4_tcp[];
286 /* IPv6 GRE IPv6 UDP GTPU IPv6 */
287 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv6[];
288 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv6_udp[];
289 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv6_tcp[];
291 /* IPv4 GRE IPv4 UDP GTPU EH IPv4 */
292 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh[];
293 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv4[];
294 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv4_udp[];
295 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv4_tcp[];
297 /* IPv4 GRE IPv4 UDP GTPU EH IPv6 */
298 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv6[];
299 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv6_udp[];
300 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv6_tcp[];
302 /* IPv4 GRE IPv6 UDP GTPU EH IPv4 */
303 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh[];
304 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv4[];
305 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv4_udp[];
306 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv4_tcp[];
308 /* IPv4 GRE IPv6 UDP GTPU EH IPv6 */
309 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv6[];
310 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv6_udp[];
311 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv6_tcp[];
313 /* IPv6 GRE IPv4 UDP GTPU EH IPv4 */
314 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh[];
315 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv4[];
316 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv4_udp[];
317 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv4_tcp[];
319 /* IPv6 GRE IPv4 UDP GTPU EH IPv6 */
320 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv6[];
321 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv6_udp[];
322 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv6_tcp[];
324 /* IPv6 GRE IPv6 UDP GTPU EH IPv4 */
325 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh[];
326 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv4[];
327 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv4_udp[];
328 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv4_tcp[];
330 /* IPv6 GRE IPv6 UDP GTPU EH IPv6 */
331 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv6[];
332 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv6_udp[];
333 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv6_tcp[];
336 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6[];
337 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6_udp[];
338 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6_tcp[];
339 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6_icmp[];
342 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4[];
343 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4_udp[];
344 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4_tcp[];
345 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4_icmp[];
348 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6[];
349 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6_udp[];
350 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6_tcp[];
351 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6_icmp[];
353 /* IPv4 GTPU EH IPv4 */
354 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4[];
355 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
356 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
357 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_icmp[];
359 /* IPv4 GTPU EH IPv6 */
360 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6[];
361 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6_udp[];
362 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6_tcp[];
363 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6_icmp[];
365 /* IPv6 GTPU EH IPv4 */
366 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4[];
367 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4_udp[];
368 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4_tcp[];
369 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4_icmp[];
371 /* IPv6 GTPU EH IPv6 */
372 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6[];
373 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6_udp[];
374 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6_tcp[];
375 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6_icmp[];
378 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_esp[];
379 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_esp[];
380 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_esp[];
381 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_esp[];
384 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_ah[];
385 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_ah[];
388 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_l2tpv3[];
389 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_l2tpv3[];
392 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_pfcp[];
393 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_pfcp[];
396 extern enum rte_flow_item_type iavf_pattern_eth_ecpri[];
397 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_ecpri[];
400 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4[];
401 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6[];
402 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4[];
403 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6[];
404 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_tcp[];
405 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_tcp[];
406 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_udp[];
407 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_udp[];
408 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_tcp[];
409 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
410 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
411 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
413 extern const struct rte_flow_ops iavf_flow_ops;
415 /* pattern structure */
416 struct iavf_pattern_match_item {
417 enum rte_flow_item_type *pattern_list;
418 /* pattern_list must end with RTE_FLOW_ITEM_TYPE_END */
419 uint64_t input_set_mask;
423 typedef int (*engine_init_t)(struct iavf_adapter *ad);
424 typedef void (*engine_uninit_t)(struct iavf_adapter *ad);
425 typedef int (*engine_validation_t)(struct iavf_adapter *ad,
426 struct rte_flow *flow,
428 struct rte_flow_error *error);
429 typedef int (*engine_create_t)(struct iavf_adapter *ad,
430 struct rte_flow *flow,
432 struct rte_flow_error *error);
433 typedef int (*engine_destroy_t)(struct iavf_adapter *ad,
434 struct rte_flow *flow,
435 struct rte_flow_error *error);
436 typedef int (*engine_query_t)(struct iavf_adapter *ad,
437 struct rte_flow *flow,
438 struct rte_flow_query_count *count,
439 struct rte_flow_error *error);
440 typedef void (*engine_free_t) (struct rte_flow *flow);
441 typedef int (*parse_pattern_action_t)(struct iavf_adapter *ad,
442 struct iavf_pattern_match_item *array,
444 const struct rte_flow_item pattern[],
445 const struct rte_flow_action actions[],
447 struct rte_flow_error *error);
450 enum iavf_flow_engine_type {
451 IAVF_FLOW_ENGINE_NONE = 0,
452 IAVF_FLOW_ENGINE_FDIR,
453 IAVF_FLOW_ENGINE_HASH,
454 IAVF_FLOW_ENGINE_MAX,
458 * classification stages.
459 * for non-pipeline mode, we have two classification stages: Distributor/RSS
460 * for pipeline-mode we have three classification stages:
461 * Permission/Distributor/RSS
463 enum iavf_flow_classification_stage {
464 IAVF_FLOW_STAGE_NONE = 0,
466 IAVF_FLOW_STAGE_DISTRIBUTOR,
470 /* Struct to store engine created. */
471 struct iavf_flow_engine {
472 TAILQ_ENTRY(iavf_flow_engine) node;
474 engine_uninit_t uninit;
475 engine_validation_t validation;
476 engine_create_t create;
477 engine_destroy_t destroy;
478 engine_query_t query_count;
480 enum iavf_flow_engine_type type;
483 TAILQ_HEAD(iavf_engine_list, iavf_flow_engine);
485 /* Struct to store flow created. */
487 TAILQ_ENTRY(rte_flow) node;
488 struct iavf_flow_engine *engine;
492 struct iavf_flow_parser {
493 struct iavf_flow_engine *engine;
494 struct iavf_pattern_match_item *array;
496 parse_pattern_action_t parse_pattern_action;
497 enum iavf_flow_classification_stage stage;
500 /* Struct to store parser created. */
501 struct iavf_flow_parser_node {
502 TAILQ_ENTRY(iavf_flow_parser_node) node;
503 struct iavf_flow_parser *parser;
506 void iavf_register_flow_engine(struct iavf_flow_engine *engine);
507 int iavf_flow_init(struct iavf_adapter *ad);
508 void iavf_flow_uninit(struct iavf_adapter *ad);
509 int iavf_flow_flush(struct rte_eth_dev *dev,
510 struct rte_flow_error *error);
511 int iavf_register_parser(struct iavf_flow_parser *parser,
512 struct iavf_adapter *ad);
513 void iavf_unregister_parser(struct iavf_flow_parser *parser,
514 struct iavf_adapter *ad);
515 struct iavf_pattern_match_item *
516 iavf_search_pattern_match_item(const struct rte_flow_item pattern[],
517 struct iavf_pattern_match_item *array,
519 struct rte_flow_error *error);