-
Notifications
You must be signed in to change notification settings - Fork 2
/
firmware.yml
450 lines (390 loc) · 10.9 KB
/
firmware.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
##########################################
# Header instance definitions #
##########################################
errors:
type: enum
values:
- NoError: 1
- PacketTooShort: 2
- NoMatch: 3
- StackOutOfBounds: 4
- HeaderTooShort: 5
- ParserTimeout: 6
ethernet:
fields:
- dstAddr: 48
- srcAddr: 48
- etherType: 16
type: header
gtp:
fields:
- version_field_id: 3
- proto_type_id: 1
- spare: 1
- extension_header_flag_id: 1
- sequence_number_flag_id: 1
- npdu_number_flag_id: 1
- msgtype: 8
- msglen: 16
- teid: 32
type: header
gtp_ext:
fields:
- next_extension: 8
type: header
ipv6_inner:
fields:
- version: 4
- traffic_class: 8
- flow_label: 20
- payload_len: 16
- next_hdr: 8
- hop_limit: 8
- src_addr: 128
- dst_addr: 128
type: header
ipv6_outer:
fields:
- version: 4
- traffic_class: 8
- flow_label: 20
- payload_len: 16
- next_hdr: 8
- hop_limit: 8
- src_addr: 128
- dst_addr: 128
type: header
pdu_container:
fields:
- pdu_type: 4
- spare: 5
- rqi: 1
- qosid: 6
- padding: 8
type: header
scalars:
fields:
- metadata@next_srv6_sid: 128
type: metadata
srv6:
fields:
- next_hdr: 8
- hdr_ext_len: 8
- routing_type: 8
- segment_left: 8
- last_entry: 8
- flags: 8
- tag: 16
type: header
srv6_list:
fields:
- segment_id: 128
max_depth: 3
type: header
standard_metadata:
fields:
- ingress_port: 16
- packet_length: 14
- egress_spec: 16
- egress_port: 16
- egress_instance: 10
- instance_type: 4
- clone_spec: 32
- parser_error_location: 8
- parser_status: 3
- checksum_error: 1
type: metadata
tcp_inner:
fields:
- srcPort: 16
- dstPort: 16
- seqNo: 32
- ackNo: 32
- dataOffset: 4
- res: 3
- ecn: 3
- ctrl: 6
- window: 16
- checksum: 16
- urgentPtr: 16
type: header
udp:
fields:
- sport: 16
- dport: 16
- len: 16
- checksum: 16
type: header
udp_inner:
fields:
- sport: 16
- dport: 16
- len: 16
- checksum: 16
type: header
##########################################
# Parse states #
##########################################
parse_gtp:
implementation: extract(gtp);
select_value:
- gtp.extension_header_flag_id
src_filename: entryv2.p4
src_lineno: 163
type: parse_state
parse_gtp_ext:
implementation: extract(gtp_ext);
select_value:
- gtp_ext.next_extension
src_filename: entryv2.p4
src_lineno: 173
type: parse_state
parse_ipv6_inner:
implementation: extract(ipv6_inner);
select_value:
- ipv6_inner.next_hdr
src_filename: entryv2.p4
src_lineno: 194
type: parse_state
parse_ipv6_outer:
implementation: extract(ipv6_outer);
select_value:
- ipv6_outer.next_hdr
src_filename: entryv2.p4
src_lineno: 142
type: parse_state
parse_pdu_container:
implementation: extract(pdu_container);
src_filename: entryv2.p4
src_lineno: 181
type: parse_state
parse_srv6:
implementation: extract(srv6);
src_filename: entryv2.p4
src_lineno: 151
type: parse_state
parse_tcp_inner:
implementation: extract(tcp_inner);
src_filename: entryv2.p4
src_lineno: 208
type: parse_state
parse_udp:
implementation: extract(udp);
select_value:
- udp.dport
src_filename: entryv2.p4
src_lineno: 156
type: parse_state
parse_udp_inner:
implementation: extract(udp_inner);
src_filename: entryv2.p4
src_lineno: 203
type: parse_state
start:
implementation: extract(ethernet);
select_value:
- ethernet.etherType
src_filename: entryv2.p4
src_lineno: 131
type: parse_state
##########################################
# Parser #
##########################################
parser:
format: dot
implementation: |-
digraph {
start -> parse_ipv6_outer [value="0x86dd", mask="none", order="0"]
parse_ipv6_outer -> parse_udp [value="0x11", mask="none", order="0"]
parse_ipv6_outer -> parse_srv6 [value="0x2b", mask="none", order="1"]
parse_ipv6_outer -> exit [value="default", mask="none", order="2"]
parse_udp -> parse_gtp [value="0x0868", mask="none", order="0"]
parse_gtp -> parse_gtp_ext [value="0x01", mask="none", order="0"]
parse_gtp -> parse_ipv6_inner [value="0x00", mask="none", order="1"]
parse_gtp_ext -> parse_pdu_container [value="0x85", mask="none", order="0"]
parse_pdu_container -> parse_ipv6_inner [value="default", mask="none", order="0"]
parse_ipv6_inner -> parse_udp_inner [value="0x11", mask="none", order="0"]
parse_ipv6_inner -> parse_tcp_inner [value="0x06", mask="none", order="1"]
parse_ipv6_inner -> exit [value="default", mask="none", order="2"]
parse_udp_inner -> exit [value="default", mask="none", order="0"]
parse_tcp_inner -> exit [value="default", mask="none", order="0"]
parse_srv6 -> exit [value="default", mask="none", order="0"]
}
start_state: start
type: parser
##########################################
# Action Expressions #
##########################################
_expression_srv6_t_insert_2_0:
expression: ((((ipv6_outer.payload_len) + (0x0028))) & (0xffff))
format: bracketed_expr
type: expression
_expression_srv6_t_insert_3_0:
expression: ((((ipv6_outer.payload_len) + (0x0038))) & (0xffff))
format: bracketed_expr
type: expression
##########################################
# Action sets #
##########################################
ingress::drop:
implementation: drop();
src_filename: entryv2.p4
src_lineno: 232
type: action
ingress::ipv6_forward:
implementation: |-
modify_field(standard_metadata.egress_spec, port);
modify_field(ethernet.srcAddr, ethernet.dstAddr);
modify_field(ethernet.dstAddr, dstAddr);
parameter_list:
- dstAddr: 48
- port: 16
src_filename: entryv2.p4
src_lineno: 236
type: action
ingress::srv6_t_insert_2:
implementation: |-
modify_field(ipv6_outer.payload_len, _expression_srv6_t_insert_2_0);
add_header(srv6_list[0]);
modify_field(srv6_list[0].segment_id, s1);
add_header(srv6_list[1]);
modify_field(srv6_list[1].segment_id, s2);
modify_field(ipv6_outer.dst_addr, s2);
add_header(srv6);
modify_field(srv6.next_hdr, 0x11);
modify_field(srv6.hdr_ext_len, 0x04);
modify_field(srv6.routing_type, 0x04);
modify_field(srv6.segment_left, 0x01);
modify_field(srv6.last_entry, 0x01);
modify_field(srv6.flags, 0x00);
modify_field(srv6.tag, 0x0000);
modify_field(ipv6_outer.next_hdr, 0x2b);
parameter_list:
- s1: 128
- s2: 128
src_filename: entryv2.p4
src_lineno: 255
type: action
ingress::srv6_t_insert_3:
implementation: |-
modify_field(ipv6_outer.payload_len, _expression_srv6_t_insert_3_0);
add_header(srv6_list[0]);
modify_field(srv6_list[0].segment_id, s1);
add_header(srv6_list[1]);
modify_field(srv6_list[1].segment_id, s2);
add_header(srv6_list[2]);
modify_field(srv6_list[2].segment_id, s3);
modify_field(ipv6_outer.dst_addr, s3);
add_header(srv6);
modify_field(srv6.next_hdr, 0x11);
modify_field(srv6.hdr_ext_len, 0x06);
modify_field(srv6.routing_type, 0x04);
modify_field(srv6.segment_left, 0x02);
modify_field(srv6.last_entry, 0x02);
modify_field(srv6.flags, 0x00);
modify_field(srv6.tag, 0x0000);
modify_field(ipv6_outer.next_hdr, 0x2b);
parameter_list:
- s1: 128
- s2: 128
- s3: 128
src_filename: entryv2.p4
src_lineno: 265
type: action
##########################################
# Ingress and Egress tables #
##########################################
ingress::ipv6_outer_lpm:
allowed_actions:
- ingress::ipv6_forward
- ingress::drop
default_entry:
action: ingress::drop
const: false
match_on:
ipv6_outer.dst_addr: lpm
max_entries: 1025
src_filename: entryv2.p4
src_lineno: 278
type: table
ingress::teid_exact:
allowed_actions:
- ingress::srv6_t_insert_2
- ingress::srv6_t_insert_3
match_on:
gtp.teid: ternary
ipv6_inner.dst_addr: ternary
ipv6_inner.next_hdr: ternary
ipv6_inner.src_addr: ternary
pdu_container.qosid: ternary
tcp_inner.dstPort: ternary
tcp_inner.srcPort: ternary
udp_inner.dport: ternary
udp_inner.sport: ternary
max_entries: 1025
src_filename: entryv2.p4
src_lineno: 292
type: table
##########################################
# Ingress conditionals sets #
##########################################
_condition_0:
condition: (((not((valid(srv6))))) and (((gtp.spare) == (0))))
format: bracketed_expr
src_filename: entryv2.p4
src_lineno: 316
type: conditional
##########################################
# Ingress control flow #
##########################################
ingress_flow:
doc: control flow for ingress
format: dot
implementation: |-
digraph {
"_condition_0" -> "ingress::ipv6_outer_lpm" [condition = false]
"_condition_0" -> "ingress::teid_exact" [condition = true]
"ingress::ipv6_outer_lpm" -> "exit_control_flow" [action = always]
"ingress::teid_exact" -> "ingress::ipv6_outer_lpm" [action = always]
}
start_state: _condition_0
type: control_flow
##########################################
# Deparsers #
##########################################
deparser:
order:
- ethernet
- ipv6_outer
- srv6
- udp
- gtp
- gtp_ext
- pdu_container
- ipv6_inner
- tcp_inner
- udp_inner
- srv6_list[0]
- srv6_list[1]
- srv6_list[2]
type: deparser
##########################################
# Processor layout #
##########################################
layout:
format: list
implementation:
- parser
- ingress
type: processor_layout
##########################################
# Source info #
##########################################
source_info:
date: 2021/01/22 04:15:04
output_file: ./firmware.yml
p4_version: '16'
source_files:
- /opt/netronome/p4/include/16/p4include/core.p4
- entryv2.p4
type: source_info