1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2001-2021 Intel Corporation
5 #ifndef _ICE_FLEX_TYPE_H_
6 #define _ICE_FLEX_TYPE_H_
8 #define ICE_FV_OFFSET_INVAL 0x1FF
11 /* Extraction Sequence (Field Vector) Table */
14 u16 off; /* Offset within the protocol header */
19 #define ICE_MAX_NUM_PROFILES 256
21 #define ICE_MAX_FV_WORDS 48
23 struct ice_fv_word ew[ICE_MAX_FV_WORDS];
26 /* Package and segment headers and tables */
28 struct ice_pkg_ver pkg_format_ver;
30 __le32 seg_offset[STRUCT_HACK_VAR_LEN];
34 struct ice_generic_seg_hdr {
35 #define SEGMENT_TYPE_METADATA 0x00000001
36 #define SEGMENT_TYPE_ICE_E810 0x00000010
38 struct ice_pkg_ver seg_format_ver;
40 char seg_id[ICE_PKG_NAME_SIZE];
43 /* ice specific segment */
53 struct ice_device_id_entry {
54 union ice_device_id device;
55 union ice_device_id sub_device;
59 struct ice_generic_seg_hdr hdr;
60 __le32 device_table_count;
61 struct ice_device_id_entry device_table[STRUCT_HACK_VAR_LEN];
64 struct ice_nvm_table {
66 __le32 vers[STRUCT_HACK_VAR_LEN];
70 #define ICE_PKG_BUF_SIZE 4096
71 u8 buf[ICE_PKG_BUF_SIZE];
74 struct ice_buf_table {
76 struct ice_buf buf_array[STRUCT_HACK_VAR_LEN];
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;
84 char pkg_name[ICE_PKG_NAME_SIZE];
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
92 /* section information */
93 struct ice_section_entry {
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
104 #define ICE_METADATA_BUF 0x80000000
107 __le16 section_count;
109 struct ice_section_entry section_entry[STRUCT_HACK_VAR_LEN];
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)) /\
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
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
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
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
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
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
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
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
201 #define ICE_SID_RXPARSER_FLAG_REDIR 97
203 /* Label Metadata section IDs */
204 #define ICE_SID_LBL_FIRST 0x80000010
205 #define ICE_SID_LBL_RXPARSER_IMEM 0x80000010
206 #define ICE_SID_LBL_TXPARSER_IMEM 0x80000011
207 #define ICE_SID_LBL_RESERVED_12 0x80000012
208 #define ICE_SID_LBL_RESERVED_13 0x80000013
209 #define ICE_SID_LBL_RXPARSER_MARKER 0x80000014
210 #define ICE_SID_LBL_TXPARSER_MARKER 0x80000015
211 #define ICE_SID_LBL_PTYPE 0x80000016
212 #define ICE_SID_LBL_PROTOCOL_ID 0x80000017
213 #define ICE_SID_LBL_RXPARSER_TMEM 0x80000018
214 #define ICE_SID_LBL_TXPARSER_TMEM 0x80000019
215 #define ICE_SID_LBL_RXPARSER_PG 0x8000001A
216 #define ICE_SID_LBL_TXPARSER_PG 0x8000001B
217 #define ICE_SID_LBL_RXPARSER_M_TCAM 0x8000001C
218 #define ICE_SID_LBL_TXPARSER_M_TCAM 0x8000001D
219 #define ICE_SID_LBL_SW_PROFID_TCAM 0x8000001E
220 #define ICE_SID_LBL_ACL_PROFID_TCAM 0x8000001F
221 #define ICE_SID_LBL_PE_PROFID_TCAM 0x80000020
222 #define ICE_SID_LBL_RSS_PROFID_TCAM 0x80000021
223 #define ICE_SID_LBL_FD_PROFID_TCAM 0x80000022
224 #define ICE_SID_LBL_FLAG 0x80000023
225 #define ICE_SID_LBL_REG 0x80000024
226 #define ICE_SID_LBL_SW_PTG 0x80000025
227 #define ICE_SID_LBL_ACL_PTG 0x80000026
228 #define ICE_SID_LBL_PE_PTG 0x80000027
229 #define ICE_SID_LBL_RSS_PTG 0x80000028
230 #define ICE_SID_LBL_FD_PTG 0x80000029
231 #define ICE_SID_LBL_SW_VSIG 0x8000002A
232 #define ICE_SID_LBL_ACL_VSIG 0x8000002B
233 #define ICE_SID_LBL_PE_VSIG 0x8000002C
234 #define ICE_SID_LBL_RSS_VSIG 0x8000002D
235 #define ICE_SID_LBL_FD_VSIG 0x8000002E
236 #define ICE_SID_LBL_PTYPE_META 0x8000002F
237 #define ICE_SID_LBL_SW_PROFID 0x80000030
238 #define ICE_SID_LBL_ACL_PROFID 0x80000031
239 #define ICE_SID_LBL_PE_PROFID 0x80000032
240 #define ICE_SID_LBL_RSS_PROFID 0x80000033
241 #define ICE_SID_LBL_FD_PROFID 0x80000034
242 #define ICE_SID_LBL_RXPARSER_MARKER_GRP 0x80000035
243 #define ICE_SID_LBL_TXPARSER_MARKER_GRP 0x80000036
244 #define ICE_SID_LBL_RXPARSER_PROTO 0x80000037
245 #define ICE_SID_LBL_TXPARSER_PROTO 0x80000038
246 /* The following define MUST be updated to reflect the last label section ID */
247 #define ICE_SID_LBL_LAST 0x80000038
271 /* Packet Type (PTYPE) values */
272 #define ICE_PTYPE_MAC_PAY 1
273 #define ICE_MAC_PTP 2
274 #define ICE_MAC_LLDP 6
275 #define ICE_MAC_ARP 11
276 #define ICE_PTYPE_IPV4FRAG_PAY 22
277 #define ICE_PTYPE_IPV4_PAY 23
278 #define ICE_PTYPE_IPV4_UDP_PAY 24
279 #define ICE_PTYPE_IPV4_TCP_PAY 26
280 #define ICE_PTYPE_IPV4_SCTP_PAY 27
281 #define ICE_PTYPE_IPV4_ICMP_PAY 28
282 #define ICE_MAC_IPV4_IPV4_FRAG 29
283 #define ICE_MAC_IPV4_IPV4_PAY 30
284 #define ICE_MAC_IPV4_IPV4_UDP_PAY 31
285 #define ICE_MAC_IPV4_IPV4_TCP 33
286 #define ICE_MAC_IPV4_IPV4_SCTP 34
287 #define ICE_MAC_IPV4_IPV4_ICMP 35
288 #define ICE_MAC_IPV4_IPV6_FRAG 36
289 #define ICE_MAC_IPV4_IPV6_PAY 37
290 #define ICE_MAC_IPV4_IPV6_UDP_PAY 38
291 #define ICE_MAC_IPV4_IPV6_TCP 40
292 #define ICE_MAC_IPV4_IPV6_SCTP 41
293 #define ICE_MAC_IPV4_IPV6_ICMPV6 42
294 #define ICE_MAC_IPV4_TUN_PAY 43
295 #define ICE_MAC_IPV4_TUN_IPV4_FRAG 44
296 #define ICE_MAC_IPV4_TUN_IPV4_PAY 45
297 #define ICE_MAC_IPV4_TUN_IPV4_UDP_PAY 46
298 #define ICE_MAC_IPV4_TUN_IPV4_TCP 48
299 #define ICE_MAC_IPV4_TUN_IPV4_SCTP 49
300 #define ICE_MAC_IPV4_TUN_IPV4_ICMP 50
301 #define ICE_MAC_IPV4_TUN_IPV6_FRAG 51
302 #define ICE_MAC_IPV4_TUN_IPV6_PAY 52
303 #define ICE_MAC_IPV4_TUN_IPV6_UDP_PAY 53
304 #define ICE_MAC_IPV4_TUN_IPV6_TCP 55
305 #define ICE_MAC_IPV4_TUN_IPV6_SCTP 56
306 #define ICE_MAC_IPV4_TUN_IPV6_ICMPV6 57
307 #define ICE_MAC_IPV4_TUN_ICE_MAC_PAY 58
308 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_FRAG 59
309 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_PAY 60
310 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_UDP_PAY 61
311 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_TCP 63
312 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_SCTP 64
313 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_ICMP 65
314 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_FRAG 66
315 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_PAY 67
316 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_UDP_PAY 68
317 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_TCP 70
318 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_SCTP 71
319 #define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_ICMPV6 72
320 #define ICE_PTYPE_IPV6FRAG_PAY 88
321 #define ICE_PTYPE_IPV6_PAY 89
322 #define ICE_PTYPE_IPV6_UDP_PAY 90
323 #define ICE_PTYPE_IPV6_TCP_PAY 92
324 #define ICE_PTYPE_IPV6_SCTP_PAY 93
325 #define ICE_PTYPE_IPV6_ICMP_PAY 94
326 #define ICE_MAC_IPV6_IPV4_FRAG 95
327 #define ICE_MAC_IPV6_IPV4_PAY 96
328 #define ICE_MAC_IPV6_IPV4_UDP_PAY 97
329 #define ICE_MAC_IPV6_IPV4_TCP 99
330 #define ICE_MAC_IPV6_IPV4_SCTP 100
331 #define ICE_MAC_IPV6_IPV4_ICMP 101
332 #define ICE_MAC_IPV6_IPV6_FRAG 102
333 #define ICE_MAC_IPV6_IPV6_PAY 103
334 #define ICE_MAC_IPV6_IPV6_UDP_PAY 104
335 #define ICE_MAC_IPV6_IPV6_TCP 106
336 #define ICE_MAC_IPV6_IPV6_SCTP 107
337 #define ICE_MAC_IPV6_IPV6_ICMPV6 108
338 #define ICE_MAC_IPV6_TUN_PAY 109
339 #define ICE_MAC_IPV6_TUN_IPV4_FRAG 110
340 #define ICE_MAC_IPV6_TUN_IPV4_PAY 111
341 #define ICE_MAC_IPV6_TUN_IPV4_UDP_PAY 112
342 #define ICE_MAC_IPV6_TUN_IPV4_TCP 114
343 #define ICE_MAC_IPV6_TUN_IPV4_SCTP 115
344 #define ICE_MAC_IPV6_TUN_IPV4_ICMP 116
345 #define ICE_MAC_IPV6_TUN_IPV6_FRAG 117
346 #define ICE_MAC_IPV6_TUN_IPV6_PAY 118
347 #define ICE_MAC_IPV6_TUN_IPV6_UDP_PAY 119
348 #define ICE_MAC_IPV6_TUN_IPV6_TCP 121
349 #define ICE_MAC_IPV6_TUN_IPV6_SCTP 122
350 #define ICE_MAC_IPV6_TUN_IPV6_ICMPV6 123
351 #define ICE_MAC_IPV6_TUN_MAC_PAY 124
352 #define ICE_MAC_IPV6_TUN_MAC_IPV4_FRAG 125
353 #define ICE_MAC_IPV6_TUN_MAC_IPV4_PAY 126
354 #define ICE_MAC_IPV6_TUN_MAC_IPV4_UDP_PAY 127
355 #define ICE_MAC_IPV6_TUN_MAC_IPV4_TCP 129
356 #define ICE_MAC_IPV6_TUN_MAC_IPV4_SCTP 130
357 #define ICE_MAC_IPV6_TUN_MAC_IPV4_ICMP 131
358 #define ICE_MAC_IPV6_TUN_MAC_IPV6_FRAG 132
359 #define ICE_MAC_IPV6_TUN_MAC_IPV6_PAY 133
360 #define ICE_MAC_IPV6_TUN_MAC_IPV6_UDP_PAY 134
361 #define ICE_MAC_IPV6_TUN_MAC_IPV6_TCP 136
362 #define ICE_MAC_IPV6_TUN_MAC_IPV6_SCTP 137
363 #define ICE_MAC_IPV6_TUN_MAC_IPV6_ICMPV6 138
364 #define ICE_MAC_IPV4_ESP 160
365 #define ICE_MAC_IPV6_ESP 161
366 #define ICE_MAC_IPV4_AH 162
367 #define ICE_MAC_IPV6_AH 163
368 #define ICE_MAC_IPV4_NAT_T_ESP 164
369 #define ICE_MAC_IPV6_NAT_T_ESP 165
370 #define ICE_MAC_IPV4_NAT_T_IKE 166
371 #define ICE_MAC_IPV6_NAT_T_IKE 167
372 #define ICE_MAC_IPV4_NAT_T_KEEP 168
373 #define ICE_MAC_IPV6_NAT_T_KEEP 169
374 #define ICE_MAC_CONTROL 278
375 #define ICE_MAC_PPPOD_PAY 300
376 #define ICE_MAC_PPPOE_PAY 301
377 #define ICE_MAC_PPPOE_IPV4_FRAG 302
378 #define ICE_MAC_PPPOE_IPV4_PAY 303
379 #define ICE_MAC_PPPOE_IPV4_UDP_PAY 304
380 #define ICE_MAC_PPPOE_IPV4_TCP 305
381 #define ICE_MAC_PPPOE_IPV4_SCTP 306
382 #define ICE_MAC_PPPOE_IPV4_ICMP 307
383 #define ICE_MAC_PPPOE_IPV6_FRAG 308
384 #define ICE_MAC_PPPOE_IPV6_PAY 309
385 #define ICE_MAC_PPPOE_IPV6_UDP_PAY 310
386 #define ICE_MAC_PPPOE_IPV6_TCP 311
387 #define ICE_MAC_PPPOE_IPV6_SCTP 312
388 #define ICE_MAC_PPPOE_IPV6_ICMPV6 313
389 #define ICE_MAC_IPV4_GTPC_TEID 325
390 #define ICE_MAC_IPV6_GTPC_TEID 326
391 #define ICE_MAC_IPV4_GTPC 327
392 #define ICE_MAC_IPV6_GTPC 328
393 #define ICE_MAC_IPV4_GTPU 329
394 #define ICE_MAC_IPV6_GTPU 330
395 #define ICE_MAC_IPV4_GTPU_IPV4_FRAG 331
396 #define ICE_MAC_IPV4_GTPU_IPV4_PAY 332
397 #define ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY 333
398 #define ICE_MAC_IPV4_GTPU_IPV4_TCP 334
399 #define ICE_MAC_IPV4_GTPU_IPV4_ICMP 335
400 #define ICE_MAC_IPV6_GTPU_IPV4_FRAG 336
401 #define ICE_MAC_IPV6_GTPU_IPV4_PAY 337
402 #define ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY 338
403 #define ICE_MAC_IPV6_GTPU_IPV4_TCP 339
404 #define ICE_MAC_IPV6_GTPU_IPV4_ICMP 340
405 #define ICE_MAC_IPV4_GTPU_IPV6_FRAG 341
406 #define ICE_MAC_IPV4_GTPU_IPV6_PAY 342
407 #define ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY 343
408 #define ICE_MAC_IPV4_GTPU_IPV6_TCP 344
409 #define ICE_MAC_IPV4_GTPU_IPV6_ICMPV6 345
410 #define ICE_MAC_IPV6_GTPU_IPV6_FRAG 346
411 #define ICE_MAC_IPV6_GTPU_IPV6_PAY 347
412 #define ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY 348
413 #define ICE_MAC_IPV6_GTPU_IPV6_TCP 349
414 #define ICE_MAC_IPV6_GTPU_IPV6_ICMPV6 350
415 #define ICE_MAC_IPV4_PFCP_NODE 351
416 #define ICE_MAC_IPV4_PFCP_SESSION 352
417 #define ICE_MAC_IPV6_PFCP_NODE 353
418 #define ICE_MAC_IPV6_PFCP_SESSION 354
419 #define ICE_MAC_IPV4_L2TPV3 360
420 #define ICE_MAC_IPV6_L2TPV3 361
421 #define ICE_MAC_IPV4_L2TPV2_CONTROL 392
422 #define ICE_MAC_IPV6_L2TPV2_CONTROL 393
423 #define ICE_MAC_IPV4_L2TPV2 394
424 #define ICE_MAC_IPV6_L2TPV2 395
425 #define ICE_MAC_IPV4_PPPOL2TPV2 396
426 #define ICE_MAC_IPV6_PPPOL2TPV2 397
427 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_FRAG 398
428 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_PAY 399
429 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_UDP_PAY 400
430 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_TCP 401
431 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_SCTP 402
432 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_ICMP 403
433 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_FRAG 404
434 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_PAY 405
435 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_UDP_PAY 406
436 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_TCP 407
437 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_SCTP 408
438 #define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_ICMPV6 409
439 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_FRAG 410
440 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_PAY 411
441 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_UDP_PAY 412
442 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_TCP 413
443 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_SCTP 414
444 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_ICMP 415
445 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_FRAG 416
446 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_PAY 417
447 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_UDP_PAY 418
448 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_TCP 419
449 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_SCTP 420
450 #define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_ICMPV6 421
451 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG 450
452 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY 451
453 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY 452
454 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP 453
455 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_SCTP 454
456 #define MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP 455
457 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG 456
458 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY 457
459 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY 458
460 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP 459
461 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_SCTP 460
462 #define MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6 461
463 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG 462
464 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY 463
465 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY 464
466 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP 465
467 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_SCTP 466
468 #define MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP 467
469 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG 468
470 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY 469
471 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY 470
472 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP 471
473 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_SCTP 472
474 #define MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6 473
475 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG 474
476 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY 475
477 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY 476
478 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP 477
479 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_SCTP 478
480 #define MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP 479
481 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG 480
482 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY 481
483 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY 482
484 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP 483
485 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_SCTP 484
486 #define MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6 485
487 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG 486
488 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY 487
489 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY 488
490 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP 489
491 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_SCTP 490
492 #define MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP 491
493 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG 492
494 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY 493
495 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY 494
496 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP 495
497 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_SCTP 496
498 #define MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6 497
500 /* Attributes that can modify PTYPE definitions.
502 * These values will represent special attributes for PTYPES, which will
503 * resolve into metadata packet flags definitions that can be used in the TCAM
504 * for identifying a PTYPE with specific characteristics.
506 enum ice_ptype_attrib_type {
508 ICE_PTYPE_ATTR_GTP_PDU_EH,
509 ICE_PTYPE_ATTR_GTP_SESSION,
510 ICE_PTYPE_ATTR_GTP_DOWNLINK,
511 ICE_PTYPE_ATTR_GTP_UPLINK,
514 struct ice_ptype_attrib_info {
519 /* TCAM flag definitions */
520 #define ICE_GTP_PDU BIT(14)
521 #define ICE_GTP_PDU_LINK BIT(13)
524 #define ICE_GTP_PDU_FLAG_MASK (ICE_GTP_PDU)
525 #define ICE_GTP_PDU_EH ICE_GTP_PDU
527 #define ICE_GTP_FLAGS_MASK (ICE_GTP_PDU | ICE_GTP_PDU_LINK)
528 #define ICE_GTP_SESSION 0
529 #define ICE_GTP_DOWNLINK ICE_GTP_PDU
530 #define ICE_GTP_UPLINK (ICE_GTP_PDU | ICE_GTP_PDU_LINK)
532 struct ice_ptype_attributes {
534 enum ice_ptype_attrib_type attrib;
537 struct ice_meta_sect {
538 struct ice_pkg_ver ver;
539 #define ICE_META_SECT_NAME_SIZE 28
540 char name[ICE_META_SECT_NAME_SIZE];
544 /* Packet Type Groups (PTG) - Inner Most fields (IM) */
545 #define ICE_PTG_IM_IPV4_TCP 16
546 #define ICE_PTG_IM_IPV4_UDP 17
547 #define ICE_PTG_IM_IPV4_SCTP 18
548 #define ICE_PTG_IM_IPV4_PAY 20
549 #define ICE_PTG_IM_IPV4_OTHER 21
550 #define ICE_PTG_IM_IPV6_TCP 32
551 #define ICE_PTG_IM_IPV6_UDP 33
552 #define ICE_PTG_IM_IPV6_SCTP 34
553 #define ICE_PTG_IM_IPV6_OTHER 37
554 #define ICE_PTG_IM_L2_OTHER 67
556 struct ice_flex_fields {
561 u8 flow_label; /* valid for IPv6 only */
579 u8 flow_label; /* valid for IPv6 only */
590 #define ICE_XLT1_DFLT_GRP 0
591 #define ICE_XLT1_TABLE_SIZE 1024
596 #define ICE_PKG_LABEL_SIZE 64
597 char name[ICE_PKG_LABEL_SIZE];
600 struct ice_label_section {
602 struct ice_label label[STRUCT_HACK_VAR_LEN];
605 #define ICE_MAX_LABELS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \
606 ice_struct_size((struct ice_label_section *)0, label, 1) - \
607 sizeof(struct ice_label), sizeof(struct ice_label))
609 struct ice_sw_fv_section {
612 struct ice_fv fv[STRUCT_HACK_VAR_LEN];
615 struct ice_sw_fv_list_entry {
616 struct LIST_ENTRY_TYPE list_entry;
618 struct ice_fv *fv_ptr;
622 /* The BOOST TCAM stores the match packet header in reverse order, meaning
623 * the fields are reversed; in addition, this means that the normally big endian
624 * fields of the packet are now little endian.
626 struct ice_boost_key_value {
627 #define ICE_BOOST_REMAINING_HV_KEY 15
628 u8 remaining_hv_key[ICE_BOOST_REMAINING_HV_KEY];
629 __le16 hv_dst_port_key;
630 __le16 hv_src_port_key;
635 struct ice_boost_key {
636 struct ice_boost_key_value key;
637 struct ice_boost_key_value key2;
640 /* package Boost TCAM entry */
641 struct ice_boost_tcam_entry {
644 /* break up the 40 bytes of key into different fields */
645 struct ice_boost_key key;
646 u8 boost_hit_index_group;
647 /* The following contains bitfields which are not on byte boundaries.
648 * These fields are currently unused by driver software.
650 #define ICE_BOOST_BIT_FIELDS 43
651 u8 bit_fields[ICE_BOOST_BIT_FIELDS];
654 struct ice_boost_tcam_section {
657 struct ice_boost_tcam_entry tcam[STRUCT_HACK_VAR_LEN];
660 #define ICE_MAX_BST_TCAMS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \
661 ice_struct_size((struct ice_boost_tcam_section *)0, tcam, 1) - \
662 sizeof(struct ice_boost_tcam_entry), \
663 sizeof(struct ice_boost_tcam_entry))
665 /* package Marker PType TCAM entry */
666 struct ice_marker_ptype_tcam_entry {
667 #define ICE_MARKER_PTYPE_TCAM_ADDR_MAX 1024
673 struct ice_marker_ptype_tcam_section {
676 struct ice_marker_ptype_tcam_entry tcam[STRUCT_HACK_VAR_LEN];
679 #define ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF ICE_MAX_ENTRIES_IN_BUF( \
680 ice_struct_size((struct ice_marker_ptype_tcam_section *)0, tcam, 1) - \
681 sizeof(struct ice_marker_ptype_tcam_entry), \
682 sizeof(struct ice_marker_ptype_tcam_entry))
684 struct ice_xlt1_section {
687 u8 value[STRUCT_HACK_VAR_LEN];
690 struct ice_xlt2_section {
693 __le16 value[STRUCT_HACK_VAR_LEN];
696 struct ice_prof_redir_section {
699 u8 redir_value[STRUCT_HACK_VAR_LEN];
702 /* package buffer building */
704 struct ice_buf_build {
706 u16 reserved_section_table_entries;
709 struct ice_pkg_enum {
710 struct ice_buf_table *buf_table;
714 struct ice_buf_hdr *buf;
720 void *(*handler)(u32 sect_type, void *section, u32 index, u32 *offset);
723 /* Tunnel enabling */
725 enum ice_tunnel_type {
734 struct ice_tunnel_type_scan {
735 enum ice_tunnel_type type;
736 const char *label_prefix;
739 struct ice_tunnel_entry {
740 enum ice_tunnel_type type;
744 struct ice_boost_tcam_entry *boost_entry;
750 #define ICE_TUNNEL_MAX_ENTRIES 16
752 struct ice_tunnel_table {
753 struct ice_tunnel_entry tbl[ICE_TUNNEL_MAX_ENTRIES];
757 struct ice_dvm_entry {
760 struct ice_boost_tcam_entry *boost_entry;
763 #define ICE_DVM_MAX_ENTRIES 48
765 struct ice_dvm_table {
766 struct ice_dvm_entry tbl[ICE_DVM_MAX_ENTRIES];
773 struct ice_fv_word es[STRUCT_HACK_VAR_LEN];
782 struct LIST_HEAD_TYPE prof_map;
783 struct ice_fv_word *t;
784 struct ice_lock prof_map_lock; /* protect access to profiles list */
786 u8 reverse; /* set to true to reverse FV order */
789 /* PTYPE Group management */
791 /* Note: XLT1 table takes 13-bit as input, and results in an 8-bit packet type
792 * group (PTG) ID as output.
794 * Note: PTG 0 is the default packet type group and it is assumed that all PTYPE
795 * are a part of this group until moved to a new PTG.
797 #define ICE_DEFAULT_PTG 0
799 struct ice_ptg_entry {
800 struct ice_ptg_ptype *first_ptype;
804 struct ice_ptg_ptype {
805 struct ice_ptg_ptype *next_ptype;
809 #define ICE_MAX_TCAM_PER_PROFILE 64
810 #define ICE_MAX_PTG_PER_PROFILE 64
812 struct ice_prof_map {
813 struct LIST_ENTRY_TYPE list;
818 u8 ptg[ICE_MAX_PTG_PER_PROFILE];
819 struct ice_ptype_attrib_info attr[ICE_MAX_PTG_PER_PROFILE];
822 #define ICE_INVALID_TCAM 0xFFFF
824 struct ice_tcam_inf {
826 struct ice_ptype_attrib_info attr;
832 struct ice_vsig_prof {
833 struct LIST_ENTRY_TYPE list;
837 struct ice_tcam_inf tcam[ICE_MAX_TCAM_PER_PROFILE];
840 struct ice_vsig_entry {
841 struct LIST_HEAD_TYPE prop_lst;
842 struct ice_vsig_vsi *first_vsi;
846 struct ice_vsig_vsi {
847 struct ice_vsig_vsi *next_vsi;
853 #define ICE_XLT1_CNT 1024
854 #define ICE_MAX_PTGS 256
858 struct ice_ptg_entry *ptg_tbl;
859 struct ice_ptg_ptype *ptypes;
865 #define ICE_XLT2_CNT 768
866 #define ICE_MAX_VSIGS 768
869 * [0:12]: incremental VSIG index 1 to ICE_MAX_VSIGS
870 * [13:15]: PF number of device
872 #define ICE_VSIG_IDX_M (0x1FFF)
873 #define ICE_PF_NUM_S 13
874 #define ICE_PF_NUM_M (0x07 << ICE_PF_NUM_S)
875 #define ICE_VSIG_VALUE(vsig, pf_id) \
876 ((u16)((((u16)(vsig)) & ICE_VSIG_IDX_M) | \
877 (((u16)(pf_id) << ICE_PF_NUM_S) & ICE_PF_NUM_M)))
878 #define ICE_DEFAULT_VSIG 0
882 struct ice_vsig_entry *vsig_tbl;
883 struct ice_vsig_vsi *vsis;
889 /* Extraction sequence - list of match fields:
890 * protocol ID, offset, profile length
892 union ice_match_fld {
897 u8 reserved; /* must be zero */
902 #define ICE_MATCH_LIST_SZ 20
906 union ice_match_fld list[ICE_MATCH_LIST_SZ];
909 /* Profile ID Management */
910 struct ice_prof_id_key {
916 /* Keys are made up of two values, each one-half the size of the key.
917 * For TCAM, the entire key is 80 bits wide (or 2, 40-bit wide values)
919 #define ICE_TCAM_KEY_VAL_SZ 5
920 #define ICE_TCAM_KEY_SZ (2 * ICE_TCAM_KEY_VAL_SZ)
922 struct ice_prof_tcam_entry {
924 u8 key[ICE_TCAM_KEY_SZ];
930 struct ice_prof_id_section {
932 struct ice_prof_tcam_entry entry[STRUCT_HACK_VAR_LEN];
935 struct ice_prof_tcam {
939 struct ice_prof_tcam_entry *t;
940 u8 cdid_bits; /* # CDID bits to use in key, 0, 2, 4, or 8 */
943 struct ice_prof_redir {
950 u16 mask; /* 16-bit mask */
952 u16 ref; /* reference count */
953 u8 in_use; /* non-zero if used */
957 struct ice_lock lock; /* lock to protect this structure */
958 u16 first; /* first mask owned by the PF */
959 u16 count; /* number of masks owned by the PF */
960 #define ICE_PROF_MASK_COUNT 32
961 struct ice_mask masks[ICE_PROF_MASK_COUNT];
964 /* Tables per block */
965 struct ice_blk_info {
966 struct ice_xlt1 xlt1;
967 struct ice_xlt2 xlt2;
968 struct ice_prof_tcam prof;
969 struct ice_prof_redir prof_redir;
971 struct ice_masks masks;
972 u8 overwrite; /* set to true to allow overwrite of table entries */
986 struct LIST_ENTRY_TYPE list_entry;
987 enum ice_chg_type type;
1000 struct ice_ptype_attrib_info attr;
1003 #define ICE_FLOW_PTYPE_MAX ICE_XLT1_CNT
1005 enum ice_prof_type {
1006 ICE_PROF_NON_TUN = 0x1,
1007 ICE_PROF_TUN_UDP = 0x2,
1008 ICE_PROF_TUN_GRE = 0x4,
1009 ICE_PROF_TUN_PPPOE = 0x8,
1010 ICE_PROF_TUN_ALL = 0xE,
1011 ICE_PROF_ALL = 0xFF,
1014 /* Number of bits/bytes contained in meta init entry. Note, this should be a
1015 * multiple of 32 bits.
1017 #define ICE_META_INIT_BITS 192
1018 #define ICE_META_INIT_DW_CNT (ICE_META_INIT_BITS / (sizeof(__le32) * \
1021 /* The meta init Flag field starts at this bit */
1022 #define ICE_META_FLAGS_ST 123
1024 /* The entry and bit to check for Double VLAN Mode (DVM) support */
1025 #define ICE_META_VLAN_MODE_ENTRY 0
1026 #define ICE_META_FLAG_VLAN_MODE 60
1027 #define ICE_META_VLAN_MODE_BIT (ICE_META_FLAGS_ST + \
1028 ICE_META_FLAG_VLAN_MODE)
1030 struct ice_meta_init_entry {
1031 __le32 bm[ICE_META_INIT_DW_CNT];
1034 struct ice_meta_init_section {
1037 struct ice_meta_init_entry entry[1];
1039 #endif /* _ICE_FLEX_TYPE_H_ */