3ef97e9a2bb7ab0b5dff559e36b7317ddde4caea
[dpdk.git] / drivers / net / iavf / iavf_hash.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4
5 #include <sys/queue.h>
6 #include <stdio.h>
7 #include <errno.h>
8 #include <stdint.h>
9 #include <string.h>
10 #include <unistd.h>
11 #include <stdarg.h>
12
13 #include <rte_debug.h>
14 #include <rte_ether.h>
15 #include <rte_ethdev_driver.h>
16 #include <rte_log.h>
17 #include <rte_malloc.h>
18 #include <rte_eth_ctrl.h>
19 #include <rte_tailq.h>
20 #include <rte_flow_driver.h>
21
22 #include "iavf_log.h"
23 #include "iavf.h"
24 #include "iavf_generic_flow.h"
25
26 enum iavf_pattern_hint_type {
27         IAVF_PHINT_NONE                         = 0x00000000,
28         IAVF_PHINT_IPV4                         = 0x00000001,
29         IAVF_PHINT_IPV4_UDP                     = 0x00000002,
30         IAVF_PHINT_IPV4_TCP                     = 0x00000004,
31         IAVF_PHINT_IPV4_SCTP                    = 0x00000008,
32         IAVF_PHINT_IPV6                         = 0x00000010,
33         IAVF_PHINT_IPV6_UDP                     = 0x00000020,
34         IAVF_PHINT_IPV6_TCP                     = 0x00000040,
35         IAVF_PHINT_IPV6_SCTP                    = 0x00000080,
36         IAVF_PHINT_IPV4_GTPU_EH                 = 0x00000100,
37         IAVF_PHINT_IPV4_GTPU_EH_DWNLINK         = 0x00000200,
38         IAVF_PHINT_IPV4_GTPU_EH_UPLINK          = 0x00000400,
39 };
40
41 #define IAVF_GTPU_EH_DWNLINK    0
42 #define IAVF_GTPU_EH_UPLINK     1
43
44 struct iavf_pattern_match_type {
45         uint64_t pattern_hint;
46 };
47
48 struct iavf_hash_match_type {
49         uint64_t hash_type;
50         struct virtchnl_proto_hdrs *proto_hdrs;
51         uint64_t pattern_hint;
52 };
53
54 struct iavf_rss_meta {
55         struct virtchnl_proto_hdrs *proto_hdrs;
56         enum virtchnl_rss_algorithm rss_algorithm;
57 };
58
59 struct iavf_hash_flow_cfg {
60         struct virtchnl_rss_cfg *rss_cfg;
61         bool simple_xor;
62 };
63
64 static int
65 iavf_hash_init(struct iavf_adapter *ad);
66 static int
67 iavf_hash_create(struct iavf_adapter *ad, struct rte_flow *flow, void *meta,
68                  struct rte_flow_error *error);
69 static int
70 iavf_hash_destroy(struct iavf_adapter *ad, struct rte_flow *flow,
71                   struct rte_flow_error *error);
72 static void
73 iavf_hash_uninit(struct iavf_adapter *ad);
74 static void
75 iavf_hash_free(struct rte_flow *flow);
76 static int
77 iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
78                                struct iavf_pattern_match_item *array,
79                                uint32_t array_len,
80                                const struct rte_flow_item pattern[],
81                                const struct rte_flow_action actions[],
82                                void **meta,
83                                struct rte_flow_error *error);
84
85 static struct iavf_pattern_match_type phint_empty = {
86         IAVF_PHINT_NONE};
87 static struct iavf_pattern_match_type phint_eth_ipv4 = {
88         IAVF_PHINT_IPV4};
89 static struct iavf_pattern_match_type phint_eth_ipv4_udp = {
90         IAVF_PHINT_IPV4_UDP};
91 static struct iavf_pattern_match_type phint_eth_ipv4_tcp = {
92         IAVF_PHINT_IPV4_TCP};
93 static struct iavf_pattern_match_type phint_eth_ipv4_sctp = {
94         IAVF_PHINT_IPV4_SCTP};
95 static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4 = {
96         IAVF_PHINT_IPV4};
97 static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4_udp = {
98         IAVF_PHINT_IPV4_UDP};
99 static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4_tcp = {
100         IAVF_PHINT_IPV4_TCP};
101 static struct iavf_pattern_match_type phint_eth_ipv4_esp = {
102         IAVF_PHINT_IPV4};
103 static struct iavf_pattern_match_type phint_eth_ipv4_ah = {
104         IAVF_PHINT_IPV4};
105 static struct iavf_pattern_match_type phint_eth_ipv4_l2tpv3 = {
106         IAVF_PHINT_IPV4};
107 static struct iavf_pattern_match_type phint_eth_ipv4_pfcp = {
108         IAVF_PHINT_IPV4_UDP};
109 static struct iavf_pattern_match_type phint_eth_vlan_ipv4 = {
110         IAVF_PHINT_IPV4};
111 static struct iavf_pattern_match_type phint_eth_vlan_ipv4_udp = {
112         IAVF_PHINT_IPV4_UDP};
113 static struct iavf_pattern_match_type phint_eth_vlan_ipv4_tcp = {
114         IAVF_PHINT_IPV4_TCP};
115 static struct iavf_pattern_match_type phint_eth_vlan_ipv4_sctp = {
116         IAVF_PHINT_IPV4_SCTP};
117 static struct iavf_pattern_match_type phint_eth_ipv6 = {
118         IAVF_PHINT_IPV6};
119 static struct iavf_pattern_match_type phint_eth_ipv6_udp = {
120         IAVF_PHINT_IPV6_UDP};
121 static struct iavf_pattern_match_type phint_eth_ipv6_tcp = {
122         IAVF_PHINT_IPV6_TCP};
123 static struct iavf_pattern_match_type phint_eth_ipv6_sctp = {
124         IAVF_PHINT_IPV6_SCTP};
125 static struct iavf_pattern_match_type phint_eth_ipv6_esp = {
126         IAVF_PHINT_IPV6};
127 static struct iavf_pattern_match_type phint_eth_ipv6_ah = {
128         IAVF_PHINT_IPV6};
129 static struct iavf_pattern_match_type phint_eth_ipv6_l2tpv3 = {
130         IAVF_PHINT_IPV6};
131 static struct iavf_pattern_match_type phint_eth_ipv6_pfcp = {
132         IAVF_PHINT_IPV6_UDP};
133 static struct iavf_pattern_match_type phint_eth_vlan_ipv6 = {
134         IAVF_PHINT_IPV6};
135 static struct iavf_pattern_match_type phint_eth_vlan_ipv6_udp = {
136         IAVF_PHINT_IPV6_UDP};
137 static struct iavf_pattern_match_type phint_eth_vlan_ipv6_tcp = {
138         IAVF_PHINT_IPV6_TCP};
139 static struct iavf_pattern_match_type phint_eth_vlan_ipv6_sctp = {
140         IAVF_PHINT_IPV6_SCTP};
141
142 /**
143  * Supported pattern for hash.
144  * The first member is pattern item type,
145  * the second member is input set mask,
146  * the third member is pattern hint for hash.
147  */
148 static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
149         {iavf_pattern_eth_ipv4, IAVF_INSET_NONE, &phint_eth_ipv4},
150         {iavf_pattern_eth_ipv4_udp, IAVF_INSET_NONE, &phint_eth_ipv4_udp},
151         {iavf_pattern_eth_ipv4_tcp, IAVF_INSET_NONE, &phint_eth_ipv4_tcp},
152         {iavf_pattern_eth_ipv4_sctp, IAVF_INSET_NONE, &phint_eth_ipv4_sctp},
153         {iavf_pattern_eth_ipv4_gtpu_eh_ipv4, IAVF_INSET_NONE,
154                                         &phint_eth_ipv4_gtpu_eh_ipv4},
155         {iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp, IAVF_INSET_NONE,
156                                         &phint_eth_ipv4_gtpu_eh_ipv4_udp},
157         {iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp, IAVF_INSET_NONE,
158                                         &phint_eth_ipv4_gtpu_eh_ipv4_tcp},
159         {iavf_pattern_eth_ipv4_esp, IAVF_INSET_NONE, &phint_eth_ipv4_esp},
160         {iavf_pattern_eth_ipv4_ah, IAVF_INSET_NONE, &phint_eth_ipv4_ah},
161         {iavf_pattern_eth_ipv4_l2tpv3, IAVF_INSET_NONE,
162                                         &phint_eth_ipv4_l2tpv3},
163         {iavf_pattern_eth_ipv4_pfcp, IAVF_INSET_NONE, &phint_eth_ipv4_pfcp},
164         {iavf_pattern_eth_vlan_ipv4, IAVF_INSET_NONE, &phint_eth_vlan_ipv4},
165         {iavf_pattern_eth_vlan_ipv4_udp, IAVF_INSET_NONE,
166                                         &phint_eth_vlan_ipv4_udp},
167         {iavf_pattern_eth_vlan_ipv4_tcp, IAVF_INSET_NONE,
168                                         &phint_eth_vlan_ipv4_tcp},
169         {iavf_pattern_eth_vlan_ipv4_sctp, IAVF_INSET_NONE,
170                                         &phint_eth_vlan_ipv4_sctp},
171         {iavf_pattern_eth_ipv6, IAVF_INSET_NONE, &phint_eth_ipv6},
172         {iavf_pattern_eth_ipv6_udp, IAVF_INSET_NONE, &phint_eth_ipv6_udp},
173         {iavf_pattern_eth_ipv6_tcp, IAVF_INSET_NONE, &phint_eth_ipv6_tcp},
174         {iavf_pattern_eth_ipv6_sctp, IAVF_INSET_NONE, &phint_eth_ipv6_sctp},
175         {iavf_pattern_eth_ipv6_esp, IAVF_INSET_NONE, &phint_eth_ipv6_esp},
176         {iavf_pattern_eth_ipv6_ah, IAVF_INSET_NONE, &phint_eth_ipv6_ah},
177         {iavf_pattern_eth_ipv6_l2tpv3, IAVF_INSET_NONE,
178                                         &phint_eth_ipv6_l2tpv3},
179         {iavf_pattern_eth_ipv6_pfcp, IAVF_INSET_NONE, &phint_eth_ipv6_pfcp},
180         {iavf_pattern_eth_vlan_ipv6, IAVF_INSET_NONE, &phint_eth_vlan_ipv6},
181         {iavf_pattern_eth_vlan_ipv6_udp, IAVF_INSET_NONE,
182                                         &phint_eth_vlan_ipv6_udp},
183         {iavf_pattern_eth_vlan_ipv6_tcp, IAVF_INSET_NONE,
184                                         &phint_eth_vlan_ipv6_tcp},
185         {iavf_pattern_eth_vlan_ipv6_sctp, IAVF_INSET_NONE,
186                                         &phint_eth_vlan_ipv6_sctp},
187         {iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty},
188 };
189
190 #define TUNNEL_LEVEL_OUTER              0
191 #define TUNNEL_LEVEL_FIRST_INNER        1
192
193 #define PROTO_COUNT_ONE                 1
194 #define PROTO_COUNT_TWO                 2
195 #define PROTO_COUNT_THREE               3
196
197 #define BUFF_NOUSED                     0
198 #define FIELD_FOR_PROTO_ONLY            0
199
200 #define FIELD_SELECTOR(proto_hdr_field) \
201                 (1UL << ((proto_hdr_field) & PROTO_HDR_FIELD_MASK))
202
203 #define proto_hint_eth_src { \
204         VIRTCHNL_PROTO_HDR_ETH, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_SRC), \
205         {BUFF_NOUSED } }
206
207 #define proto_hint_eth_dst { \
208         VIRTCHNL_PROTO_HDR_ETH, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_DST), \
209         {BUFF_NOUSED } }
210
211 #define proto_hint_eth_only { \
212         VIRTCHNL_PROTO_HDR_ETH, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
213
214 #define proto_hint_eth { \
215         VIRTCHNL_PROTO_HDR_ETH, \
216         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_SRC) | \
217         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_DST), {BUFF_NOUSED } }
218
219 #define proto_hint_svlan { \
220         VIRTCHNL_PROTO_HDR_S_VLAN, \
221         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_S_VLAN_ID), {BUFF_NOUSED } }
222
223 #define proto_hint_cvlan { \
224         VIRTCHNL_PROTO_HDR_C_VLAN, \
225         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_C_VLAN_ID), {BUFF_NOUSED } }
226
227 #define proto_hint_ipv4_src { \
228         VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC), \
229         {BUFF_NOUSED } }
230
231 #define proto_hint_ipv4_dst { \
232         VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), \
233         {BUFF_NOUSED } }
234
235 #define proto_hint_ipv4_only { \
236         VIRTCHNL_PROTO_HDR_IPV4, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
237
238 #define proto_hint_ipv4 { \
239         VIRTCHNL_PROTO_HDR_IPV4, \
240         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
241         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), {BUFF_NOUSED } }
242
243 #define proto_hint_udp_src_port { \
244         VIRTCHNL_PROTO_HDR_UDP, \
245         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT), {BUFF_NOUSED } }
246
247 #define proto_hint_udp_dst_port { \
248         VIRTCHNL_PROTO_HDR_UDP, \
249         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT), {BUFF_NOUSED } }
250
251 #define proto_hint_udp_only { \
252         VIRTCHNL_PROTO_HDR_UDP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
253
254 #define proto_hint_udp { \
255         VIRTCHNL_PROTO_HDR_UDP, \
256         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | \
257         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT), {BUFF_NOUSED } }
258
259 #define proto_hint_tcp_src_port { \
260         VIRTCHNL_PROTO_HDR_TCP, \
261         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT), {BUFF_NOUSED } }
262
263 #define proto_hint_tcp_dst_port { \
264         VIRTCHNL_PROTO_HDR_TCP, \
265         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT), {BUFF_NOUSED } }
266
267 #define proto_hint_tcp_only { \
268         VIRTCHNL_PROTO_HDR_TCP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
269
270 #define proto_hint_tcp { \
271         VIRTCHNL_PROTO_HDR_TCP, \
272         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT) | \
273         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT), {BUFF_NOUSED } }
274
275 #define proto_hint_sctp_src_port { \
276         VIRTCHNL_PROTO_HDR_SCTP, \
277         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT), {BUFF_NOUSED } }
278
279 #define proto_hint_sctp_dst_port { \
280         VIRTCHNL_PROTO_HDR_SCTP, \
281         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT), {BUFF_NOUSED } }
282
283 #define proto_hint_sctp_only { \
284         VIRTCHNL_PROTO_HDR_SCTP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
285
286 #define proto_hint_sctp { \
287         VIRTCHNL_PROTO_HDR_SCTP, \
288         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT) | \
289         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT), {BUFF_NOUSED } }
290
291 #define proto_hint_ipv6_src { \
292         VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC), \
293         {BUFF_NOUSED } }
294
295 #define proto_hint_ipv6_dst { \
296         VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), \
297         {BUFF_NOUSED } }
298
299 #define proto_hint_ipv6_only { \
300         VIRTCHNL_PROTO_HDR_IPV6, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
301
302 #define proto_hint_ipv6 { \
303         VIRTCHNL_PROTO_HDR_IPV6, \
304         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
305         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), {BUFF_NOUSED } }
306
307 #define proto_hint_gtpu_eh_only { \
308         VIRTCHNL_PROTO_HDR_GTPU_EH, \
309         FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
310
311 #define proto_hint_gtpu_up_only { \
312         VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP, \
313         FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
314
315 #define proto_hint_gtpu_dwn_only { \
316         VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN, \
317         FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
318
319 #define proto_hint_esp { \
320         VIRTCHNL_PROTO_HDR_ESP, \
321         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ESP_SPI), {BUFF_NOUSED } }
322
323 #define proto_hint_ah { \
324         VIRTCHNL_PROTO_HDR_AH, \
325         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_AH_SPI), {BUFF_NOUSED } }
326
327 #define proto_hint_l2tpv3 { \
328         VIRTCHNL_PROTO_HDR_L2TPV3, \
329         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV3_SESS_ID), {BUFF_NOUSED } }
330
331 #define proto_hint_pfcp { \
332         VIRTCHNL_PROTO_HDR_PFCP, \
333         FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), {BUFF_NOUSED } }
334
335 /* IPV4 */
336
337 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv4 = {
338         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_eth_src,
339         proto_hint_ipv4_only }
340 };
341
342 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv4_udp = {
343         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_src,
344         proto_hint_ipv4_only, proto_hint_udp_only }
345 };
346
347 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv4_tcp = {
348         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_src,
349         proto_hint_ipv4_only, proto_hint_tcp_only }
350 };
351
352 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv4_sctp = {
353         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_src,
354         proto_hint_ipv4_only, proto_hint_sctp_only }
355 };
356
357 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv4 = {
358         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_eth_dst,
359         proto_hint_ipv4_only }
360 };
361
362 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv4_udp = {
363         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_dst,
364         proto_hint_ipv4_only, proto_hint_udp_only }
365 };
366
367 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv4_tcp = {
368         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_dst,
369         proto_hint_ipv4_only, proto_hint_tcp_only }
370 };
371
372 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv4_sctp = {
373         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_dst,
374         proto_hint_ipv4_only, proto_hint_sctp_only }
375 };
376
377 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv4 = {
378         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_eth,
379         proto_hint_ipv4_only }
380 };
381
382 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv4_udp = {
383         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth,
384         proto_hint_ipv4_only, proto_hint_udp_only }
385 };
386
387 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv4_tcp = {
388         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth,
389         proto_hint_ipv4_only, proto_hint_tcp_only }
390 };
391
392 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv4_sctp = {
393         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth,
394         proto_hint_ipv4_only, proto_hint_sctp_only }
395 };
396
397 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv4 = {
398         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_svlan,
399         proto_hint_ipv4_only}
400 };
401
402 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv4_udp = {
403         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_svlan,
404         proto_hint_ipv4_only, proto_hint_udp_only}
405 };
406
407 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv4_tcp = {
408         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_svlan,
409         proto_hint_ipv4_only, proto_hint_tcp_only}
410 };
411
412 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv4_sctp = {
413         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_svlan,
414         proto_hint_ipv4_only, proto_hint_sctp_only}
415 };
416
417 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4 = {
418         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_cvlan,
419         proto_hint_ipv4_only}
420 };
421
422 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_udp = {
423         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_cvlan,
424         proto_hint_ipv4_only, proto_hint_udp_only}
425 };
426
427 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_tcp = {
428         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_cvlan,
429         proto_hint_ipv4_only, proto_hint_tcp_only}
430 };
431
432 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_sctp = {
433         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_cvlan,
434         proto_hint_ipv4_only, proto_hint_sctp_only}
435 };
436
437 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src = {
438         TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4_src }
439 };
440
441 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst = {
442         TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4_dst }
443 };
444
445 struct virtchnl_proto_hdrs hdrs_hint_ipv4 = {
446         TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv4 }
447 };
448
449 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_src_port = {
450         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,
451         proto_hint_udp_src_port }
452 };
453
454 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_dst_port = {
455         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,
456         proto_hint_udp_dst_port }
457 };
458
459 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_src_port = {
460         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,
461         proto_hint_udp_src_port }
462 };
463
464 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_dst_port = {
465         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,
466         proto_hint_udp_dst_port }
467 };
468
469 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_port = {
470         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
471         proto_hint_udp_src_port }
472 };
473
474 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_dst_port = {
475         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
476         proto_hint_udp_dst_port }
477 };
478
479 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp = {
480         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4,
481         proto_hint_udp }
482 };
483
484 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_src_port = {
485         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,
486         proto_hint_tcp_src_port }
487 };
488
489 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_dst_port = {
490         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,
491         proto_hint_tcp_dst_port }
492 };
493
494 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_src_port = {
495         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,
496         proto_hint_tcp_src_port }
497 };
498
499 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_dst_port = {
500         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,
501         proto_hint_tcp_dst_port }
502 };
503
504 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_src_port = {
505         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
506         proto_hint_tcp_src_port }
507 };
508
509 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_dst_port = {
510         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
511         proto_hint_tcp_dst_port }
512 };
513
514 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp = {
515         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4,
516         proto_hint_tcp }
517 };
518
519 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_sctp_src_port = {
520         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,
521         proto_hint_sctp_src_port }
522 };
523
524 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_sctp_dst_port = {
525         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_src,
526         proto_hint_sctp_dst_port }
527 };
528
529 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_sctp_src_port = {
530         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,
531         proto_hint_sctp_src_port }
532 };
533
534 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_sctp_dst_port = {
535         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_dst,
536         proto_hint_sctp_dst_port }
537 };
538
539 struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp_src_port = {
540         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
541         proto_hint_sctp_src_port }
542 };
543
544 struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp_dst_port = {
545         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
546         proto_hint_sctp_dst_port }
547 };
548
549 struct virtchnl_proto_hdrs hdrs_hint_ipv4_sctp = {
550         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4,
551         proto_hint_sctp }
552 };
553
554 struct virtchnl_proto_hdrs hdrs_hint_ipv4_esp = {
555         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
556         proto_hint_esp }
557 };
558
559 struct virtchnl_proto_hdrs hdrs_hint_ipv4_ah = {
560         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
561         proto_hint_ah }
562 };
563
564 struct virtchnl_proto_hdrs hdrs_hint_ipv4_l2tpv3 = {
565         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
566         proto_hint_l2tpv3 }
567 };
568
569 struct virtchnl_proto_hdrs hdrs_hint_ipv4_pfcp = {
570         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv4_only,
571         proto_hint_pfcp }
572 };
573
574 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_esp = {
575         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_only,
576         proto_hint_udp_only, proto_hint_esp }
577 };
578
579 /* GTPU EH */
580
581 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_gtpu_eh = {
582         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
583         proto_hint_udp_src_port}
584 };
585
586 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_dst_gtpu_eh = {
587         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
588         proto_hint_udp_dst_port}
589 };
590
591 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_src_gtpu_eh = {
592         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
593         proto_hint_tcp_src_port}
594 };
595
596 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_dst_gtpu_eh = {
597         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
598         proto_hint_tcp_dst_port}
599 };
600
601 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_eh = {
602         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
603         proto_hint_ipv4_src }
604 };
605
606 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_src_gtpu_eh = {
607         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
608         proto_hint_udp_src_port}
609 };
610
611 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_dst_gtpu_eh = {
612         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
613         proto_hint_udp_dst_port}
614 };
615
616 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_src_gtpu_eh = {
617         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
618         proto_hint_tcp_src_port}
619 };
620
621 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_dst_gtpu_eh = {
622         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
623         proto_hint_tcp_dst_port}
624 };
625
626 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_eh = {
627         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
628         proto_hint_ipv4_dst }
629 };
630
631 struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpu_eh = {
632         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
633         proto_hint_ipv4 }
634 };
635
636 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_src_gtpu_eh = {
637         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
638         proto_hint_udp_src_port}
639 };
640
641 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_dst_gtpu_eh = {
642         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
643         proto_hint_udp_dst_port}
644 };
645
646 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_src_gtpu_eh = {
647         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
648         proto_hint_tcp_src_port}
649 };
650
651 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_dst_gtpu_eh = {
652         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
653         proto_hint_tcp_dst_port}
654 };
655
656 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_gtpu_eh = {
657         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
658         proto_hint_udp}
659 };
660
661 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_gtpu_eh = {
662         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_eh_only,
663         proto_hint_tcp}
664 };
665
666 /* GTPU UP */
667
668 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_gtpu_up = {
669         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
670         proto_hint_udp_src_port}
671 };
672
673 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_dst_gtpu_up = {
674         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
675         proto_hint_udp_dst_port}
676 };
677
678 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_src_gtpu_up = {
679         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
680         proto_hint_tcp_src_port}
681 };
682
683 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_dst_gtpu_up = {
684         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
685         proto_hint_tcp_dst_port}
686 };
687
688 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_up = {
689         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
690         proto_hint_ipv4_src }
691 };
692
693 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_src_gtpu_up = {
694         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
695         proto_hint_udp_src_port}
696 };
697
698 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_dst_gtpu_up = {
699         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
700         proto_hint_udp_dst_port}
701 };
702
703 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_src_gtpu_up = {
704         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
705         proto_hint_tcp_src_port}
706 };
707
708 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_dst_gtpu_up = {
709         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
710         proto_hint_tcp_dst_port}
711 };
712
713 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_up = {
714         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
715         proto_hint_ipv4_dst }
716 };
717
718 struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpu_up = {
719         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
720         proto_hint_ipv4 }
721 };
722
723 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_src_gtpu_up = {
724         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
725         proto_hint_udp_src_port}
726 };
727
728 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_dst_gtpu_up = {
729         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
730         proto_hint_udp_dst_port}
731 };
732
733 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_src_gtpu_up = {
734         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
735         proto_hint_tcp_src_port}
736 };
737
738 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_dst_gtpu_up = {
739         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
740         proto_hint_tcp_dst_port}
741 };
742
743 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_gtpu_up = {
744         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
745         proto_hint_udp}
746 };
747
748 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_gtpu_up = {
749         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
750         proto_hint_tcp}
751 };
752
753 /* GTPU DWN */
754
755 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_gtpu_dwn = {
756         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
757         proto_hint_udp_src_port}
758 };
759
760 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_dst_gtpu_dwn = {
761         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
762         proto_hint_udp_dst_port}
763 };
764
765 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_src_gtpu_dwn = {
766         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
767         proto_hint_tcp_src_port}
768 };
769
770 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_dst_gtpu_dwn = {
771         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
772         proto_hint_tcp_dst_port}
773 };
774
775 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_dwn = {
776         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
777         proto_hint_ipv4_src }
778 };
779
780 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_src_gtpu_dwn = {
781         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
782         proto_hint_udp_src_port}
783 };
784
785 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_udp_dst_gtpu_dwn = {
786         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
787         proto_hint_udp_dst_port}
788 };
789
790 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_src_gtpu_dwn = {
791         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
792         proto_hint_tcp_src_port}
793 };
794
795 struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_tcp_dst_gtpu_dwn = {
796         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
797         proto_hint_tcp_dst_port}
798 };
799
800 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_dwn = {
801         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
802         proto_hint_ipv4_dst }
803 };
804
805 struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpu_dwn = {
806         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
807         proto_hint_ipv4 }
808 };
809
810 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_src_gtpu_dwn = {
811         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
812         proto_hint_udp_src_port}
813 };
814
815 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_udp_dst_gtpu_dwn = {
816         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
817         proto_hint_udp_dst_port}
818 };
819
820 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_src_gtpu_dwn = {
821         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
822         proto_hint_tcp_src_port}
823 };
824
825 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_tcp_dst_gtpu_dwn = {
826         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
827         proto_hint_tcp_dst_port}
828 };
829
830 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_gtpu_dwn = {
831         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
832         proto_hint_udp}
833 };
834
835 struct virtchnl_proto_hdrs hdrs_hint_ipv4_tcp_gtpu_dwn = {
836         TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
837         proto_hint_tcp}
838 };
839
840 /* IPV6 */
841
842 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv6 = {
843         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_eth_src,
844         proto_hint_ipv6_only }
845 };
846
847 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv6_udp = {
848         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_src,
849         proto_hint_ipv6_only, proto_hint_udp_only }
850 };
851
852 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv6_tcp = {
853         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_src,
854         proto_hint_ipv6_only, proto_hint_tcp_only }
855 };
856
857 struct virtchnl_proto_hdrs hdrs_hint_eth_src_ipv6_sctp = {
858         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_src,
859         proto_hint_ipv6_only, proto_hint_sctp_only }
860 };
861
862 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv6 = {
863         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_eth_dst,
864         proto_hint_ipv6_only }
865 };
866
867 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv6_udp = {
868         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_dst,
869         proto_hint_ipv6_only, proto_hint_udp_only }
870 };
871
872 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv6_tcp = {
873         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_dst,
874         proto_hint_ipv6_only, proto_hint_tcp_only }
875 };
876
877 struct virtchnl_proto_hdrs hdrs_hint_eth_dst_ipv6_sctp = {
878         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth_dst,
879         proto_hint_ipv6_only, proto_hint_sctp_only }
880 };
881
882 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv6 = {
883         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_eth,
884         proto_hint_ipv6_only }
885 };
886
887 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv6_udp = {
888         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth,
889         proto_hint_ipv6_only, proto_hint_udp_only }
890 };
891
892 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv6_tcp = {
893         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth,
894         proto_hint_ipv6_only, proto_hint_tcp_only }
895 };
896
897 struct virtchnl_proto_hdrs hdrs_hint_eth_ipv6_sctp = {
898         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_eth,
899         proto_hint_ipv6_only, proto_hint_sctp_only }
900 };
901
902 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv6 = {
903         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_svlan,
904         proto_hint_ipv6_only}
905 };
906
907 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv6_udp = {
908         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_svlan,
909         proto_hint_ipv6_only, proto_hint_udp_only}
910 };
911
912 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv6_tcp = {
913         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_svlan,
914         proto_hint_ipv6_only, proto_hint_tcp_only}
915 };
916
917 struct virtchnl_proto_hdrs hdrs_hint_svlan_ipv6_sctp = {
918         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_svlan,
919         proto_hint_ipv6_only, proto_hint_sctp_only}
920 };
921
922 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6 = {
923         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_cvlan,
924         proto_hint_ipv6_only}
925 };
926
927 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_udp = {
928         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_cvlan,
929         proto_hint_ipv6_only, proto_hint_udp_only}
930 };
931
932 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_tcp = {
933         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_cvlan,
934         proto_hint_ipv6_only, proto_hint_tcp_only}
935 };
936
937 struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_sctp = {
938         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_cvlan,
939         proto_hint_ipv6_only, proto_hint_sctp_only}
940 };
941
942 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src = {
943         TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_src }
944 };
945
946 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst = {
947         TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_dst }
948 };
949
950 struct virtchnl_proto_hdrs hdrs_hint_ipv6 = {
951         TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6 }
952 };
953
954 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_udp_src_port = {
955         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,
956         proto_hint_udp_src_port }
957 };
958
959 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_udp_dst_port = {
960         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,
961         proto_hint_udp_dst_port }
962 };
963
964 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_udp_src_port = {
965         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,
966         proto_hint_udp_src_port }
967 };
968
969 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_udp_dst_port = {
970         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,
971         proto_hint_udp_dst_port }
972 };
973
974 struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp_src_port = {
975         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
976         proto_hint_udp_src_port }
977 };
978
979 struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp_dst_port = {
980         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
981         proto_hint_udp_dst_port }
982 };
983
984 struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp = {
985         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6,
986         proto_hint_udp }
987 };
988
989 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_tcp_src_port = {
990         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,
991         proto_hint_tcp_src_port }
992 };
993
994 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_tcp_dst_port = {
995         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,
996         proto_hint_tcp_dst_port }
997 };
998
999 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_tcp_src_port = {
1000         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,
1001         proto_hint_tcp_src_port }
1002 };
1003
1004 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_tcp_dst_port = {
1005         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,
1006         proto_hint_tcp_dst_port }
1007 };
1008
1009 struct virtchnl_proto_hdrs hdrs_hint_ipv6_tcp_src_port = {
1010         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1011         proto_hint_tcp_src_port }
1012 };
1013
1014 struct virtchnl_proto_hdrs hdrs_hint_ipv6_tcp_dst_port = {
1015         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1016         proto_hint_tcp_dst_port }
1017 };
1018
1019 struct virtchnl_proto_hdrs hdrs_hint_ipv6_tcp = {
1020         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6,
1021         proto_hint_tcp }
1022 };
1023
1024 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_sctp_src_port = {
1025         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,
1026         proto_hint_sctp_src_port }
1027 };
1028
1029 struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_sctp_dst_port = {
1030         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_src,
1031         proto_hint_sctp_dst_port }
1032 };
1033
1034 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_sctp_src_port = {
1035         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,
1036         proto_hint_sctp_src_port }
1037 };
1038
1039 struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_sctp_dst_port = {
1040         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_dst,
1041         proto_hint_sctp_dst_port }
1042 };
1043
1044 struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp_src_port = {
1045         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1046         proto_hint_sctp_src_port }
1047 };
1048
1049 struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp_dst_port = {
1050         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1051         proto_hint_sctp_dst_port }
1052 };
1053
1054 struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp = {
1055         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6,
1056         proto_hint_sctp }
1057 };
1058
1059 struct virtchnl_proto_hdrs hdrs_hint_ipv6_esp = {
1060         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1061         proto_hint_esp }
1062 };
1063
1064 struct virtchnl_proto_hdrs hdrs_hint_ipv6_ah = {
1065         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1066         proto_hint_ah }
1067 };
1068
1069 struct virtchnl_proto_hdrs hdrs_hint_ipv6_l2tpv3 = {
1070         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1071         proto_hint_l2tpv3 }
1072 };
1073
1074 struct virtchnl_proto_hdrs hdrs_hint_ipv6_pfcp = {
1075         TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_only,
1076         proto_hint_pfcp }
1077 };
1078
1079 struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp_esp = {
1080         TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_only,
1081         proto_hint_udp_only, proto_hint_esp }
1082 };
1083
1084 struct iavf_hash_match_type iavf_hash_map_list[] = {
1085         /* IPV4 */
1086         {ETH_RSS_L2_SRC_ONLY,
1087                 &hdrs_hint_eth_src_ipv4, IAVF_PHINT_IPV4},
1088         {ETH_RSS_L2_DST_ONLY,
1089                 &hdrs_hint_eth_dst_ipv4, IAVF_PHINT_IPV4},
1090         {ETH_RSS_ETH,
1091                 &hdrs_hint_eth_ipv4, IAVF_PHINT_IPV4},
1092         {ETH_RSS_L3_SRC_ONLY,
1093                 &hdrs_hint_ipv4_src, IAVF_PHINT_IPV4},
1094         {ETH_RSS_L3_DST_ONLY,
1095                 &hdrs_hint_ipv4_dst, IAVF_PHINT_IPV4},
1096         {ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
1097                 &hdrs_hint_ipv4_src, IAVF_PHINT_IPV4},
1098         {ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY,
1099                 &hdrs_hint_ipv4_dst, IAVF_PHINT_IPV4},
1100         {ETH_RSS_IPV4,
1101                 &hdrs_hint_ipv4, IAVF_PHINT_IPV4},
1102         {ETH_RSS_ESP,
1103                 &hdrs_hint_ipv4_esp, IAVF_PHINT_IPV4},
1104         {ETH_RSS_AH,
1105                 &hdrs_hint_ipv4_ah, IAVF_PHINT_IPV4},
1106         {ETH_RSS_L2TPV3,
1107                 &hdrs_hint_ipv4_l2tpv3, IAVF_PHINT_IPV4},
1108         {ETH_RSS_S_VLAN,
1109                 &hdrs_hint_svlan_ipv4, IAVF_PHINT_IPV4},
1110         {ETH_RSS_S_VLAN,
1111                 &hdrs_hint_svlan_ipv4_udp, IAVF_PHINT_IPV4_UDP},
1112         {ETH_RSS_S_VLAN,
1113                 &hdrs_hint_svlan_ipv4_tcp, IAVF_PHINT_IPV4_TCP},
1114         {ETH_RSS_S_VLAN,
1115                 &hdrs_hint_svlan_ipv4_sctp, IAVF_PHINT_IPV4_SCTP},
1116         {ETH_RSS_C_VLAN,
1117                 &hdrs_hint_cvlan_ipv4, IAVF_PHINT_IPV4},
1118         {ETH_RSS_C_VLAN,
1119                 &hdrs_hint_cvlan_ipv4_udp, IAVF_PHINT_IPV4_UDP},
1120         {ETH_RSS_C_VLAN,
1121                 &hdrs_hint_cvlan_ipv4_tcp, IAVF_PHINT_IPV4_TCP},
1122         {ETH_RSS_C_VLAN,
1123                 &hdrs_hint_cvlan_ipv4_sctp, IAVF_PHINT_IPV4_SCTP},
1124         /* IPV4 UDP */
1125         {ETH_RSS_L2_SRC_ONLY,
1126                 &hdrs_hint_eth_src_ipv4_udp, IAVF_PHINT_IPV4_UDP},
1127         {ETH_RSS_L2_DST_ONLY,
1128                 &hdrs_hint_eth_dst_ipv4_udp, IAVF_PHINT_IPV4_UDP},
1129         {ETH_RSS_ETH,
1130                 &hdrs_hint_eth_ipv4_udp, IAVF_PHINT_IPV4_UDP},
1131         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1132                 &hdrs_hint_ipv4_src_udp_src_port, IAVF_PHINT_IPV4_UDP},
1133         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1134                 &hdrs_hint_ipv4_src_udp_dst_port, IAVF_PHINT_IPV4_UDP},
1135         {ETH_RSS_L3_SRC_ONLY,
1136                 &hdrs_hint_ipv4_src, IAVF_PHINT_IPV4_UDP},
1137         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1138                 &hdrs_hint_ipv4_dst_udp_src_port, IAVF_PHINT_IPV4_UDP},
1139         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1140                 &hdrs_hint_ipv4_dst_udp_dst_port, IAVF_PHINT_IPV4_UDP},
1141         {ETH_RSS_L3_DST_ONLY,
1142                 &hdrs_hint_ipv4_dst, IAVF_PHINT_IPV4_UDP},
1143         {ETH_RSS_NONFRAG_IPV4_UDP |
1144                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1145                 &hdrs_hint_ipv4_src_udp_src_port, IAVF_PHINT_IPV4_UDP},
1146         {ETH_RSS_NONFRAG_IPV4_UDP |
1147                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1148                 &hdrs_hint_ipv4_src_udp_dst_port, IAVF_PHINT_IPV4_UDP},
1149         {ETH_RSS_NONFRAG_IPV4_UDP |
1150                 ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
1151                 IAVF_PHINT_IPV4_UDP},
1152         {ETH_RSS_NONFRAG_IPV4_UDP |
1153                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1154                 &hdrs_hint_ipv4_dst_udp_src_port, IAVF_PHINT_IPV4_UDP},
1155         {ETH_RSS_NONFRAG_IPV4_UDP |
1156                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1157                 &hdrs_hint_ipv4_dst_udp_dst_port, IAVF_PHINT_IPV4_UDP},
1158         {ETH_RSS_NONFRAG_IPV4_UDP |
1159                 ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
1160                 IAVF_PHINT_IPV4_UDP},
1161         {ETH_RSS_L4_SRC_ONLY,
1162                 &hdrs_hint_ipv4_udp_src_port, IAVF_PHINT_IPV4_UDP},
1163         {ETH_RSS_L4_DST_ONLY,
1164                 &hdrs_hint_ipv4_udp_dst_port, IAVF_PHINT_IPV4_UDP},
1165         {ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_SRC_ONLY,
1166                 &hdrs_hint_ipv4_udp_src_port, IAVF_PHINT_IPV4_UDP},
1167         {ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_DST_ONLY,
1168                 &hdrs_hint_ipv4_udp_dst_port, IAVF_PHINT_IPV4_UDP},
1169         {ETH_RSS_PFCP,
1170                 &hdrs_hint_ipv4_pfcp, IAVF_PHINT_IPV4_UDP},
1171         {ETH_RSS_ESP,
1172                 &hdrs_hint_ipv4_udp_esp, IAVF_PHINT_IPV4_UDP},
1173         {ETH_RSS_NONFRAG_IPV4_UDP,
1174                 &hdrs_hint_ipv4_udp, IAVF_PHINT_IPV4_UDP},
1175         /* IPV4 TCP */
1176         {ETH_RSS_L2_SRC_ONLY,
1177                 &hdrs_hint_eth_src_ipv4_tcp, IAVF_PHINT_IPV4_TCP},
1178         {ETH_RSS_L2_DST_ONLY,
1179                 &hdrs_hint_eth_dst_ipv4_tcp, IAVF_PHINT_IPV4_TCP},
1180         {ETH_RSS_ETH,
1181                 &hdrs_hint_eth_ipv4_tcp, IAVF_PHINT_IPV4_TCP},
1182         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1183                 &hdrs_hint_ipv4_src_tcp_src_port, IAVF_PHINT_IPV4_TCP},
1184         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1185                 &hdrs_hint_ipv4_src_tcp_dst_port, IAVF_PHINT_IPV4_TCP},
1186         {ETH_RSS_L3_SRC_ONLY,
1187                 &hdrs_hint_ipv4_src, IAVF_PHINT_IPV4_TCP},
1188         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1189                 &hdrs_hint_ipv4_dst_tcp_src_port, IAVF_PHINT_IPV4_TCP},
1190         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1191                 &hdrs_hint_ipv4_dst_tcp_dst_port, IAVF_PHINT_IPV4_TCP},
1192         {ETH_RSS_L3_DST_ONLY,
1193                 &hdrs_hint_ipv4_dst, IAVF_PHINT_IPV4_TCP},
1194         {ETH_RSS_NONFRAG_IPV4_TCP |
1195                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1196                 &hdrs_hint_ipv4_src_tcp_src_port, IAVF_PHINT_IPV4_TCP},
1197         {ETH_RSS_NONFRAG_IPV4_TCP |
1198                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1199                 &hdrs_hint_ipv4_src_tcp_dst_port, IAVF_PHINT_IPV4_TCP},
1200         {ETH_RSS_NONFRAG_IPV4_TCP |
1201                 ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
1202                 IAVF_PHINT_IPV4_TCP},
1203         {ETH_RSS_NONFRAG_IPV4_TCP |
1204                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1205                 &hdrs_hint_ipv4_dst_tcp_src_port, IAVF_PHINT_IPV4_TCP},
1206         {ETH_RSS_NONFRAG_IPV4_TCP |
1207                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1208                 &hdrs_hint_ipv4_dst_tcp_dst_port, IAVF_PHINT_IPV4_TCP},
1209         {ETH_RSS_NONFRAG_IPV4_TCP |
1210                 ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
1211                 IAVF_PHINT_IPV4_TCP},
1212         {ETH_RSS_L4_SRC_ONLY,
1213                 &hdrs_hint_ipv4_tcp_src_port, IAVF_PHINT_IPV4_TCP},
1214         {ETH_RSS_L4_DST_ONLY,
1215                 &hdrs_hint_ipv4_tcp_dst_port, IAVF_PHINT_IPV4_TCP},
1216         {ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L4_SRC_ONLY,
1217                 &hdrs_hint_ipv4_tcp_src_port, IAVF_PHINT_IPV4_TCP},
1218         {ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L4_DST_ONLY,
1219                 &hdrs_hint_ipv4_tcp_dst_port, IAVF_PHINT_IPV4_TCP},
1220         {ETH_RSS_NONFRAG_IPV4_TCP,
1221                 &hdrs_hint_ipv4_tcp, IAVF_PHINT_IPV4_TCP},
1222         /* IPV4 SCTP */
1223         {ETH_RSS_L2_SRC_ONLY,
1224                 &hdrs_hint_eth_src_ipv4_sctp, IAVF_PHINT_IPV4_SCTP},
1225         {ETH_RSS_L2_DST_ONLY,
1226                 &hdrs_hint_eth_dst_ipv4_sctp, IAVF_PHINT_IPV4_SCTP},
1227         {ETH_RSS_ETH,
1228                 &hdrs_hint_eth_ipv4_sctp, IAVF_PHINT_IPV4_SCTP},
1229         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1230                 &hdrs_hint_ipv4_src_sctp_src_port, IAVF_PHINT_IPV4_SCTP},
1231         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1232                 &hdrs_hint_ipv4_src_sctp_dst_port, IAVF_PHINT_IPV4_SCTP},
1233         {ETH_RSS_L3_SRC_ONLY,
1234                 &hdrs_hint_ipv4_src, IAVF_PHINT_IPV4_SCTP},
1235         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1236                 &hdrs_hint_ipv4_dst_sctp_src_port, IAVF_PHINT_IPV4_SCTP},
1237         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1238                 &hdrs_hint_ipv4_dst_sctp_dst_port, IAVF_PHINT_IPV4_SCTP},
1239         {ETH_RSS_L3_DST_ONLY,
1240                 &hdrs_hint_ipv4_dst, IAVF_PHINT_IPV4_SCTP},
1241         {ETH_RSS_NONFRAG_IPV4_SCTP |
1242                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1243                 &hdrs_hint_ipv4_src_sctp_src_port, IAVF_PHINT_IPV4_SCTP},
1244         {ETH_RSS_NONFRAG_IPV4_SCTP |
1245                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1246                 &hdrs_hint_ipv4_src_sctp_dst_port, IAVF_PHINT_IPV4_SCTP},
1247         {ETH_RSS_NONFRAG_IPV4_SCTP |
1248                 ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
1249                 IAVF_PHINT_IPV4_SCTP},
1250         {ETH_RSS_NONFRAG_IPV4_SCTP |
1251                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1252                 &hdrs_hint_ipv4_dst_sctp_src_port, IAVF_PHINT_IPV4_SCTP},
1253         {ETH_RSS_NONFRAG_IPV4_SCTP |
1254                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1255                 &hdrs_hint_ipv4_dst_sctp_dst_port, IAVF_PHINT_IPV4_SCTP},
1256         {ETH_RSS_NONFRAG_IPV4_SCTP |
1257                 ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
1258                 IAVF_PHINT_IPV4_SCTP},
1259         {ETH_RSS_L4_SRC_ONLY,
1260                 &hdrs_hint_ipv4_sctp_src_port, IAVF_PHINT_IPV4_SCTP},
1261         {ETH_RSS_L4_DST_ONLY,
1262                 &hdrs_hint_ipv4_sctp_dst_port, IAVF_PHINT_IPV4_SCTP},
1263         {ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L4_SRC_ONLY,
1264                 &hdrs_hint_ipv4_sctp_src_port, IAVF_PHINT_IPV4_SCTP},
1265         {ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L4_DST_ONLY,
1266                 &hdrs_hint_ipv4_sctp_dst_port, IAVF_PHINT_IPV4_SCTP},
1267         {ETH_RSS_NONFRAG_IPV4_SCTP,
1268                 &hdrs_hint_ipv4_sctp, IAVF_PHINT_IPV4_SCTP},
1269         /* IPV6 */
1270         {ETH_RSS_L2_SRC_ONLY,
1271                 &hdrs_hint_eth_src_ipv6, IAVF_PHINT_IPV6},
1272         {ETH_RSS_L2_DST_ONLY,
1273                 &hdrs_hint_eth_dst_ipv6, IAVF_PHINT_IPV6},
1274         {ETH_RSS_ETH,
1275                 &hdrs_hint_eth_ipv6, IAVF_PHINT_IPV6},
1276         {ETH_RSS_L3_SRC_ONLY,
1277                 &hdrs_hint_ipv6_src, IAVF_PHINT_IPV6},
1278         {ETH_RSS_L3_DST_ONLY,
1279                 &hdrs_hint_ipv6_dst, IAVF_PHINT_IPV6},
1280         {ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
1281                 &hdrs_hint_ipv6_src, IAVF_PHINT_IPV6},
1282         {ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY,
1283                 &hdrs_hint_ipv6_dst, IAVF_PHINT_IPV6},
1284         {ETH_RSS_IPV6,
1285                 &hdrs_hint_ipv6, IAVF_PHINT_IPV6},
1286         {ETH_RSS_ESP,
1287                 &hdrs_hint_ipv6_esp, IAVF_PHINT_IPV6},
1288         {ETH_RSS_AH,
1289                 &hdrs_hint_ipv6_ah, IAVF_PHINT_IPV6},
1290         {ETH_RSS_L2TPV3,
1291                 &hdrs_hint_ipv6_l2tpv3, IAVF_PHINT_IPV6},
1292         /* IPV6 UDP */
1293         {ETH_RSS_L2_SRC_ONLY,
1294                 &hdrs_hint_eth_src_ipv6_udp, IAVF_PHINT_IPV6_UDP},
1295         {ETH_RSS_L2_DST_ONLY,
1296                 &hdrs_hint_eth_dst_ipv6_udp, IAVF_PHINT_IPV6_UDP},
1297         {ETH_RSS_ETH,
1298                 &hdrs_hint_eth_ipv6_udp, IAVF_PHINT_IPV6_UDP},
1299         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1300                 &hdrs_hint_ipv6_src_udp_src_port, IAVF_PHINT_IPV6_UDP},
1301         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1302                 &hdrs_hint_ipv6_src_udp_dst_port, IAVF_PHINT_IPV6_UDP},
1303         {ETH_RSS_L3_SRC_ONLY,
1304                 &hdrs_hint_ipv6_src, IAVF_PHINT_IPV6_UDP},
1305         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1306                 &hdrs_hint_ipv6_dst_udp_src_port, IAVF_PHINT_IPV6_UDP},
1307         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1308                 &hdrs_hint_ipv6_dst_udp_dst_port, IAVF_PHINT_IPV6_UDP},
1309         {ETH_RSS_L3_DST_ONLY,
1310                 &hdrs_hint_ipv6_dst, IAVF_PHINT_IPV6_UDP},
1311         {ETH_RSS_NONFRAG_IPV6_UDP |
1312                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1313                 &hdrs_hint_ipv6_src_udp_src_port, IAVF_PHINT_IPV6_UDP},
1314         {ETH_RSS_NONFRAG_IPV6_UDP |
1315                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1316                 &hdrs_hint_ipv6_src_udp_dst_port, IAVF_PHINT_IPV6_UDP},
1317         {ETH_RSS_NONFRAG_IPV6_UDP |
1318                 ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src,
1319                 IAVF_PHINT_IPV6_UDP},
1320         {ETH_RSS_NONFRAG_IPV6_UDP |
1321                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1322                 &hdrs_hint_ipv6_dst_udp_src_port, IAVF_PHINT_IPV6_UDP},
1323         {ETH_RSS_NONFRAG_IPV6_UDP |
1324                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1325                 &hdrs_hint_ipv6_dst_udp_dst_port, IAVF_PHINT_IPV6_UDP},
1326         {ETH_RSS_NONFRAG_IPV6_UDP |
1327                 ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst,
1328                 IAVF_PHINT_IPV6_UDP},
1329         {ETH_RSS_L4_SRC_ONLY,
1330                 &hdrs_hint_ipv6_udp_src_port, IAVF_PHINT_IPV6_UDP},
1331         {ETH_RSS_L4_DST_ONLY,
1332                 &hdrs_hint_ipv6_udp_dst_port, IAVF_PHINT_IPV6_UDP},
1333         {ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L4_SRC_ONLY,
1334                 &hdrs_hint_ipv6_udp_src_port, IAVF_PHINT_IPV6_UDP},
1335         {ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L4_DST_ONLY,
1336                 &hdrs_hint_ipv6_udp_dst_port, IAVF_PHINT_IPV6_UDP},
1337         {ETH_RSS_PFCP,
1338                 &hdrs_hint_ipv6_pfcp, IAVF_PHINT_IPV6_UDP},
1339         {ETH_RSS_ESP,
1340                 &hdrs_hint_ipv6_udp_esp, IAVF_PHINT_IPV6_UDP},
1341         {ETH_RSS_NONFRAG_IPV6_UDP,
1342                 &hdrs_hint_ipv6_udp, IAVF_PHINT_IPV6_UDP},
1343         /* IPV6 TCP */
1344         {ETH_RSS_L2_SRC_ONLY,
1345                 &hdrs_hint_eth_src_ipv6_tcp, IAVF_PHINT_IPV6_TCP},
1346         {ETH_RSS_L2_DST_ONLY,
1347                 &hdrs_hint_eth_dst_ipv6_tcp, IAVF_PHINT_IPV6_TCP},
1348         {ETH_RSS_ETH,
1349                 &hdrs_hint_eth_ipv6_tcp, IAVF_PHINT_IPV6_TCP},
1350         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1351                 &hdrs_hint_ipv6_src_tcp_src_port, IAVF_PHINT_IPV6_TCP},
1352         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1353                 &hdrs_hint_ipv6_src_tcp_dst_port, IAVF_PHINT_IPV6_TCP},
1354         {ETH_RSS_L3_SRC_ONLY,
1355                 &hdrs_hint_ipv6_src, IAVF_PHINT_IPV6_TCP},
1356         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1357                 &hdrs_hint_ipv6_dst_tcp_src_port, IAVF_PHINT_IPV6_TCP},
1358         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1359                 &hdrs_hint_ipv6_dst_tcp_dst_port, IAVF_PHINT_IPV6_TCP},
1360         {ETH_RSS_L3_DST_ONLY,
1361                 &hdrs_hint_ipv6_dst, IAVF_PHINT_IPV6_TCP},
1362         {ETH_RSS_NONFRAG_IPV6_TCP |
1363                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1364                 &hdrs_hint_ipv6_src_tcp_src_port, IAVF_PHINT_IPV6_TCP},
1365         {ETH_RSS_NONFRAG_IPV6_TCP |
1366                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1367                 &hdrs_hint_ipv6_src_tcp_dst_port, IAVF_PHINT_IPV6_TCP},
1368         {ETH_RSS_NONFRAG_IPV6_TCP |
1369                 ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src,
1370                 IAVF_PHINT_IPV6_TCP},
1371         {ETH_RSS_NONFRAG_IPV6_TCP |
1372                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1373                 &hdrs_hint_ipv6_dst_tcp_src_port, IAVF_PHINT_IPV6_TCP},
1374         {ETH_RSS_NONFRAG_IPV6_TCP |
1375                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1376                 &hdrs_hint_ipv6_dst_tcp_dst_port, IAVF_PHINT_IPV6_TCP},
1377         {ETH_RSS_NONFRAG_IPV6_TCP |
1378                 ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst,
1379                 IAVF_PHINT_IPV6_TCP},
1380         {ETH_RSS_L4_SRC_ONLY,
1381                 &hdrs_hint_ipv6_tcp_src_port, IAVF_PHINT_IPV6_TCP},
1382         {ETH_RSS_L4_DST_ONLY,
1383                 &hdrs_hint_ipv6_tcp_dst_port, IAVF_PHINT_IPV6_TCP},
1384         {ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L4_SRC_ONLY,
1385                 &hdrs_hint_ipv6_tcp_src_port, IAVF_PHINT_IPV6_TCP},
1386         {ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_L4_DST_ONLY,
1387                 &hdrs_hint_ipv6_tcp_dst_port, IAVF_PHINT_IPV6_TCP},
1388         {ETH_RSS_NONFRAG_IPV6_TCP,
1389                 &hdrs_hint_ipv6_tcp, IAVF_PHINT_IPV6_TCP},
1390         /* IPV6 SCTP */
1391         {ETH_RSS_L2_SRC_ONLY,
1392                 &hdrs_hint_eth_src_ipv6_sctp, IAVF_PHINT_IPV6_SCTP},
1393         {ETH_RSS_L2_DST_ONLY,
1394                 &hdrs_hint_eth_dst_ipv6_sctp, IAVF_PHINT_IPV6_SCTP},
1395         {ETH_RSS_ETH,
1396                 &hdrs_hint_eth_ipv6_sctp, IAVF_PHINT_IPV6_SCTP},
1397         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1398                 &hdrs_hint_ipv6_src_sctp_src_port, IAVF_PHINT_IPV6_SCTP},
1399         {ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1400                 &hdrs_hint_ipv6_src_sctp_dst_port, IAVF_PHINT_IPV6_SCTP},
1401         {ETH_RSS_L3_SRC_ONLY,
1402                 &hdrs_hint_ipv6_src, IAVF_PHINT_IPV6_SCTP},
1403         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1404                 &hdrs_hint_ipv6_dst_sctp_src_port, IAVF_PHINT_IPV6_SCTP},
1405         {ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1406                 &hdrs_hint_ipv6_dst_sctp_dst_port, IAVF_PHINT_IPV6_SCTP},
1407         {ETH_RSS_L3_DST_ONLY,
1408                 &hdrs_hint_ipv6_dst, IAVF_PHINT_IPV6_SCTP},
1409         {ETH_RSS_NONFRAG_IPV6_SCTP |
1410                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1411                 &hdrs_hint_ipv6_src_sctp_src_port, IAVF_PHINT_IPV6_SCTP},
1412         {ETH_RSS_NONFRAG_IPV6_SCTP |
1413                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1414                 &hdrs_hint_ipv6_src_sctp_dst_port, IAVF_PHINT_IPV6_SCTP},
1415         {ETH_RSS_NONFRAG_IPV6_SCTP |
1416                 ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src,
1417                 IAVF_PHINT_IPV6_SCTP},
1418         {ETH_RSS_NONFRAG_IPV6_SCTP |
1419                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1420                 &hdrs_hint_ipv6_dst_sctp_src_port, IAVF_PHINT_IPV6_SCTP},
1421         {ETH_RSS_NONFRAG_IPV6_SCTP |
1422                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1423                 &hdrs_hint_ipv6_dst_sctp_dst_port, IAVF_PHINT_IPV6_SCTP},
1424         {ETH_RSS_NONFRAG_IPV6_SCTP |
1425                 ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst,
1426                 IAVF_PHINT_IPV6_SCTP},
1427         {ETH_RSS_L4_SRC_ONLY,
1428                 &hdrs_hint_ipv6_sctp_src_port, IAVF_PHINT_IPV6_SCTP},
1429         {ETH_RSS_L4_DST_ONLY,
1430                 &hdrs_hint_ipv6_sctp_dst_port, IAVF_PHINT_IPV6_SCTP},
1431         {ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_SRC_ONLY,
1432                 &hdrs_hint_ipv6_sctp_src_port, IAVF_PHINT_IPV6_SCTP},
1433         {ETH_RSS_NONFRAG_IPV6_SCTP | ETH_RSS_L4_DST_ONLY,
1434                 &hdrs_hint_ipv6_sctp_dst_port, IAVF_PHINT_IPV6_SCTP},
1435         {ETH_RSS_NONFRAG_IPV6_SCTP,
1436                 &hdrs_hint_ipv6_sctp, IAVF_PHINT_IPV6_SCTP},
1437         {ETH_RSS_S_VLAN,
1438                 &hdrs_hint_svlan_ipv6, IAVF_PHINT_IPV6},
1439         {ETH_RSS_S_VLAN,
1440                 &hdrs_hint_svlan_ipv6_udp, IAVF_PHINT_IPV6_UDP},
1441         {ETH_RSS_S_VLAN,
1442                 &hdrs_hint_svlan_ipv6_tcp, IAVF_PHINT_IPV6_TCP},
1443         {ETH_RSS_S_VLAN,
1444                 &hdrs_hint_svlan_ipv6_sctp, IAVF_PHINT_IPV6_SCTP},
1445         {ETH_RSS_C_VLAN,
1446                 &hdrs_hint_cvlan_ipv6, IAVF_PHINT_IPV6},
1447         {ETH_RSS_C_VLAN,
1448                 &hdrs_hint_cvlan_ipv6_udp, IAVF_PHINT_IPV6_UDP},
1449         {ETH_RSS_C_VLAN,
1450                 &hdrs_hint_cvlan_ipv6_tcp, IAVF_PHINT_IPV6_TCP},
1451         {ETH_RSS_C_VLAN,
1452                 &hdrs_hint_cvlan_ipv6_sctp, IAVF_PHINT_IPV6_SCTP},
1453 };
1454
1455 struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = {
1456         /* GTPU */
1457         /* GTPU EH */
1458         /* Inner IPV4 */
1459         {ETH_RSS_L3_SRC_ONLY,
1460                 &hdrs_hint_ipv4_src_gtpu_eh,
1461                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4},
1462         {ETH_RSS_L3_DST_ONLY,
1463                 &hdrs_hint_ipv4_dst_gtpu_eh,
1464                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4},
1465         {ETH_RSS_IPV4 |
1466                 ETH_RSS_L3_SRC_ONLY,
1467                 &hdrs_hint_ipv4_src_gtpu_eh,
1468                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4},
1469         {ETH_RSS_IPV4 |
1470                 ETH_RSS_L3_DST_ONLY,
1471                 &hdrs_hint_ipv4_dst_gtpu_eh,
1472                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4},
1473         {ETH_RSS_IPV4,
1474                 &hdrs_hint_ipv4_gtpu_eh,
1475                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4},
1476         /* Inner IPV4->UDP */
1477         {ETH_RSS_L3_SRC_ONLY |
1478                 ETH_RSS_L4_SRC_ONLY,
1479                 &hdrs_hint_ipv4_src_udp_src_gtpu_eh,
1480                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1481         {ETH_RSS_L3_SRC_ONLY |
1482                 ETH_RSS_L4_DST_ONLY,
1483                 &hdrs_hint_ipv4_src_udp_dst_gtpu_eh,
1484                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1485         {ETH_RSS_L3_SRC_ONLY,
1486                 &hdrs_hint_ipv4_src_gtpu_eh,
1487                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1488         {ETH_RSS_L4_SRC_ONLY,
1489                 &hdrs_hint_ipv4_udp_src_gtpu_eh,
1490                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1491         {ETH_RSS_L3_DST_ONLY |
1492                 ETH_RSS_L4_SRC_ONLY,
1493                 &hdrs_hint_ipv4_dst_udp_src_gtpu_eh,
1494                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1495         {ETH_RSS_L3_DST_ONLY |
1496                 ETH_RSS_L4_DST_ONLY,
1497                 &hdrs_hint_ipv4_dst_udp_dst_gtpu_eh,
1498                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1499         {ETH_RSS_L3_DST_ONLY,
1500                 &hdrs_hint_ipv4_dst_gtpu_eh,
1501                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1502         {ETH_RSS_L4_DST_ONLY,
1503                 &hdrs_hint_ipv4_udp_dst_gtpu_eh,
1504                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1505         {ETH_RSS_NONFRAG_IPV4_UDP |
1506                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1507                 &hdrs_hint_ipv4_src_udp_src_gtpu_eh,
1508                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1509         {ETH_RSS_NONFRAG_IPV4_UDP |
1510                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1511                 &hdrs_hint_ipv4_src_udp_dst_gtpu_eh,
1512                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1513         {ETH_RSS_NONFRAG_IPV4_UDP |
1514                 ETH_RSS_L3_SRC_ONLY,
1515                 &hdrs_hint_ipv4_src_gtpu_eh,
1516                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1517         {ETH_RSS_NONFRAG_IPV4_UDP |
1518                 ETH_RSS_L4_SRC_ONLY,
1519                 &hdrs_hint_ipv4_udp_src_gtpu_eh,
1520                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1521         {ETH_RSS_NONFRAG_IPV4_UDP |
1522                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1523                 &hdrs_hint_ipv4_dst_udp_src_gtpu_eh,
1524                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1525         {ETH_RSS_NONFRAG_IPV4_UDP |
1526                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1527                 &hdrs_hint_ipv4_dst_udp_dst_gtpu_eh,
1528                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1529         {ETH_RSS_NONFRAG_IPV4_UDP |
1530                 ETH_RSS_L3_DST_ONLY,
1531                 &hdrs_hint_ipv4_dst_gtpu_eh,
1532                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1533         {ETH_RSS_NONFRAG_IPV4_UDP |
1534                 ETH_RSS_L4_DST_ONLY,
1535                 &hdrs_hint_ipv4_udp_dst_gtpu_eh,
1536                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1537         {ETH_RSS_NONFRAG_IPV4_UDP,
1538                 &hdrs_hint_ipv4_udp_gtpu_eh,
1539                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_UDP},
1540         /* Inner IPV4->TCP */
1541         {ETH_RSS_L3_SRC_ONLY |
1542                 ETH_RSS_L4_SRC_ONLY,
1543                 &hdrs_hint_ipv4_src_tcp_src_gtpu_eh,
1544                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1545         {ETH_RSS_L3_SRC_ONLY |
1546                 ETH_RSS_L4_DST_ONLY,
1547                 &hdrs_hint_ipv4_src_tcp_dst_gtpu_eh,
1548                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1549         {ETH_RSS_L3_SRC_ONLY,
1550                 &hdrs_hint_ipv4_src_gtpu_eh,
1551                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1552         {ETH_RSS_L4_SRC_ONLY,
1553                 &hdrs_hint_ipv4_tcp_src_gtpu_eh,
1554                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1555         {ETH_RSS_L3_DST_ONLY |
1556                 ETH_RSS_L4_SRC_ONLY,
1557                 &hdrs_hint_ipv4_dst_tcp_src_gtpu_eh,
1558                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1559         {ETH_RSS_L3_DST_ONLY |
1560                 ETH_RSS_L4_DST_ONLY,
1561                 &hdrs_hint_ipv4_dst_tcp_dst_gtpu_eh,
1562                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1563         {ETH_RSS_L3_DST_ONLY,
1564                 &hdrs_hint_ipv4_dst_gtpu_eh,
1565                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1566         {ETH_RSS_L4_DST_ONLY,
1567                 &hdrs_hint_ipv4_tcp_dst_gtpu_eh,
1568                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1569         {ETH_RSS_NONFRAG_IPV4_TCP |
1570                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1571                 &hdrs_hint_ipv4_src_tcp_src_gtpu_eh,
1572                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1573         {ETH_RSS_NONFRAG_IPV4_TCP |
1574                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1575                 &hdrs_hint_ipv4_src_tcp_dst_gtpu_eh,
1576                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1577         {ETH_RSS_NONFRAG_IPV4_TCP |
1578                 ETH_RSS_L3_SRC_ONLY,
1579                 &hdrs_hint_ipv4_src_gtpu_eh,
1580                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1581         {ETH_RSS_NONFRAG_IPV4_TCP |
1582                 ETH_RSS_L4_SRC_ONLY,
1583                 &hdrs_hint_ipv4_tcp_src_gtpu_eh,
1584                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1585         {ETH_RSS_NONFRAG_IPV4_TCP |
1586                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1587                 &hdrs_hint_ipv4_dst_tcp_src_gtpu_eh,
1588                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1589         {ETH_RSS_NONFRAG_IPV4_TCP |
1590                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1591                 &hdrs_hint_ipv4_dst_tcp_dst_gtpu_eh,
1592                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1593         {ETH_RSS_NONFRAG_IPV4_TCP |
1594                 ETH_RSS_L3_DST_ONLY,
1595                 &hdrs_hint_ipv4_dst_gtpu_eh,
1596                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1597         {ETH_RSS_NONFRAG_IPV4_TCP |
1598                 ETH_RSS_L4_DST_ONLY,
1599                 &hdrs_hint_ipv4_tcp_dst_gtpu_eh,
1600                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1601         {ETH_RSS_NONFRAG_IPV4_TCP,
1602                 &hdrs_hint_ipv4_tcp_gtpu_eh,
1603                 IAVF_PHINT_IPV4_GTPU_EH | IAVF_PHINT_IPV4_TCP},
1604         /* GTPU EH UP */
1605         /* Inner IPV4 */
1606         {ETH_RSS_L3_SRC_ONLY,
1607                 &hdrs_hint_ipv4_src_gtpu_up,
1608                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4},
1609         {ETH_RSS_L3_DST_ONLY,
1610                 &hdrs_hint_ipv4_dst_gtpu_up,
1611                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4},
1612         {ETH_RSS_IPV4 |
1613                 ETH_RSS_L3_SRC_ONLY,
1614                 &hdrs_hint_ipv4_src_gtpu_up,
1615                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4},
1616         {ETH_RSS_IPV4 |
1617                 ETH_RSS_L3_DST_ONLY,
1618                 &hdrs_hint_ipv4_dst_gtpu_up,
1619                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4},
1620         {ETH_RSS_IPV4,
1621                 &hdrs_hint_ipv4_gtpu_up,
1622                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4},
1623         /* Inner IPV4->UDP */
1624         {ETH_RSS_L3_SRC_ONLY |
1625                 ETH_RSS_L4_SRC_ONLY,
1626                 &hdrs_hint_ipv4_src_udp_src_gtpu_up,
1627                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1628         {ETH_RSS_L3_SRC_ONLY |
1629                 ETH_RSS_L4_DST_ONLY,
1630                 &hdrs_hint_ipv4_src_udp_dst_gtpu_up,
1631                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1632         {ETH_RSS_L3_SRC_ONLY,
1633                 &hdrs_hint_ipv4_src_gtpu_up,
1634                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1635         {ETH_RSS_L4_SRC_ONLY,
1636                 &hdrs_hint_ipv4_udp_src_gtpu_up,
1637                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1638         {ETH_RSS_L3_DST_ONLY |
1639                 ETH_RSS_L4_SRC_ONLY,
1640                 &hdrs_hint_ipv4_dst_udp_src_gtpu_up,
1641                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1642         {ETH_RSS_L3_DST_ONLY |
1643                 ETH_RSS_L4_DST_ONLY,
1644                 &hdrs_hint_ipv4_dst_udp_dst_gtpu_up,
1645                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1646         {ETH_RSS_L3_DST_ONLY,
1647                 &hdrs_hint_ipv4_dst_gtpu_up,
1648                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1649         {ETH_RSS_L4_DST_ONLY,
1650                 &hdrs_hint_ipv4_udp_dst_gtpu_up,
1651                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1652         {ETH_RSS_NONFRAG_IPV4_UDP |
1653                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1654                 &hdrs_hint_ipv4_src_udp_src_gtpu_up,
1655                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1656         {ETH_RSS_NONFRAG_IPV4_UDP |
1657                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1658                 &hdrs_hint_ipv4_src_udp_dst_gtpu_up,
1659                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1660         {ETH_RSS_NONFRAG_IPV4_UDP |
1661                 ETH_RSS_L3_SRC_ONLY,
1662                 &hdrs_hint_ipv4_src_gtpu_up,
1663                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1664         {ETH_RSS_NONFRAG_IPV4_UDP |
1665                 ETH_RSS_L4_SRC_ONLY,
1666                 &hdrs_hint_ipv4_udp_src_gtpu_up,
1667                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1668         {ETH_RSS_NONFRAG_IPV4_UDP |
1669                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1670                 &hdrs_hint_ipv4_dst_udp_src_gtpu_up,
1671                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1672         {ETH_RSS_NONFRAG_IPV4_UDP |
1673                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1674                 &hdrs_hint_ipv4_dst_udp_dst_gtpu_up,
1675                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1676         {ETH_RSS_NONFRAG_IPV4_UDP |
1677                 ETH_RSS_L3_DST_ONLY,
1678                 &hdrs_hint_ipv4_dst_gtpu_up,
1679                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1680         {ETH_RSS_NONFRAG_IPV4_UDP |
1681                 ETH_RSS_L4_DST_ONLY,
1682                 &hdrs_hint_ipv4_udp_dst_gtpu_up,
1683                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1684         {ETH_RSS_NONFRAG_IPV4_UDP,
1685                 &hdrs_hint_ipv4_udp_gtpu_up,
1686                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_UDP},
1687         /* Inner IPV4->TCP */
1688         {ETH_RSS_L3_SRC_ONLY |
1689                 ETH_RSS_L4_SRC_ONLY,
1690                 &hdrs_hint_ipv4_src_tcp_src_gtpu_up,
1691                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1692         {ETH_RSS_L3_SRC_ONLY |
1693                 ETH_RSS_L4_DST_ONLY,
1694                 &hdrs_hint_ipv4_src_tcp_dst_gtpu_up,
1695                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1696         {ETH_RSS_L3_SRC_ONLY,
1697                 &hdrs_hint_ipv4_src_gtpu_up,
1698                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1699         {ETH_RSS_L4_SRC_ONLY,
1700                 &hdrs_hint_ipv4_tcp_src_gtpu_up,
1701                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1702         {ETH_RSS_L3_DST_ONLY |
1703                 ETH_RSS_L4_SRC_ONLY,
1704                 &hdrs_hint_ipv4_dst_tcp_src_gtpu_up,
1705                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1706         {ETH_RSS_L3_DST_ONLY |
1707                 ETH_RSS_L4_DST_ONLY,
1708                 &hdrs_hint_ipv4_dst_tcp_dst_gtpu_up,
1709                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1710         {ETH_RSS_L3_DST_ONLY,
1711                 &hdrs_hint_ipv4_dst_gtpu_up,
1712                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1713         {ETH_RSS_L4_DST_ONLY,
1714                 &hdrs_hint_ipv4_tcp_dst_gtpu_up,
1715                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1716         {ETH_RSS_NONFRAG_IPV4_TCP |
1717                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1718                 &hdrs_hint_ipv4_src_tcp_src_gtpu_up,
1719                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1720         {ETH_RSS_NONFRAG_IPV4_TCP |
1721                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1722                 &hdrs_hint_ipv4_src_tcp_dst_gtpu_up,
1723                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1724         {ETH_RSS_NONFRAG_IPV4_TCP |
1725                 ETH_RSS_L3_SRC_ONLY,
1726                 &hdrs_hint_ipv4_src_gtpu_up,
1727                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1728         {ETH_RSS_NONFRAG_IPV4_TCP |
1729                 ETH_RSS_L4_SRC_ONLY,
1730                 &hdrs_hint_ipv4_tcp_src_gtpu_up,
1731                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1732         {ETH_RSS_NONFRAG_IPV4_TCP |
1733                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1734                 &hdrs_hint_ipv4_dst_tcp_src_gtpu_up,
1735                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1736         {ETH_RSS_NONFRAG_IPV4_TCP |
1737                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1738                 &hdrs_hint_ipv4_dst_tcp_dst_gtpu_up,
1739                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1740         {ETH_RSS_NONFRAG_IPV4_TCP |
1741                 ETH_RSS_L3_DST_ONLY,
1742                 &hdrs_hint_ipv4_dst_gtpu_up,
1743                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1744         {ETH_RSS_NONFRAG_IPV4_TCP |
1745                 ETH_RSS_L4_DST_ONLY,
1746                 &hdrs_hint_ipv4_tcp_dst_gtpu_up,
1747                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1748         {ETH_RSS_NONFRAG_IPV4_TCP,
1749                 &hdrs_hint_ipv4_tcp_gtpu_up,
1750                 IAVF_PHINT_IPV4_GTPU_EH_UPLINK | IAVF_PHINT_IPV4_TCP},
1751         /* GTPU EH DWN */
1752         /* Inner IPV4 */
1753         {ETH_RSS_L3_SRC_ONLY,
1754                 &hdrs_hint_ipv4_src_gtpu_dwn,
1755                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4},
1756         {ETH_RSS_L3_DST_ONLY,
1757                 &hdrs_hint_ipv4_dst_gtpu_dwn,
1758                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4},
1759         {ETH_RSS_IPV4 |
1760                 ETH_RSS_L3_SRC_ONLY,
1761                 &hdrs_hint_ipv4_src_gtpu_dwn,
1762                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4},
1763         {ETH_RSS_IPV4 |
1764                 ETH_RSS_L3_DST_ONLY,
1765                 &hdrs_hint_ipv4_dst_gtpu_dwn,
1766                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4},
1767         {ETH_RSS_IPV4,
1768                 &hdrs_hint_ipv4_gtpu_dwn,
1769                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4},
1770         /* Inner IPV4->UDP */
1771         {ETH_RSS_L3_SRC_ONLY |
1772                 ETH_RSS_L4_SRC_ONLY,
1773                 &hdrs_hint_ipv4_src_udp_src_gtpu_dwn,
1774                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1775         {ETH_RSS_L3_SRC_ONLY |
1776                 ETH_RSS_L4_DST_ONLY,
1777                 &hdrs_hint_ipv4_src_udp_dst_gtpu_dwn,
1778                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1779         {ETH_RSS_L3_SRC_ONLY,
1780                 &hdrs_hint_ipv4_src_gtpu_dwn,
1781                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1782         {ETH_RSS_L4_SRC_ONLY,
1783                 &hdrs_hint_ipv4_udp_src_gtpu_dwn,
1784                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1785         {ETH_RSS_L3_DST_ONLY |
1786                 ETH_RSS_L4_SRC_ONLY,
1787                 &hdrs_hint_ipv4_dst_udp_src_gtpu_dwn,
1788                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1789         {ETH_RSS_L3_DST_ONLY |
1790                 ETH_RSS_L4_DST_ONLY,
1791                 &hdrs_hint_ipv4_dst_udp_dst_gtpu_dwn,
1792                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1793         {ETH_RSS_L3_DST_ONLY,
1794                 &hdrs_hint_ipv4_dst_gtpu_dwn,
1795                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1796         {ETH_RSS_L4_DST_ONLY,
1797                 &hdrs_hint_ipv4_udp_dst_gtpu_dwn,
1798                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1799         {ETH_RSS_NONFRAG_IPV4_UDP |
1800                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1801                 &hdrs_hint_ipv4_src_udp_src_gtpu_dwn,
1802                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1803         {ETH_RSS_NONFRAG_IPV4_UDP |
1804                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1805                 &hdrs_hint_ipv4_src_udp_dst_gtpu_dwn,
1806                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1807         {ETH_RSS_NONFRAG_IPV4_UDP |
1808                 ETH_RSS_L3_SRC_ONLY,
1809                 &hdrs_hint_ipv4_src_gtpu_dwn,
1810                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1811         {ETH_RSS_NONFRAG_IPV4_UDP |
1812                 ETH_RSS_L4_SRC_ONLY,
1813                 &hdrs_hint_ipv4_udp_src_gtpu_dwn,
1814                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1815         {ETH_RSS_NONFRAG_IPV4_UDP |
1816                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1817                 &hdrs_hint_ipv4_dst_udp_src_gtpu_dwn,
1818                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1819         {ETH_RSS_NONFRAG_IPV4_UDP |
1820                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1821                 &hdrs_hint_ipv4_dst_udp_dst_gtpu_dwn,
1822                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1823         {ETH_RSS_NONFRAG_IPV4_UDP |
1824                 ETH_RSS_L3_DST_ONLY,
1825                 &hdrs_hint_ipv4_dst_gtpu_dwn,
1826                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1827         {ETH_RSS_NONFRAG_IPV4_UDP |
1828                 ETH_RSS_L4_DST_ONLY,
1829                 &hdrs_hint_ipv4_udp_dst_gtpu_dwn,
1830                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1831         {ETH_RSS_NONFRAG_IPV4_UDP,
1832                 &hdrs_hint_ipv4_udp_gtpu_dwn,
1833                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_UDP},
1834         /* Inner IPV4->TCP */
1835         {ETH_RSS_L3_SRC_ONLY |
1836                 ETH_RSS_L4_SRC_ONLY,
1837                 &hdrs_hint_ipv4_src_tcp_src_gtpu_dwn,
1838                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1839         {ETH_RSS_L3_SRC_ONLY |
1840                 ETH_RSS_L4_DST_ONLY,
1841                 &hdrs_hint_ipv4_src_tcp_dst_gtpu_dwn,
1842                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1843         {ETH_RSS_L3_SRC_ONLY,
1844                 &hdrs_hint_ipv4_src_gtpu_dwn,
1845                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1846         {ETH_RSS_L4_SRC_ONLY,
1847                 &hdrs_hint_ipv4_tcp_src_gtpu_dwn,
1848                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1849         {ETH_RSS_L3_DST_ONLY |
1850                 ETH_RSS_L4_SRC_ONLY,
1851                 &hdrs_hint_ipv4_dst_tcp_src_gtpu_dwn,
1852                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1853         {ETH_RSS_L3_DST_ONLY |
1854                 ETH_RSS_L4_DST_ONLY,
1855                 &hdrs_hint_ipv4_dst_tcp_dst_gtpu_dwn,
1856                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1857         {ETH_RSS_L3_DST_ONLY,
1858                 &hdrs_hint_ipv4_dst_gtpu_dwn,
1859                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1860         {ETH_RSS_L4_DST_ONLY,
1861                 &hdrs_hint_ipv4_tcp_dst_gtpu_dwn,
1862                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1863         {ETH_RSS_NONFRAG_IPV4_TCP |
1864                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
1865                 &hdrs_hint_ipv4_src_tcp_src_gtpu_dwn,
1866                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1867         {ETH_RSS_NONFRAG_IPV4_TCP |
1868                 ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
1869                 &hdrs_hint_ipv4_src_tcp_dst_gtpu_dwn,
1870                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1871         {ETH_RSS_NONFRAG_IPV4_TCP |
1872                 ETH_RSS_L3_SRC_ONLY,
1873                 &hdrs_hint_ipv4_src_gtpu_dwn,
1874                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1875         {ETH_RSS_NONFRAG_IPV4_TCP |
1876                 ETH_RSS_L4_SRC_ONLY,
1877                 &hdrs_hint_ipv4_tcp_src_gtpu_dwn,
1878                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1879         {ETH_RSS_NONFRAG_IPV4_TCP |
1880                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
1881                 &hdrs_hint_ipv4_dst_tcp_src_gtpu_dwn,
1882                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1883         {ETH_RSS_NONFRAG_IPV4_TCP |
1884                 ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
1885                 &hdrs_hint_ipv4_dst_tcp_dst_gtpu_dwn,
1886                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1887         {ETH_RSS_NONFRAG_IPV4_TCP |
1888                 ETH_RSS_L3_DST_ONLY,
1889                 &hdrs_hint_ipv4_dst_gtpu_dwn,
1890                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1891         {ETH_RSS_NONFRAG_IPV4_TCP |
1892                 ETH_RSS_L4_DST_ONLY,
1893                 &hdrs_hint_ipv4_tcp_dst_gtpu_dwn,
1894                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1895         {ETH_RSS_NONFRAG_IPV4_TCP,
1896                 &hdrs_hint_ipv4_tcp_gtpu_dwn,
1897                 IAVF_PHINT_IPV4_GTPU_EH_DWNLINK | IAVF_PHINT_IPV4_TCP},
1898 };
1899
1900 struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
1901         &hdrs_hint_ipv4,
1902         &hdrs_hint_ipv4_udp,
1903         &hdrs_hint_ipv4_tcp,
1904         &hdrs_hint_ipv4_sctp,
1905         &hdrs_hint_ipv6,
1906         &hdrs_hint_ipv6_udp,
1907         &hdrs_hint_ipv6_tcp,
1908         &hdrs_hint_ipv6_sctp,
1909 };
1910
1911 static struct iavf_flow_engine iavf_hash_engine = {
1912         .init = iavf_hash_init,
1913         .create = iavf_hash_create,
1914         .destroy = iavf_hash_destroy,
1915         .uninit = iavf_hash_uninit,
1916         .free = iavf_hash_free,
1917         .type = IAVF_FLOW_ENGINE_HASH,
1918 };
1919
1920 /* Register parser for comms package. */
1921 static struct iavf_flow_parser iavf_hash_parser = {
1922         .engine = &iavf_hash_engine,
1923         .array = iavf_hash_pattern_list,
1924         .array_len = RTE_DIM(iavf_hash_pattern_list),
1925         .parse_pattern_action = iavf_hash_parse_pattern_action,
1926         .stage = IAVF_FLOW_STAGE_RSS,
1927 };
1928
1929 static int
1930 iavf_hash_default_set(struct iavf_adapter *ad, bool add)
1931 {
1932         struct virtchnl_rss_cfg *rss_cfg;
1933         uint16_t i;
1934         int ret;
1935
1936         rss_cfg = rte_zmalloc("iavf rss rule",
1937                               sizeof(struct virtchnl_rss_cfg), 0);
1938         if (!rss_cfg)
1939                 return -ENOMEM;
1940
1941         for (i = 0; i < RTE_DIM(iavf_hash_default_hdrs); i++) {
1942                 rss_cfg->proto_hdrs = *iavf_hash_default_hdrs[i];
1943                 rss_cfg->rss_algorithm = VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
1944
1945                 ret = iavf_add_del_rss_cfg(ad, rss_cfg, add);
1946                 if (ret) {
1947                         PMD_DRV_LOG(ERR, "fail to %s RSS configure",
1948                                     add ? "add" : "delete");
1949                         rte_free(rss_cfg);
1950                         return ret;
1951                 }
1952         }
1953
1954         return ret;
1955 }
1956
1957 RTE_INIT(iavf_hash_engine_init)
1958 {
1959         struct iavf_flow_engine *engine = &iavf_hash_engine;
1960
1961         iavf_register_flow_engine(engine);
1962 }
1963
1964 static int
1965 iavf_hash_init(struct iavf_adapter *ad)
1966 {
1967         struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
1968         struct iavf_flow_parser *parser;
1969         int ret;
1970
1971         if (!vf->vf_res)
1972                 return -EINVAL;
1973
1974         if (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF))
1975                 return -ENOTSUP;
1976
1977         parser = &iavf_hash_parser;
1978
1979         ret = iavf_register_parser(parser, ad);
1980         if (ret) {
1981                 PMD_DRV_LOG(ERR, "fail to register hash parser");
1982                 return ret;
1983         }
1984
1985         ret = iavf_hash_default_set(ad, true);
1986         if (ret) {
1987                 PMD_DRV_LOG(ERR, "fail to set default RSS");
1988                 iavf_unregister_parser(parser, ad);
1989         }
1990
1991         return ret;
1992 }
1993
1994 static int
1995 iavf_hash_parse_pattern(struct iavf_pattern_match_item *pattern_match_item,
1996                         const struct rte_flow_item pattern[], uint64_t *phint,
1997                         struct rte_flow_error *error)
1998 {
1999         const struct rte_flow_item *item = pattern;
2000         const struct rte_flow_item_gtp_psc *psc;
2001
2002         for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
2003                 if (item->last) {
2004                         rte_flow_error_set(error, EINVAL,
2005                                            RTE_FLOW_ERROR_TYPE_ITEM, item,
2006                                            "Not support range");
2007                         return -rte_errno;
2008                 }
2009
2010                 switch (item->type) {
2011                 case RTE_FLOW_ITEM_TYPE_GTP_PSC:
2012                         psc = item->spec;
2013                         if (!psc)
2014                                 *phint |= IAVF_PHINT_IPV4_GTPU_EH;
2015                         else if (psc->pdu_type == IAVF_GTPU_EH_UPLINK)
2016                                 *phint |= IAVF_PHINT_IPV4_GTPU_EH_UPLINK;
2017                         else if (psc->pdu_type == IAVF_GTPU_EH_DWNLINK)
2018                                 *phint |= IAVF_PHINT_IPV4_GTPU_EH_DWNLINK;
2019                         break;
2020                 default:
2021                         break;
2022                 }
2023         }
2024
2025         /* update and restore pattern hint */
2026         *phint |= ((struct iavf_pattern_match_type *)
2027                                 (pattern_match_item->meta))->pattern_hint;
2028
2029         return 0;
2030 }
2031
2032 static int
2033 iavf_hash_parse_action(const struct rte_flow_action actions[],
2034                        uint64_t pattern_hint, void **meta,
2035                        struct rte_flow_error *error)
2036 {
2037         struct iavf_rss_meta *rss_meta = (struct iavf_rss_meta *)*meta;
2038         struct iavf_hash_match_type *hash_map_list;
2039         enum rte_flow_action_type action_type;
2040         const struct rte_flow_action_rss *rss;
2041         const struct rte_flow_action *action;
2042         uint32_t mlist_len;
2043         bool item_found = false;
2044         uint64_t rss_type;
2045         uint16_t i;
2046
2047         /* Supported action is RSS. */
2048         for (action = actions; action->type !=
2049                 RTE_FLOW_ACTION_TYPE_END; action++) {
2050                 action_type = action->type;
2051                 switch (action_type) {
2052                 case RTE_FLOW_ACTION_TYPE_RSS:
2053                         rss = action->conf;
2054                         rss_type = rss->types;
2055
2056                         if (rss->func ==
2057                             RTE_ETH_HASH_FUNCTION_SIMPLE_XOR){
2058                                 rss_meta->rss_algorithm =
2059                                         VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC;
2060                         } else if (rss->func ==
2061                                    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) {
2062                                 rss_meta->rss_algorithm =
2063                                         VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
2064                         } else {
2065                                 rss_meta->rss_algorithm =
2066                                         VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
2067                         }
2068
2069                         if (rss->level)
2070                                 return rte_flow_error_set(error, ENOTSUP,
2071                                         RTE_FLOW_ERROR_TYPE_ACTION, action,
2072                                         "a nonzero RSS encapsulation level is not supported");
2073
2074                         if (rss->key_len)
2075                                 return rte_flow_error_set(error, ENOTSUP,
2076                                         RTE_FLOW_ERROR_TYPE_ACTION, action,
2077                                         "a nonzero RSS key_len is not supported");
2078
2079                         if (rss->queue_num)
2080                                 return rte_flow_error_set(error, ENOTSUP,
2081                                         RTE_FLOW_ERROR_TYPE_ACTION, action,
2082                                         "a non-NULL RSS queue is not supported");
2083
2084                         /**
2085                          * Check simultaneous use of SRC_ONLY and DST_ONLY
2086                          * of the same level.
2087                          */
2088                         rss_type = rte_eth_rss_hf_refine(rss_type);
2089
2090                         if ((pattern_hint & IAVF_PHINT_IPV4_GTPU_EH) ||
2091                             (pattern_hint & IAVF_PHINT_IPV4_GTPU_EH_UPLINK) ||
2092                             (pattern_hint & IAVF_PHINT_IPV4_GTPU_EH_DWNLINK)) {
2093                                 hash_map_list = iavf_gtpu_hash_map_list;
2094                                 mlist_len = RTE_DIM(iavf_gtpu_hash_map_list);
2095                         } else {
2096                                 hash_map_list = iavf_hash_map_list;
2097                                 mlist_len = RTE_DIM(iavf_hash_map_list);
2098                         }
2099
2100                         /* Find matched proto hdrs according to hash type. */
2101                         for (i = 0; i < mlist_len; i++) {
2102                                 struct iavf_hash_match_type *ht_map =
2103                                         &hash_map_list[i];
2104                                 if (rss_type == ht_map->hash_type &&
2105                                     pattern_hint == ht_map->pattern_hint) {
2106                                         rss_meta->proto_hdrs =
2107                                                 ht_map->proto_hdrs;
2108                                         item_found = true;
2109                                         break;
2110                                 }
2111                         }
2112
2113                         if (!item_found)
2114                                 return rte_flow_error_set(error, ENOTSUP,
2115                                         RTE_FLOW_ERROR_TYPE_ACTION, action,
2116                                         "Not supported flow");
2117                         break;
2118
2119                 case RTE_FLOW_ACTION_TYPE_END:
2120                         break;
2121
2122                 default:
2123                         rte_flow_error_set(error, EINVAL,
2124                                            RTE_FLOW_ERROR_TYPE_ACTION, action,
2125                                            "Invalid action.");
2126                         return -rte_errno;
2127                 }
2128         }
2129
2130         return 0;
2131 }
2132
2133 static int
2134 iavf_hash_parse_pattern_action(__rte_unused struct iavf_adapter *ad,
2135                                struct iavf_pattern_match_item *array,
2136                                uint32_t array_len,
2137                                const struct rte_flow_item pattern[],
2138                                const struct rte_flow_action actions[],
2139                                void **meta,
2140                                struct rte_flow_error *error)
2141 {
2142         struct iavf_pattern_match_item *pattern_match_item;
2143         struct iavf_rss_meta *rss_meta_ptr;
2144         uint64_t phint = IAVF_PHINT_NONE;
2145         int ret = 0;
2146
2147         rss_meta_ptr = rte_zmalloc(NULL, sizeof(*rss_meta_ptr), 0);
2148         if (!rss_meta_ptr) {
2149                 rte_flow_error_set(error, EINVAL,
2150                                    RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
2151                                    "No memory for rss_meta_ptr");
2152                 return -ENOMEM;
2153         }
2154
2155         /* Check rss supported pattern and find matched pattern. */
2156         pattern_match_item =
2157                 iavf_search_pattern_match_item(pattern, array, array_len,
2158                                                error);
2159         if (!pattern_match_item) {
2160                 ret = -rte_errno;
2161                 goto error;
2162         }
2163
2164         ret = iavf_hash_parse_pattern(pattern_match_item, pattern, &phint,
2165                                       error);
2166         if (ret)
2167                 goto error;
2168
2169         ret = iavf_hash_parse_action(actions, phint,
2170                                      (void **)&rss_meta_ptr, error);
2171
2172 error:
2173         if (!ret && meta)
2174                 *meta = rss_meta_ptr;
2175         else
2176                 rte_free(rss_meta_ptr);
2177
2178         rte_free(pattern_match_item);
2179
2180         return ret;
2181 }
2182
2183 static int
2184 iavf_hash_create(__rte_unused struct iavf_adapter *ad,
2185                  __rte_unused struct rte_flow *flow, void *meta,
2186                  __rte_unused struct rte_flow_error *error)
2187 {
2188         struct iavf_rss_meta *rss_meta = (struct iavf_rss_meta *)meta;
2189         struct virtchnl_rss_cfg *rss_cfg;
2190         int ret = 0;
2191
2192         rss_cfg = rte_zmalloc("iavf rss rule",
2193                               sizeof(struct virtchnl_rss_cfg), 0);
2194         if (!rss_cfg) {
2195                 rte_flow_error_set(error, EINVAL,
2196                                    RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
2197                                    "No memory for rss rule");
2198                 return -ENOMEM;
2199         }
2200
2201         rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
2202         rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
2203
2204         ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);
2205         if (!ret) {
2206                 flow->rule = rss_cfg;
2207         } else {
2208                 PMD_DRV_LOG(ERR, "fail to add RSS configure");
2209                 rte_flow_error_set(error, -ret,
2210                                    RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
2211                                    "Failed to add rss rule.");
2212                 rte_free(rss_cfg);
2213                 return -rte_errno;
2214         }
2215
2216         rte_free(meta);
2217
2218         return ret;
2219 }
2220
2221 static int
2222 iavf_hash_destroy(__rte_unused struct iavf_adapter *ad,
2223                   struct rte_flow *flow,
2224                   __rte_unused struct rte_flow_error *error)
2225 {
2226         struct virtchnl_rss_cfg *rss_cfg;
2227         int ret = 0;
2228
2229         rss_cfg = (struct virtchnl_rss_cfg *)flow->rule;
2230
2231         ret = iavf_add_del_rss_cfg(ad, rss_cfg, false);
2232         if (ret) {
2233                 PMD_DRV_LOG(ERR, "fail to del RSS configure");
2234                 rte_flow_error_set(error, -ret,
2235                                    RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
2236                                    "Failed to delete rss rule.");
2237                 return -rte_errno;
2238         }
2239         return ret;
2240 }
2241
2242 static void
2243 iavf_hash_uninit(struct iavf_adapter *ad)
2244 {
2245         if (iavf_hash_default_set(ad, false))
2246                 PMD_DRV_LOG(ERR, "fail to delete default RSS");
2247
2248         iavf_unregister_parser(&iavf_hash_parser, ad);
2249 }
2250
2251 static void
2252 iavf_hash_free(struct rte_flow *flow)
2253 {
2254         rte_free(flow->rule);
2255 }