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