blob: 5de22a572e673ec30ddf3717a57024e246c87d5c [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" : [
12 ["tmp", 64, false],
13 ["tmp_0", 32, false],
14 ["tmp_1", 32, false]
15 ]
16 },
17 {
18 "name" : "ethernet_t",
19 "id" : 1,
20 "fields" : [
21 ["dstAddr", 48, false],
22 ["srcAddr", 48, false],
23 ["etherType", 16, false]
24 ]
25 },
26 {
27 "name" : "ipv4_t",
28 "id" : 2,
29 "fields" : [
30 ["version", 4, false],
31 ["ihl", 4, false],
32 ["diffserv", 8, false],
33 ["totalLen", 16, false],
34 ["identification", 16, false],
35 ["flags", 3, false],
36 ["fragOffset", 13, false],
37 ["ttl", 8, false],
38 ["protocol", 8, false],
39 ["hdrChecksum", 16, false],
40 ["srcAddr", 32, false],
41 ["dstAddr", 32, false]
42 ]
43 },
44 {
45 "name" : "tcp_t",
46 "id" : 3,
47 "fields" : [
48 ["srcPort", 16, false],
49 ["dstPort", 16, false],
50 ["seqNo", 32, false],
51 ["ackNo", 32, false],
52 ["dataOffset", 4, false],
53 ["res", 3, false],
54 ["ecn", 3, false],
55 ["ctrl", 6, false],
56 ["window", 16, false],
57 ["checksum", 16, false],
58 ["urgentPtr", 16, false]
59 ]
60 },
61 {
62 "name" : "udp_t",
63 "id" : 4,
64 "fields" : [
65 ["srcPort", 16, false],
66 ["dstPort", 16, false],
67 ["length_", 16, false],
68 ["checksum", 16, false]
69 ]
70 },
71 {
72 "name" : "ecmp_metadata_t",
73 "id" : 5,
74 "fields" : [
75 ["groupId", 16, false],
76 ["selector", 16, false],
77 ["groupSize", 32, false]
78 ]
79 },
80 {
81 "name" : "intrinsic_metadata_t",
82 "id" : 6,
83 "fields" : [
84 ["ingress_global_timestamp", 32, false],
85 ["lf_field_list", 32, false],
86 ["mcast_grp", 16, false],
87 ["egress_rid", 16, false]
88 ]
89 },
90 {
91 "name" : "standard_metadata",
92 "id" : 7,
93 "fields" : [
94 ["ingress_port", 9, false],
95 ["egress_spec", 9, false],
96 ["egress_port", 9, false],
97 ["clone_spec", 32, false],
98 ["instance_type", 32, false],
99 ["drop", 1, false],
100 ["recirculate_port", 16, false],
101 ["packet_length", 32, false],
102 ["enq_timestamp", 32, false],
103 ["enq_qdepth", 19, false],
104 ["deq_timedelta", 32, false],
105 ["deq_qdepth", 19, false],
106 ["ingress_global_timestamp", 48, false],
107 ["lf_field_list", 32, false],
108 ["mcast_grp", 16, false],
109 ["resubmit_flag", 1, false],
110 ["egress_rid", 16, false],
111 ["_padding", 5, false]
112 ]
113 }
114 ],
115 "headers" : [
116 {
117 "name" : "scalars",
118 "id" : 0,
119 "header_type" : "scalars_0",
120 "metadata" : true,
121 "pi_omit" : true
122 },
123 {
124 "name" : "standard_metadata",
125 "id" : 1,
126 "header_type" : "standard_metadata",
127 "metadata" : true,
128 "pi_omit" : true
129 },
130 {
131 "name" : "ethernet",
132 "id" : 2,
133 "header_type" : "ethernet_t",
134 "metadata" : false,
135 "pi_omit" : true
136 },
137 {
138 "name" : "ipv4",
139 "id" : 3,
140 "header_type" : "ipv4_t",
141 "metadata" : false,
142 "pi_omit" : true
143 },
144 {
145 "name" : "tcp",
146 "id" : 4,
147 "header_type" : "tcp_t",
148 "metadata" : false,
149 "pi_omit" : true
150 },
151 {
152 "name" : "udp",
153 "id" : 5,
154 "header_type" : "udp_t",
155 "metadata" : false,
156 "pi_omit" : true
157 },
158 {
159 "name" : "ecmp_metadata",
160 "id" : 6,
161 "header_type" : "ecmp_metadata_t",
162 "metadata" : true,
163 "pi_omit" : true
164 },
165 {
166 "name" : "intrinsic_metadata",
167 "id" : 7,
168 "header_type" : "intrinsic_metadata_t",
169 "metadata" : true,
170 "pi_omit" : true
171 }
172 ],
173 "header_stacks" : [],
174 "header_union_types" : [],
175 "header_unions" : [],
176 "header_union_stacks" : [],
177 "field_lists" : [],
178 "errors" : [
179 ["NoError", 1],
180 ["PacketTooShort", 2],
181 ["NoMatch", 3],
182 ["StackOutOfBounds", 4],
183 ["HeaderTooShort", 5],
184 ["ParserTimeout", 6]
185 ],
186 "enums" : [],
187 "parsers" : [
188 {
189 "name" : "parser",
190 "id" : 0,
191 "init_state" : "start",
192 "parse_states" : [
193 {
194 "name" : "parse_ethernet",
195 "id" : 0,
196 "parser_ops" : [
197 {
198 "parameters" : [
199 {
200 "type" : "regular",
201 "value" : "ethernet"
202 }
203 ],
204 "op" : "extract"
205 }
206 ],
207 "transitions" : [
208 {
209 "value" : "0x0800",
210 "mask" : null,
211 "next_state" : "parse_ipv4"
212 },
213 {
214 "value" : "default",
215 "mask" : null,
216 "next_state" : null
217 }
218 ],
219 "transition_key" : [
220 {
221 "type" : "field",
222 "value" : ["ethernet", "etherType"]
223 }
224 ]
225 },
226 {
227 "name" : "parse_ipv4",
228 "id" : 1,
229 "parser_ops" : [
230 {
231 "parameters" : [
232 {
233 "type" : "regular",
234 "value" : "ipv4"
235 }
236 ],
237 "op" : "extract"
238 }
239 ],
240 "transitions" : [
241 {
242 "value" : "0x000006",
243 "mask" : null,
244 "next_state" : "parse_tcp"
245 },
246 {
247 "value" : "0x000011",
248 "mask" : null,
249 "next_state" : "parse_udp"
250 },
251 {
252 "value" : "default",
253 "mask" : null,
254 "next_state" : null
255 }
256 ],
257 "transition_key" : [
258 {
259 "type" : "field",
260 "value" : ["ipv4", "fragOffset"]
261 },
262 {
263 "type" : "field",
264 "value" : ["ipv4", "protocol"]
265 }
266 ]
267 },
268 {
269 "name" : "parse_tcp",
270 "id" : 2,
271 "parser_ops" : [
272 {
273 "parameters" : [
274 {
275 "type" : "regular",
276 "value" : "tcp"
277 }
278 ],
279 "op" : "extract"
280 }
281 ],
282 "transitions" : [
283 {
284 "value" : "default",
285 "mask" : null,
286 "next_state" : null
287 }
288 ],
289 "transition_key" : []
290 },
291 {
292 "name" : "parse_udp",
293 "id" : 3,
294 "parser_ops" : [
295 {
296 "parameters" : [
297 {
298 "type" : "regular",
299 "value" : "udp"
300 }
301 ],
302 "op" : "extract"
303 }
304 ],
305 "transitions" : [
306 {
307 "value" : "default",
308 "mask" : null,
309 "next_state" : null
310 }
311 ],
312 "transition_key" : []
313 },
314 {
315 "name" : "start",
316 "id" : 4,
317 "parser_ops" : [],
318 "transitions" : [
319 {
320 "value" : "default",
321 "mask" : null,
322 "next_state" : "parse_ethernet"
323 }
324 ],
325 "transition_key" : []
326 }
327 ]
328 }
329 ],
330 "deparsers" : [
331 {
332 "name" : "deparser",
333 "id" : 0,
334 "order" : ["ethernet", "ipv4", "udp", "tcp"]
335 }
336 ],
337 "meter_arrays" : [],
338 "counter_arrays" : [
339 {
340 "name" : "table0_counter",
341 "id" : 0,
342 "is_direct" : true,
343 "binding" : "table0"
344 },
345 {
346 "name" : "ecmp_group_table_counter",
347 "id" : 1,
348 "is_direct" : true,
349 "binding" : "ecmp_group_table"
350 },
351 {
352 "name" : "egress_port_counter",
353 "id" : 2,
354 "size" : 254,
355 "is_direct" : false
356 },
357 {
358 "name" : "ingress_port_counter",
359 "id" : 3,
360 "size" : 254,
361 "is_direct" : false
362 }
363 ],
364 "register_arrays" : [],
365 "calculations" : [
366 {
367 "name" : "calc",
368 "id" : 0,
369 "algo" : "crc32",
370 "input" : [
371 {
372 "type" : "field",
373 "value" : ["ipv4", "srcAddr"]
374 },
375 {
376 "type" : "field",
377 "value" : ["ipv4", "dstAddr"]
378 },
379 {
380 "type" : "field",
381 "value" : ["ipv4", "protocol"]
382 },
383 {
384 "type" : "field",
385 "value" : ["tcp", "srcPort"]
386 },
387 {
388 "type" : "field",
389 "value" : ["tcp", "dstPort"]
390 },
391 {
392 "type" : "field",
393 "value" : ["udp", "srcPort"]
394 },
395 {
396 "type" : "field",
397 "value" : ["udp", "dstPort"]
398 }
399 ]
400 }
401 ],
402 "learn_lists" : [],
403 "actions" : [
404 {
405 "name" : "NoAction",
406 "id" : 0,
407 "runtime_data" : [],
408 "primitives" : []
409 },
410 {
411 "name" : "NoAction",
412 "id" : 1,
413 "runtime_data" : [],
414 "primitives" : []
415 },
416 {
417 "name" : "NoAction",
418 "id" : 2,
419 "runtime_data" : [],
420 "primitives" : []
421 },
422 {
423 "name" : "set_egress_port",
424 "id" : 3,
425 "runtime_data" : [
426 {
427 "name" : "port",
428 "bitwidth" : 9
429 }
430 ],
431 "primitives" : [
432 {
433 "op" : "assign",
434 "parameters" : [
435 {
436 "type" : "field",
437 "value" : ["standard_metadata", "egress_spec"]
438 },
439 {
440 "type" : "runtime_data",
441 "value" : 0
442 }
443 ],
444 "source_info" : {
445 "filename" : "include/actions.p4",
446 "line" : 1,
447 "column" : 23,
448 "source_fragment" : "port) { ..."
449 }
450 }
451 ]
452 },
453 {
454 "name" : "set_egress_port",
455 "id" : 4,
456 "runtime_data" : [
457 {
458 "name" : "port",
459 "bitwidth" : 9
460 }
461 ],
462 "primitives" : [
463 {
464 "op" : "assign",
465 "parameters" : [
466 {
467 "type" : "field",
468 "value" : ["standard_metadata", "egress_spec"]
469 },
470 {
471 "type" : "runtime_data",
472 "value" : 0
473 }
474 ],
475 "source_info" : {
476 "filename" : "include/actions.p4",
477 "line" : 1,
478 "column" : 23,
479 "source_fragment" : "port) { ..."
480 }
481 }
482 ]
483 },
484 {
485 "name" : "ecmp_group",
486 "id" : 5,
487 "runtime_data" : [
488 {
489 "name" : "groupId",
490 "bitwidth" : 16
491 },
492 {
493 "name" : "groupSize",
494 "bitwidth" : 32
495 }
496 ],
497 "primitives" : [
498 {
499 "op" : "assign",
500 "parameters" : [
501 {
502 "type" : "field",
503 "value" : ["ecmp_metadata", "groupId"]
504 },
505 {
506 "type" : "runtime_data",
507 "value" : 0
508 }
509 ],
510 "source_info" : {
511 "filename" : "ecmp.p4",
512 "line" : 35,
513 "column" : 18,
514 "source_fragment" : "groupId, groupSize) { ..."
515 }
516 },
517 {
518 "op" : "assign",
519 "parameters" : [
520 {
521 "type" : "field",
522 "value" : ["ecmp_metadata", "groupSize"]
523 },
524 {
525 "type" : "runtime_data",
526 "value" : 1
527 }
528 ],
529 "source_info" : {
530 "filename" : "ecmp.p4",
531 "line" : 35,
532 "column" : 27,
533 "source_fragment" : "groupSize) { ..."
534 }
535 },
536 {
537 "op" : "assign",
538 "parameters" : [
539 {
540 "type" : "field",
541 "value" : ["scalars", "tmp"]
542 },
543 {
544 "type" : "expression",
545 "value" : {
546 "type" : "expression",
547 "value" : {
548 "op" : "&",
549 "left" : {
550 "type" : "local",
551 "value" : 1
552 },
553 "right" : {
554 "type" : "hexstr",
555 "value" : "0xffffffffffffffff"
556 }
557 }
558 }
559 }
560 ]
561 },
562 {
563 "op" : "modify_field_with_hash_based_offset",
564 "parameters" : [
565 {
566 "type" : "field",
567 "value" : ["ecmp_metadata", "selector"]
568 },
569 {
570 "type" : "hexstr",
571 "value" : "0x00000000"
572 },
573 {
574 "type" : "calculation",
575 "value" : "calc"
576 },
577 {
578 "type" : "field",
579 "value" : ["scalars", "tmp"]
580 }
581 ],
582 "source_info" : {
583 "filename" : "ecmp.p4",
584 "line" : 38,
585 "column" : 4,
586 "source_fragment" : "modify_field_with_hash_based_offset(ecmp_metadata.selector, 0, ecmp_hash, groupSize)"
587 }
588 }
589 ]
590 },
591 {
592 "name" : "send_to_cpu",
593 "id" : 6,
594 "runtime_data" : [],
595 "primitives" : [
596 {
597 "op" : "assign",
598 "parameters" : [
599 {
600 "type" : "field",
601 "value" : ["standard_metadata", "egress_spec"]
602 },
603 {
604 "type" : "hexstr",
605 "value" : "0x00ff"
606 }
607 ],
608 "source_info" : {
609 "filename" : "include/actions.p4",
610 "line" : 10,
611 "column" : 4,
612 "source_fragment" : "modify_field(standard_metadata.egress_spec, 255)"
613 }
614 }
615 ]
616 },
617 {
618 "name" : "drop",
619 "id" : 7,
620 "runtime_data" : [],
621 "primitives" : [
622 {
623 "op" : "assign",
624 "parameters" : [
625 {
626 "type" : "field",
627 "value" : ["standard_metadata", "egress_spec"]
628 },
629 {
630 "type" : "hexstr",
631 "value" : "0x01ff"
632 }
633 ],
634 "source_info" : {
635 "filename" : "include/actions.p4",
636 "line" : 6,
637 "column" : 4,
638 "source_fragment" : "modify_field(standard_metadata.egress_spec, 511)"
639 }
640 }
641 ]
642 },
643 {
644 "name" : "count_packet",
645 "id" : 8,
646 "runtime_data" : [],
647 "primitives" : [
648 {
649 "op" : "assign",
650 "parameters" : [
651 {
652 "type" : "field",
653 "value" : ["scalars", "tmp_0"]
654 },
655 {
656 "type" : "expression",
657 "value" : {
658 "type" : "expression",
659 "value" : {
660 "op" : "&",
661 "left" : {
662 "type" : "field",
663 "value" : ["standard_metadata", "ingress_port"]
664 },
665 "right" : {
666 "type" : "hexstr",
667 "value" : "0xffffffff"
668 }
669 }
670 }
671 }
672 ]
673 },
674 {
675 "op" : "count",
676 "parameters" : [
677 {
678 "type" : "counter_array",
679 "value" : "ingress_port_counter"
680 },
681 {
682 "type" : "field",
683 "value" : ["scalars", "tmp_0"]
684 }
685 ],
686 "source_info" : {
687 "filename" : "include/port_counters.p4",
688 "line" : 20,
689 "column" : 4,
690 "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
691 }
692 },
693 {
694 "op" : "assign",
695 "parameters" : [
696 {
697 "type" : "field",
698 "value" : ["scalars", "tmp_1"]
699 },
700 {
701 "type" : "expression",
702 "value" : {
703 "type" : "expression",
704 "value" : {
705 "op" : "&",
706 "left" : {
707 "type" : "field",
708 "value" : ["standard_metadata", "egress_spec"]
709 },
710 "right" : {
711 "type" : "hexstr",
712 "value" : "0xffffffff"
713 }
714 }
715 }
716 }
717 ]
718 },
719 {
720 "op" : "count",
721 "parameters" : [
722 {
723 "type" : "counter_array",
724 "value" : "egress_port_counter"
725 },
726 {
727 "type" : "field",
728 "value" : ["scalars", "tmp_1"]
729 }
730 ],
731 "source_info" : {
732 "filename" : "include/port_counters.p4",
733 "line" : 21,
734 "column" : 4,
735 "source_fragment" : "count(egress_port_counter, standard_metadata.egress_spec)"
736 }
737 }
738 ]
739 }
740 ],
741 "pipelines" : [
742 {
743 "name" : "ingress",
744 "id" : 0,
745 "init_table" : "table0",
746 "tables" : [
747 {
748 "name" : "table0",
749 "id" : 0,
750 "source_info" : {
751 "filename" : "ecmp.p4",
752 "line" : 41,
753 "column" : 0,
754 "source_fragment" : "table table0 { ..."
755 },
756 "key" : [
757 {
758 "match_type" : "ternary",
759 "target" : ["standard_metadata", "ingress_port"],
760 "mask" : null
761 },
762 {
763 "match_type" : "ternary",
764 "target" : ["ethernet", "dstAddr"],
765 "mask" : null
766 },
767 {
768 "match_type" : "ternary",
769 "target" : ["ethernet", "srcAddr"],
770 "mask" : null
771 },
772 {
773 "match_type" : "ternary",
774 "target" : ["ethernet", "etherType"],
775 "mask" : null
776 }
777 ],
778 "match_type" : "ternary",
779 "type" : "simple",
780 "max_size" : 1024,
781 "with_counters" : true,
782 "support_timeout" : false,
783 "direct_meters" : null,
784 "action_ids" : [4, 5, 6, 7, 1],
785 "actions" : ["set_egress_port", "ecmp_group", "send_to_cpu", "drop", "NoAction"],
786 "base_default_next" : "node_4",
787 "next_tables" : {
788 "ecmp_group" : "ecmp_group_table",
789 "set_egress_port" : "node_4",
790 "send_to_cpu" : "node_4",
791 "drop" : "node_4",
792 "NoAction" : "node_4"
793 },
794 "default_entry" : {
795 "action_id" : 1,
796 "action_const" : false,
797 "action_data" : [],
798 "action_entry_const" : false
799 }
800 },
801 {
802 "name" : "ecmp_group_table",
803 "id" : 1,
804 "source_info" : {
805 "filename" : "ecmp.p4",
806 "line" : 57,
807 "column" : 0,
808 "source_fragment" : "table ecmp_group_table { ..."
809 },
810 "key" : [
811 {
812 "match_type" : "exact",
813 "target" : ["ecmp_metadata", "groupId"],
814 "mask" : null
815 },
816 {
817 "match_type" : "exact",
818 "target" : ["ecmp_metadata", "selector"],
819 "mask" : null
820 }
821 ],
822 "match_type" : "exact",
823 "type" : "simple",
824 "max_size" : 1024,
825 "with_counters" : true,
826 "support_timeout" : false,
827 "direct_meters" : null,
828 "action_ids" : [3, 0],
829 "actions" : ["set_egress_port", "NoAction"],
830 "base_default_next" : "node_4",
831 "next_tables" : {
832 "set_egress_port" : "node_4",
833 "NoAction" : "node_4"
834 },
835 "default_entry" : {
836 "action_id" : 0,
837 "action_const" : false,
838 "action_data" : [],
839 "action_entry_const" : false
840 }
841 },
842 {
843 "name" : "port_count_table",
844 "id" : 2,
845 "source_info" : {
846 "filename" : "include/port_counters.p4",
847 "line" : 13,
848 "column" : 0,
849 "source_fragment" : "table port_count_table { ..."
850 },
851 "key" : [],
852 "match_type" : "exact",
853 "type" : "simple",
854 "max_size" : 1024,
855 "with_counters" : false,
856 "support_timeout" : false,
857 "direct_meters" : null,
858 "action_ids" : [8, 2],
859 "actions" : ["count_packet", "NoAction"],
860 "base_default_next" : null,
861 "next_tables" : {
862 "count_packet" : null,
863 "NoAction" : null
864 },
865 "default_entry" : {
866 "action_id" : 2,
867 "action_const" : false,
868 "action_data" : [],
869 "action_entry_const" : false
870 }
871 }
872 ],
873 "action_profiles" : [],
874 "conditionals" : [
875 {
876 "name" : "node_4",
877 "id" : 0,
878 "source_info" : {
879 "filename" : "include/port_counters.p4",
880 "line" : 26,
881 "column" : 35,
882 "source_fragment" : "<"
883 },
884 "expression" : {
885 "type" : "expression",
886 "value" : {
887 "op" : "<",
888 "left" : {
889 "type" : "field",
890 "value" : ["standard_metadata", "egress_spec"]
891 },
892 "right" : {
893 "type" : "hexstr",
894 "value" : "0x00fe"
895 }
896 }
897 },
898 "false_next" : null,
899 "true_next" : "port_count_table"
900 }
901 ]
902 },
903 {
904 "name" : "egress",
905 "id" : 1,
906 "init_table" : null,
907 "tables" : [],
908 "action_profiles" : [],
909 "conditionals" : []
910 }
911 ],
912 "checksums" : [],
913 "force_arith" : [],
914 "extern_instances" : [],
915 "field_aliases" : [
916 [
917 "queueing_metadata.enq_timestamp",
918 ["standard_metadata", "enq_timestamp"]
919 ],
920 [
921 "queueing_metadata.enq_qdepth",
922 ["standard_metadata", "enq_qdepth"]
923 ],
924 [
925 "queueing_metadata.deq_timedelta",
926 ["standard_metadata", "deq_timedelta"]
927 ],
928 [
929 "queueing_metadata.deq_qdepth",
930 ["standard_metadata", "deq_qdepth"]
931 ],
932 [
933 "intrinsic_metadata.ingress_global_timestamp",
934 ["standard_metadata", "ingress_global_timestamp"]
935 ],
936 [
937 "intrinsic_metadata.lf_field_list",
938 ["standard_metadata", "lf_field_list"]
939 ],
940 [
941 "intrinsic_metadata.mcast_grp",
942 ["standard_metadata", "mcast_grp"]
943 ],
944 [
945 "intrinsic_metadata.resubmit_flag",
946 ["standard_metadata", "resubmit_flag"]
947 ],
948 [
949 "intrinsic_metadata.egress_rid",
950 ["standard_metadata", "egress_rid"]
951 ]
952 ]
953}