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