net/ice/base: support flow director for GTPoGRE
[dpdk.git] / drivers / net / ice / base / ice_flex_type.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2001-2021 Intel Corporation
3  */
4
5 #ifndef _ICE_FLEX_TYPE_H_
6 #define _ICE_FLEX_TYPE_H_
7
8 #define ICE_FV_OFFSET_INVAL     0x1FF
9
10 #pragma pack(1)
11 /* Extraction Sequence (Field Vector) Table */
12 struct ice_fv_word {
13         u8 prot_id;
14         u16 off;                /* Offset within the protocol header */
15         u8 resvrd;
16 };
17 #pragma pack()
18
19 #define ICE_MAX_NUM_PROFILES 256
20
21 #define ICE_MAX_FV_WORDS 48
22 struct ice_fv {
23         struct ice_fv_word ew[ICE_MAX_FV_WORDS];
24 };
25
26 /* Package and segment headers and tables */
27 struct ice_pkg_hdr {
28         struct ice_pkg_ver pkg_format_ver;
29         __le32 seg_count;
30         __le32 seg_offset[STRUCT_HACK_VAR_LEN];
31 };
32
33 /* generic segment */
34 struct ice_generic_seg_hdr {
35 #define SEGMENT_TYPE_METADATA   0x00000001
36 #define SEGMENT_TYPE_ICE        0x00000010
37         __le32 seg_type;
38         struct ice_pkg_ver seg_format_ver;
39         __le32 seg_size;
40         char seg_id[ICE_PKG_NAME_SIZE];
41 };
42
43 /* ice specific segment */
44
45 union ice_device_id {
46         struct {
47                 __le16 device_id;
48                 __le16 vendor_id;
49         } dev_vend_id;
50         __le32 id;
51 };
52
53 struct ice_device_id_entry {
54         union ice_device_id device;
55         union ice_device_id sub_device;
56 };
57
58 struct ice_seg {
59         struct ice_generic_seg_hdr hdr;
60         __le32 device_table_count;
61         struct ice_device_id_entry device_table[STRUCT_HACK_VAR_LEN];
62 };
63
64 struct ice_nvm_table {
65         __le32 table_count;
66         __le32 vers[STRUCT_HACK_VAR_LEN];
67 };
68
69 struct ice_buf {
70 #define ICE_PKG_BUF_SIZE        4096
71         u8 buf[ICE_PKG_BUF_SIZE];
72 };
73
74 struct ice_buf_table {
75         __le32 buf_count;
76         struct ice_buf buf_array[STRUCT_HACK_VAR_LEN];
77 };
78
79 /* global metadata specific segment */
80 struct ice_global_metadata_seg {
81         struct ice_generic_seg_hdr hdr;
82         struct ice_pkg_ver pkg_ver;
83         __le32 rsvd;
84         char pkg_name[ICE_PKG_NAME_SIZE];
85 };
86
87 #define ICE_MIN_S_OFF           12
88 #define ICE_MAX_S_OFF           4095
89 #define ICE_MIN_S_SZ            1
90 #define ICE_MAX_S_SZ            4084
91
92 /* section information */
93 struct ice_section_entry {
94         __le32 type;
95         __le16 offset;
96         __le16 size;
97 };
98
99 #define ICE_MIN_S_COUNT         1
100 #define ICE_MAX_S_COUNT         511
101 #define ICE_MIN_S_DATA_END      12
102 #define ICE_MAX_S_DATA_END      4096
103
104 #define ICE_METADATA_BUF        0x80000000
105
106 struct ice_buf_hdr {
107         __le16 section_count;
108         __le16 data_end;
109         struct ice_section_entry section_entry[STRUCT_HACK_VAR_LEN];
110 };
111
112 #define ICE_MAX_ENTRIES_IN_BUF(hd_sz, ent_sz) ((ICE_PKG_BUF_SIZE - \
113         ice_struct_size((struct ice_buf_hdr *)0, section_entry, 1) - (hd_sz)) /\
114         (ent_sz))
115
116 /* ice package section IDs */
117 #define ICE_SID_METADATA                1
118 #define ICE_SID_XLT0_SW                 10
119 #define ICE_SID_XLT_KEY_BUILDER_SW      11
120 #define ICE_SID_XLT1_SW                 12
121 #define ICE_SID_XLT2_SW                 13
122 #define ICE_SID_PROFID_TCAM_SW          14
123 #define ICE_SID_PROFID_REDIR_SW         15
124 #define ICE_SID_FLD_VEC_SW              16
125 #define ICE_SID_CDID_KEY_BUILDER_SW     17
126 #define ICE_SID_CDID_REDIR_SW           18
127
128 #define ICE_SID_XLT0_ACL                20
129 #define ICE_SID_XLT_KEY_BUILDER_ACL     21
130 #define ICE_SID_XLT1_ACL                22
131 #define ICE_SID_XLT2_ACL                23
132 #define ICE_SID_PROFID_TCAM_ACL         24
133 #define ICE_SID_PROFID_REDIR_ACL        25
134 #define ICE_SID_FLD_VEC_ACL             26
135 #define ICE_SID_CDID_KEY_BUILDER_ACL    27
136 #define ICE_SID_CDID_REDIR_ACL          28
137
138 #define ICE_SID_XLT0_FD                 30
139 #define ICE_SID_XLT_KEY_BUILDER_FD      31
140 #define ICE_SID_XLT1_FD                 32
141 #define ICE_SID_XLT2_FD                 33
142 #define ICE_SID_PROFID_TCAM_FD          34
143 #define ICE_SID_PROFID_REDIR_FD         35
144 #define ICE_SID_FLD_VEC_FD              36
145 #define ICE_SID_CDID_KEY_BUILDER_FD     37
146 #define ICE_SID_CDID_REDIR_FD           38
147
148 #define ICE_SID_XLT0_RSS                40
149 #define ICE_SID_XLT_KEY_BUILDER_RSS     41
150 #define ICE_SID_XLT1_RSS                42
151 #define ICE_SID_XLT2_RSS                43
152 #define ICE_SID_PROFID_TCAM_RSS         44
153 #define ICE_SID_PROFID_REDIR_RSS        45
154 #define ICE_SID_FLD_VEC_RSS             46
155 #define ICE_SID_CDID_KEY_BUILDER_RSS    47
156 #define ICE_SID_CDID_REDIR_RSS          48
157
158 #define ICE_SID_RXPARSER_CAM            50
159 #define ICE_SID_RXPARSER_NOMATCH_CAM    51
160 #define ICE_SID_RXPARSER_IMEM           52
161 #define ICE_SID_RXPARSER_XLT0_BUILDER   53
162 #define ICE_SID_RXPARSER_NODE_PTYPE     54
163 #define ICE_SID_RXPARSER_MARKER_PTYPE   55
164 #define ICE_SID_RXPARSER_BOOST_TCAM     56
165 #define ICE_SID_RXPARSER_PROTO_GRP      57
166 #define ICE_SID_RXPARSER_METADATA_INIT  58
167 #define ICE_SID_RXPARSER_XLT0           59
168
169 #define ICE_SID_TXPARSER_CAM            60
170 #define ICE_SID_TXPARSER_NOMATCH_CAM    61
171 #define ICE_SID_TXPARSER_IMEM           62
172 #define ICE_SID_TXPARSER_XLT0_BUILDER   63
173 #define ICE_SID_TXPARSER_NODE_PTYPE     64
174 #define ICE_SID_TXPARSER_MARKER_PTYPE   65
175 #define ICE_SID_TXPARSER_BOOST_TCAM     66
176 #define ICE_SID_TXPARSER_PROTO_GRP      67
177 #define ICE_SID_TXPARSER_METADATA_INIT  68
178 #define ICE_SID_TXPARSER_XLT0           69
179
180 #define ICE_SID_RXPARSER_INIT_REDIR     70
181 #define ICE_SID_TXPARSER_INIT_REDIR     71
182 #define ICE_SID_RXPARSER_MARKER_GRP     72
183 #define ICE_SID_TXPARSER_MARKER_GRP     73
184 #define ICE_SID_RXPARSER_LAST_PROTO     74
185 #define ICE_SID_TXPARSER_LAST_PROTO     75
186 #define ICE_SID_RXPARSER_PG_SPILL       76
187 #define ICE_SID_TXPARSER_PG_SPILL       77
188 #define ICE_SID_RXPARSER_NOMATCH_SPILL  78
189 #define ICE_SID_TXPARSER_NOMATCH_SPILL  79
190
191 #define ICE_SID_XLT0_PE                 80
192 #define ICE_SID_XLT_KEY_BUILDER_PE      81
193 #define ICE_SID_XLT1_PE                 82
194 #define ICE_SID_XLT2_PE                 83
195 #define ICE_SID_PROFID_TCAM_PE          84
196 #define ICE_SID_PROFID_REDIR_PE         85
197 #define ICE_SID_FLD_VEC_PE              86
198 #define ICE_SID_CDID_KEY_BUILDER_PE     87
199 #define ICE_SID_CDID_REDIR_PE           88
200
201 /* Label Metadata section IDs */
202 #define ICE_SID_LBL_FIRST               0x80000010
203 #define ICE_SID_LBL_RXPARSER_IMEM       0x80000010
204 #define ICE_SID_LBL_TXPARSER_IMEM       0x80000011
205 #define ICE_SID_LBL_RESERVED_12         0x80000012
206 #define ICE_SID_LBL_RESERVED_13         0x80000013
207 #define ICE_SID_LBL_RXPARSER_MARKER     0x80000014
208 #define ICE_SID_LBL_TXPARSER_MARKER     0x80000015
209 #define ICE_SID_LBL_PTYPE               0x80000016
210 #define ICE_SID_LBL_PROTOCOL_ID         0x80000017
211 #define ICE_SID_LBL_RXPARSER_TMEM       0x80000018
212 #define ICE_SID_LBL_TXPARSER_TMEM       0x80000019
213 #define ICE_SID_LBL_RXPARSER_PG         0x8000001A
214 #define ICE_SID_LBL_TXPARSER_PG         0x8000001B
215 #define ICE_SID_LBL_RXPARSER_M_TCAM     0x8000001C
216 #define ICE_SID_LBL_TXPARSER_M_TCAM     0x8000001D
217 #define ICE_SID_LBL_SW_PROFID_TCAM      0x8000001E
218 #define ICE_SID_LBL_ACL_PROFID_TCAM     0x8000001F
219 #define ICE_SID_LBL_PE_PROFID_TCAM      0x80000020
220 #define ICE_SID_LBL_RSS_PROFID_TCAM     0x80000021
221 #define ICE_SID_LBL_FD_PROFID_TCAM      0x80000022
222 #define ICE_SID_LBL_FLAG                0x80000023
223 #define ICE_SID_LBL_REG                 0x80000024
224 #define ICE_SID_LBL_SW_PTG              0x80000025
225 #define ICE_SID_LBL_ACL_PTG             0x80000026
226 #define ICE_SID_LBL_PE_PTG              0x80000027
227 #define ICE_SID_LBL_RSS_PTG             0x80000028
228 #define ICE_SID_LBL_FD_PTG              0x80000029
229 #define ICE_SID_LBL_SW_VSIG             0x8000002A
230 #define ICE_SID_LBL_ACL_VSIG            0x8000002B
231 #define ICE_SID_LBL_PE_VSIG             0x8000002C
232 #define ICE_SID_LBL_RSS_VSIG            0x8000002D
233 #define ICE_SID_LBL_FD_VSIG             0x8000002E
234 #define ICE_SID_LBL_PTYPE_META          0x8000002F
235 #define ICE_SID_LBL_SW_PROFID           0x80000030
236 #define ICE_SID_LBL_ACL_PROFID          0x80000031
237 #define ICE_SID_LBL_PE_PROFID           0x80000032
238 #define ICE_SID_LBL_RSS_PROFID          0x80000033
239 #define ICE_SID_LBL_FD_PROFID           0x80000034
240 #define ICE_SID_LBL_RXPARSER_MARKER_GRP 0x80000035
241 #define ICE_SID_LBL_TXPARSER_MARKER_GRP 0x80000036
242 #define ICE_SID_LBL_RXPARSER_PROTO      0x80000037
243 #define ICE_SID_LBL_TXPARSER_PROTO      0x80000038
244 /* The following define MUST be updated to reflect the last label section ID */
245 #define ICE_SID_LBL_LAST                0x80000038
246
247 enum ice_block {
248         ICE_BLK_SW = 0,
249         ICE_BLK_ACL,
250         ICE_BLK_FD,
251         ICE_BLK_RSS,
252         ICE_BLK_PE,
253         ICE_BLK_COUNT
254 };
255
256 enum ice_sect {
257         ICE_XLT0 = 0,
258         ICE_XLT_KB,
259         ICE_XLT1,
260         ICE_XLT2,
261         ICE_PROF_TCAM,
262         ICE_PROF_REDIR,
263         ICE_VEC_TBL,
264         ICE_CDID_KB,
265         ICE_CDID_REDIR,
266         ICE_SECT_COUNT
267 };
268
269 /* Packet Type (PTYPE) values */
270 #define ICE_PTYPE_MAC_PAY                       1
271 #define ICE_MAC_PTP                             2
272 #define ICE_MAC_LLDP                            6
273 #define ICE_MAC_ARP                             11
274 #define ICE_PTYPE_IPV4FRAG_PAY                  22
275 #define ICE_PTYPE_IPV4_PAY                      23
276 #define ICE_PTYPE_IPV4_UDP_PAY                  24
277 #define ICE_PTYPE_IPV4_TCP_PAY                  26
278 #define ICE_PTYPE_IPV4_SCTP_PAY                 27
279 #define ICE_PTYPE_IPV4_ICMP_PAY                 28
280 #define ICE_MAC_IPV4_IPV4_FRAG                  29
281 #define ICE_MAC_IPV4_IPV4_PAY                   30
282 #define ICE_MAC_IPV4_IPV4_UDP_PAY               31
283 #define ICE_MAC_IPV4_IPV4_TCP                   33
284 #define ICE_MAC_IPV4_IPV4_SCTP                  34
285 #define ICE_MAC_IPV4_IPV4_ICMP                  35
286 #define ICE_MAC_IPV4_IPV6_FRAG                  36
287 #define ICE_MAC_IPV4_IPV6_PAY                   37
288 #define ICE_MAC_IPV4_IPV6_UDP_PAY               38
289 #define ICE_MAC_IPV4_IPV6_TCP                   40
290 #define ICE_MAC_IPV4_IPV6_SCTP                  41
291 #define ICE_MAC_IPV4_IPV6_ICMPV6                42
292 #define ICE_MAC_IPV4_TUN_PAY                    43
293 #define ICE_MAC_IPV4_TUN_IPV4_FRAG              44
294 #define ICE_MAC_IPV4_TUN_IPV4_PAY               45
295 #define ICE_MAC_IPV4_TUN_IPV4_UDP_PAY           46
296 #define ICE_MAC_IPV4_TUN_IPV4_TCP               48
297 #define ICE_MAC_IPV4_TUN_IPV4_SCTP              49
298 #define ICE_MAC_IPV4_TUN_IPV4_ICMP              50
299 #define ICE_MAC_IPV4_TUN_IPV6_FRAG              51
300 #define ICE_MAC_IPV4_TUN_IPV6_PAY               52
301 #define ICE_MAC_IPV4_TUN_IPV6_UDP_PAY           53
302 #define ICE_MAC_IPV4_TUN_IPV6_TCP               55
303 #define ICE_MAC_IPV4_TUN_IPV6_SCTP              56
304 #define ICE_MAC_IPV4_TUN_IPV6_ICMPV6            57
305 #define ICE_MAC_IPV4_TUN_ICE_MAC_PAY            58
306 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_FRAG      59
307 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_PAY       60
308 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_UDP_PAY   61
309 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_TCP       63
310 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_SCTP      64
311 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_ICMP      65
312 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_FRAG      66
313 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_PAY       67
314 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_UDP_PAY   68
315 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_TCP       70
316 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_SCTP      71
317 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_ICMPV6    72
318 #define ICE_PTYPE_IPV6FRAG_PAY                  88
319 #define ICE_PTYPE_IPV6_PAY                      89
320 #define ICE_PTYPE_IPV6_UDP_PAY                  90
321 #define ICE_PTYPE_IPV6_TCP_PAY                  92
322 #define ICE_PTYPE_IPV6_SCTP_PAY                 93
323 #define ICE_PTYPE_IPV6_ICMP_PAY                 94
324 #define ICE_MAC_IPV6_IPV4_FRAG                  95
325 #define ICE_MAC_IPV6_IPV4_PAY                   96
326 #define ICE_MAC_IPV6_IPV4_UDP_PAY               97
327 #define ICE_MAC_IPV6_IPV4_TCP                   99
328 #define ICE_MAC_IPV6_IPV4_SCTP                  100
329 #define ICE_MAC_IPV6_IPV4_ICMP                  101
330 #define ICE_MAC_IPV6_IPV6_FRAG                  102
331 #define ICE_MAC_IPV6_IPV6_PAY                   103
332 #define ICE_MAC_IPV6_IPV6_UDP_PAY               104
333 #define ICE_MAC_IPV6_IPV6_TCP                   106
334 #define ICE_MAC_IPV6_IPV6_SCTP                  107
335 #define ICE_MAC_IPV6_IPV6_ICMPV6                108
336 #define ICE_MAC_IPV6_TUN_PAY                    109
337 #define ICE_MAC_IPV6_TUN_IPV4_FRAG              110
338 #define ICE_MAC_IPV6_TUN_IPV4_PAY               111
339 #define ICE_MAC_IPV6_TUN_IPV4_UDP_PAY           112
340 #define ICE_MAC_IPV6_TUN_IPV4_TCP               114
341 #define ICE_MAC_IPV6_TUN_IPV4_SCTP              115
342 #define ICE_MAC_IPV6_TUN_IPV4_ICMP              116
343 #define ICE_MAC_IPV6_TUN_IPV6_FRAG              117
344 #define ICE_MAC_IPV6_TUN_IPV6_PAY               118
345 #define ICE_MAC_IPV6_TUN_IPV6_UDP_PAY           119
346 #define ICE_MAC_IPV6_TUN_IPV6_TCP               121
347 #define ICE_MAC_IPV6_TUN_IPV6_SCTP              122
348 #define ICE_MAC_IPV6_TUN_IPV6_ICMPV6            123
349 #define ICE_MAC_IPV6_TUN_MAC_PAY                124
350 #define ICE_MAC_IPV6_TUN_MAC_IPV4_FRAG          125
351 #define ICE_MAC_IPV6_TUN_MAC_IPV4_PAY           126
352 #define ICE_MAC_IPV6_TUN_MAC_IPV4_UDP_PAY       127
353 #define ICE_MAC_IPV6_TUN_MAC_IPV4_TCP           129
354 #define ICE_MAC_IPV6_TUN_MAC_IPV4_SCTP          130
355 #define ICE_MAC_IPV6_TUN_MAC_IPV4_ICMP          131
356 #define ICE_MAC_IPV6_TUN_MAC_IPV6_FRAG          132
357 #define ICE_MAC_IPV6_TUN_MAC_IPV6_PAY           133
358 #define ICE_MAC_IPV6_TUN_MAC_IPV6_UDP_PAY       134
359 #define ICE_MAC_IPV6_TUN_MAC_IPV6_TCP           136
360 #define ICE_MAC_IPV6_TUN_MAC_IPV6_SCTP          137
361 #define ICE_MAC_IPV6_TUN_MAC_IPV6_ICMPV6        138
362 #define ICE_MAC_IPV4_ESP                        160
363 #define ICE_MAC_IPV6_ESP                        161
364 #define ICE_MAC_IPV4_AH                         162
365 #define ICE_MAC_IPV6_AH                         163
366 #define ICE_MAC_IPV4_NAT_T_ESP                  164
367 #define ICE_MAC_IPV6_NAT_T_ESP                  165
368 #define ICE_MAC_IPV4_NAT_T_IKE                  166
369 #define ICE_MAC_IPV6_NAT_T_IKE                  167
370 #define ICE_MAC_IPV4_NAT_T_KEEP                 168
371 #define ICE_MAC_IPV6_NAT_T_KEEP                 169
372 #define ICE_MAC_CONTROL                         278
373 #define ICE_MAC_PPPOD_PAY                       300
374 #define ICE_MAC_PPPOE_PAY                       301
375 #define ICE_MAC_PPPOE_IPV4_FRAG                 302
376 #define ICE_MAC_PPPOE_IPV4_PAY                  303
377 #define ICE_MAC_PPPOE_IPV4_UDP_PAY              304
378 #define ICE_MAC_PPPOE_IPV4_TCP                  305
379 #define ICE_MAC_PPPOE_IPV4_SCTP                 306
380 #define ICE_MAC_PPPOE_IPV4_ICMP                 307
381 #define ICE_MAC_PPPOE_IPV6_FRAG                 308
382 #define ICE_MAC_PPPOE_IPV6_PAY                  309
383 #define ICE_MAC_PPPOE_IPV6_UDP_PAY              310
384 #define ICE_MAC_PPPOE_IPV6_TCP                  311
385 #define ICE_MAC_PPPOE_IPV6_SCTP                 312
386 #define ICE_MAC_PPPOE_IPV6_ICMPV6               313
387 #define ICE_MAC_IPV4_GTPC_TEID                  325
388 #define ICE_MAC_IPV6_GTPC_TEID                  326
389 #define ICE_MAC_IPV4_GTPC                       327
390 #define ICE_MAC_IPV6_GTPC                       328
391 #define ICE_MAC_IPV4_GTPU                       329
392 #define ICE_MAC_IPV6_GTPU                       330
393 #define ICE_MAC_IPV4_GTPU_IPV4_FRAG             331
394 #define ICE_MAC_IPV4_GTPU_IPV4_PAY              332
395 #define ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY          333
396 #define ICE_MAC_IPV4_GTPU_IPV4_TCP              334
397 #define ICE_MAC_IPV4_GTPU_IPV4_ICMP             335
398 #define ICE_MAC_IPV6_GTPU_IPV4_FRAG             336
399 #define ICE_MAC_IPV6_GTPU_IPV4_PAY              337
400 #define ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY          338
401 #define ICE_MAC_IPV6_GTPU_IPV4_TCP              339
402 #define ICE_MAC_IPV6_GTPU_IPV4_ICMP             340
403 #define ICE_MAC_IPV4_GTPU_IPV6_FRAG             341
404 #define ICE_MAC_IPV4_GTPU_IPV6_PAY              342
405 #define ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY          343
406 #define ICE_MAC_IPV4_GTPU_IPV6_TCP              344
407 #define ICE_MAC_IPV4_GTPU_IPV6_ICMPV6           345
408 #define ICE_MAC_IPV6_GTPU_IPV6_FRAG             346
409 #define ICE_MAC_IPV6_GTPU_IPV6_PAY              347
410 #define ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY          348
411 #define ICE_MAC_IPV6_GTPU_IPV6_TCP              349
412 #define ICE_MAC_IPV6_GTPU_IPV6_ICMPV6           350
413 #define ICE_MAC_IPV4_PFCP_NODE                  351
414 #define ICE_MAC_IPV4_PFCP_SESSION               352
415 #define ICE_MAC_IPV6_PFCP_NODE                  353
416 #define ICE_MAC_IPV6_PFCP_SESSION               354
417 #define ICE_MAC_IPV4_L2TPV3                     360
418 #define ICE_MAC_IPV6_L2TPV3                     361
419 #define ICE_MAC_IPV4_L2TPV2_CONTROL             392
420 #define ICE_MAC_IPV6_L2TPV2_CONTROL             393
421 #define ICE_MAC_IPV4_L2TPV2                     394
422 #define ICE_MAC_IPV6_L2TPV2                     395
423 #define ICE_MAC_IPV4_PPPOL2TPV2                 396
424 #define ICE_MAC_IPV6_PPPOL2TPV2                 397
425 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_FRAG       398
426 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_PAY        399
427 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_UDP_PAY    400
428 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_TCP        401
429 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_SCTP       402
430 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_ICMP       403
431 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_FRAG       404
432 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_PAY        405
433 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_UDP_PAY    406
434 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_TCP        407
435 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_SCTP       408
436 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_ICMPV6     409
437 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_FRAG       410
438 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_PAY        411
439 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_UDP_PAY    412
440 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_TCP        413
441 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_SCTP       414
442 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_ICMP       415
443 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_FRAG       416
444 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_PAY        417
445 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_UDP_PAY    418
446 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_TCP        419
447 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_SCTP       420
448 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_ICMPV6     421
449 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG        450
450 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY         451
451 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY     452
452 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP         453
453 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_SCTP        454
454 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP        455
455 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG        456
456 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY         457
457 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY     458
458 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP         459
459 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_SCTP        460
460 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6      461
461 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG        462
462 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY         463
463 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY     464
464 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP         465
465 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_SCTP        466
466 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP        467
467 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG        468
468 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY         469
469 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY     470
470 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP         471
471 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_SCTP        472
472 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6      473
473 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG        474
474 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY         475
475 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY     476
476 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP         477
477 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_SCTP        478
478 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP        479
479 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG        480
480 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY         481
481 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY     482
482 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP         483
483 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_SCTP        484
484 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6      485
485 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG        486
486 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY         487
487 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY     488
488 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP         489
489 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_SCTP        490
490 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP        491
491 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG        492
492 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY         493
493 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY     494
494 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP         495
495 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_SCTP        496
496 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6      497
497
498 /* Attributes that can modify PTYPE definitions.
499  *
500  * These values will represent special attributes for PTYPES, which will
501  * resolve into metadata packet flags definitions that can be used in the TCAM
502  * for identifying a PTYPE with specific characteristics.
503  */
504 enum ice_ptype_attrib_type {
505         /* GTP PTYPES */
506         ICE_PTYPE_ATTR_GTP_PDU_EH,
507         ICE_PTYPE_ATTR_GTP_SESSION,
508         ICE_PTYPE_ATTR_GTP_DOWNLINK,
509         ICE_PTYPE_ATTR_GTP_UPLINK,
510 };
511
512 struct ice_ptype_attrib_info {
513         u16 flags;
514         u16 mask;
515 };
516
517 /* TCAM flag definitions */
518 #define ICE_GTP_PDU                     BIT(14)
519 #define ICE_GTP_PDU_LINK                BIT(13)
520
521 /* GTP attributes */
522 #define ICE_GTP_PDU_FLAG_MASK           (ICE_GTP_PDU)
523 #define ICE_GTP_PDU_EH                  ICE_GTP_PDU
524
525 #define ICE_GTP_FLAGS_MASK              (ICE_GTP_PDU | ICE_GTP_PDU_LINK)
526 #define ICE_GTP_SESSION                 0
527 #define ICE_GTP_DOWNLINK                ICE_GTP_PDU
528 #define ICE_GTP_UPLINK                  (ICE_GTP_PDU | ICE_GTP_PDU_LINK)
529
530 struct ice_ptype_attributes {
531         u16 ptype;
532         enum ice_ptype_attrib_type attrib;
533 };
534
535 struct ice_meta_sect {
536         struct ice_pkg_ver ver;
537 #define ICE_META_SECT_NAME_SIZE 28
538         char name[ICE_META_SECT_NAME_SIZE];
539         __le32 track_id;
540 };
541
542 /* Packet Type Groups (PTG) - Inner Most fields (IM) */
543 #define ICE_PTG_IM_IPV4_TCP             16
544 #define ICE_PTG_IM_IPV4_UDP             17
545 #define ICE_PTG_IM_IPV4_SCTP            18
546 #define ICE_PTG_IM_IPV4_PAY             20
547 #define ICE_PTG_IM_IPV4_OTHER           21
548 #define ICE_PTG_IM_IPV6_TCP             32
549 #define ICE_PTG_IM_IPV6_UDP             33
550 #define ICE_PTG_IM_IPV6_SCTP            34
551 #define ICE_PTG_IM_IPV6_OTHER           37
552 #define ICE_PTG_IM_L2_OTHER             67
553
554 struct ice_flex_fields {
555         union {
556                 struct {
557                         u8 src_ip;
558                         u8 dst_ip;
559                         u8 flow_label;  /* valid for IPv6 only */
560                 } ip_fields;
561
562                 struct {
563                         u8 src_prt;
564                         u8 dst_prt;
565                 } tcp_udp_fields;
566
567                 struct {
568                         u8 src_ip;
569                         u8 dst_ip;
570                         u8 src_prt;
571                         u8 dst_prt;
572                 } ip_tcp_udp_fields;
573
574                 struct {
575                         u8 src_prt;
576                         u8 dst_prt;
577                         u8 flow_label;  /* valid for IPv6 only */
578                         u8 spi;
579                 } ip_esp_fields;
580
581                 struct {
582                         u32 offset;
583                         u32 length;
584                 } off_len;
585         } fields;
586 };
587
588 #define ICE_XLT1_DFLT_GRP       0
589 #define ICE_XLT1_TABLE_SIZE     1024
590
591 /* package labels */
592 struct ice_label {
593         __le16 value;
594 #define ICE_PKG_LABEL_SIZE      64
595         char name[ICE_PKG_LABEL_SIZE];
596 };
597
598 struct ice_label_section {
599         __le16 count;
600         struct ice_label label[STRUCT_HACK_VAR_LEN];
601 };
602
603 #define ICE_MAX_LABELS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \
604         ice_struct_size((struct ice_label_section *)0, label, 1) - \
605         sizeof(struct ice_label), sizeof(struct ice_label))
606
607 struct ice_sw_fv_section {
608         __le16 count;
609         __le16 base_offset;
610         struct ice_fv fv[STRUCT_HACK_VAR_LEN];
611 };
612
613 struct ice_sw_fv_list_entry {
614         struct LIST_ENTRY_TYPE list_entry;
615         u32 profile_id;
616         struct ice_fv *fv_ptr;
617 };
618
619 #pragma pack(1)
620 /* The BOOST TCAM stores the match packet header in reverse order, meaning
621  * the fields are reversed; in addition, this means that the normally big endian
622  * fields of the packet are now little endian.
623  */
624 struct ice_boost_key_value {
625 #define ICE_BOOST_REMAINING_HV_KEY      15
626         u8 remaining_hv_key[ICE_BOOST_REMAINING_HV_KEY];
627         __le16 hv_dst_port_key;
628         __le16 hv_src_port_key;
629         u8 tcam_search_key;
630 };
631 #pragma pack()
632
633 struct ice_boost_key {
634         struct ice_boost_key_value key;
635         struct ice_boost_key_value key2;
636 };
637
638 /* package Boost TCAM entry */
639 struct ice_boost_tcam_entry {
640         __le16 addr;
641         __le16 reserved;
642         /* break up the 40 bytes of key into different fields */
643         struct ice_boost_key key;
644         u8 boost_hit_index_group;
645         /* The following contains bitfields which are not on byte boundaries.
646          * These fields are currently unused by driver software.
647          */
648 #define ICE_BOOST_BIT_FIELDS            43
649         u8 bit_fields[ICE_BOOST_BIT_FIELDS];
650 };
651
652 struct ice_boost_tcam_section {
653         __le16 count;
654         __le16 reserved;
655         struct ice_boost_tcam_entry tcam[STRUCT_HACK_VAR_LEN];
656 };
657
658 #define ICE_MAX_BST_TCAMS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \
659         ice_struct_size((struct ice_boost_tcam_section *)0, tcam, 1) - \
660         sizeof(struct ice_boost_tcam_entry), \
661         sizeof(struct ice_boost_tcam_entry))
662
663 /* package Marker PType TCAM entry */
664 struct ice_marker_ptype_tcam_entry {
665 #define ICE_MARKER_PTYPE_TCAM_ADDR_MAX  1024
666         __le16 addr;
667         __le16 ptype;
668         u8 keys[20];
669 };
670
671 struct ice_marker_ptype_tcam_section {
672         __le16 count;
673         __le16 reserved;
674         struct ice_marker_ptype_tcam_entry tcam[STRUCT_HACK_VAR_LEN];
675 };
676
677 #define ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \
678         ice_struct_size((struct ice_marker_ptype_tcam_section *)0, tcam, 1) - \
679         sizeof(struct ice_marker_ptype_tcam_entry), \
680         sizeof(struct ice_marker_ptype_tcam_entry))
681
682 struct ice_xlt1_section {
683         __le16 count;
684         __le16 offset;
685         u8 value[STRUCT_HACK_VAR_LEN];
686 };
687
688 struct ice_xlt2_section {
689         __le16 count;
690         __le16 offset;
691         __le16 value[STRUCT_HACK_VAR_LEN];
692 };
693
694 struct ice_prof_redir_section {
695         __le16 count;
696         __le16 offset;
697         u8 redir_value[STRUCT_HACK_VAR_LEN];
698 };
699
700 /* package buffer building */
701
702 struct ice_buf_build {
703         struct ice_buf buf;
704         u16 reserved_section_table_entries;
705 };
706
707 struct ice_pkg_enum {
708         struct ice_buf_table *buf_table;
709         u32 buf_idx;
710
711         u32 type;
712         struct ice_buf_hdr *buf;
713         u32 sect_idx;
714         void *sect;
715         u32 sect_type;
716
717         u32 entry_idx;
718         void *(*handler)(u32 sect_type, void *section, u32 index, u32 *offset);
719 };
720
721 /* Tunnel enabling */
722
723 enum ice_tunnel_type {
724         TNL_VXLAN = 0,
725         TNL_GENEVE,
726         TNL_ECPRI,
727         TNL_GTP,
728         TNL_LAST = 0xFF,
729         TNL_ALL = 0xFF,
730 };
731
732 struct ice_tunnel_type_scan {
733         enum ice_tunnel_type type;
734         const char *label_prefix;
735 };
736
737 struct ice_tunnel_entry {
738         enum ice_tunnel_type type;
739         u16 boost_addr;
740         u16 port;
741         u16 ref;
742         struct ice_boost_tcam_entry *boost_entry;
743         u8 valid;
744         u8 in_use;
745         u8 marked;
746 };
747
748 #define ICE_TUNNEL_MAX_ENTRIES  16
749
750 struct ice_tunnel_table {
751         struct ice_tunnel_entry tbl[ICE_TUNNEL_MAX_ENTRIES];
752         u16 count;
753 };
754
755 struct ice_dvm_entry {
756         u16 boost_addr;
757         u16 enable;
758         struct ice_boost_tcam_entry *boost_entry;
759 };
760
761 #define ICE_DVM_MAX_ENTRIES     48
762
763 struct ice_dvm_table {
764         struct ice_dvm_entry tbl[ICE_DVM_MAX_ENTRIES];
765         u16 count;
766 };
767
768 struct ice_pkg_es {
769         __le16 count;
770         __le16 offset;
771         struct ice_fv_word es[STRUCT_HACK_VAR_LEN];
772 };
773
774 struct ice_es {
775         u32 sid;
776         u16 count;
777         u16 fvw;
778         u16 *ref_count;
779         u32 *mask_ena;
780         struct LIST_HEAD_TYPE prof_map;
781         struct ice_fv_word *t;
782         struct ice_lock prof_map_lock;  /* protect access to profiles list */
783         u8 *written;
784         u8 reverse; /* set to true to reverse FV order */
785 };
786
787 /* PTYPE Group management */
788
789 /* Note: XLT1 table takes 13-bit as input, and results in an 8-bit packet type
790  * group (PTG) ID as output.
791  *
792  * Note: PTG 0 is the default packet type group and it is assumed that all PTYPE
793  * are a part of this group until moved to a new PTG.
794  */
795 #define ICE_DEFAULT_PTG 0
796
797 struct ice_ptg_entry {
798         struct ice_ptg_ptype *first_ptype;
799         u8 in_use;
800 };
801
802 struct ice_ptg_ptype {
803         struct ice_ptg_ptype *next_ptype;
804         u8 ptg;
805 };
806
807 #define ICE_MAX_TCAM_PER_PROFILE        32
808 #define ICE_MAX_PTG_PER_PROFILE         32
809
810 struct ice_prof_map {
811         struct LIST_ENTRY_TYPE list;
812         u64 profile_cookie;
813         u64 context;
814         u8 prof_id;
815         u8 ptg_cnt;
816         u8 ptg[ICE_MAX_PTG_PER_PROFILE];
817         struct ice_ptype_attrib_info attr[ICE_MAX_PTG_PER_PROFILE];
818 };
819
820 #define ICE_INVALID_TCAM        0xFFFF
821
822 struct ice_tcam_inf {
823         u16 tcam_idx;
824         struct ice_ptype_attrib_info attr;
825         u8 ptg;
826         u8 prof_id;
827         u8 in_use;
828 };
829
830 struct ice_vsig_prof {
831         struct LIST_ENTRY_TYPE list;
832         u64 profile_cookie;
833         u8 prof_id;
834         u8 tcam_count;
835         struct ice_tcam_inf tcam[ICE_MAX_TCAM_PER_PROFILE];
836 };
837
838 struct ice_vsig_entry {
839         struct LIST_HEAD_TYPE prop_lst;
840         struct ice_vsig_vsi *first_vsi;
841         u8 in_use;
842 };
843
844 struct ice_vsig_vsi {
845         struct ice_vsig_vsi *next_vsi;
846         u32 prop_mask;
847         u16 changed;
848         u16 vsig;
849 };
850
851 #define ICE_XLT1_CNT    1024
852 #define ICE_MAX_PTGS    256
853
854 /* XLT1 Table */
855 struct ice_xlt1 {
856         struct ice_ptg_entry *ptg_tbl;
857         struct ice_ptg_ptype *ptypes;
858         u8 *t;
859         u32 sid;
860         u16 count;
861 };
862
863 #define ICE_XLT2_CNT    768
864 #define ICE_MAX_VSIGS   768
865
866 /* VSIG bit layout:
867  * [0:12]: incremental VSIG index 1 to ICE_MAX_VSIGS
868  * [13:15]: PF number of device
869  */
870 #define ICE_VSIG_IDX_M  (0x1FFF)
871 #define ICE_PF_NUM_S    13
872 #define ICE_PF_NUM_M    (0x07 << ICE_PF_NUM_S)
873 #define ICE_VSIG_VALUE(vsig, pf_id) \
874         ((u16)((((u16)(vsig)) & ICE_VSIG_IDX_M) | \
875                (((u16)(pf_id) << ICE_PF_NUM_S) & ICE_PF_NUM_M)))
876 #define ICE_DEFAULT_VSIG        0
877
878 /* XLT2 Table */
879 struct ice_xlt2 {
880         struct ice_vsig_entry *vsig_tbl;
881         struct ice_vsig_vsi *vsis;
882         u16 *t;
883         u32 sid;
884         u16 count;
885 };
886
887 /* Extraction sequence - list of match fields:
888  * protocol ID, offset, profile length
889  */
890 union ice_match_fld {
891         struct {
892                 u8 prot_id;
893                 u8 offset;
894                 u8 length;
895                 u8 reserved; /* must be zero */
896         } fld;
897         u32 val;
898 };
899
900 #define ICE_MATCH_LIST_SZ       20
901 #pragma pack(1)
902 struct ice_match {
903         u8 count;
904         union ice_match_fld list[ICE_MATCH_LIST_SZ];
905 };
906
907 /* Profile ID Management */
908 struct ice_prof_id_key {
909         __le16 flags;
910         u8 xlt1;
911         __le16 xlt2_cdid;
912 };
913
914 /* Keys are made up of two values, each one-half the size of the key.
915  * For TCAM, the entire key is 80 bits wide (or 2, 40-bit wide values)
916  */
917 #define ICE_TCAM_KEY_VAL_SZ     5
918 #define ICE_TCAM_KEY_SZ         (2 * ICE_TCAM_KEY_VAL_SZ)
919
920 struct ice_prof_tcam_entry {
921         __le16 addr;
922         u8 key[ICE_TCAM_KEY_SZ];
923         u8 prof_id;
924 };
925
926 #pragma pack()
927
928 struct ice_prof_id_section {
929         __le16 count;
930         struct ice_prof_tcam_entry entry[STRUCT_HACK_VAR_LEN];
931 };
932
933 struct ice_prof_tcam {
934         u32 sid;
935         u16 count;
936         u16 max_prof_id;
937         struct ice_prof_tcam_entry *t;
938         u8 cdid_bits; /* # CDID bits to use in key, 0, 2, 4, or 8 */
939 };
940
941 struct ice_prof_redir {
942         u8 *t;
943         u32 sid;
944         u16 count;
945 };
946
947 struct ice_mask {
948         u16 mask;       /* 16-bit mask */
949         u16 idx;        /* index */
950         u16 ref;        /* reference count */
951         u8 in_use;      /* non-zero if used */
952 };
953
954 struct ice_masks {
955         struct ice_lock lock;  /* lock to protect this structure */
956         u16 first;      /* first mask owned by the PF */
957         u16 count;      /* number of masks owned by the PF */
958 #define ICE_PROF_MASK_COUNT 32
959         struct ice_mask masks[ICE_PROF_MASK_COUNT];
960 };
961
962 /* Tables per block */
963 struct ice_blk_info {
964         struct ice_xlt1 xlt1;
965         struct ice_xlt2 xlt2;
966         struct ice_prof_tcam prof;
967         struct ice_prof_redir prof_redir;
968         struct ice_es es;
969         struct ice_masks masks;
970         u8 overwrite; /* set to true to allow overwrite of table entries */
971         u8 is_list_init;
972 };
973
974 enum ice_chg_type {
975         ICE_TCAM_NONE = 0,
976         ICE_PTG_ES_ADD,
977         ICE_TCAM_ADD,
978         ICE_VSIG_ADD,
979         ICE_VSIG_REM,
980         ICE_VSI_MOVE,
981 };
982
983 struct ice_chs_chg {
984         struct LIST_ENTRY_TYPE list_entry;
985         enum ice_chg_type type;
986
987         u8 add_ptg;
988         u8 add_vsig;
989         u8 add_tcam_idx;
990         u8 add_prof;
991         u16 ptype;
992         u8 ptg;
993         u8 prof_id;
994         u16 vsi;
995         u16 vsig;
996         u16 orig_vsig;
997         u16 tcam_idx;
998         struct ice_ptype_attrib_info attr;
999 };
1000
1001 #define ICE_FLOW_PTYPE_MAX              ICE_XLT1_CNT
1002
1003 enum ice_prof_type {
1004         ICE_PROF_NON_TUN = 0x1,
1005         ICE_PROF_TUN_UDP = 0x2,
1006         ICE_PROF_TUN_GRE = 0x4,
1007         ICE_PROF_TUN_PPPOE = 0x8,
1008         ICE_PROF_TUN_ALL = 0xE,
1009         ICE_PROF_ALL = 0xFF,
1010 };
1011
1012 /* Number of bits/bytes contained in meta init entry. Note, this should be a
1013  * multiple of 32 bits.
1014  */
1015 #define ICE_META_INIT_BITS      192
1016 #define ICE_META_INIT_DW_CNT    (ICE_META_INIT_BITS / (sizeof(__le32) * \
1017                                  BITS_PER_BYTE))
1018
1019 /* The meta init Flag field starts at this bit */
1020 #define ICE_META_FLAGS_ST               123
1021
1022 /* The entry and bit to check for Double VLAN Mode (DVM) support */
1023 #define ICE_META_VLAN_MODE_ENTRY        0
1024 #define ICE_META_FLAG_VLAN_MODE         60
1025 #define ICE_META_VLAN_MODE_BIT          (ICE_META_FLAGS_ST + \
1026                                          ICE_META_FLAG_VLAN_MODE)
1027
1028 struct ice_meta_init_entry {
1029         __le32 bm[ICE_META_INIT_DW_CNT];
1030 };
1031
1032 struct ice_meta_init_section {
1033         __le16 count;
1034         __le16 offset;
1035         struct ice_meta_init_entry entry[1];
1036 };
1037 #endif /* _ICE_FLEX_TYPE_H_ */