blob: 8c971bb6cb934aad64ba7489650659229fab3adc [file] [log] [blame]
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001{
2 "program" : "ecmp.p4",
3 "__meta__" : {
4 "version" : [2, 7],
5 "compiler" : "https://github.com/p4lang/p4c"
6 },
7 "header_types" : [
8 {
9 "name" : "scalars_0",
10 "id" : 0,
11 "fields" : [
Carmelo Cascone16de6db2017-08-22 00:27:57 +020012 ["tmp_0", 104, false],
13 ["tmp", 8, false],
14 ["tmp_1", 32, false],
15 ["tmp_2", 32, false]
Carmelo Casconefc3776d2017-08-21 23:17:22 +020016 ]
17 },
18 {
19 "name" : "ethernet_t",
20 "id" : 1,
21 "fields" : [
22 ["dstAddr", 48, false],
23 ["srcAddr", 48, false],
24 ["etherType", 16, false]
25 ]
26 },
27 {
28 "name" : "ipv4_t",
29 "id" : 2,
30 "fields" : [
31 ["version", 4, false],
32 ["ihl", 4, false],
33 ["diffserv", 8, false],
34 ["totalLen", 16, false],
35 ["identification", 16, false],
36 ["flags", 3, false],
37 ["fragOffset", 13, false],
38 ["ttl", 8, false],
39 ["protocol", 8, false],
40 ["hdrChecksum", 16, false],
41 ["srcAddr", 32, false],
42 ["dstAddr", 32, false]
43 ]
44 },
45 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +020046 "name" : "packet_in_t",
Carmelo Casconefc3776d2017-08-21 23:17:22 +020047 "id" : 3,
48 "fields" : [
Carmelo Cascone16de6db2017-08-22 00:27:57 +020049 ["ingress_port", 9, false],
50 ["_padding", 7, false]
51 ]
52 },
53 {
54 "name" : "packet_out_t",
55 "id" : 4,
56 "fields" : [
57 ["egress_port", 9, false],
58 ["_padding_0", 7, false]
59 ]
60 },
61 {
62 "name" : "tcp_t",
63 "id" : 5,
64 "fields" : [
Carmelo Casconefc3776d2017-08-21 23:17:22 +020065 ["srcPort", 16, false],
66 ["dstPort", 16, false],
67 ["seqNo", 32, false],
68 ["ackNo", 32, false],
69 ["dataOffset", 4, false],
70 ["res", 3, false],
71 ["ecn", 3, false],
72 ["ctrl", 6, false],
73 ["window", 16, false],
74 ["checksum", 16, false],
75 ["urgentPtr", 16, false]
76 ]
77 },
78 {
79 "name" : "udp_t",
Carmelo Cascone16de6db2017-08-22 00:27:57 +020080 "id" : 6,
Carmelo Casconefc3776d2017-08-21 23:17:22 +020081 "fields" : [
82 ["srcPort", 16, false],
83 ["dstPort", 16, false],
84 ["length_", 16, false],
85 ["checksum", 16, false]
86 ]
87 },
88 {
89 "name" : "ecmp_metadata_t",
Carmelo Cascone16de6db2017-08-22 00:27:57 +020090 "id" : 7,
Carmelo Casconefc3776d2017-08-21 23:17:22 +020091 "fields" : [
92 ["groupId", 16, false],
Carmelo Cascone16de6db2017-08-22 00:27:57 +020093 ["selector", 16, false]
Carmelo Casconefc3776d2017-08-21 23:17:22 +020094 ]
95 },
96 {
97 "name" : "standard_metadata",
Carmelo Cascone16de6db2017-08-22 00:27:57 +020098 "id" : 8,
Carmelo Casconefc3776d2017-08-21 23:17:22 +020099 "fields" : [
100 ["ingress_port", 9, false],
101 ["egress_spec", 9, false],
102 ["egress_port", 9, false],
103 ["clone_spec", 32, false],
104 ["instance_type", 32, false],
105 ["drop", 1, false],
106 ["recirculate_port", 16, false],
107 ["packet_length", 32, false],
108 ["enq_timestamp", 32, false],
109 ["enq_qdepth", 19, false],
110 ["deq_timedelta", 32, false],
111 ["deq_qdepth", 19, false],
112 ["ingress_global_timestamp", 48, false],
113 ["lf_field_list", 32, false],
114 ["mcast_grp", 16, false],
115 ["resubmit_flag", 1, false],
116 ["egress_rid", 16, false],
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200117 ["_padding_1", 5, false]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200118 ]
119 }
120 ],
121 "headers" : [
122 {
123 "name" : "scalars",
124 "id" : 0,
125 "header_type" : "scalars_0",
126 "metadata" : true,
127 "pi_omit" : true
128 },
129 {
130 "name" : "standard_metadata",
131 "id" : 1,
132 "header_type" : "standard_metadata",
133 "metadata" : true,
134 "pi_omit" : true
135 },
136 {
137 "name" : "ethernet",
138 "id" : 2,
139 "header_type" : "ethernet_t",
140 "metadata" : false,
141 "pi_omit" : true
142 },
143 {
144 "name" : "ipv4",
145 "id" : 3,
146 "header_type" : "ipv4_t",
147 "metadata" : false,
148 "pi_omit" : true
149 },
150 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200151 "name" : "packet_in_hdr",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200152 "id" : 4,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200153 "header_type" : "packet_in_t",
154 "metadata" : false,
155 "pi_omit" : true
156 },
157 {
158 "name" : "packet_out_hdr",
159 "id" : 5,
160 "header_type" : "packet_out_t",
161 "metadata" : false,
162 "pi_omit" : true
163 },
164 {
165 "name" : "tcp",
166 "id" : 6,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200167 "header_type" : "tcp_t",
168 "metadata" : false,
169 "pi_omit" : true
170 },
171 {
172 "name" : "udp",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200173 "id" : 7,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200174 "header_type" : "udp_t",
175 "metadata" : false,
176 "pi_omit" : true
177 },
178 {
179 "name" : "ecmp_metadata",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200180 "id" : 8,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200181 "header_type" : "ecmp_metadata_t",
182 "metadata" : true,
183 "pi_omit" : true
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200184 }
185 ],
186 "header_stacks" : [],
187 "header_union_types" : [],
188 "header_unions" : [],
189 "header_union_stacks" : [],
190 "field_lists" : [],
191 "errors" : [
192 ["NoError", 1],
193 ["PacketTooShort", 2],
194 ["NoMatch", 3],
195 ["StackOutOfBounds", 4],
196 ["HeaderTooShort", 5],
197 ["ParserTimeout", 6]
198 ],
199 "enums" : [],
200 "parsers" : [
201 {
202 "name" : "parser",
203 "id" : 0,
204 "init_state" : "start",
205 "parse_states" : [
206 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200207 "name" : "default_parser",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200208 "id" : 0,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200209 "parser_ops" : [],
210 "transitions" : [
211 {
212 "value" : "0x00ff",
213 "mask" : null,
214 "next_state" : "parse_pkt_out"
215 },
216 {
217 "value" : "default",
218 "mask" : null,
219 "next_state" : "parse_ethernet"
220 }
221 ],
222 "transition_key" : [
223 {
224 "type" : "field",
225 "value" : ["standard_metadata", "ingress_port"]
226 }
227 ]
228 },
229 {
230 "name" : "parse_ethernet",
231 "id" : 1,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200232 "parser_ops" : [
233 {
234 "parameters" : [
235 {
236 "type" : "regular",
237 "value" : "ethernet"
238 }
239 ],
240 "op" : "extract"
241 }
242 ],
243 "transitions" : [
244 {
245 "value" : "0x0800",
246 "mask" : null,
247 "next_state" : "parse_ipv4"
248 },
249 {
250 "value" : "default",
251 "mask" : null,
252 "next_state" : null
253 }
254 ],
255 "transition_key" : [
256 {
257 "type" : "field",
258 "value" : ["ethernet", "etherType"]
259 }
260 ]
261 },
262 {
263 "name" : "parse_ipv4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200264 "id" : 2,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200265 "parser_ops" : [
266 {
267 "parameters" : [
268 {
269 "type" : "regular",
270 "value" : "ipv4"
271 }
272 ],
273 "op" : "extract"
274 }
275 ],
276 "transitions" : [
277 {
278 "value" : "0x000006",
279 "mask" : null,
280 "next_state" : "parse_tcp"
281 },
282 {
283 "value" : "0x000011",
284 "mask" : null,
285 "next_state" : "parse_udp"
286 },
287 {
288 "value" : "default",
289 "mask" : null,
290 "next_state" : null
291 }
292 ],
293 "transition_key" : [
294 {
295 "type" : "field",
296 "value" : ["ipv4", "fragOffset"]
297 },
298 {
299 "type" : "field",
300 "value" : ["ipv4", "protocol"]
301 }
302 ]
303 },
304 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200305 "name" : "parse_pkt_in",
306 "id" : 3,
307 "parser_ops" : [
308 {
309 "parameters" : [
310 {
311 "type" : "regular",
312 "value" : "packet_in_hdr"
313 }
314 ],
315 "op" : "extract"
316 }
317 ],
318 "transitions" : [
319 {
320 "value" : "default",
321 "mask" : null,
322 "next_state" : "parse_ethernet"
323 }
324 ],
325 "transition_key" : []
326 },
327 {
328 "name" : "parse_pkt_out",
329 "id" : 4,
330 "parser_ops" : [
331 {
332 "parameters" : [
333 {
334 "type" : "regular",
335 "value" : "packet_out_hdr"
336 }
337 ],
338 "op" : "extract"
339 }
340 ],
341 "transitions" : [
342 {
343 "value" : "default",
344 "mask" : null,
345 "next_state" : "parse_ethernet"
346 }
347 ],
348 "transition_key" : []
349 },
350 {
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200351 "name" : "parse_tcp",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200352 "id" : 5,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200353 "parser_ops" : [
354 {
355 "parameters" : [
356 {
357 "type" : "regular",
358 "value" : "tcp"
359 }
360 ],
361 "op" : "extract"
362 }
363 ],
364 "transitions" : [
365 {
366 "value" : "default",
367 "mask" : null,
368 "next_state" : null
369 }
370 ],
371 "transition_key" : []
372 },
373 {
374 "name" : "parse_udp",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200375 "id" : 6,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200376 "parser_ops" : [
377 {
378 "parameters" : [
379 {
380 "type" : "regular",
381 "value" : "udp"
382 }
383 ],
384 "op" : "extract"
385 }
386 ],
387 "transitions" : [
388 {
389 "value" : "default",
390 "mask" : null,
391 "next_state" : null
392 }
393 ],
394 "transition_key" : []
395 },
396 {
397 "name" : "start",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200398 "id" : 7,
399 "parser_ops" : [
400 {
401 "parameters" : [
402 {
403 "type" : "field",
404 "value" : ["scalars", "tmp_0"]
405 },
406 {
407 "type" : "lookahead",
408 "value" : [0, 104]
409 }
410 ],
411 "op" : "set"
412 },
413 {
414 "parameters" : [
415 {
416 "type" : "field",
417 "value" : ["scalars", "tmp"]
418 },
419 {
420 "type" : "expression",
421 "value" : {
422 "type" : "expression",
423 "value" : {
424 "op" : "&",
425 "left" : {
426 "type" : "field",
427 "value" : ["scalars", "tmp_0"]
428 },
429 "right" : {
430 "type" : "hexstr",
431 "value" : "0xff"
432 }
433 }
434 }
435 }
436 ],
437 "op" : "set"
438 }
439 ],
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200440 "transitions" : [
441 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200442 "value" : "0x00",
443 "mask" : null,
444 "next_state" : "parse_pkt_in"
445 },
446 {
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200447 "value" : "default",
448 "mask" : null,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200449 "next_state" : "default_parser"
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200450 }
451 ],
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200452 "transition_key" : [
453 {
454 "type" : "field",
455 "value" : ["scalars", "tmp"]
456 }
457 ]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200458 }
459 ]
460 }
461 ],
462 "deparsers" : [
463 {
464 "name" : "deparser",
465 "id" : 0,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200466 "order" : ["packet_out_hdr", "packet_in_hdr", "ethernet", "ipv4", "udp", "tcp"]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200467 }
468 ],
469 "meter_arrays" : [],
470 "counter_arrays" : [
471 {
472 "name" : "table0_counter",
473 "id" : 0,
474 "is_direct" : true,
475 "binding" : "table0"
476 },
477 {
478 "name" : "ecmp_group_table_counter",
479 "id" : 1,
480 "is_direct" : true,
481 "binding" : "ecmp_group_table"
482 },
483 {
484 "name" : "egress_port_counter",
485 "id" : 2,
486 "size" : 254,
487 "is_direct" : false
488 },
489 {
490 "name" : "ingress_port_counter",
491 "id" : 3,
492 "size" : 254,
493 "is_direct" : false
494 }
495 ],
496 "register_arrays" : [],
497 "calculations" : [
498 {
499 "name" : "calc",
500 "id" : 0,
501 "algo" : "crc32",
502 "input" : [
503 {
504 "type" : "field",
505 "value" : ["ipv4", "srcAddr"]
506 },
507 {
508 "type" : "field",
509 "value" : ["ipv4", "dstAddr"]
510 },
511 {
512 "type" : "field",
513 "value" : ["ipv4", "protocol"]
514 },
515 {
516 "type" : "field",
517 "value" : ["tcp", "srcPort"]
518 },
519 {
520 "type" : "field",
521 "value" : ["tcp", "dstPort"]
522 },
523 {
524 "type" : "field",
525 "value" : ["udp", "srcPort"]
526 },
527 {
528 "type" : "field",
529 "value" : ["udp", "dstPort"]
530 }
531 ]
532 }
533 ],
534 "learn_lists" : [],
535 "actions" : [
536 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200537 "name" : "add_packet_in_hdr",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200538 "id" : 0,
539 "runtime_data" : [],
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200540 "primitives" : [
541 {
542 "op" : "add_header",
543 "parameters" : [
544 {
545 "type" : "header",
546 "value" : "packet_in_hdr"
547 }
548 ],
549 "source_info" : {
550 "filename" : "include/packet_io.p4",
551 "line" : 25,
552 "column" : 4,
553 "source_fragment" : "add_header(packet_in_hdr)"
554 }
555 },
556 {
557 "op" : "assign",
558 "parameters" : [
559 {
560 "type" : "field",
561 "value" : ["packet_in_hdr", "ingress_port"]
562 },
563 {
564 "type" : "field",
565 "value" : ["standard_metadata", "ingress_port"]
566 }
567 ],
568 "source_info" : {
569 "filename" : "include/packet_io.p4",
570 "line" : 26,
571 "column" : 4,
572 "source_fragment" : "modify_field(packet_in_hdr.ingress_port, standard_metadata.ingress_port)"
573 }
574 }
575 ]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200576 },
577 {
578 "name" : "NoAction",
579 "id" : 1,
580 "runtime_data" : [],
581 "primitives" : []
582 },
583 {
584 "name" : "NoAction",
585 "id" : 2,
586 "runtime_data" : [],
587 "primitives" : []
588 },
589 {
590 "name" : "set_egress_port",
591 "id" : 3,
592 "runtime_data" : [
593 {
594 "name" : "port",
595 "bitwidth" : 9
596 }
597 ],
598 "primitives" : [
599 {
600 "op" : "assign",
601 "parameters" : [
602 {
603 "type" : "field",
604 "value" : ["standard_metadata", "egress_spec"]
605 },
606 {
607 "type" : "runtime_data",
608 "value" : 0
609 }
610 ],
611 "source_info" : {
612 "filename" : "include/actions.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200613 "line" : 5,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200614 "column" : 23,
615 "source_fragment" : "port) { ..."
616 }
617 }
618 ]
619 },
620 {
621 "name" : "set_egress_port",
622 "id" : 4,
623 "runtime_data" : [
624 {
625 "name" : "port",
626 "bitwidth" : 9
627 }
628 ],
629 "primitives" : [
630 {
631 "op" : "assign",
632 "parameters" : [
633 {
634 "type" : "field",
635 "value" : ["standard_metadata", "egress_spec"]
636 },
637 {
638 "type" : "runtime_data",
639 "value" : 0
640 }
641 ],
642 "source_info" : {
643 "filename" : "include/actions.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200644 "line" : 5,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200645 "column" : 23,
646 "source_fragment" : "port) { ..."
647 }
648 }
649 ]
650 },
651 {
652 "name" : "ecmp_group",
653 "id" : 5,
654 "runtime_data" : [
655 {
656 "name" : "groupId",
657 "bitwidth" : 16
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200658 }
659 ],
660 "primitives" : [
661 {
662 "op" : "assign",
663 "parameters" : [
664 {
665 "type" : "field",
666 "value" : ["ecmp_metadata", "groupId"]
667 },
668 {
669 "type" : "runtime_data",
670 "value" : 0
671 }
672 ],
673 "source_info" : {
674 "filename" : "ecmp.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200675 "line" : 42,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200676 "column" : 18,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200677 "source_fragment" : "groupId) { ..."
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200678 }
679 },
680 {
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200681 "op" : "modify_field_with_hash_based_offset",
682 "parameters" : [
683 {
684 "type" : "field",
685 "value" : ["ecmp_metadata", "selector"]
686 },
687 {
688 "type" : "hexstr",
689 "value" : "0x00000000"
690 },
691 {
692 "type" : "calculation",
693 "value" : "calc"
694 },
695 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200696 "type" : "hexstr",
697 "value" : "0x0000000000000004"
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200698 }
699 ],
700 "source_info" : {
701 "filename" : "ecmp.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200702 "line" : 44,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200703 "column" : 4,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200704 "source_fragment" : "modify_field_with_hash_based_offset(ecmp_metadata.selector, 0, ecmp_hash, 4)"
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200705 }
706 }
707 ]
708 },
709 {
710 "name" : "send_to_cpu",
711 "id" : 6,
712 "runtime_data" : [],
713 "primitives" : [
714 {
715 "op" : "assign",
716 "parameters" : [
717 {
718 "type" : "field",
719 "value" : ["standard_metadata", "egress_spec"]
720 },
721 {
722 "type" : "hexstr",
723 "value" : "0x00ff"
724 }
725 ],
726 "source_info" : {
727 "filename" : "include/actions.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200728 "line" : 21,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200729 "column" : 4,
730 "source_fragment" : "modify_field(standard_metadata.egress_spec, 255)"
731 }
732 }
733 ]
734 },
735 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200736 "name" : "_drop",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200737 "id" : 7,
738 "runtime_data" : [],
739 "primitives" : [
740 {
741 "op" : "assign",
742 "parameters" : [
743 {
744 "type" : "field",
745 "value" : ["standard_metadata", "egress_spec"]
746 },
747 {
748 "type" : "hexstr",
749 "value" : "0x01ff"
750 }
751 ],
752 "source_info" : {
753 "filename" : "include/actions.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200754 "line" : 13,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200755 "column" : 4,
756 "source_fragment" : "modify_field(standard_metadata.egress_spec, 511)"
757 }
758 }
759 ]
760 },
761 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200762 "name" : "_packet_out",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200763 "id" : 8,
764 "runtime_data" : [],
765 "primitives" : [
766 {
767 "op" : "assign",
768 "parameters" : [
769 {
770 "type" : "field",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200771 "value" : ["standard_metadata", "egress_spec"]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200772 },
773 {
774 "type" : "field",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200775 "value" : ["packet_out_hdr", "egress_port"]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200776 }
777 ],
778 "source_info" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200779 "filename" : "include/packet_io.p4",
780 "line" : 7,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200781 "column" : 4,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200782 "source_fragment" : "modify_field(standard_metadata.egress_spec, packet_out_hdr.egress_port)"
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200783 }
784 },
785 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200786 "op" : "remove_header",
787 "parameters" : [
788 {
789 "type" : "header",
790 "value" : "packet_out_hdr"
791 }
792 ],
793 "source_info" : {
794 "filename" : "include/packet_io.p4",
795 "line" : 8,
796 "column" : 4,
797 "source_fragment" : "remove_header(packet_out_hdr)"
798 }
799 }
800 ]
801 },
802 {
803 "name" : "count_egress",
804 "id" : 9,
805 "runtime_data" : [],
806 "primitives" : [
807 {
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200808 "op" : "assign",
809 "parameters" : [
810 {
811 "type" : "field",
812 "value" : ["scalars", "tmp_1"]
813 },
814 {
815 "type" : "expression",
816 "value" : {
817 "type" : "expression",
818 "value" : {
819 "op" : "&",
820 "left" : {
821 "type" : "field",
822 "value" : ["standard_metadata", "egress_spec"]
823 },
824 "right" : {
825 "type" : "hexstr",
826 "value" : "0xffffffff"
827 }
828 }
829 }
830 }
831 ]
832 },
833 {
834 "op" : "count",
835 "parameters" : [
836 {
837 "type" : "counter_array",
838 "value" : "egress_port_counter"
839 },
840 {
841 "type" : "field",
842 "value" : ["scalars", "tmp_1"]
843 }
844 ],
845 "source_info" : {
846 "filename" : "include/port_counters.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200847 "line" : 22,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200848 "column" : 4,
849 "source_fragment" : "count(egress_port_counter, standard_metadata.egress_spec)"
850 }
851 }
852 ]
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200853 },
854 {
855 "name" : "count_ingress",
856 "id" : 10,
857 "runtime_data" : [],
858 "primitives" : [
859 {
860 "op" : "assign",
861 "parameters" : [
862 {
863 "type" : "field",
864 "value" : ["scalars", "tmp_2"]
865 },
866 {
867 "type" : "expression",
868 "value" : {
869 "type" : "expression",
870 "value" : {
871 "op" : "&",
872 "left" : {
873 "type" : "field",
874 "value" : ["standard_metadata", "ingress_port"]
875 },
876 "right" : {
877 "type" : "hexstr",
878 "value" : "0xffffffff"
879 }
880 }
881 }
882 }
883 ]
884 },
885 {
886 "op" : "count",
887 "parameters" : [
888 {
889 "type" : "counter_array",
890 "value" : "ingress_port_counter"
891 },
892 {
893 "type" : "field",
894 "value" : ["scalars", "tmp_2"]
895 }
896 ],
897 "source_info" : {
898 "filename" : "include/port_counters.p4",
899 "line" : 18,
900 "column" : 4,
901 "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
902 }
903 }
904 ]
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200905 }
906 ],
907 "pipelines" : [
908 {
909 "name" : "ingress",
910 "id" : 0,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200911 "init_table" : "node_2",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200912 "tables" : [
913 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200914 "name" : "ingress_pkt",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200915 "id" : 0,
916 "source_info" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200917 "filename" : "include/packet_io.p4",
918 "line" : 11,
919 "column" : 0,
920 "source_fragment" : "table ingress_pkt { ..."
921 },
922 "key" : [],
923 "match_type" : "exact",
924 "type" : "simple",
925 "max_size" : 1024,
926 "with_counters" : false,
927 "support_timeout" : false,
928 "direct_meters" : null,
929 "action_ids" : [8],
930 "actions" : ["_packet_out"],
931 "base_default_next" : "node_4",
932 "next_tables" : {
933 "_packet_out" : "node_4"
934 },
935 "default_entry" : {
936 "action_id" : 8,
937 "action_const" : false,
938 "action_data" : [],
939 "action_entry_const" : false
940 }
941 },
942 {
943 "name" : "table0",
944 "id" : 1,
945 "source_info" : {
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200946 "filename" : "ecmp.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200947 "line" : 50,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200948 "column" : 0,
949 "source_fragment" : "table table0 { ..."
950 },
951 "key" : [
952 {
953 "match_type" : "ternary",
954 "target" : ["standard_metadata", "ingress_port"],
955 "mask" : null
956 },
957 {
958 "match_type" : "ternary",
959 "target" : ["ethernet", "dstAddr"],
960 "mask" : null
961 },
962 {
963 "match_type" : "ternary",
964 "target" : ["ethernet", "srcAddr"],
965 "mask" : null
966 },
967 {
968 "match_type" : "ternary",
969 "target" : ["ethernet", "etherType"],
970 "mask" : null
971 }
972 ],
973 "match_type" : "ternary",
974 "type" : "simple",
975 "max_size" : 1024,
976 "with_counters" : true,
977 "support_timeout" : false,
978 "direct_meters" : null,
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200979 "action_ids" : [4, 5, 6, 7, 2],
980 "actions" : ["set_egress_port", "ecmp_group", "send_to_cpu", "_drop", "NoAction"],
981 "base_default_next" : "node_7",
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200982 "next_tables" : {
983 "ecmp_group" : "ecmp_group_table",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200984 "set_egress_port" : "node_7",
985 "send_to_cpu" : "node_7",
986 "_drop" : "node_7",
987 "NoAction" : "node_7"
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200988 },
989 "default_entry" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200990 "action_id" : 2,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200991 "action_const" : false,
992 "action_data" : [],
993 "action_entry_const" : false
994 }
995 },
996 {
997 "name" : "ecmp_group_table",
Carmelo Cascone16de6db2017-08-22 00:27:57 +0200998 "id" : 2,
Carmelo Casconefc3776d2017-08-21 23:17:22 +0200999 "source_info" : {
1000 "filename" : "ecmp.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001001 "line" : 66,
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001002 "column" : 0,
1003 "source_fragment" : "table ecmp_group_table { ..."
1004 },
1005 "key" : [
1006 {
1007 "match_type" : "exact",
1008 "target" : ["ecmp_metadata", "groupId"],
1009 "mask" : null
1010 },
1011 {
1012 "match_type" : "exact",
1013 "target" : ["ecmp_metadata", "selector"],
1014 "mask" : null
1015 }
1016 ],
1017 "match_type" : "exact",
1018 "type" : "simple",
1019 "max_size" : 1024,
1020 "with_counters" : true,
1021 "support_timeout" : false,
1022 "direct_meters" : null,
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001023 "action_ids" : [3, 1],
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001024 "actions" : ["set_egress_port", "NoAction"],
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001025 "base_default_next" : "node_7",
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001026 "next_tables" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001027 "set_egress_port" : "node_7",
1028 "NoAction" : "node_7"
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001029 },
1030 "default_entry" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001031 "action_id" : 1,
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001032 "action_const" : false,
1033 "action_data" : [],
1034 "action_entry_const" : false
1035 }
1036 },
1037 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001038 "name" : "ingress_port_count_table",
1039 "id" : 3,
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001040 "source_info" : {
1041 "filename" : "include/port_counters.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001042 "line" : 25,
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001043 "column" : 0,
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001044 "source_fragment" : "table ingress_port_count_table { ..."
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001045 },
1046 "key" : [],
1047 "match_type" : "exact",
1048 "type" : "simple",
1049 "max_size" : 1024,
1050 "with_counters" : false,
1051 "support_timeout" : false,
1052 "direct_meters" : null,
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001053 "action_ids" : [10],
1054 "actions" : ["count_ingress"],
1055 "base_default_next" : "egress_port_count_table",
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001056 "next_tables" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001057 "count_ingress" : "egress_port_count_table"
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001058 },
1059 "default_entry" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001060 "action_id" : 10,
1061 "action_const" : false,
1062 "action_data" : [],
1063 "action_entry_const" : false
1064 }
1065 },
1066 {
1067 "name" : "egress_port_count_table",
1068 "id" : 4,
1069 "source_info" : {
1070 "filename" : "include/port_counters.p4",
1071 "line" : 30,
1072 "column" : 0,
1073 "source_fragment" : "table egress_port_count_table { ..."
1074 },
1075 "key" : [],
1076 "match_type" : "exact",
1077 "type" : "simple",
1078 "max_size" : 1024,
1079 "with_counters" : false,
1080 "support_timeout" : false,
1081 "direct_meters" : null,
1082 "action_ids" : [9],
1083 "actions" : ["count_egress"],
1084 "base_default_next" : null,
1085 "next_tables" : {
1086 "count_egress" : null
1087 },
1088 "default_entry" : {
1089 "action_id" : 9,
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001090 "action_const" : false,
1091 "action_data" : [],
1092 "action_entry_const" : false
1093 }
1094 }
1095 ],
1096 "action_profiles" : [],
1097 "conditionals" : [
1098 {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001099 "name" : "node_2",
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001100 "id" : 0,
1101 "source_info" : {
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001102 "filename" : "include/packet_io.p4",
1103 "line" : 19,
1104 "column" : 8,
1105 "source_fragment" : "valid(packet_out_hdr)"
1106 },
1107 "expression" : {
1108 "type" : "expression",
1109 "value" : {
1110 "op" : "==",
1111 "left" : {
1112 "type" : "field",
1113 "value" : ["packet_out_hdr", "$valid$"]
1114 },
1115 "right" : {
1116 "type" : "hexstr",
1117 "value" : "0x01"
1118 }
1119 }
1120 },
1121 "true_next" : "ingress_pkt",
1122 "false_next" : "node_4"
1123 },
1124 {
1125 "name" : "node_4",
1126 "id" : 1,
1127 "source_info" : {
1128 "filename" : "ecmp.p4",
1129 "line" : 90,
1130 "column" : 12,
1131 "source_fragment" : "valid(packet_out_hdr)"
1132 },
1133 "expression" : {
1134 "type" : "expression",
1135 "value" : {
1136 "op" : "!=",
1137 "left" : {
1138 "type" : "field",
1139 "value" : ["packet_out_hdr", "$valid$"]
1140 },
1141 "right" : {
1142 "type" : "hexstr",
1143 "value" : "0x01"
1144 }
1145 }
1146 },
1147 "true_next" : "table0",
1148 "false_next" : "node_7"
1149 },
1150 {
1151 "name" : "node_7",
1152 "id" : 2,
1153 "source_info" : {
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001154 "filename" : "include/port_counters.p4",
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001155 "line" : 36,
1156 "column" : 38,
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001157 "source_fragment" : "<"
1158 },
1159 "expression" : {
1160 "type" : "expression",
1161 "value" : {
1162 "op" : "<",
1163 "left" : {
1164 "type" : "field",
1165 "value" : ["standard_metadata", "egress_spec"]
1166 },
1167 "right" : {
1168 "type" : "hexstr",
1169 "value" : "0x00fe"
1170 }
1171 }
1172 },
1173 "false_next" : null,
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001174 "true_next" : "ingress_port_count_table"
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001175 }
1176 ]
1177 },
1178 {
1179 "name" : "egress",
1180 "id" : 1,
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001181 "init_table" : "node_12",
1182 "tables" : [
1183 {
1184 "name" : "egress_pkt",
1185 "id" : 5,
1186 "source_info" : {
1187 "filename" : "include/packet_io.p4",
1188 "line" : 29,
1189 "column" : 0,
1190 "source_fragment" : "table egress_pkt { ..."
1191 },
1192 "key" : [],
1193 "match_type" : "exact",
1194 "type" : "simple",
1195 "max_size" : 1024,
1196 "with_counters" : false,
1197 "support_timeout" : false,
1198 "direct_meters" : null,
1199 "action_ids" : [0],
1200 "actions" : ["add_packet_in_hdr"],
1201 "base_default_next" : null,
1202 "next_tables" : {
1203 "add_packet_in_hdr" : null
1204 },
1205 "default_entry" : {
1206 "action_id" : 0,
1207 "action_const" : false,
1208 "action_data" : [],
1209 "action_entry_const" : false
1210 }
1211 }
1212 ],
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001213 "action_profiles" : [],
Carmelo Cascone16de6db2017-08-22 00:27:57 +02001214 "conditionals" : [
1215 {
1216 "name" : "node_12",
1217 "id" : 3,
1218 "source_info" : {
1219 "filename" : "include/packet_io.p4",
1220 "line" : 40,
1221 "column" : 39,
1222 "source_fragment" : "=="
1223 },
1224 "expression" : {
1225 "type" : "expression",
1226 "value" : {
1227 "op" : "==",
1228 "left" : {
1229 "type" : "field",
1230 "value" : ["standard_metadata", "ingress_port"]
1231 },
1232 "right" : {
1233 "type" : "hexstr",
1234 "value" : "0x00ff"
1235 }
1236 }
1237 },
1238 "false_next" : null,
1239 "true_next" : "egress_pkt"
1240 }
1241 ]
Carmelo Casconefc3776d2017-08-21 23:17:22 +02001242 }
1243 ],
1244 "checksums" : [],
1245 "force_arith" : [],
1246 "extern_instances" : [],
1247 "field_aliases" : [
1248 [
1249 "queueing_metadata.enq_timestamp",
1250 ["standard_metadata", "enq_timestamp"]
1251 ],
1252 [
1253 "queueing_metadata.enq_qdepth",
1254 ["standard_metadata", "enq_qdepth"]
1255 ],
1256 [
1257 "queueing_metadata.deq_timedelta",
1258 ["standard_metadata", "deq_timedelta"]
1259 ],
1260 [
1261 "queueing_metadata.deq_qdepth",
1262 ["standard_metadata", "deq_qdepth"]
1263 ],
1264 [
1265 "intrinsic_metadata.ingress_global_timestamp",
1266 ["standard_metadata", "ingress_global_timestamp"]
1267 ],
1268 [
1269 "intrinsic_metadata.lf_field_list",
1270 ["standard_metadata", "lf_field_list"]
1271 ],
1272 [
1273 "intrinsic_metadata.mcast_grp",
1274 ["standard_metadata", "mcast_grp"]
1275 ],
1276 [
1277 "intrinsic_metadata.resubmit_flag",
1278 ["standard_metadata", "resubmit_flag"]
1279 ],
1280 [
1281 "intrinsic_metadata.egress_rid",
1282 ["standard_metadata", "egress_rid"]
1283 ]
1284 ]
1285}