Support tofino build for P4_14 test programs
Also, modified programs such that both the P4_14 and P4_16 versions
produce the same forwarding behaviour and control API (i.e. P4Info)
Change-Id: I90b7fdfedff5f2a89e0f2295d32e2bb61cd0e0eb
diff --git a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java
index fa6a8ea..3fc7287 100644
--- a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java
+++ b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java
@@ -62,7 +62,7 @@
private static final String TABLE0 = "table0";
private static final String SEND_TO_CPU = "send_to_cpu";
private static final String PORT = "port";
- private static final String DROP = "drop";
+ private static final String DROP = "_drop";
private static final String SET_EGRESS_PORT = "set_egress_port";
private static final String EGRESS_PORT = "egress_port";
private static final int PORT_NUMBER_BIT_WIDTH = 9;
diff --git a/tools/test/p4src/p4-14/Makefile b/tools/test/p4src/p4-14/Makefile
index 6b9618b..623b5d3 100644
--- a/tools/test/p4src/p4-14/Makefile
+++ b/tools/test/p4src/p4-14/Makefile
@@ -1,7 +1,7 @@
all: default.json empty.json ecmp.json wcmp.json
default.json: default.p4
- p4c-bm2-ss --p4v 14 -o p4c-out/default.json \
+ p4c-bm2-ss -D DO_BMV2_BUILD --p4v 14 -o p4c-out/default.json \
--p4runtime-file p4c-out/default.p4info --p4runtime-format text \
default.p4
@@ -11,13 +11,13 @@
empty.p4
ecmp.json: ecmp.p4
- p4c-bm2-ss --p4v 14 -o p4c-out/ecmp.json \
+ p4c-bm2-ss -D DO_BMV2_BUILD --p4v 14 -o p4c-out/ecmp.json \
--p4runtime-file p4c-out/ecmp.p4info --p4runtime-format text \
ecmp.p4
wcmp.json: wcmp.p4
- p4c-bm2-ss --p4v 14 -o p4c-out/wcmp.json \
- --p4runtime-file p4c-out/ecmp.p4info --p4runtime-format text \
+ p4c-bm2-ss -D DO_BMV2_BUILD --p4v 14 -o p4c-out/wcmp.json \
+ --p4runtime-file p4c-out/wcmp.p4info --p4runtime-format text \
wcmp.p4
clean:
diff --git a/tools/test/p4src/p4-14/default.p4 b/tools/test/p4src/p4-14/default.p4
index be88a5d..f653b98 100644
--- a/tools/test/p4src/p4-14/default.p4
+++ b/tools/test/p4src/p4-14/default.p4
@@ -3,18 +3,19 @@
#include "include/parser.p4"
#include "include/actions.p4"
#include "include/port_counters.p4"
+#include "include/packet_io.p4"
table table0 {
reads {
- standard_metadata.ingress_port : ternary;
- ethernet.dstAddr : ternary;
- ethernet.srcAddr : ternary;
+ IGR_PORT_FIELD : ternary;
+ ethernet.dstAddr : ternary;
+ ethernet.srcAddr : ternary;
ethernet.etherType : ternary;
}
actions {
set_egress_port;
send_to_cpu;
- drop;
+ _drop;
}
support_timeout: true;
}
@@ -26,6 +27,13 @@
}
control ingress {
- apply(table0);
+ ingress_pkt_io();
+ if (not valid(packet_out_hdr)) {
+ apply(table0);
+ }
process_port_counters();
+}
+
+control egress {
+ egress_pkt_io();
}
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/ecmp.p4 b/tools/test/p4src/p4-14/ecmp.p4
index f751049..341e1e1 100644
--- a/tools/test/p4src/p4-14/ecmp.p4
+++ b/tools/test/p4src/p4-14/ecmp.p4
@@ -3,12 +3,19 @@
#include "include/parser.p4"
#include "include/actions.p4"
#include "include/port_counters.p4"
+#include "include/packet_io.p4"
+
+/*
+ Expected number of ports of an ECMP group.
+ This value is fixed, .i.e. we do not support ECMP over port groups of different size.
+ Due to hardware limitations, this value must be constant and a power of 2.
+*/
+#define ECMP_GROUP_SIZE 4
header_type ecmp_metadata_t {
fields {
groupId : 16;
selector : 16;
- groupSize : 32; // Not used. Workaround to avoid p4c complaining about inferring type to groupSize.
}
}
@@ -32,24 +39,26 @@
output_width : 32;
}
-action ecmp_group(groupId, groupSize) {
+action ecmp_group(groupId) {
modify_field(ecmp_metadata.groupId, groupId);
- modify_field(ecmp_metadata.groupSize, groupSize);
- modify_field_with_hash_based_offset(ecmp_metadata.selector, 0, ecmp_hash, groupSize);
+ modify_field_with_hash_based_offset(ecmp_metadata.selector, 0, ecmp_hash, ECMP_GROUP_SIZE);
}
+#ifdef __TOFINO_BUILD__
+@pragma immediate 0
+#endif
table table0 {
reads {
- standard_metadata.ingress_port : ternary;
- ethernet.dstAddr : ternary;
- ethernet.srcAddr : ternary;
+ IGR_PORT_FIELD : ternary;
+ ethernet.dstAddr : ternary;
+ ethernet.srcAddr : ternary;
ethernet.etherType : ternary;
}
actions {
set_egress_port;
ecmp_group;
send_to_cpu;
- drop;
+ _drop;
}
support_timeout: true;
}
@@ -77,10 +86,17 @@
}
control ingress {
- apply(table0) {
- ecmp_group {
- apply(ecmp_group_table);
+ ingress_pkt_io();
+ if (not valid(packet_out_hdr)) {
+ apply(table0) {
+ ecmp_group {
+ apply(ecmp_group_table);
+ }
}
}
process_port_counters();
+}
+
+control egress {
+ egress_pkt_io();
}
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/include/actions.p4 b/tools/test/p4src/p4-14/include/actions.p4
index 8649da0..961890d 100644
--- a/tools/test/p4src/p4-14/include/actions.p4
+++ b/tools/test/p4src/p4-14/include/actions.p4
@@ -1,11 +1,24 @@
+#ifndef __ACTIONS_P4__
+#define __ACTIONS_P4__
+#include "headers.p4"
+
action set_egress_port(port) {
- modify_field(standard_metadata.egress_spec, port);
+ modify_field(EGR_PORT_FIELD, port);
}
-action drop() {
+action _drop() {
+ #ifdef __TOFINO_BUILD__
+ drop();
+ #else
modify_field(standard_metadata.egress_spec, DROP_PORT);
+ #endif
}
action send_to_cpu() {
+ #ifdef __TOFINO_BUILD__
+ modify_field(ig_intr_md_for_tm.copy_to_cpu, 1);
+ #else
modify_field(standard_metadata.egress_spec, CPU_PORT);
-}
\ No newline at end of file
+ #endif
+}
+#endif
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/include/defines.p4 b/tools/test/p4src/p4-14/include/defines.p4
index c9229c9..b47a74a 100644
--- a/tools/test/p4src/p4-14/include/defines.p4
+++ b/tools/test/p4src/p4-14/include/defines.p4
@@ -2,3 +2,25 @@
#define MAX_PORTS 254
#define CPU_PORT 255
#define DROP_PORT 511
+
+#define NULL_ETH_TYPE 0x00
+#define ETHERTYPE_IPV4 0x0800
+#define IP_PROTOCOLS_TCP 6
+#define IP_PROTOCOLS_UDP 17
+
+// Build for Tofino by default.
+
+#ifdef DO_BMV2_BUILD
+#define __BMV2_BUILD__ 1
+#else
+#define __TOFINO_BUILD__ 1
+#endif
+
+#ifdef __TOFINO_BUILD__
+#define EGR_PORT_FIELD ig_intr_md_for_tm.ucast_egress_port
+#define IGR_PORT_FIELD ig_intr_md.ingress_port
+
+#else
+#define EGR_PORT_FIELD standard_metadata.egress_spec
+#define IGR_PORT_FIELD standard_metadata.ingress_port
+#endif
diff --git a/tools/test/p4src/p4-14/include/headers.p4 b/tools/test/p4src/p4-14/include/headers.p4
index 57bda87..c8fb31f 100644
--- a/tools/test/p4src/p4-14/include/headers.p4
+++ b/tools/test/p4src/p4-14/include/headers.p4
@@ -1,9 +1,19 @@
-header_type intrinsic_metadata_t {
+#ifndef __HEADERS_P4__
+#define __HEADERS_P4__
+
+#ifdef __TOFINO_BUILD__
+#include <tofino/intrinsic_metadata.p4>
+#endif
+
+header_type packet_in_t {
fields {
- ingress_global_timestamp : 32;
- lf_field_list : 32;
- mcast_grp : 16;
- egress_rid : 16;
+ ingress_port: 9;
+ }
+}
+
+header_type packet_out_t {
+ fields {
+ egress_port: 9;
}
}
@@ -55,4 +65,6 @@
length_ : 16;
checksum : 16;
}
-}
\ No newline at end of file
+}
+
+#endif
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/include/packet_io.p4 b/tools/test/p4src/p4-14/include/packet_io.p4
new file mode 100644
index 0000000..5da7a65
--- /dev/null
+++ b/tools/test/p4src/p4-14/include/packet_io.p4
@@ -0,0 +1,46 @@
+#ifndef __PACKET_IO__
+#define __PACKET_IO__
+#include "headers.p4"
+#include "parser.p4"
+
+action _packet_out() {
+ modify_field(EGR_PORT_FIELD, packet_out_hdr.egress_port);
+ remove_header(packet_out_hdr);
+}
+
+table ingress_pkt {
+ actions {
+ _packet_out;
+ }
+ default_action: _packet_out();
+}
+
+control ingress_pkt_io {
+ if (valid(packet_out_hdr)) {
+ apply(ingress_pkt);
+ }
+}
+
+action add_packet_in_hdr() {
+ add_header(packet_in_hdr);
+ modify_field(packet_in_hdr.ingress_port, IGR_PORT_FIELD);
+}
+
+table egress_pkt {
+ actions {
+ add_packet_in_hdr;
+ }
+ default_action: add_packet_in_hdr();
+}
+
+control egress_pkt_io {
+ #ifdef __TOFINO_BUILD__
+ if (ig_intr_md_for_tm.copy_to_cpu == 1) {
+ #else
+ if (IGR_PORT_FIELD == CPU_PORT) {
+ #endif
+ apply(egress_pkt);
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/include/parser.p4 b/tools/test/p4src/p4-14/include/parser.p4
index 6a205ec..73dcdfd 100644
--- a/tools/test/p4src/p4-14/include/parser.p4
+++ b/tools/test/p4src/p4-14/include/parser.p4
@@ -1,12 +1,40 @@
-metadata intrinsic_metadata_t intrinsic_metadata;
+#ifndef __PARSER_P4__
+#define __PARSER_P4__
+#include "defines.p4"
+#include "headers.p4"
+
+header packet_in_t packet_in_hdr;
+header packet_out_t packet_out_hdr;
+header ethernet_t ethernet;
+header ipv4_t ipv4;
+header tcp_t tcp;
+header udp_t udp;
parser start {
+ // FIXME: Cheat the compiler to generate the deparser of packet in
+ // This is just a hack, we assume first 8 bit of etherType won't be 0
+ return select( current(96, 8) ) {
+ NULL_ETH_TYPE : parse_pkt_in;
+ default : default_parser;
+ }
+}
+
+parser parse_pkt_in {
+ extract(packet_in_hdr);
return parse_ethernet;
}
-#define ETHERTYPE_IPV4 0x0800
+parser default_parser {
+ return select(IGR_PORT_FIELD) {
+ CPU_PORT : parse_pkt_out;
+ default : parse_ethernet;
+ }
+}
-header ethernet_t ethernet;
+parser parse_pkt_out {
+ extract(packet_out_hdr);
+ return parse_ethernet;
+}
parser parse_ethernet {
extract(ethernet);
@@ -16,11 +44,6 @@
}
}
-header ipv4_t ipv4;
-
-#define IP_PROTOCOLS_TCP 6
-#define IP_PROTOCOLS_UDP 17
-
parser parse_ipv4 {
extract(ipv4);
return select(latest.fragOffset, latest.protocol) {
@@ -30,16 +53,14 @@
}
}
-header tcp_t tcp;
-
parser parse_tcp {
extract(tcp);
return ingress;
}
-header udp_t udp;
-
parser parse_udp {
extract(udp);
return ingress;
-}
\ No newline at end of file
+}
+
+#endif
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/include/port_counters.p4 b/tools/test/p4src/p4-14/include/port_counters.p4
index 06cba4f..44a2b0e 100644
--- a/tools/test/p4src/p4-14/include/port_counters.p4
+++ b/tools/test/p4src/p4-14/include/port_counters.p4
@@ -1,5 +1,9 @@
+#ifndef __PORT_COUNTERS_P4__
+#define __PORT_COUNTERS_P4__
+#include "defines.p4"
+
counter ingress_port_counter {
- type : packets; // bmv2 always counts both bytes and packets
+ type : packets; // bmv2 always counts both bytes and packets
instance_count : MAX_PORTS;
min_width : 32;
}
@@ -10,20 +14,29 @@
min_width : 32;
}
-table port_count_table {
- actions {
- count_packet;
- }
+action count_ingress() {
+ count(ingress_port_counter, IGR_PORT_FIELD);
}
-action count_packet() {
- count(ingress_port_counter, standard_metadata.ingress_port);
- count(egress_port_counter, standard_metadata.egress_spec);
+action count_egress() {
+ count(egress_port_counter, EGR_PORT_FIELD);
+}
+
+table ingress_port_count_table {
+ actions { count_ingress; }
+ default_action: count_ingress;
+}
+
+table egress_port_count_table {
+ actions { count_egress; }
+ default_action: count_egress;
}
control process_port_counters {
- // Avoid counting logical ports, such as drop and cpu
- if (standard_metadata.egress_spec < MAX_PORTS) {
- apply(port_count_table);
- }
-}
\ No newline at end of file
+ if (EGR_PORT_FIELD < MAX_PORTS) {
+ apply(ingress_port_count_table);
+ apply(egress_port_count_table);
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/p4c-out/default.json b/tools/test/p4src/p4-14/p4c-out/default.json
index 4490c18..347b3be 100644
--- a/tools/test/p4src/p4-14/p4c-out/default.json
+++ b/tools/test/p4src/p4-14/p4c-out/default.json
@@ -9,8 +9,10 @@
"name" : "scalars_0",
"id" : 0,
"fields" : [
- ["tmp", 32, false],
- ["tmp_0", 32, false]
+ ["tmp_0", 104, false],
+ ["tmp", 8, false],
+ ["tmp_1", 32, false],
+ ["tmp_2", 32, false]
]
},
{
@@ -41,9 +43,25 @@
]
},
{
- "name" : "tcp_t",
+ "name" : "packet_in_t",
"id" : 3,
"fields" : [
+ ["ingress_port", 9, false],
+ ["_padding", 7, false]
+ ]
+ },
+ {
+ "name" : "packet_out_t",
+ "id" : 4,
+ "fields" : [
+ ["egress_port", 9, false],
+ ["_padding_0", 7, false]
+ ]
+ },
+ {
+ "name" : "tcp_t",
+ "id" : 5,
+ "fields" : [
["srcPort", 16, false],
["dstPort", 16, false],
["seqNo", 32, false],
@@ -59,7 +77,7 @@
},
{
"name" : "udp_t",
- "id" : 4,
+ "id" : 6,
"fields" : [
["srcPort", 16, false],
["dstPort", 16, false],
@@ -68,18 +86,8 @@
]
},
{
- "name" : "intrinsic_metadata_t",
- "id" : 5,
- "fields" : [
- ["ingress_global_timestamp", 32, false],
- ["lf_field_list", 32, false],
- ["mcast_grp", 16, false],
- ["egress_rid", 16, false]
- ]
- },
- {
"name" : "standard_metadata",
- "id" : 6,
+ "id" : 7,
"fields" : [
["ingress_port", 9, false],
["egress_spec", 9, false],
@@ -98,7 +106,7 @@
["mcast_grp", 16, false],
["resubmit_flag", 1, false],
["egress_rid", 16, false],
- ["_padding", 5, false]
+ ["_padding_1", 5, false]
]
}
],
@@ -132,25 +140,32 @@
"pi_omit" : true
},
{
- "name" : "tcp",
+ "name" : "packet_in_hdr",
"id" : 4,
+ "header_type" : "packet_in_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "packet_out_hdr",
+ "id" : 5,
+ "header_type" : "packet_out_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "tcp",
+ "id" : 6,
"header_type" : "tcp_t",
"metadata" : false,
"pi_omit" : true
},
{
"name" : "udp",
- "id" : 5,
+ "id" : 7,
"header_type" : "udp_t",
"metadata" : false,
"pi_omit" : true
- },
- {
- "name" : "intrinsic_metadata",
- "id" : 6,
- "header_type" : "intrinsic_metadata_t",
- "metadata" : true,
- "pi_omit" : true
}
],
"header_stacks" : [],
@@ -174,8 +189,31 @@
"init_state" : "start",
"parse_states" : [
{
- "name" : "parse_ethernet",
+ "name" : "default_parser",
"id" : 0,
+ "parser_ops" : [],
+ "transitions" : [
+ {
+ "value" : "0x00ff",
+ "mask" : null,
+ "next_state" : "parse_pkt_out"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_ethernet",
+ "id" : 1,
"parser_ops" : [
{
"parameters" : [
@@ -208,7 +246,7 @@
},
{
"name" : "parse_ipv4",
- "id" : 1,
+ "id" : 2,
"parser_ops" : [
{
"parameters" : [
@@ -249,8 +287,54 @@
]
},
{
+ "name" : "parse_pkt_in",
+ "id" : 3,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_in_hdr"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_pkt_out",
+ "id" : 4,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_out_hdr"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
"name" : "parse_tcp",
- "id" : 2,
+ "id" : 5,
"parser_ops" : [
{
"parameters" : [
@@ -273,7 +357,7 @@
},
{
"name" : "parse_udp",
- "id" : 3,
+ "id" : 6,
"parser_ops" : [
{
"parameters" : [
@@ -296,16 +380,66 @@
},
{
"name" : "start",
- "id" : 4,
- "parser_ops" : [],
+ "id" : 7,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_0"]
+ },
+ {
+ "type" : "lookahead",
+ "value" : [0, 104]
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp_0"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ }
+ ],
"transitions" : [
{
+ "value" : "0x00",
+ "mask" : null,
+ "next_state" : "parse_pkt_in"
+ },
+ {
"value" : "default",
"mask" : null,
- "next_state" : "parse_ethernet"
+ "next_state" : "default_parser"
}
],
- "transition_key" : []
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ }
+ ]
}
]
}
@@ -314,7 +448,7 @@
{
"name" : "deparser",
"id" : 0,
- "order" : ["ethernet", "ipv4", "udp", "tcp"]
+ "order" : ["packet_out_hdr", "packet_in_hdr", "ethernet", "ipv4", "udp", "tcp"]
}
],
"meter_arrays" : [],
@@ -343,10 +477,45 @@
"learn_lists" : [],
"actions" : [
{
- "name" : "NoAction",
+ "name" : "add_packet_in_hdr",
"id" : 0,
"runtime_data" : [],
- "primitives" : []
+ "primitives" : [
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_in_hdr"
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 25,
+ "column" : 4,
+ "source_fragment" : "add_header(packet_in_hdr)"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["packet_in_hdr", "ingress_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 26,
+ "column" : 4,
+ "source_fragment" : "modify_field(packet_in_hdr.ingress_port, standard_metadata.ingress_port)"
+ }
+ }
+ ]
},
{
"name" : "NoAction",
@@ -378,7 +547,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 1,
+ "line" : 5,
"column" : 23,
"source_fragment" : "port) { ..."
}
@@ -404,7 +573,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 21,
"column" : 4,
"source_fragment" : "modify_field(standard_metadata.egress_spec, 255)"
}
@@ -412,7 +581,7 @@
]
},
{
- "name" : "drop",
+ "name" : "_drop",
"id" : 4,
"runtime_data" : [],
"primitives" : [
@@ -430,7 +599,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 13,
"column" : 4,
"source_fragment" : "modify_field(standard_metadata.egress_spec, 511)"
}
@@ -438,7 +607,7 @@
]
},
{
- "name" : "count_packet",
+ "name" : "_packet_out",
"id" : 5,
"runtime_data" : [],
"primitives" : [
@@ -447,52 +616,48 @@
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp"]
- },
- {
- "type" : "expression",
- "value" : {
- "type" : "expression",
- "value" : {
- "op" : "&",
- "left" : {
- "type" : "field",
- "value" : ["standard_metadata", "ingress_port"]
- },
- "right" : {
- "type" : "hexstr",
- "value" : "0xffffffff"
- }
- }
- }
- }
- ]
- },
- {
- "op" : "count",
- "parameters" : [
- {
- "type" : "counter_array",
- "value" : "ingress_port_counter"
+ "value" : ["standard_metadata", "egress_spec"]
},
{
"type" : "field",
- "value" : ["scalars", "tmp"]
+ "value" : ["packet_out_hdr", "egress_port"]
}
],
"source_info" : {
- "filename" : "include/port_counters.p4",
- "line" : 20,
+ "filename" : "include/packet_io.p4",
+ "line" : 7,
"column" : 4,
- "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
+ "source_fragment" : "modify_field(standard_metadata.egress_spec, packet_out_hdr.egress_port)"
}
},
{
+ "op" : "remove_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_out_hdr"
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 8,
+ "column" : 4,
+ "source_fragment" : "remove_header(packet_out_hdr)"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "count_egress",
+ "id" : 6,
+ "runtime_data" : [],
+ "primitives" : [
+ {
"op" : "assign",
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["scalars", "tmp_1"]
},
{
"type" : "expression",
@@ -522,31 +687,112 @@
},
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["scalars", "tmp_1"]
}
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 21,
+ "line" : 22,
"column" : 4,
"source_fragment" : "count(egress_port_counter, standard_metadata.egress_spec)"
}
}
]
+ },
+ {
+ "name" : "count_ingress",
+ "id" : 7,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffffffff"
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "op" : "count",
+ "parameters" : [
+ {
+ "type" : "counter_array",
+ "value" : "ingress_port_counter"
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/port_counters.p4",
+ "line" : 18,
+ "column" : 4,
+ "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
+ }
+ }
+ ]
}
],
"pipelines" : [
{
"name" : "ingress",
"id" : 0,
- "init_table" : "table0",
+ "init_table" : "node_2",
"tables" : [
{
- "name" : "table0",
+ "name" : "ingress_pkt",
"id" : 0,
"source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 11,
+ "column" : 0,
+ "source_fragment" : "table ingress_pkt { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [5],
+ "actions" : ["_packet_out"],
+ "base_default_next" : "node_4",
+ "next_tables" : {
+ "_packet_out" : "node_4"
+ },
+ "default_entry" : {
+ "action_id" : 5,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "table0",
+ "id" : 1,
+ "source_info" : {
"filename" : "default.p4",
- "line" : 7,
+ "line" : 8,
"column" : 0,
"source_fragment" : "table table0 { ..."
},
@@ -578,30 +824,30 @@
"with_counters" : true,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [2, 3, 4, 0],
- "actions" : ["set_egress_port", "send_to_cpu", "drop", "NoAction"],
- "base_default_next" : "node_3",
+ "action_ids" : [2, 3, 4, 1],
+ "actions" : ["set_egress_port", "send_to_cpu", "_drop", "NoAction"],
+ "base_default_next" : "node_6",
"next_tables" : {
- "set_egress_port" : "node_3",
- "send_to_cpu" : "node_3",
- "drop" : "node_3",
- "NoAction" : "node_3"
+ "set_egress_port" : "node_6",
+ "send_to_cpu" : "node_6",
+ "_drop" : "node_6",
+ "NoAction" : "node_6"
},
"default_entry" : {
- "action_id" : 0,
+ "action_id" : 1,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
}
},
{
- "name" : "port_count_table",
- "id" : 1,
+ "name" : "ingress_port_count_table",
+ "id" : 2,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 13,
+ "line" : 25,
"column" : 0,
- "source_fragment" : "table port_count_table { ..."
+ "source_fragment" : "table ingress_port_count_table { ..."
},
"key" : [],
"match_type" : "exact",
@@ -610,15 +856,43 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [5, 1],
- "actions" : ["count_packet", "NoAction"],
- "base_default_next" : null,
+ "action_ids" : [7],
+ "actions" : ["count_ingress"],
+ "base_default_next" : "egress_port_count_table",
"next_tables" : {
- "count_packet" : null,
- "NoAction" : null
+ "count_ingress" : "egress_port_count_table"
},
"default_entry" : {
- "action_id" : 1,
+ "action_id" : 7,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "egress_port_count_table",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "include/port_counters.p4",
+ "line" : 30,
+ "column" : 0,
+ "source_fragment" : "table egress_port_count_table { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [6],
+ "actions" : ["count_egress"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "count_egress" : null
+ },
+ "default_entry" : {
+ "action_id" : 6,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -628,12 +902,64 @@
"action_profiles" : [],
"conditionals" : [
{
- "name" : "node_3",
+ "name" : "node_2",
"id" : 0,
"source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 19,
+ "column" : 8,
+ "source_fragment" : "valid(packet_out_hdr)"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out_hdr", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "ingress_pkt",
+ "false_next" : "node_4"
+ },
+ {
+ "name" : "node_4",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "default.p4",
+ "line" : 31,
+ "column" : 12,
+ "source_fragment" : "valid(packet_out_hdr)"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out_hdr", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "table0",
+ "false_next" : "node_6"
+ },
+ {
+ "name" : "node_6",
+ "id" : 2,
+ "source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 26,
- "column" : 35,
+ "line" : 36,
+ "column" : 38,
"source_fragment" : "<"
},
"expression" : {
@@ -651,17 +977,74 @@
}
},
"false_next" : null,
- "true_next" : "port_count_table"
+ "true_next" : "ingress_port_count_table"
}
]
},
{
"name" : "egress",
"id" : 1,
- "init_table" : null,
- "tables" : [],
+ "init_table" : "node_11",
+ "tables" : [
+ {
+ "name" : "egress_pkt",
+ "id" : 4,
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 29,
+ "column" : 0,
+ "source_fragment" : "table egress_pkt { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [0],
+ "actions" : ["add_packet_in_hdr"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "add_packet_in_hdr" : null
+ },
+ "default_entry" : {
+ "action_id" : 0,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ }
+ ],
"action_profiles" : [],
- "conditionals" : []
+ "conditionals" : [
+ {
+ "name" : "node_11",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 40,
+ "column" : 39,
+ "source_fragment" : "=="
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x00ff"
+ }
+ }
+ },
+ "false_next" : null,
+ "true_next" : "egress_pkt"
+ }
+ ]
}
],
"checksums" : [],
diff --git a/tools/test/p4src/p4-14/p4c-out/default.p4info b/tools/test/p4src/p4-14/p4c-out/default.p4info
index 40722aa..c076ebb 100644
--- a/tools/test/p4src/p4-14/p4c-out/default.p4info
+++ b/tools/test/p4src/p4-14/p4c-out/default.p4info
@@ -35,7 +35,7 @@
id: 16829080
}
action_refs {
- id: 16793508
+ id: 16784184
}
action_refs {
id: 16800567
@@ -47,16 +47,45 @@
}
tables {
preamble {
- id: 33583368
- name: "port_count_table"
- alias: "port_count_table"
+ id: 33560548
+ name: "ingress_pkt"
+ alias: "ingress_pkt"
}
action_refs {
- id: 16781545
+ id: 16835928
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33618793
+ name: "egress_port_count_table"
+ alias: "egress_port_count_table"
}
action_refs {
- id: 16800567
- annotations: "@defaultonly()"
+ id: 16822771
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33579767
+ name: "ingress_port_count_table"
+ alias: "ingress_port_count_table"
+ }
+ action_refs {
+ id: 16837943
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33608529
+ name: "egress_pkt"
+ alias: "egress_pkt"
+ }
+ action_refs {
+ id: 16835663
}
size: 1024
}
@@ -88,16 +117,37 @@
}
actions {
preamble {
- id: 16793508
- name: "drop"
- alias: "drop"
+ id: 16784184
+ name: "_drop"
+ alias: "_drop"
}
}
actions {
preamble {
- id: 16781545
- name: "count_packet"
- alias: "count_packet"
+ id: 16835928
+ name: "_packet_out"
+ alias: "_packet_out"
+ }
+}
+actions {
+ preamble {
+ id: 16822771
+ name: "count_egress"
+ alias: "count_egress"
+ }
+}
+actions {
+ preamble {
+ id: 16837943
+ name: "count_ingress"
+ alias: "count_ingress"
+ }
+}
+actions {
+ preamble {
+ id: 16835663
+ name: "add_packet_in_hdr"
+ alias: "add_packet_in_hdr"
}
}
counters {
@@ -135,3 +185,28 @@
}
direct_table_id: 33617813
}
+# Manually adding controller_packet_metadata for packet I/O since P4_14 doesn't support annotations.
+controller_packet_metadata {
+ preamble {
+ id: 2868941301
+ name: "packet_in"
+ annotations: "@controller_header(\"packet_in\")"
+ }
+ metadata {
+ id: 1
+ name: "ingress_port"
+ bitwidth: 9
+ }
+}
+controller_packet_metadata {
+ preamble {
+ id: 2868916615
+ name: "packet_out"
+ annotations: "@controller_header(\"packet_out\")"
+ }
+ metadata {
+ id: 1
+ name: "egress_port"
+ bitwidth: 9
+ }
+}
\ No newline at end of file
diff --git a/tools/test/p4src/p4-14/p4c-out/ecmp.json b/tools/test/p4src/p4-14/p4c-out/ecmp.json
index 5de22a5..8c971bb 100644
--- a/tools/test/p4src/p4-14/p4c-out/ecmp.json
+++ b/tools/test/p4src/p4-14/p4c-out/ecmp.json
@@ -9,9 +9,10 @@
"name" : "scalars_0",
"id" : 0,
"fields" : [
- ["tmp", 64, false],
- ["tmp_0", 32, false],
- ["tmp_1", 32, false]
+ ["tmp_0", 104, false],
+ ["tmp", 8, false],
+ ["tmp_1", 32, false],
+ ["tmp_2", 32, false]
]
},
{
@@ -42,9 +43,25 @@
]
},
{
- "name" : "tcp_t",
+ "name" : "packet_in_t",
"id" : 3,
"fields" : [
+ ["ingress_port", 9, false],
+ ["_padding", 7, false]
+ ]
+ },
+ {
+ "name" : "packet_out_t",
+ "id" : 4,
+ "fields" : [
+ ["egress_port", 9, false],
+ ["_padding_0", 7, false]
+ ]
+ },
+ {
+ "name" : "tcp_t",
+ "id" : 5,
+ "fields" : [
["srcPort", 16, false],
["dstPort", 16, false],
["seqNo", 32, false],
@@ -60,7 +77,7 @@
},
{
"name" : "udp_t",
- "id" : 4,
+ "id" : 6,
"fields" : [
["srcPort", 16, false],
["dstPort", 16, false],
@@ -70,26 +87,15 @@
},
{
"name" : "ecmp_metadata_t",
- "id" : 5,
+ "id" : 7,
"fields" : [
["groupId", 16, false],
- ["selector", 16, false],
- ["groupSize", 32, false]
- ]
- },
- {
- "name" : "intrinsic_metadata_t",
- "id" : 6,
- "fields" : [
- ["ingress_global_timestamp", 32, false],
- ["lf_field_list", 32, false],
- ["mcast_grp", 16, false],
- ["egress_rid", 16, false]
+ ["selector", 16, false]
]
},
{
"name" : "standard_metadata",
- "id" : 7,
+ "id" : 8,
"fields" : [
["ingress_port", 9, false],
["egress_spec", 9, false],
@@ -108,7 +114,7 @@
["mcast_grp", 16, false],
["resubmit_flag", 1, false],
["egress_rid", 16, false],
- ["_padding", 5, false]
+ ["_padding_1", 5, false]
]
}
],
@@ -142,32 +148,39 @@
"pi_omit" : true
},
{
- "name" : "tcp",
+ "name" : "packet_in_hdr",
"id" : 4,
+ "header_type" : "packet_in_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "packet_out_hdr",
+ "id" : 5,
+ "header_type" : "packet_out_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "tcp",
+ "id" : 6,
"header_type" : "tcp_t",
"metadata" : false,
"pi_omit" : true
},
{
"name" : "udp",
- "id" : 5,
+ "id" : 7,
"header_type" : "udp_t",
"metadata" : false,
"pi_omit" : true
},
{
"name" : "ecmp_metadata",
- "id" : 6,
+ "id" : 8,
"header_type" : "ecmp_metadata_t",
"metadata" : true,
"pi_omit" : true
- },
- {
- "name" : "intrinsic_metadata",
- "id" : 7,
- "header_type" : "intrinsic_metadata_t",
- "metadata" : true,
- "pi_omit" : true
}
],
"header_stacks" : [],
@@ -191,8 +204,31 @@
"init_state" : "start",
"parse_states" : [
{
- "name" : "parse_ethernet",
+ "name" : "default_parser",
"id" : 0,
+ "parser_ops" : [],
+ "transitions" : [
+ {
+ "value" : "0x00ff",
+ "mask" : null,
+ "next_state" : "parse_pkt_out"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_ethernet",
+ "id" : 1,
"parser_ops" : [
{
"parameters" : [
@@ -225,7 +261,7 @@
},
{
"name" : "parse_ipv4",
- "id" : 1,
+ "id" : 2,
"parser_ops" : [
{
"parameters" : [
@@ -266,8 +302,54 @@
]
},
{
+ "name" : "parse_pkt_in",
+ "id" : 3,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_in_hdr"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_pkt_out",
+ "id" : 4,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_out_hdr"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
"name" : "parse_tcp",
- "id" : 2,
+ "id" : 5,
"parser_ops" : [
{
"parameters" : [
@@ -290,7 +372,7 @@
},
{
"name" : "parse_udp",
- "id" : 3,
+ "id" : 6,
"parser_ops" : [
{
"parameters" : [
@@ -313,16 +395,66 @@
},
{
"name" : "start",
- "id" : 4,
- "parser_ops" : [],
+ "id" : 7,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_0"]
+ },
+ {
+ "type" : "lookahead",
+ "value" : [0, 104]
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp_0"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ }
+ ],
"transitions" : [
{
+ "value" : "0x00",
+ "mask" : null,
+ "next_state" : "parse_pkt_in"
+ },
+ {
"value" : "default",
"mask" : null,
- "next_state" : "parse_ethernet"
+ "next_state" : "default_parser"
}
],
- "transition_key" : []
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ }
+ ]
}
]
}
@@ -331,7 +463,7 @@
{
"name" : "deparser",
"id" : 0,
- "order" : ["ethernet", "ipv4", "udp", "tcp"]
+ "order" : ["packet_out_hdr", "packet_in_hdr", "ethernet", "ipv4", "udp", "tcp"]
}
],
"meter_arrays" : [],
@@ -402,10 +534,45 @@
"learn_lists" : [],
"actions" : [
{
- "name" : "NoAction",
+ "name" : "add_packet_in_hdr",
"id" : 0,
"runtime_data" : [],
- "primitives" : []
+ "primitives" : [
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_in_hdr"
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 25,
+ "column" : 4,
+ "source_fragment" : "add_header(packet_in_hdr)"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["packet_in_hdr", "ingress_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 26,
+ "column" : 4,
+ "source_fragment" : "modify_field(packet_in_hdr.ingress_port, standard_metadata.ingress_port)"
+ }
+ }
+ ]
},
{
"name" : "NoAction",
@@ -443,7 +610,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 1,
+ "line" : 5,
"column" : 23,
"source_fragment" : "port) { ..."
}
@@ -474,7 +641,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 1,
+ "line" : 5,
"column" : 23,
"source_fragment" : "port) { ..."
}
@@ -488,10 +655,6 @@
{
"name" : "groupId",
"bitwidth" : 16
- },
- {
- "name" : "groupSize",
- "bitwidth" : 32
}
],
"primitives" : [
@@ -509,57 +672,12 @@
],
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 35,
+ "line" : 42,
"column" : 18,
- "source_fragment" : "groupId, groupSize) { ..."
+ "source_fragment" : "groupId) { ..."
}
},
{
- "op" : "assign",
- "parameters" : [
- {
- "type" : "field",
- "value" : ["ecmp_metadata", "groupSize"]
- },
- {
- "type" : "runtime_data",
- "value" : 1
- }
- ],
- "source_info" : {
- "filename" : "ecmp.p4",
- "line" : 35,
- "column" : 27,
- "source_fragment" : "groupSize) { ..."
- }
- },
- {
- "op" : "assign",
- "parameters" : [
- {
- "type" : "field",
- "value" : ["scalars", "tmp"]
- },
- {
- "type" : "expression",
- "value" : {
- "type" : "expression",
- "value" : {
- "op" : "&",
- "left" : {
- "type" : "local",
- "value" : 1
- },
- "right" : {
- "type" : "hexstr",
- "value" : "0xffffffffffffffff"
- }
- }
- }
- }
- ]
- },
- {
"op" : "modify_field_with_hash_based_offset",
"parameters" : [
{
@@ -575,15 +693,15 @@
"value" : "calc"
},
{
- "type" : "field",
- "value" : ["scalars", "tmp"]
+ "type" : "hexstr",
+ "value" : "0x0000000000000004"
}
],
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 38,
+ "line" : 44,
"column" : 4,
- "source_fragment" : "modify_field_with_hash_based_offset(ecmp_metadata.selector, 0, ecmp_hash, groupSize)"
+ "source_fragment" : "modify_field_with_hash_based_offset(ecmp_metadata.selector, 0, ecmp_hash, 4)"
}
}
]
@@ -607,7 +725,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 21,
"column" : 4,
"source_fragment" : "modify_field(standard_metadata.egress_spec, 255)"
}
@@ -615,7 +733,7 @@
]
},
{
- "name" : "drop",
+ "name" : "_drop",
"id" : 7,
"runtime_data" : [],
"primitives" : [
@@ -633,7 +751,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 13,
"column" : 4,
"source_fragment" : "modify_field(standard_metadata.egress_spec, 511)"
}
@@ -641,7 +759,7 @@
]
},
{
- "name" : "count_packet",
+ "name" : "_packet_out",
"id" : 8,
"runtime_data" : [],
"primitives" : [
@@ -650,47 +768,43 @@
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
- },
- {
- "type" : "expression",
- "value" : {
- "type" : "expression",
- "value" : {
- "op" : "&",
- "left" : {
- "type" : "field",
- "value" : ["standard_metadata", "ingress_port"]
- },
- "right" : {
- "type" : "hexstr",
- "value" : "0xffffffff"
- }
- }
- }
- }
- ]
- },
- {
- "op" : "count",
- "parameters" : [
- {
- "type" : "counter_array",
- "value" : "ingress_port_counter"
+ "value" : ["standard_metadata", "egress_spec"]
},
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["packet_out_hdr", "egress_port"]
}
],
"source_info" : {
- "filename" : "include/port_counters.p4",
- "line" : 20,
+ "filename" : "include/packet_io.p4",
+ "line" : 7,
"column" : 4,
- "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
+ "source_fragment" : "modify_field(standard_metadata.egress_spec, packet_out_hdr.egress_port)"
}
},
{
+ "op" : "remove_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_out_hdr"
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 8,
+ "column" : 4,
+ "source_fragment" : "remove_header(packet_out_hdr)"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "count_egress",
+ "id" : 9,
+ "runtime_data" : [],
+ "primitives" : [
+ {
"op" : "assign",
"parameters" : [
{
@@ -730,26 +844,107 @@
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 21,
+ "line" : 22,
"column" : 4,
"source_fragment" : "count(egress_port_counter, standard_metadata.egress_spec)"
}
}
]
+ },
+ {
+ "name" : "count_ingress",
+ "id" : 10,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffffffff"
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "op" : "count",
+ "parameters" : [
+ {
+ "type" : "counter_array",
+ "value" : "ingress_port_counter"
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/port_counters.p4",
+ "line" : 18,
+ "column" : 4,
+ "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
+ }
+ }
+ ]
}
],
"pipelines" : [
{
"name" : "ingress",
"id" : 0,
- "init_table" : "table0",
+ "init_table" : "node_2",
"tables" : [
{
- "name" : "table0",
+ "name" : "ingress_pkt",
"id" : 0,
"source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 11,
+ "column" : 0,
+ "source_fragment" : "table ingress_pkt { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [8],
+ "actions" : ["_packet_out"],
+ "base_default_next" : "node_4",
+ "next_tables" : {
+ "_packet_out" : "node_4"
+ },
+ "default_entry" : {
+ "action_id" : 8,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "table0",
+ "id" : 1,
+ "source_info" : {
"filename" : "ecmp.p4",
- "line" : 41,
+ "line" : 50,
"column" : 0,
"source_fragment" : "table table0 { ..."
},
@@ -781,18 +976,18 @@
"with_counters" : true,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [4, 5, 6, 7, 1],
- "actions" : ["set_egress_port", "ecmp_group", "send_to_cpu", "drop", "NoAction"],
- "base_default_next" : "node_4",
+ "action_ids" : [4, 5, 6, 7, 2],
+ "actions" : ["set_egress_port", "ecmp_group", "send_to_cpu", "_drop", "NoAction"],
+ "base_default_next" : "node_7",
"next_tables" : {
"ecmp_group" : "ecmp_group_table",
- "set_egress_port" : "node_4",
- "send_to_cpu" : "node_4",
- "drop" : "node_4",
- "NoAction" : "node_4"
+ "set_egress_port" : "node_7",
+ "send_to_cpu" : "node_7",
+ "_drop" : "node_7",
+ "NoAction" : "node_7"
},
"default_entry" : {
- "action_id" : 1,
+ "action_id" : 2,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -800,10 +995,10 @@
},
{
"name" : "ecmp_group_table",
- "id" : 1,
+ "id" : 2,
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 57,
+ "line" : 66,
"column" : 0,
"source_fragment" : "table ecmp_group_table { ..."
},
@@ -825,28 +1020,28 @@
"with_counters" : true,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [3, 0],
+ "action_ids" : [3, 1],
"actions" : ["set_egress_port", "NoAction"],
- "base_default_next" : "node_4",
+ "base_default_next" : "node_7",
"next_tables" : {
- "set_egress_port" : "node_4",
- "NoAction" : "node_4"
+ "set_egress_port" : "node_7",
+ "NoAction" : "node_7"
},
"default_entry" : {
- "action_id" : 0,
+ "action_id" : 1,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
}
},
{
- "name" : "port_count_table",
- "id" : 2,
+ "name" : "ingress_port_count_table",
+ "id" : 3,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 13,
+ "line" : 25,
"column" : 0,
- "source_fragment" : "table port_count_table { ..."
+ "source_fragment" : "table ingress_port_count_table { ..."
},
"key" : [],
"match_type" : "exact",
@@ -855,15 +1050,43 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [8, 2],
- "actions" : ["count_packet", "NoAction"],
- "base_default_next" : null,
+ "action_ids" : [10],
+ "actions" : ["count_ingress"],
+ "base_default_next" : "egress_port_count_table",
"next_tables" : {
- "count_packet" : null,
- "NoAction" : null
+ "count_ingress" : "egress_port_count_table"
},
"default_entry" : {
- "action_id" : 2,
+ "action_id" : 10,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "egress_port_count_table",
+ "id" : 4,
+ "source_info" : {
+ "filename" : "include/port_counters.p4",
+ "line" : 30,
+ "column" : 0,
+ "source_fragment" : "table egress_port_count_table { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [9],
+ "actions" : ["count_egress"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "count_egress" : null
+ },
+ "default_entry" : {
+ "action_id" : 9,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -873,12 +1096,64 @@
"action_profiles" : [],
"conditionals" : [
{
- "name" : "node_4",
+ "name" : "node_2",
"id" : 0,
"source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 19,
+ "column" : 8,
+ "source_fragment" : "valid(packet_out_hdr)"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out_hdr", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "ingress_pkt",
+ "false_next" : "node_4"
+ },
+ {
+ "name" : "node_4",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "ecmp.p4",
+ "line" : 90,
+ "column" : 12,
+ "source_fragment" : "valid(packet_out_hdr)"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out_hdr", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "table0",
+ "false_next" : "node_7"
+ },
+ {
+ "name" : "node_7",
+ "id" : 2,
+ "source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 26,
- "column" : 35,
+ "line" : 36,
+ "column" : 38,
"source_fragment" : "<"
},
"expression" : {
@@ -896,17 +1171,74 @@
}
},
"false_next" : null,
- "true_next" : "port_count_table"
+ "true_next" : "ingress_port_count_table"
}
]
},
{
"name" : "egress",
"id" : 1,
- "init_table" : null,
- "tables" : [],
+ "init_table" : "node_12",
+ "tables" : [
+ {
+ "name" : "egress_pkt",
+ "id" : 5,
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 29,
+ "column" : 0,
+ "source_fragment" : "table egress_pkt { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [0],
+ "actions" : ["add_packet_in_hdr"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "add_packet_in_hdr" : null
+ },
+ "default_entry" : {
+ "action_id" : 0,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ }
+ ],
"action_profiles" : [],
- "conditionals" : []
+ "conditionals" : [
+ {
+ "name" : "node_12",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 40,
+ "column" : 39,
+ "source_fragment" : "=="
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x00ff"
+ }
+ }
+ },
+ "false_next" : null,
+ "true_next" : "egress_pkt"
+ }
+ ]
}
],
"checksums" : [],
diff --git a/tools/test/p4src/p4-14/p4c-out/ecmp.p4info b/tools/test/p4src/p4-14/p4c-out/ecmp.p4info
index fdfeff0..0961378 100644
--- a/tools/test/p4src/p4-14/p4c-out/ecmp.p4info
+++ b/tools/test/p4src/p4-14/p4c-out/ecmp.p4info
@@ -1,5 +1,33 @@
tables {
preamble {
+ id: 33612022
+ name: "ecmp_group_table"
+ alias: "ecmp_group_table"
+ }
+ match_fields {
+ id: 1
+ name: "ecmp_metadata.groupId"
+ bitwidth: 16
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "ecmp_metadata.selector"
+ bitwidth: 16
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16794308
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302009688
+ size: 1024
+}
+tables {
+ preamble {
id: 33617813
name: "table0"
alias: "table0"
@@ -32,13 +60,13 @@
id: 16794308
}
action_refs {
- id: 16791212
+ id: 16830055
}
action_refs {
id: 16829080
}
action_refs {
- id: 16793508
+ id: 16784184
}
action_refs {
id: 16800567
@@ -50,59 +78,45 @@
}
tables {
preamble {
- id: 33596222
- name: "wcmp_group_table"
- alias: "wcmp_group_table"
- }
- match_fields {
- id: 1
- name: "wcmp_meta.groupId"
- bitwidth: 16
- match_type: EXACT
- }
- match_fields {
- id: 2
- name: "wcmp_meta.selector"
- bitwidth: 32
- match_type: LPM
+ id: 33560548
+ name: "ingress_pkt"
+ alias: "ingress_pkt"
}
action_refs {
- id: 16794308
- }
- action_refs {
- id: 16800567
- annotations: "@defaultonly()"
- }
- direct_resource_ids: 302006421
- size: 1024
-}
-tables {
- preamble {
- id: 33613026
- name: "wcmp_set_selector_table"
- alias: "wcmp_set_selector_table"
- }
- action_refs {
- id: 16819919
- }
- action_refs {
- id: 16800567
- annotations: "@defaultonly()"
+ id: 16835928
}
size: 1024
}
tables {
preamble {
- id: 33583368
- name: "port_count_table"
- alias: "port_count_table"
+ id: 33618793
+ name: "egress_port_count_table"
+ alias: "egress_port_count_table"
}
action_refs {
- id: 16781545
+ id: 16822771
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33579767
+ name: "ingress_port_count_table"
+ alias: "ingress_port_count_table"
}
action_refs {
- id: 16800567
- annotations: "@defaultonly()"
+ id: 16837943
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33608529
+ name: "egress_pkt"
+ alias: "egress_pkt"
+ }
+ action_refs {
+ id: 16835663
}
size: 1024
}
@@ -115,13 +129,6 @@
}
actions {
preamble {
- id: 16819919
- name: "wcmp_set_selector"
- alias: "wcmp_set_selector"
- }
-}
-actions {
- preamble {
id: 16794308
name: "set_egress_port"
alias: "set_egress_port"
@@ -134,9 +141,9 @@
}
actions {
preamble {
- id: 16791212
- name: "wcmp_group"
- alias: "wcmp_group"
+ id: 16830055
+ name: "ecmp_group"
+ alias: "ecmp_group"
}
params {
id: 1
@@ -153,16 +160,37 @@
}
actions {
preamble {
- id: 16793508
- name: "drop"
- alias: "drop"
+ id: 16784184
+ name: "_drop"
+ alias: "_drop"
}
}
actions {
preamble {
- id: 16781545
- name: "count_packet"
- alias: "count_packet"
+ id: 16835928
+ name: "_packet_out"
+ alias: "_packet_out"
+ }
+}
+actions {
+ preamble {
+ id: 16822771
+ name: "count_egress"
+ alias: "count_egress"
+ }
+}
+actions {
+ preamble {
+ id: 16837943
+ name: "count_ingress"
+ alias: "count_ingress"
+ }
+}
+actions {
+ preamble {
+ id: 16835663
+ name: "add_packet_in_hdr"
+ alias: "add_packet_in_hdr"
}
}
counters {
@@ -191,6 +219,17 @@
}
direct_counters {
preamble {
+ id: 302009688
+ name: "ecmp_group_table_counter"
+ alias: "ecmp_group_table_counter"
+ }
+ spec {
+ unit: PACKETS
+ }
+ direct_table_id: 33612022
+}
+direct_counters {
+ preamble {
id: 301990488
name: "table0_counter"
alias: "table0_counter"
@@ -200,14 +239,28 @@
}
direct_table_id: 33617813
}
-direct_counters {
+# Manually adding controller_packet_metadata for packet I/O since P4_14 doesn't support annotations.
+controller_packet_metadata {
preamble {
- id: 302006421
- name: "wcmp_group_table_counter"
- alias: "wcmp_group_table_counter"
+ id: 2868941301
+ name: "packet_in"
+ annotations: "@controller_header(\"packet_in\")"
}
- spec {
- unit: PACKETS
+ metadata {
+ id: 1
+ name: "ingress_port"
+ bitwidth: 9
}
- direct_table_id: 33596222
+}
+controller_packet_metadata {
+ preamble {
+ id: 2868916615
+ name: "packet_out"
+ annotations: "@controller_header(\"packet_out\")"
+ }
+ metadata {
+ id: 1
+ name: "egress_port"
+ bitwidth: 9
+ }
}
diff --git a/tools/test/p4src/p4-14/p4c-out/wcmp.json b/tools/test/p4src/p4-14/p4c-out/wcmp.json
index 173dfe1..6313d0d 100644
--- a/tools/test/p4src/p4-14/p4c-out/wcmp.json
+++ b/tools/test/p4src/p4-14/p4c-out/wcmp.json
@@ -9,8 +9,10 @@
"name" : "scalars_0",
"id" : 0,
"fields" : [
- ["tmp", 32, false],
- ["tmp_0", 32, false]
+ ["tmp_0", 104, false],
+ ["tmp", 8, false],
+ ["tmp_1", 32, false],
+ ["tmp_2", 32, false]
]
},
{
@@ -41,9 +43,25 @@
]
},
{
- "name" : "tcp_t",
+ "name" : "packet_in_t",
"id" : 3,
"fields" : [
+ ["ingress_port", 9, false],
+ ["_padding", 7, false]
+ ]
+ },
+ {
+ "name" : "packet_out_t",
+ "id" : 4,
+ "fields" : [
+ ["egress_port", 9, false],
+ ["_padding_0", 7, false]
+ ]
+ },
+ {
+ "name" : "tcp_t",
+ "id" : 5,
+ "fields" : [
["srcPort", 16, false],
["dstPort", 16, false],
["seqNo", 32, false],
@@ -59,7 +77,7 @@
},
{
"name" : "udp_t",
- "id" : 4,
+ "id" : 6,
"fields" : [
["srcPort", 16, false],
["dstPort", 16, false],
@@ -68,18 +86,8 @@
]
},
{
- "name" : "intrinsic_metadata_t",
- "id" : 5,
- "fields" : [
- ["ingress_global_timestamp", 32, false],
- ["lf_field_list", 32, false],
- ["mcast_grp", 16, false],
- ["egress_rid", 16, false]
- ]
- },
- {
"name" : "wcmp_meta_t",
- "id" : 6,
+ "id" : 7,
"fields" : [
["groupId", 16, false],
["numBits", 8, false],
@@ -88,7 +96,7 @@
},
{
"name" : "standard_metadata",
- "id" : 7,
+ "id" : 8,
"fields" : [
["ingress_port", 9, false],
["egress_spec", 9, false],
@@ -107,7 +115,7 @@
["mcast_grp", 16, false],
["resubmit_flag", 1, false],
["egress_rid", 16, false],
- ["_padding", 5, false]
+ ["_padding_1", 5, false]
]
}
],
@@ -141,29 +149,36 @@
"pi_omit" : true
},
{
- "name" : "tcp",
+ "name" : "packet_in_hdr",
"id" : 4,
+ "header_type" : "packet_in_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "packet_out_hdr",
+ "id" : 5,
+ "header_type" : "packet_out_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "tcp",
+ "id" : 6,
"header_type" : "tcp_t",
"metadata" : false,
"pi_omit" : true
},
{
"name" : "udp",
- "id" : 5,
+ "id" : 7,
"header_type" : "udp_t",
"metadata" : false,
"pi_omit" : true
},
{
- "name" : "intrinsic_metadata",
- "id" : 6,
- "header_type" : "intrinsic_metadata_t",
- "metadata" : true,
- "pi_omit" : true
- },
- {
"name" : "wcmp_meta",
- "id" : 7,
+ "id" : 8,
"header_type" : "wcmp_meta_t",
"metadata" : true,
"pi_omit" : true
@@ -190,8 +205,31 @@
"init_state" : "start",
"parse_states" : [
{
- "name" : "parse_ethernet",
+ "name" : "default_parser",
"id" : 0,
+ "parser_ops" : [],
+ "transitions" : [
+ {
+ "value" : "0x00ff",
+ "mask" : null,
+ "next_state" : "parse_pkt_out"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_ethernet",
+ "id" : 1,
"parser_ops" : [
{
"parameters" : [
@@ -224,7 +262,7 @@
},
{
"name" : "parse_ipv4",
- "id" : 1,
+ "id" : 2,
"parser_ops" : [
{
"parameters" : [
@@ -265,8 +303,54 @@
]
},
{
+ "name" : "parse_pkt_in",
+ "id" : 3,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_in_hdr"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_pkt_out",
+ "id" : 4,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_out_hdr"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
"name" : "parse_tcp",
- "id" : 2,
+ "id" : 5,
"parser_ops" : [
{
"parameters" : [
@@ -289,7 +373,7 @@
},
{
"name" : "parse_udp",
- "id" : 3,
+ "id" : 6,
"parser_ops" : [
{
"parameters" : [
@@ -312,16 +396,66 @@
},
{
"name" : "start",
- "id" : 4,
- "parser_ops" : [],
+ "id" : 7,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_0"]
+ },
+ {
+ "type" : "lookahead",
+ "value" : [0, 104]
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp_0"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ }
+ ],
"transitions" : [
{
+ "value" : "0x00",
+ "mask" : null,
+ "next_state" : "parse_pkt_in"
+ },
+ {
"value" : "default",
"mask" : null,
- "next_state" : "parse_ethernet"
+ "next_state" : "default_parser"
}
],
- "transition_key" : []
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ }
+ ]
}
]
}
@@ -330,7 +464,7 @@
{
"name" : "deparser",
"id" : 0,
- "order" : ["ethernet", "ipv4", "udp", "tcp"]
+ "order" : ["packet_out_hdr", "packet_in_hdr", "ethernet", "ipv4", "udp", "tcp"]
}
],
"meter_arrays" : [],
@@ -401,10 +535,45 @@
"learn_lists" : [],
"actions" : [
{
- "name" : "NoAction",
+ "name" : "add_packet_in_hdr",
"id" : 0,
"runtime_data" : [],
- "primitives" : []
+ "primitives" : [
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_in_hdr"
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 25,
+ "column" : 4,
+ "source_fragment" : "add_header(packet_in_hdr)"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["packet_in_hdr", "ingress_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 26,
+ "column" : 4,
+ "source_fragment" : "modify_field(packet_in_hdr.ingress_port, standard_metadata.ingress_port)"
+ }
+ }
+ ]
},
{
"name" : "NoAction",
@@ -536,7 +705,7 @@
],
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 43,
+ "line" : 44,
"column" : 4,
"source_fragment" : "modify_field(wcmp_meta.selector, ..."
}
@@ -567,7 +736,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 1,
+ "line" : 5,
"column" : 23,
"source_fragment" : "port) { ..."
}
@@ -598,7 +767,7 @@
],
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 37,
+ "line" : 38,
"column" : 18,
"source_fragment" : "groupId) { ..."
}
@@ -625,7 +794,7 @@
],
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 39,
+ "line" : 40,
"column" : 4,
"source_fragment" : "modify_field_with_hash_based_offset(wcmp_meta.numBits, 2, wcmp_hash, (32 - 2))"
}
@@ -651,7 +820,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 21,
"column" : 4,
"source_fragment" : "modify_field(standard_metadata.egress_spec, 255)"
}
@@ -659,7 +828,7 @@
]
},
{
- "name" : "drop",
+ "name" : "_drop",
"id" : 8,
"runtime_data" : [],
"primitives" : [
@@ -677,7 +846,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 13,
"column" : 4,
"source_fragment" : "modify_field(standard_metadata.egress_spec, 511)"
}
@@ -708,7 +877,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 1,
+ "line" : 5,
"column" : 23,
"source_fragment" : "port) { ..."
}
@@ -716,7 +885,7 @@
]
},
{
- "name" : "count_packet",
+ "name" : "_packet_out",
"id" : 10,
"runtime_data" : [],
"primitives" : [
@@ -725,52 +894,48 @@
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp"]
- },
- {
- "type" : "expression",
- "value" : {
- "type" : "expression",
- "value" : {
- "op" : "&",
- "left" : {
- "type" : "field",
- "value" : ["standard_metadata", "ingress_port"]
- },
- "right" : {
- "type" : "hexstr",
- "value" : "0xffffffff"
- }
- }
- }
- }
- ]
- },
- {
- "op" : "count",
- "parameters" : [
- {
- "type" : "counter_array",
- "value" : "ingress_port_counter"
+ "value" : ["standard_metadata", "egress_spec"]
},
{
"type" : "field",
- "value" : ["scalars", "tmp"]
+ "value" : ["packet_out_hdr", "egress_port"]
}
],
"source_info" : {
- "filename" : "include/port_counters.p4",
- "line" : 20,
+ "filename" : "include/packet_io.p4",
+ "line" : 7,
"column" : 4,
- "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
+ "source_fragment" : "modify_field(standard_metadata.egress_spec, packet_out_hdr.egress_port)"
}
},
{
+ "op" : "remove_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_out_hdr"
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 8,
+ "column" : 4,
+ "source_fragment" : "remove_header(packet_out_hdr)"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "count_egress",
+ "id" : 11,
+ "runtime_data" : [],
+ "primitives" : [
+ {
"op" : "assign",
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["scalars", "tmp_1"]
},
{
"type" : "expression",
@@ -800,31 +965,112 @@
},
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["scalars", "tmp_1"]
}
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 21,
+ "line" : 22,
"column" : 4,
"source_fragment" : "count(egress_port_counter, standard_metadata.egress_spec)"
}
}
]
+ },
+ {
+ "name" : "count_ingress",
+ "id" : 12,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffffffff"
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "op" : "count",
+ "parameters" : [
+ {
+ "type" : "counter_array",
+ "value" : "ingress_port_counter"
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "include/port_counters.p4",
+ "line" : 18,
+ "column" : 4,
+ "source_fragment" : "count(ingress_port_counter, standard_metadata.ingress_port)"
+ }
+ }
+ ]
}
],
"pipelines" : [
{
"name" : "ingress",
"id" : 0,
- "init_table" : "table0",
+ "init_table" : "node_2",
"tables" : [
{
- "name" : "table0",
+ "name" : "ingress_pkt",
"id" : 0,
"source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 11,
+ "column" : 0,
+ "source_fragment" : "table ingress_pkt { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [10],
+ "actions" : ["_packet_out"],
+ "base_default_next" : "node_4",
+ "next_tables" : {
+ "_packet_out" : "node_4"
+ },
+ "default_entry" : {
+ "action_id" : 10,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "table0",
+ "id" : 1,
+ "source_info" : {
"filename" : "wcmp.p4",
- "line" : 47,
+ "line" : 48,
"column" : 0,
"source_fragment" : "table table0 { ..."
},
@@ -856,18 +1102,18 @@
"with_counters" : true,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [5, 6, 7, 8, 0],
- "actions" : ["set_egress_port", "wcmp_group", "send_to_cpu", "drop", "NoAction"],
- "base_default_next" : "node_5",
+ "action_ids" : [5, 6, 7, 8, 1],
+ "actions" : ["set_egress_port", "wcmp_group", "send_to_cpu", "_drop", "NoAction"],
+ "base_default_next" : "node_8",
"next_tables" : {
"wcmp_group" : "wcmp_set_selector_table",
- "set_egress_port" : "node_5",
- "send_to_cpu" : "node_5",
- "drop" : "node_5",
- "NoAction" : "node_5"
+ "set_egress_port" : "node_8",
+ "send_to_cpu" : "node_8",
+ "_drop" : "node_8",
+ "NoAction" : "node_8"
},
"default_entry" : {
- "action_id" : 0,
+ "action_id" : 1,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -875,10 +1121,10 @@
},
{
"name" : "wcmp_set_selector_table",
- "id" : 1,
+ "id" : 2,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 63,
+ "line" : 64,
"column" : 0,
"source_fragment" : "table wcmp_set_selector_table { ..."
},
@@ -889,15 +1135,15 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [4, 2],
+ "action_ids" : [4, 3],
"actions" : ["wcmp_set_selector", "NoAction"],
- "base_default_next" : "node_5",
+ "base_default_next" : "node_8",
"next_tables" : {
"wcmp_set_selector" : "wcmp_group_table",
- "NoAction" : "node_5"
+ "NoAction" : "node_8"
},
"default_entry" : {
- "action_id" : 2,
+ "action_id" : 3,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -905,10 +1151,10 @@
},
{
"name" : "wcmp_group_table",
- "id" : 2,
+ "id" : 3,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 69,
+ "line" : 70,
"column" : 0,
"source_fragment" : "table wcmp_group_table { ..."
},
@@ -930,28 +1176,28 @@
"with_counters" : true,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [9, 1],
+ "action_ids" : [9, 2],
"actions" : ["set_egress_port", "NoAction"],
- "base_default_next" : "node_5",
+ "base_default_next" : "node_8",
"next_tables" : {
- "set_egress_port" : "node_5",
- "NoAction" : "node_5"
+ "set_egress_port" : "node_8",
+ "NoAction" : "node_8"
},
"default_entry" : {
- "action_id" : 1,
+ "action_id" : 2,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
}
},
{
- "name" : "port_count_table",
- "id" : 3,
+ "name" : "ingress_port_count_table",
+ "id" : 4,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 13,
+ "line" : 25,
"column" : 0,
- "source_fragment" : "table port_count_table { ..."
+ "source_fragment" : "table ingress_port_count_table { ..."
},
"key" : [],
"match_type" : "exact",
@@ -960,15 +1206,43 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [10, 3],
- "actions" : ["count_packet", "NoAction"],
- "base_default_next" : null,
+ "action_ids" : [12],
+ "actions" : ["count_ingress"],
+ "base_default_next" : "egress_port_count_table",
"next_tables" : {
- "count_packet" : null,
- "NoAction" : null
+ "count_ingress" : "egress_port_count_table"
},
"default_entry" : {
- "action_id" : 3,
+ "action_id" : 12,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "egress_port_count_table",
+ "id" : 5,
+ "source_info" : {
+ "filename" : "include/port_counters.p4",
+ "line" : 30,
+ "column" : 0,
+ "source_fragment" : "table egress_port_count_table { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [11],
+ "actions" : ["count_egress"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "count_egress" : null
+ },
+ "default_entry" : {
+ "action_id" : 11,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -978,12 +1252,64 @@
"action_profiles" : [],
"conditionals" : [
{
- "name" : "node_5",
+ "name" : "node_2",
"id" : 0,
"source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 19,
+ "column" : 8,
+ "source_fragment" : "valid(packet_out_hdr)"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out_hdr", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "ingress_pkt",
+ "false_next" : "node_4"
+ },
+ {
+ "name" : "node_4",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "wcmp.p4",
+ "line" : 94,
+ "column" : 12,
+ "source_fragment" : "valid(packet_out_hdr)"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out_hdr", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "table0",
+ "false_next" : "node_8"
+ },
+ {
+ "name" : "node_8",
+ "id" : 2,
+ "source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 26,
- "column" : 35,
+ "line" : 36,
+ "column" : 38,
"source_fragment" : "<"
},
"expression" : {
@@ -1001,17 +1327,74 @@
}
},
"false_next" : null,
- "true_next" : "port_count_table"
+ "true_next" : "ingress_port_count_table"
}
]
},
{
"name" : "egress",
"id" : 1,
- "init_table" : null,
- "tables" : [],
+ "init_table" : "node_13",
+ "tables" : [
+ {
+ "name" : "egress_pkt",
+ "id" : 6,
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 29,
+ "column" : 0,
+ "source_fragment" : "table egress_pkt { ..."
+ },
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [0],
+ "actions" : ["add_packet_in_hdr"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "add_packet_in_hdr" : null
+ },
+ "default_entry" : {
+ "action_id" : 0,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ }
+ ],
"action_profiles" : [],
- "conditionals" : []
+ "conditionals" : [
+ {
+ "name" : "node_13",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "include/packet_io.p4",
+ "line" : 40,
+ "column" : 39,
+ "source_fragment" : "=="
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x00ff"
+ }
+ }
+ },
+ "false_next" : null,
+ "true_next" : "egress_pkt"
+ }
+ ]
}
],
"checksums" : [],
diff --git a/tools/test/p4src/p4-14/p4c-out/wcmp.p4info b/tools/test/p4src/p4-14/p4c-out/wcmp.p4info
new file mode 100644
index 0000000..8024064
--- /dev/null
+++ b/tools/test/p4src/p4-14/p4c-out/wcmp.p4info
@@ -0,0 +1,288 @@
+tables {
+ preamble {
+ id: 33617813
+ name: "table0"
+ alias: "table0"
+ }
+ match_fields {
+ id: 1
+ name: "standard_metadata.ingress_port"
+ bitwidth: 9
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 2
+ name: "ethernet.dstAddr"
+ bitwidth: 48
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 3
+ name: "ethernet.srcAddr"
+ bitwidth: 48
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 4
+ name: "ethernet.etherType"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16794308
+ }
+ action_refs {
+ id: 16791212
+ }
+ action_refs {
+ id: 16829080
+ }
+ action_refs {
+ id: 16784184
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 301990488
+ size: 1024
+ with_entry_timeout: true
+}
+tables {
+ preamble {
+ id: 33596222
+ name: "wcmp_group_table"
+ alias: "wcmp_group_table"
+ }
+ match_fields {
+ id: 1
+ name: "wcmp_meta.groupId"
+ bitwidth: 16
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "wcmp_meta.selector"
+ bitwidth: 32
+ match_type: LPM
+ }
+ action_refs {
+ id: 16794308
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302006421
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33613026
+ name: "wcmp_set_selector_table"
+ alias: "wcmp_set_selector_table"
+ }
+ action_refs {
+ id: 16819919
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33560548
+ name: "ingress_pkt"
+ alias: "ingress_pkt"
+ }
+ action_refs {
+ id: 16835928
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33618793
+ name: "egress_port_count_table"
+ alias: "egress_port_count_table"
+ }
+ action_refs {
+ id: 16822771
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33579767
+ name: "ingress_port_count_table"
+ alias: "ingress_port_count_table"
+ }
+ action_refs {
+ id: 16837943
+ }
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33608529
+ name: "egress_pkt"
+ alias: "egress_pkt"
+ }
+ action_refs {
+ id: 16835663
+ }
+ size: 1024
+}
+actions {
+ preamble {
+ id: 16800567
+ name: "NoAction"
+ alias: "NoAction"
+ }
+}
+actions {
+ preamble {
+ id: 16819919
+ name: "wcmp_set_selector"
+ alias: "wcmp_set_selector"
+ }
+}
+actions {
+ preamble {
+ id: 16794308
+ name: "set_egress_port"
+ alias: "set_egress_port"
+ }
+ params {
+ id: 1
+ name: "port"
+ bitwidth: 9
+ }
+}
+actions {
+ preamble {
+ id: 16791212
+ name: "wcmp_group"
+ alias: "wcmp_group"
+ }
+ params {
+ id: 1
+ name: "groupId"
+ bitwidth: 16
+ }
+}
+actions {
+ preamble {
+ id: 16829080
+ name: "send_to_cpu"
+ alias: "send_to_cpu"
+ }
+}
+actions {
+ preamble {
+ id: 16784184
+ name: "_drop"
+ alias: "_drop"
+ }
+}
+actions {
+ preamble {
+ id: 16835928
+ name: "_packet_out"
+ alias: "_packet_out"
+ }
+}
+actions {
+ preamble {
+ id: 16822771
+ name: "count_egress"
+ alias: "count_egress"
+ }
+}
+actions {
+ preamble {
+ id: 16837943
+ name: "count_ingress"
+ alias: "count_ingress"
+ }
+}
+actions {
+ preamble {
+ id: 16835663
+ name: "add_packet_in_hdr"
+ alias: "add_packet_in_hdr"
+ }
+}
+counters {
+ preamble {
+ id: 302008596
+ name: "egress_port_counter"
+ alias: "egress_port_counter"
+ annotations: "@min_width(32)"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 254
+}
+counters {
+ preamble {
+ id: 301991238
+ name: "ingress_port_counter"
+ alias: "ingress_port_counter"
+ annotations: "@min_width(32)"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 254
+}
+direct_counters {
+ preamble {
+ id: 301990488
+ name: "table0_counter"
+ alias: "table0_counter"
+ }
+ spec {
+ unit: PACKETS
+ }
+ direct_table_id: 33617813
+}
+direct_counters {
+ preamble {
+ id: 302006421
+ name: "wcmp_group_table_counter"
+ alias: "wcmp_group_table_counter"
+ }
+ spec {
+ unit: PACKETS
+ }
+ direct_table_id: 33596222
+}
+# Manually adding controller_packet_metadata for packet I/O since P4_14 doesn't support annotations.
+controller_packet_metadata {
+ preamble {
+ id: 2868941301
+ name: "packet_in"
+ annotations: "@controller_header(\"packet_in\")"
+ }
+ metadata {
+ id: 1
+ name: "ingress_port"
+ bitwidth: 9
+ }
+}
+controller_packet_metadata {
+ preamble {
+ id: 2868916615
+ name: "packet_out"
+ annotations: "@controller_header(\"packet_out\")"
+ }
+ metadata {
+ id: 1
+ name: "egress_port"
+ bitwidth: 9
+ }
+}
diff --git a/tools/test/p4src/p4-14/wcmp.p4 b/tools/test/p4src/p4-14/wcmp.p4
index d24183f..a388be7 100644
--- a/tools/test/p4src/p4-14/wcmp.p4
+++ b/tools/test/p4src/p4-14/wcmp.p4
@@ -3,6 +3,7 @@
#include "include/parser.p4"
#include "include/actions.p4"
#include "include/port_counters.p4"
+#include "include/packet_io.p4"
#define SELECTOR_WIDTH 32
@@ -46,16 +47,16 @@
table table0 {
reads {
- standard_metadata.ingress_port : ternary;
- ethernet.dstAddr : ternary;
- ethernet.srcAddr : ternary;
+ IGR_PORT_FIELD : ternary;
+ ethernet.dstAddr : ternary;
+ ethernet.srcAddr : ternary;
ethernet.etherType : ternary;
}
actions {
set_egress_port;
wcmp_group;
send_to_cpu;
- drop;
+ _drop;
}
support_timeout: true;
}
@@ -89,14 +90,21 @@
}
control ingress {
- apply(table0) {
- wcmp_group {
- apply(wcmp_set_selector_table) {
- wcmp_set_selector {
- apply(wcmp_group_table);
+ ingress_pkt_io();
+ if (not valid(packet_out_hdr)) {
+ apply(table0) {
+ wcmp_group {
+ apply(wcmp_set_selector_table) {
+ wcmp_set_selector {
+ apply(wcmp_group_table);
+ }
}
}
}
}
process_port_counters();
-}
\ No newline at end of file
+}
+
+control egress {
+ egress_pkt_io();
+}
diff --git a/tools/test/p4src/p4-16/default.p4 b/tools/test/p4src/p4-16/default.p4
index b977d91..c76cbf7 100644
--- a/tools/test/p4src/p4-16/default.p4
+++ b/tools/test/p4src/p4-16/default.p4
@@ -54,10 +54,10 @@
set_egress_port(standard_metadata);
send_to_cpu(standard_metadata);
do_ecmp();
- drop(standard_metadata);
+ _drop(standard_metadata);
}
counters = table0_counter;
- default_action = drop(standard_metadata);
+ default_action = _drop(standard_metadata);
}
action_selector(HashAlgorithm.crc16, 32w64, 32w16) ecmp_selector;
diff --git a/tools/test/p4src/p4-16/ecmp.p4 b/tools/test/p4src/p4-16/ecmp.p4
index 7e2010d..7146cd2 100644
--- a/tools/test/p4src/p4-16/ecmp.p4
+++ b/tools/test/p4src/p4-16/ecmp.p4
@@ -20,7 +20,13 @@
#include "include/headers.p4"
typedef bit<16> group_id_t;
-typedef bit<8> group_size_t;
+
+/*
+ Expected number of ports of an ECMP group.
+ This value is fixed, .i.e. we do not support ECMP over port groups of different size.
+ Due to hardware limitations, this value must be constant and a power of 2.
+*/
+#define ECMP_GROUP_SIZE 128w2
struct ecmp_metadata_t {
group_id_t group_id;
@@ -44,12 +50,11 @@
direct_counter(CounterType.packets) ecmp_group_table_counter;
direct_counter(CounterType.packets) table0_counter;
- action ecmp_group(group_id_t group_id, group_size_t groupSize) {
+ action ecmp_group(group_id_t group_id) {
meta.ecmp_metadata.group_id = group_id;
- hash(meta.ecmp_metadata.selector, HashAlgorithm.crc16, (bit<64>)0,
+ hash(meta.ecmp_metadata.selector, HashAlgorithm.crc32, (bit<64>)0,
{ hdr.ipv4.srcAddr, hdr.ipv4.dstAddr, hdr.ipv4.protocol, hdr.tcp.srcPort, hdr.tcp.dstPort, hdr.udp.srcPort,
- hdr.udp.dstPort },
- (bit<128>)groupSize);
+ hdr.udp.dstPort }, ECMP_GROUP_SIZE);
}
table ecmp_group_table {
@@ -69,7 +74,7 @@
ecmp_group;
set_egress_port(standard_metadata);
send_to_cpu(standard_metadata);
- drop(standard_metadata);
+ _drop(standard_metadata);
}
key = {
standard_metadata.ingress_port: ternary;
@@ -78,6 +83,7 @@
hdr.ethernet.etherType : ternary;
}
counters = table0_counter;
+ default_action = _drop(standard_metadata);
}
PortCountersControl() port_counters_control;
diff --git a/tools/test/p4src/p4-16/include/actions.p4 b/tools/test/p4src/p4-16/include/actions.p4
index c9f2dec..0b87ef3 100644
--- a/tools/test/p4src/p4-16/include/actions.p4
+++ b/tools/test/p4src/p4-16/include/actions.p4
@@ -27,7 +27,7 @@
standard_metadata.egress_spec = port;
}
-action drop(inout standard_metadata_t standard_metadata) {
+action _drop(inout standard_metadata_t standard_metadata) {
standard_metadata.egress_spec = DROP_PORT;
}
diff --git a/tools/test/p4src/p4-16/p4c-out/default.json b/tools/test/p4src/p4-16/p4c-out/default.json
index c35cf25..33af4c7 100644
--- a/tools/test/p4src/p4-16/p4c-out/default.json
+++ b/tools/test/p4src/p4-16/p4c-out/default.json
@@ -2481,7 +2481,7 @@
]
},
{
- "name" : "drop",
+ "name" : "_drop",
"id" : 3,
"runtime_data" : [],
"primitives" : [
@@ -2500,7 +2500,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2519,7 +2519,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2538,7 +2538,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2557,7 +2557,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2576,7 +2576,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2595,7 +2595,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2614,7 +2614,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2633,7 +2633,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2652,7 +2652,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2671,7 +2671,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2690,7 +2690,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2709,7 +2709,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2728,7 +2728,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2747,7 +2747,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2766,7 +2766,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2785,7 +2785,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2804,7 +2804,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2842,7 +2842,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2861,7 +2861,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2880,7 +2880,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2899,7 +2899,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2918,7 +2918,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2937,7 +2937,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2956,7 +2956,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2975,7 +2975,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2994,7 +2994,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3013,7 +3013,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3032,7 +3032,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3051,7 +3051,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3070,7 +3070,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3089,7 +3089,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3108,7 +3108,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3127,7 +3127,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3146,7 +3146,7 @@
"source_info" : {
"filename" : "include/actions.p4",
"line" : 30,
- "column" : 38,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
}
@@ -3448,13 +3448,13 @@
"support_timeout" : false,
"direct_meters" : null,
"action_ids" : [0, 2, 5, 3],
- "actions" : ["set_egress_port", "send_to_cpu", "do_ecmp", "drop"],
+ "actions" : ["set_egress_port", "send_to_cpu", "do_ecmp", "_drop"],
"base_default_next" : "node_7",
"next_tables" : {
"do_ecmp" : "ecmp",
"set_egress_port" : "node_7",
"send_to_cpu" : "node_7",
- "drop" : "node_7"
+ "_drop" : "node_7"
},
"default_entry" : {
"action_id" : 3,
diff --git a/tools/test/p4src/p4-16/p4c-out/default.p4info b/tools/test/p4src/p4-16/p4c-out/default.p4info
index 957149e..a485e17 100644
--- a/tools/test/p4src/p4-16/p4c-out/default.p4info
+++ b/tools/test/p4src/p4-16/p4c-out/default.p4info
@@ -38,7 +38,7 @@
id: 16824896
}
action_refs {
- id: 16793508
+ id: 16784184
}
direct_resource_ids: 301990488
size: 1024
@@ -87,9 +87,9 @@
}
actions {
preamble {
- id: 16793508
- name: "drop"
- alias: "drop"
+ id: 16784184
+ name: "_drop"
+ alias: "_drop"
}
}
actions {
diff --git a/tools/test/p4src/p4-16/p4c-out/ecmp.json b/tools/test/p4src/p4-16/p4c-out/ecmp.json
index c416184..506db53 100644
--- a/tools/test/p4src/p4-16/p4c-out/ecmp.json
+++ b/tools/test/p4src/p4-16/p4c-out/ecmp.json
@@ -9,9 +9,8 @@
"name" : "scalars_0",
"id" : 0,
"fields" : [
- ["tmp", 128, false],
- ["tmp_0", 32, false],
- ["tmp_1", 32, false]
+ ["tmp", 32, false],
+ ["tmp_0", 32, false]
]
},
{
@@ -419,7 +418,7 @@
"id" : 0,
"source_info" : {
"filename" : "include/parsers.p4",
- "line" : 48,
+ "line" : 64,
"column" : 8,
"source_fragment" : "DeparserImpl"
},
@@ -445,7 +444,7 @@
"id" : 2,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 6,
+ "line" : 22,
"column" : 38,
"source_fragment" : "egress_port_counter"
},
@@ -457,7 +456,7 @@
"id" : 3,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 7,
+ "line" : 23,
"column" : 38,
"source_fragment" : "ingress_port_counter"
},
@@ -470,7 +469,7 @@
{
"name" : "calc",
"id" : 0,
- "algo" : "crc16",
+ "algo" : "crc32",
"input" : [
{
"type" : "field",
@@ -529,7 +528,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -548,7 +547,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -567,7 +566,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -586,7 +585,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -605,7 +604,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -624,7 +623,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -643,7 +642,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -662,7 +661,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -681,7 +680,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -700,7 +699,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -719,7 +718,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -738,7 +737,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -757,7 +756,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -776,7 +775,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -795,7 +794,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -814,7 +813,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -833,7 +832,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -852,7 +851,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 11,
+ "line" : 27,
"column" : 4,
"source_fragment" : "standard_metadata.egress_spec = port"
}
@@ -871,7 +870,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -890,7 +889,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -909,7 +908,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -928,7 +927,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -947,7 +946,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -966,7 +965,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -985,7 +984,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1004,7 +1003,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1023,7 +1022,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1042,7 +1041,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1061,7 +1060,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1080,7 +1079,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1099,7 +1098,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1118,7 +1117,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1137,7 +1136,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1156,7 +1155,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1175,7 +1174,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1206,7 +1205,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1225,7 +1224,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1244,7 +1243,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1263,7 +1262,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1282,7 +1281,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1301,7 +1300,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1320,7 +1319,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1339,7 +1338,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1358,7 +1357,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1377,7 +1376,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1396,7 +1395,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1415,7 +1414,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1434,7 +1433,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1453,7 +1452,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1472,7 +1471,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1491,7 +1490,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1510,7 +1509,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1529,7 +1528,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 11,
+ "line" : 27,
"column" : 4,
"source_fragment" : "standard_metadata.egress_spec = port"
}
@@ -1548,7 +1547,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1567,7 +1566,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1586,7 +1585,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1605,7 +1604,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1624,7 +1623,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1643,7 +1642,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1662,7 +1661,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1681,7 +1680,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1700,7 +1699,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1719,7 +1718,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1738,7 +1737,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1757,7 +1756,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1776,7 +1775,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1795,7 +1794,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1814,7 +1813,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1833,7 +1832,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1852,7 +1851,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1866,14 +1865,8 @@
"primitives" : []
},
{
- "name" : "NoAction",
- "id" : 3,
- "runtime_data" : [],
- "primitives" : []
- },
- {
"name" : "send_to_cpu",
- "id" : 4,
+ "id" : 3,
"runtime_data" : [],
"primitives" : [
{
@@ -1890,7 +1883,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1909,7 +1902,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1928,7 +1921,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1947,7 +1940,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1966,7 +1959,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1985,7 +1978,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2004,7 +1997,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2023,7 +2016,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2042,7 +2035,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2061,7 +2054,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2080,7 +2073,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2099,7 +2092,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2118,7 +2111,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2137,7 +2130,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2156,7 +2149,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2175,7 +2168,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2194,7 +2187,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2213,7 +2206,7 @@
],
"source_info" : {
"filename" : "include/defines.p4",
- "line" : 12,
+ "line" : 29,
"column" : 24,
"source_fragment" : "255; ..."
}
@@ -2232,7 +2225,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2251,7 +2244,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2270,7 +2263,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2289,7 +2282,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2308,7 +2301,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2327,7 +2320,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2346,7 +2339,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2365,7 +2358,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2384,7 +2377,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2403,7 +2396,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2422,7 +2415,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2441,7 +2434,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2460,7 +2453,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2479,7 +2472,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2498,7 +2491,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2517,7 +2510,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2536,7 +2529,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2544,8 +2537,8 @@
]
},
{
- "name" : "drop",
- "id" : 5,
+ "name" : "_drop",
+ "id" : 4,
"runtime_data" : [],
"primitives" : [
{
@@ -2562,8 +2555,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2581,8 +2574,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2600,8 +2593,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2619,8 +2612,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2638,8 +2631,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2657,8 +2650,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2676,8 +2669,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2695,8 +2688,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2714,8 +2707,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2733,8 +2726,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2752,8 +2745,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2771,8 +2764,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2790,8 +2783,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2809,8 +2802,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2828,8 +2821,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2847,8 +2840,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2866,8 +2859,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2885,7 +2878,7 @@
],
"source_info" : {
"filename" : "include/defines.p4",
- "line" : 13,
+ "line" : 30,
"column" : 25,
"source_fragment" : "511; ..."
}
@@ -2904,8 +2897,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2923,8 +2916,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2942,8 +2935,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2961,8 +2954,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2980,8 +2973,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2999,8 +2992,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3018,8 +3011,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3037,8 +3030,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3056,8 +3049,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3075,8 +3068,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3094,8 +3087,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3113,8 +3106,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3132,8 +3125,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3151,8 +3144,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3170,8 +3163,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3189,8 +3182,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3208,8 +3201,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
}
@@ -3217,15 +3210,11 @@
},
{
"name" : "ecmp_group",
- "id" : 6,
+ "id" : 5,
"runtime_data" : [
{
"name" : "group_id",
"bitwidth" : 16
- },
- {
- "name" : "groupSize",
- "bitwidth" : 8
}
],
"primitives" : [
@@ -3243,38 +3232,12 @@
],
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 32,
+ "line" : 54,
"column" : 8,
"source_fragment" : "meta.ecmp_metadata.group_id = group_id"
}
},
{
- "op" : "assign",
- "parameters" : [
- {
- "type" : "field",
- "value" : ["scalars", "tmp"]
- },
- {
- "type" : "expression",
- "value" : {
- "type" : "expression",
- "value" : {
- "op" : "&",
- "left" : {
- "type" : "local",
- "value" : 1
- },
- "right" : {
- "type" : "hexstr",
- "value" : "0xffffffffffffffffffffffffffffffff"
- }
- }
- }
- }
- ]
- },
- {
"op" : "modify_field_with_hash_based_offset",
"parameters" : [
{
@@ -3290,22 +3253,22 @@
"value" : "calc"
},
{
- "type" : "field",
- "value" : ["scalars", "tmp"]
+ "type" : "hexstr",
+ "value" : "0x00000000000000000000000000000002"
}
],
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 33,
+ "line" : 55,
"column" : 8,
- "source_fragment" : "hash(meta.ecmp_metadata.selector, HashAlgorithm.crc16, (bit<64>)0, ..."
+ "source_fragment" : "hash(meta.ecmp_metadata.selector, HashAlgorithm.crc32, (bit<64>)0, ..."
}
}
]
},
{
"name" : "act",
- "id" : 7,
+ "id" : 6,
"runtime_data" : [],
"primitives" : [
{
@@ -3331,7 +3294,7 @@
},
{
"name" : "act_0",
- "id" : 8,
+ "id" : 7,
"runtime_data" : [],
"primitives" : [
{
@@ -3339,7 +3302,7 @@
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["scalars", "tmp"]
},
{
"type" : "expression",
@@ -3369,12 +3332,12 @@
},
{
"type" : "field",
- "value" : ["scalars", "tmp_0"]
+ "value" : ["scalars", "tmp"]
}
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 11,
+ "line" : 27,
"column" : 12,
"source_fragment" : "ingress_port_counter.count((bit<32>)standard_metadata.ingress_port)"
}
@@ -3384,7 +3347,7 @@
"parameters" : [
{
"type" : "field",
- "value" : ["scalars", "tmp_1"]
+ "value" : ["scalars", "tmp_0"]
},
{
"type" : "expression",
@@ -3414,12 +3377,12 @@
},
{
"type" : "field",
- "value" : ["scalars", "tmp_1"]
+ "value" : ["scalars", "tmp_0"]
}
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 12,
+ "line" : 28,
"column" : 12,
"source_fragment" : "egress_port_counter.count((bit<32>)standard_metadata.egress_spec)"
}
@@ -3428,7 +3391,7 @@
},
{
"name" : "act_1",
- "id" : 9,
+ "id" : 8,
"runtime_data" : [],
"primitives" : [
{
@@ -3469,7 +3432,7 @@
},
{
"name" : "act_2",
- "id" : 10,
+ "id" : 9,
"runtime_data" : [],
"primitives" : [
{
@@ -3496,7 +3459,7 @@
"id" : 0,
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 26,
+ "line" : 48,
"column" : 8,
"source_fragment" : "ingress"
},
@@ -3512,14 +3475,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [7],
+ "action_ids" : [6],
"actions" : ["act"],
"base_default_next" : "node_4",
"next_tables" : {
"act" : "node_4"
},
"default_entry" : {
- "action_id" : 7,
+ "action_id" : 6,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3530,7 +3493,7 @@
"id" : 1,
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 50,
+ "line" : 71,
"column" : 10,
"source_fragment" : "table0"
},
@@ -3561,18 +3524,17 @@
"max_size" : 1024,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [6, 1, 4, 5, 3],
- "actions" : ["ecmp_group", "set_egress_port", "send_to_cpu", "drop", "NoAction"],
+ "action_ids" : [5, 1, 3, 4],
+ "actions" : ["ecmp_group", "set_egress_port", "send_to_cpu", "_drop"],
"base_default_next" : "node_7",
"next_tables" : {
"ecmp_group" : "ecmp_group_table",
"set_egress_port" : "node_7",
"send_to_cpu" : "node_7",
- "drop" : "node_7",
- "NoAction" : "node_7"
+ "_drop" : "node_7"
},
"default_entry" : {
- "action_id" : 3,
+ "action_id" : 4,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -3583,7 +3545,7 @@
"id" : 2,
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 39,
+ "line" : 60,
"column" : 10,
"source_fragment" : "ecmp_group_table"
},
@@ -3628,14 +3590,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [8],
+ "action_ids" : [7],
"actions" : ["act_0"],
"base_default_next" : null,
"next_tables" : {
"act_0" : null
},
"default_entry" : {
- "action_id" : 8,
+ "action_id" : 7,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3675,7 +3637,7 @@
"id" : 1,
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 72,
+ "line" : 94,
"column" : 13,
"source_fragment" : "hdr.packet_out.isValid()"
},
@@ -3701,7 +3663,7 @@
"id" : 2,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 10,
+ "line" : 26,
"column" : 12,
"source_fragment" : "standard_metadata.egress_spec < 254"
},
@@ -3729,7 +3691,7 @@
"id" : 1,
"source_info" : {
"filename" : "ecmp.p4",
- "line" : 83,
+ "line" : 105,
"column" : 8,
"source_fragment" : "egress"
},
@@ -3745,14 +3707,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [10],
+ "action_ids" : [9],
"actions" : ["act_2"],
"base_default_next" : "node_12",
"next_tables" : {
"act_2" : "node_12"
},
"default_entry" : {
- "action_id" : 10,
+ "action_id" : 9,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3768,14 +3730,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [9],
+ "action_ids" : [8],
"actions" : ["act_1"],
"base_default_next" : null,
"next_tables" : {
"act_1" : null
},
"default_entry" : {
- "action_id" : 9,
+ "action_id" : 8,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
diff --git a/tools/test/p4src/p4-16/p4c-out/ecmp.p4info b/tools/test/p4src/p4-16/p4c-out/ecmp.p4info
index bfa727d..29fd5c0 100644
--- a/tools/test/p4src/p4-16/p4c-out/ecmp.p4info
+++ b/tools/test/p4src/p4-16/p4c-out/ecmp.p4info
@@ -66,11 +66,7 @@
id: 16829080
}
action_refs {
- id: 16793508
- }
- action_refs {
- id: 16800567
- annotations: "@defaultonly()"
+ id: 16784184
}
direct_resource_ids: 301990488
size: 1024
@@ -104,9 +100,9 @@
}
actions {
preamble {
- id: 16793508
- name: "drop"
- alias: "drop"
+ id: 16784184
+ name: "_drop"
+ alias: "_drop"
}
}
actions {
@@ -120,11 +116,6 @@
name: "group_id"
bitwidth: 16
}
- params {
- id: 2
- name: "groupSize"
- bitwidth: 8
- }
}
counters {
preamble {
diff --git a/tools/test/p4src/p4-16/p4c-out/empty.json b/tools/test/p4src/p4-16/p4c-out/empty.json
index d308780..8da30fa 100644
--- a/tools/test/p4src/p4-16/p4c-out/empty.json
+++ b/tools/test/p4src/p4-16/p4c-out/empty.json
@@ -107,7 +107,7 @@
"id" : 0,
"source_info" : {
"filename" : "empty.p4",
- "line" : 44,
+ "line" : 60,
"column" : 8,
"source_fragment" : "DeparserImpl"
},
@@ -145,7 +145,7 @@
],
"source_info" : {
"filename" : "empty.p4",
- "line" : 23,
+ "line" : 39,
"column" : 8,
"source_fragment" : "meta.dummy_metadata.dummyField = 8w1"
}
@@ -159,7 +159,7 @@
"id" : 0,
"source_info" : {
"filename" : "empty.p4",
- "line" : 21,
+ "line" : 37,
"column" : 8,
"source_fragment" : "ingress"
},
@@ -170,7 +170,7 @@
"id" : 0,
"source_info" : {
"filename" : "empty.p4",
- "line" : 25,
+ "line" : 41,
"column" : 10,
"source_fragment" : "table0"
},
@@ -210,7 +210,7 @@
"id" : 1,
"source_info" : {
"filename" : "empty.p4",
- "line" : 38,
+ "line" : 54,
"column" : 8,
"source_fragment" : "egress"
},
diff --git a/tools/test/p4src/p4-16/p4c-out/wcmp.json b/tools/test/p4src/p4-16/p4c-out/wcmp.json
index 6e57c49..dc50c96 100644
--- a/tools/test/p4src/p4-16/p4c-out/wcmp.json
+++ b/tools/test/p4src/p4-16/p4c-out/wcmp.json
@@ -393,7 +393,7 @@
"parser_ops" : [],
"transitions" : [
{
- "value" : "0x00ff",
+ "value" : "0xff",
"mask" : null,
"next_state" : "parse_packet_out"
},
@@ -419,7 +419,7 @@
"id" : 0,
"source_info" : {
"filename" : "include/parsers.p4",
- "line" : 48,
+ "line" : 64,
"column" : 8,
"source_fragment" : "DeparserImpl"
},
@@ -445,7 +445,7 @@
"id" : 2,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 6,
+ "line" : 22,
"column" : 38,
"source_fragment" : "egress_port_counter"
},
@@ -457,7 +457,7 @@
"id" : 3,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 7,
+ "line" : 23,
"column" : 38,
"source_fragment" : "ingress_port_counter"
},
@@ -529,7 +529,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -548,7 +548,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -567,7 +567,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -586,7 +586,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -605,7 +605,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -624,7 +624,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -643,7 +643,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -662,7 +662,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -681,7 +681,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -700,7 +700,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -719,7 +719,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -738,7 +738,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -757,7 +757,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -776,7 +776,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -795,7 +795,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -814,7 +814,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -833,7 +833,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -852,7 +852,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 11,
+ "line" : 27,
"column" : 4,
"source_fragment" : "standard_metadata.egress_spec = port"
}
@@ -871,7 +871,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -890,7 +890,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -909,7 +909,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -928,7 +928,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -947,7 +947,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -966,7 +966,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -985,7 +985,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1004,7 +1004,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1023,7 +1023,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1042,7 +1042,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1061,7 +1061,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1080,7 +1080,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1099,7 +1099,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1118,7 +1118,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1137,7 +1137,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1156,7 +1156,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1175,7 +1175,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1206,7 +1206,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1225,7 +1225,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1244,7 +1244,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1263,7 +1263,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1282,7 +1282,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1301,7 +1301,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1320,7 +1320,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1339,7 +1339,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1358,7 +1358,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1377,7 +1377,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1396,7 +1396,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1415,7 +1415,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1434,7 +1434,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1453,7 +1453,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1472,7 +1472,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1491,7 +1491,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1510,7 +1510,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1529,7 +1529,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 11,
+ "line" : 27,
"column" : 4,
"source_fragment" : "standard_metadata.egress_spec = port"
}
@@ -1548,7 +1548,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1567,7 +1567,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1586,7 +1586,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1605,7 +1605,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1624,7 +1624,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1643,7 +1643,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1662,7 +1662,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1681,7 +1681,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1700,7 +1700,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1719,7 +1719,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1738,7 +1738,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1757,7 +1757,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1776,7 +1776,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1795,7 +1795,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1814,7 +1814,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1833,7 +1833,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1852,7 +1852,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 10,
+ "line" : 26,
"column" : 49,
"source_fragment" : "standard_metadata, port_t port) { ..."
}
@@ -1878,7 +1878,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1897,7 +1897,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1916,7 +1916,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1935,7 +1935,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1954,7 +1954,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1973,7 +1973,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -1992,7 +1992,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2011,7 +2011,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2030,7 +2030,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2049,7 +2049,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2068,7 +2068,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2087,7 +2087,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2106,7 +2106,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2125,7 +2125,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2144,7 +2144,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2163,7 +2163,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2182,7 +2182,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2201,7 +2201,7 @@
],
"source_info" : {
"filename" : "include/defines.p4",
- "line" : 12,
+ "line" : 29,
"column" : 24,
"source_fragment" : "255; ..."
}
@@ -2220,7 +2220,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2239,7 +2239,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2258,7 +2258,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2277,7 +2277,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2296,7 +2296,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2315,7 +2315,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2334,7 +2334,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2353,7 +2353,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2372,7 +2372,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2391,7 +2391,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2410,7 +2410,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2429,7 +2429,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2448,7 +2448,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2467,7 +2467,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2486,7 +2486,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2505,7 +2505,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2524,7 +2524,7 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 6,
+ "line" : 22,
"column" : 45,
"source_fragment" : "standard_metadata) { ..."
}
@@ -2532,7 +2532,7 @@
]
},
{
- "name" : "drop",
+ "name" : "_drop",
"id" : 3,
"runtime_data" : [],
"primitives" : [
@@ -2550,8 +2550,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2569,8 +2569,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2588,8 +2588,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2607,8 +2607,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2626,8 +2626,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2645,8 +2645,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2664,8 +2664,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2683,8 +2683,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2702,8 +2702,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2721,8 +2721,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2740,8 +2740,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2759,8 +2759,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2778,8 +2778,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2797,8 +2797,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2816,8 +2816,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2835,8 +2835,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2854,8 +2854,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2873,7 +2873,7 @@
],
"source_info" : {
"filename" : "include/defines.p4",
- "line" : 13,
+ "line" : 30,
"column" : 25,
"source_fragment" : "511; ..."
}
@@ -2892,8 +2892,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2911,8 +2911,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2930,8 +2930,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2949,8 +2949,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2968,8 +2968,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -2987,8 +2987,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3006,8 +3006,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3025,8 +3025,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3044,8 +3044,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3063,8 +3063,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3082,8 +3082,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3101,8 +3101,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3120,8 +3120,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3139,8 +3139,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3158,8 +3158,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3177,8 +3177,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
},
@@ -3196,8 +3196,8 @@
],
"source_info" : {
"filename" : "include/actions.p4",
- "line" : 14,
- "column" : 38,
+ "line" : 30,
+ "column" : 39,
"source_fragment" : "standard_metadata) { ..."
}
}
@@ -3210,14 +3210,8 @@
"primitives" : []
},
{
- "name" : "NoAction",
- "id" : 5,
- "runtime_data" : [],
- "primitives" : []
- },
- {
"name" : "wcmp_group",
- "id" : 6,
+ "id" : 5,
"runtime_data" : [
{
"name" : "group_id",
@@ -3239,7 +3233,7 @@
],
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 34,
+ "line" : 50,
"column" : 8,
"source_fragment" : "meta.wcmp_metadata.group_id = group_id"
}
@@ -3266,7 +3260,7 @@
],
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 35,
+ "line" : 51,
"column" : 8,
"source_fragment" : "hash(meta.wcmp_metadata.numBits, HashAlgorithm.crc16, (bit<64>)2, ..."
}
@@ -3275,7 +3269,7 @@
},
{
"name" : "wcmp_set_selector",
- "id" : 7,
+ "id" : 6,
"runtime_data" : [],
"primitives" : [
{
@@ -3375,7 +3369,7 @@
],
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 42,
+ "line" : 58,
"column" : 8,
"source_fragment" : "meta.wcmp_metadata.selector = ((ONE << meta.wcmp_metadata.numBits) - ONE) << (64 - meta.wcmp_metadata.numBits)"
}
@@ -3384,7 +3378,7 @@
},
{
"name" : "act",
- "id" : 8,
+ "id" : 7,
"runtime_data" : [],
"primitives" : [
{
@@ -3410,7 +3404,7 @@
},
{
"name" : "act_0",
- "id" : 9,
+ "id" : 8,
"runtime_data" : [],
"primitives" : [
{
@@ -3453,7 +3447,7 @@
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 11,
+ "line" : 27,
"column" : 12,
"source_fragment" : "ingress_port_counter.count((bit<32>)standard_metadata.ingress_port)"
}
@@ -3498,7 +3492,7 @@
],
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 12,
+ "line" : 28,
"column" : 12,
"source_fragment" : "egress_port_counter.count((bit<32>)standard_metadata.egress_spec)"
}
@@ -3507,7 +3501,7 @@
},
{
"name" : "act_1",
- "id" : 10,
+ "id" : 9,
"runtime_data" : [],
"primitives" : [
{
@@ -3548,7 +3542,7 @@
},
{
"name" : "act_2",
- "id" : 11,
+ "id" : 10,
"runtime_data" : [],
"primitives" : [
{
@@ -3575,7 +3569,7 @@
"id" : 0,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 28,
+ "line" : 44,
"column" : 8,
"source_fragment" : "ingress"
},
@@ -3591,14 +3585,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [8],
+ "action_ids" : [7],
"actions" : ["act"],
"base_default_next" : "node_4",
"next_tables" : {
"act" : "node_4"
},
"default_entry" : {
- "action_id" : 8,
+ "action_id" : 7,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3609,7 +3603,7 @@
"id" : 1,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 45,
+ "line" : 61,
"column" : 10,
"source_fragment" : "table0"
},
@@ -3640,18 +3634,17 @@
"max_size" : 1024,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [0, 6, 2, 3, 4],
- "actions" : ["set_egress_port", "wcmp_group", "send_to_cpu", "drop", "NoAction"],
+ "action_ids" : [0, 5, 2, 3],
+ "actions" : ["set_egress_port", "wcmp_group", "send_to_cpu", "_drop"],
"base_default_next" : "node_8",
"next_tables" : {
"wcmp_group" : "tbl_wcmp_set_selector",
"set_egress_port" : "node_8",
"send_to_cpu" : "node_8",
- "drop" : "node_8",
- "NoAction" : "node_8"
+ "_drop" : "node_8"
},
"default_entry" : {
- "action_id" : 4,
+ "action_id" : 3,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -3667,14 +3660,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [7],
+ "action_ids" : [6],
"actions" : ["wcmp_set_selector"],
"base_default_next" : "wcmp_group_table",
"next_tables" : {
"wcmp_set_selector" : "wcmp_group_table"
},
"default_entry" : {
- "action_id" : 7,
+ "action_id" : 6,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3685,7 +3678,7 @@
"id" : 3,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 62,
+ "line" : 79,
"column" : 10,
"source_fragment" : "wcmp_group_table"
},
@@ -3706,7 +3699,7 @@
"max_size" : 1024,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [1, 5],
+ "action_ids" : [1, 4],
"actions" : ["set_egress_port", "NoAction"],
"base_default_next" : "node_8",
"next_tables" : {
@@ -3714,7 +3707,7 @@
"NoAction" : "node_8"
},
"default_entry" : {
- "action_id" : 5,
+ "action_id" : 4,
"action_const" : false,
"action_data" : [],
"action_entry_const" : false
@@ -3730,14 +3723,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [9],
+ "action_ids" : [8],
"actions" : ["act_0"],
"base_default_next" : null,
"next_tables" : {
"act_0" : null
},
"default_entry" : {
- "action_id" : 9,
+ "action_id" : 8,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3777,7 +3770,7 @@
"id" : 1,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 78,
+ "line" : 95,
"column" : 13,
"source_fragment" : "hdr.packet_out.isValid()"
},
@@ -3803,7 +3796,7 @@
"id" : 2,
"source_info" : {
"filename" : "include/port_counters.p4",
- "line" : 10,
+ "line" : 26,
"column" : 12,
"source_fragment" : "standard_metadata.egress_spec < 254"
},
@@ -3831,7 +3824,7 @@
"id" : 1,
"source_info" : {
"filename" : "wcmp.p4",
- "line" : 90,
+ "line" : 107,
"column" : 8,
"source_fragment" : "egress"
},
@@ -3847,14 +3840,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [11],
+ "action_ids" : [10],
"actions" : ["act_2"],
"base_default_next" : "node_13",
"next_tables" : {
"act_2" : "node_13"
},
"default_entry" : {
- "action_id" : 11,
+ "action_id" : 10,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
@@ -3870,14 +3863,14 @@
"with_counters" : false,
"support_timeout" : false,
"direct_meters" : null,
- "action_ids" : [10],
+ "action_ids" : [9],
"actions" : ["act_1"],
"base_default_next" : null,
"next_tables" : {
"act_1" : null
},
"default_entry" : {
- "action_id" : 10,
+ "action_id" : 9,
"action_const" : true,
"action_data" : [],
"action_entry_const" : true
diff --git a/tools/test/p4src/p4-16/p4c-out/wcmp.p4info b/tools/test/p4src/p4-16/p4c-out/wcmp.p4info
index 8846b67..41aabf4 100644
--- a/tools/test/p4src/p4-16/p4c-out/wcmp.p4info
+++ b/tools/test/p4src/p4-16/p4c-out/wcmp.p4info
@@ -38,11 +38,7 @@
id: 16829080
}
action_refs {
- id: 16793508
- }
- action_refs {
- id: 16800567
- annotations: "@defaultonly()"
+ id: 16784184
}
direct_resource_ids: 301990488
size: 1024
@@ -97,9 +93,9 @@
}
actions {
preamble {
- id: 16793508
- name: "drop"
- alias: "drop"
+ id: 16784184
+ name: "_drop"
+ alias: "_drop"
}
}
actions {
diff --git a/tools/test/p4src/p4-16/wcmp.p4 b/tools/test/p4src/p4-16/wcmp.p4
index 419ba83..8123bfb 100644
--- a/tools/test/p4src/p4-16/wcmp.p4
+++ b/tools/test/p4src/p4-16/wcmp.p4
@@ -64,7 +64,7 @@
set_egress_port(standard_metadata);
wcmp_group;
send_to_cpu(standard_metadata);
- drop(standard_metadata);
+ _drop(standard_metadata);
}
key = {
standard_metadata.ingress_port: ternary;
@@ -73,6 +73,7 @@
hdr.ethernet.etherType : ternary;
}
counters = table0_counter;
+ default_action = _drop(standard_metadata);
}
table wcmp_group_table {