[ONOS-7128] Initial commit of fabric.p4
Change-Id: I5224c411a1eccdbee84b1fc0b1824c5fa922f689
diff --git a/modules.defs b/modules.defs
index 22ea0cd..da1f005 100644
--- a/modules.defs
+++ b/modules.defs
@@ -249,6 +249,7 @@
PIPELINES = [
'//pipelines/basic:onos-pipelines-basic-oar',
+ '//pipelines/fabric:onos-pipelines-fabric-oar',
]
APP_JARS = [
diff --git a/pipelines/fabric/BUCK b/pipelines/fabric/BUCK
new file mode 100644
index 0000000..114701d
--- /dev/null
+++ b/pipelines/fabric/BUCK
@@ -0,0 +1,31 @@
+COMPILE_DEPS = [
+ '//lib:CORE_DEPS',
+ '//protocols/p4runtime/model:onos-protocols-p4runtime-model',
+ '//protocols/p4runtime/api:onos-protocols-p4runtime-api',
+ '//pipelines/basic:onos-pipelines-basic',
+]
+
+TEST_DEPS = [
+ '//lib:TEST_ADAPTERS',
+]
+
+BUNDLES = [
+ '//pipelines/fabric:onos-pipelines-fabric',
+]
+
+osgi_jar_with_tests (
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+)
+
+onos_app(
+ app_name = 'org.onosproject.pipelines.fabric',
+ title = 'Fabric Pipeline',
+ category = 'Pipeline',
+ url = 'http://onosproject.org',
+ description = 'Provides pipelines with CORD fabric underlay support.',
+ included_bundles = BUNDLES,
+ required_apps = [
+ 'org.onosproject.drivers.p4runtime',
+ ]
+)
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java
new file mode 100644
index 0000000..333964a
--- /dev/null
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pipelines.fabric;
+
+import org.onosproject.net.pi.model.PiActionId;
+import org.onosproject.net.pi.model.PiActionParamId;
+import org.onosproject.net.pi.model.PiActionProfileId;
+import org.onosproject.net.pi.model.PiControlMetadataId;
+import org.onosproject.net.pi.model.PiCounterId;
+import org.onosproject.net.pi.model.PiMatchFieldId;
+import org.onosproject.net.pi.model.PiTableId;
+/**
+ * Constants for fabric pipeline.
+ */
+public final class FabricConstants {
+
+ // hide default constructor
+ private FabricConstants() {
+ }
+
+ public static final String DOT = ".";
+ // Header IDs
+ public static final String HDR = "hdr";
+ public static final String UDP = "udp";
+ public static final String STANDARD_METADATA = "standard_metadata";
+ public static final String MPLS = "mpls";
+ public static final String TCP = "tcp";
+ public static final String FABRIC_METADATA = "fabric_metadata";
+ public static final String IPV4 = "ipv4";
+ public static final String IPV6 = "ipv6";
+ public static final String ETHERNET = "ethernet";
+ public static final String VLAN_TAG = "vlan_tag";
+ public static final String ICMP = "icmp";
+
+ // Header field IDs
+ public static final PiMatchFieldId HF_VLAN_TAG_VLAN_ID_ID = buildPiMatchField(VLAN_TAG, "vlan_id", true);
+ public static final PiMatchFieldId HF_MPLS_LABEL_ID = buildPiMatchField(MPLS, "label", true);
+ public static final PiMatchFieldId HF_STANDARD_METADATA_INGRESS_PORT_ID =
+ buildPiMatchField(STANDARD_METADATA, "ingress_port", false);
+ public static final PiMatchFieldId HF_UDP_SRC_PORT_ID = buildPiMatchField(UDP, "src_port", true);
+ public static final PiMatchFieldId HF_VLAN_TAG_IS_VALID_ID = buildPiMatchField(VLAN_TAG, "is_valid", true);
+ public static final PiMatchFieldId HF_IPV6_NEXT_HDR_ID = buildPiMatchField(IPV6, "next_hdr", true);
+ public static final PiMatchFieldId HF_ETHERNET_SRC_ADDR_ID = buildPiMatchField(ETHERNET, "src_addr", true);
+ public static final PiMatchFieldId HF_ICMP_ICMP_TYPE_ID = buildPiMatchField(ICMP, "icmp_type", true);
+ public static final PiMatchFieldId HF_MPLS_TC_ID = buildPiMatchField(MPLS, "tc", true);
+ public static final PiMatchFieldId HF_IPV4_DST_ADDR_ID = buildPiMatchField(IPV4, "dst_addr", true);
+ public static final PiMatchFieldId HF_VLAN_TAG_PRI_ID = buildPiMatchField(VLAN_TAG, "pri", true);
+ public static final PiMatchFieldId HF_TCP_SRC_PORT_ID = buildPiMatchField(TCP, "src_port", true);
+ public static final PiMatchFieldId HF_ETHERNET_ETHER_TYPE_ID = buildPiMatchField(ETHERNET, "ether_type", true);
+ public static final PiMatchFieldId HF_ICMP_ICMP_CODE_ID = buildPiMatchField(ICMP, "icmp_code", true);
+ public static final PiMatchFieldId HF_MPLS_BOS_ID = buildPiMatchField(MPLS, "bos", true);
+ public static final PiMatchFieldId HF_FABRIC_METADATA_IP_PROTO_ID =
+ buildPiMatchField(FABRIC_METADATA, "ip_proto", false);
+ public static final PiMatchFieldId HF_FABRIC_METADATA_NEXT_ID_ID =
+ buildPiMatchField(FABRIC_METADATA, "next_id", false);
+ public static final PiMatchFieldId HF_UDP_DST_PORT_ID = buildPiMatchField(UDP, "dst_port", true);
+ public static final PiMatchFieldId HF_IPV4_PROTOCOL_ID = buildPiMatchField(IPV4, "protocol", true);
+ public static final PiMatchFieldId HF_IPV4_SRC_ADDR_ID = buildPiMatchField(IPV4, "src_addr", true);
+ public static final PiMatchFieldId HF_IPV6_SRC_ADDR_ID = buildPiMatchField(IPV6, "src_addr", true);
+ public static final PiMatchFieldId HF_IPV6_DST_ADDR_ID = buildPiMatchField(IPV6, "dst_addr", true);
+ public static final PiMatchFieldId HF_TCP_DST_PORT_ID = buildPiMatchField(TCP, "dst_port", true);
+ public static final PiMatchFieldId HF_ETHERNET_DST_ADDR_ID = buildPiMatchField(ETHERNET, "dst_addr", true);
+
+ private static PiMatchFieldId buildPiMatchField(String header, String field, boolean withHdrPrefix) {
+ if (withHdrPrefix) {
+ return PiMatchFieldId.of(HDR + DOT + header + DOT + field);
+ } else {
+ return PiMatchFieldId.of(header + DOT + field);
+ }
+ }
+
+ // Table IDs
+ public static final PiTableId TBL_MULTICAST_V4_ID = PiTableId.of("forwarding.multicast_v4");
+ public static final PiTableId TBL_MULTICAST_V6_ID = PiTableId.of("forwarding.multicast_v6");
+ public static final PiTableId TBL_ACL_ID = PiTableId.of("forwarding.acl");
+ public static final PiTableId TBL_BROADCAST_ID = PiTableId.of("next.broadcast");
+ public static final PiTableId TBL_HASHED_ID = PiTableId.of("next.hashed");
+ public static final PiTableId TBL_INGRESS_PORT_VLAN_ID = PiTableId.of("filtering.ingress_port_vlan");
+ public static final PiTableId TBL_FWD_CLASSIFIER_ID = PiTableId.of("filtering.fwd_classifier");
+ public static final PiTableId TBL_NEXT_ID_MAPPING_ID = PiTableId.of("next.next_id_mapping");
+ public static final PiTableId TBL_UNICAST_V6_ID = PiTableId.of("forwarding.unicast_v6");
+ public static final PiTableId TBL_SIMPLE_ID = PiTableId.of("next.simple");
+ public static final PiTableId TBL_BRIDGING_ID = PiTableId.of("forwarding.bridging");
+ public static final PiTableId TBL_UNICAST_V4_ID = PiTableId.of("forwarding.unicast_v4");
+ public static final PiTableId TBL_MPLS_ID = PiTableId.of("forwarding.mpls");
+
+ // Indirect Counter IDs
+ public static final PiCounterId CNT_EGRESS_PORT_COUNTER_ID =
+ PiCounterId.of("port_counters_control.egress_port_counter");
+ public static final PiCounterId CNT_INGRESS_PORT_COUNTER_ID =
+ PiCounterId.of("port_counters_control.ingress_port_counter");
+
+ // Direct Counter IDs
+ public static final PiCounterId CNT_MULTICAST_V6_COUNTER_ID = PiCounterId.of("forwarding.multicast_v6_counter");
+ public static final PiCounterId CNT_ACL_COUNTER_ID = PiCounterId.of("forwarding.acl_counter");
+ public static final PiCounterId CNT_UNICAST_V4_COUNTER_ID = PiCounterId.of("forwarding.unicast_v4_counter");
+ public static final PiCounterId CNT_INGRESS_PORT_VLAN_COUNTER_ID =
+ PiCounterId.of("filtering.ingress_port_vlan_counter");
+ public static final PiCounterId CNT_FWD_CLASSIFIER_COUNTER_ID = PiCounterId.of("filtering.fwd_classifier_counter");
+ public static final PiCounterId CNT_UNICAST_V6_COUNTER_ID = PiCounterId.of("forwarding.unicast_v6_counter");
+ public static final PiCounterId CNT_BRIDGING_COUNTER_ID = PiCounterId.of("forwarding.bridging_counter");
+ public static final PiCounterId CNT_NEXT_ID_MAPPING_COUNTER_ID = PiCounterId.of("next.next_id_mapping_counter");
+ public static final PiCounterId CNT_SIMPLE_COUNTER_ID = PiCounterId.of("next.simple_counter");
+ public static final PiCounterId CNT_HASHED_COUNTER_ID = PiCounterId.of("next.hashed_counter");
+ public static final PiCounterId CNT_BROADCAST_COUNTER_ID = PiCounterId.of("next.broadcast_counter");
+ public static final PiCounterId CNT_MULTICAST_V4_COUNTER_ID = PiCounterId.of("forwarding.multicast_v4_counter");
+ public static final PiCounterId CNT_MPLS_COUNTER_ID = PiCounterId.of("forwarding.mpls_counter");
+
+ // Action IDs
+ public static final PiActionId ACT_SET_MCAST_GROUP_ID = PiActionId.of("next.set_mcast_group");
+ public static final PiActionId ACT_DROP_ID = PiActionId.of("drop");
+ public static final PiActionId ACT_PUSH_INTERNAL_VLAN_ID = PiActionId.of("filtering.push_internal_vlan");
+ public static final PiActionId ACT_SET_VLAN_OUTPUT_ID = PiActionId.of("next.set_vlan_output");
+ public static final PiActionId ACT_NOACTION_ID = PiActionId.of("NoAction");
+ public static final PiActionId ACT_PUSH_MPLS_AND_NEXT_V6_ID = PiActionId.of("forwarding.push_mpls_and_next_v6");
+ public static final PiActionId ACT_PUSH_MPLS_AND_NEXT_V4_ID = PiActionId.of("forwarding.push_mpls_and_next_v4");
+ public static final PiActionId ACT_SET_FORWARDING_TYPE_ID = PiActionId.of("filtering.set_forwarding_type");
+ public static final PiActionId ACT_POP_MPLS_AND_NEXT_ID = PiActionId.of("forwarding.pop_mpls_and_next");
+ public static final PiActionId ACT_SET_NEXT_TYPE_ID = PiActionId.of("next.set_next_type");
+ public static final PiActionId ACT_L3_ROUTING_ID = PiActionId.of("next.l3_routing");
+ public static final PiActionId ACT_OUTPUT_ID = PiActionId.of("next.output");
+ public static final PiActionId ACT_NOP_ID = PiActionId.of("nop");
+ public static final PiActionId ACT_SET_NEXT_ID_ID = PiActionId.of("forwarding.set_next_id");
+ public static final PiActionId ACT_SET_VLAN_ID = PiActionId.of("filtering.set_vlan");
+ public static final PiActionId ACT_DUPLICATE_TO_CONTROLLER_ID = PiActionId.of("forwarding.duplicate_to_controller");
+
+ // Action Param IDs
+ public static final PiActionParamId ACT_PRM_DMAC_ID = PiActionParamId.of("dmac");
+ public static final PiActionParamId ACT_PRM_PORT_NUM_ID = PiActionParamId.of("port_num");
+ public static final PiActionParamId ACT_PRM_LABEL_ID = PiActionParamId.of("label");
+ public static final PiActionParamId ACT_PRM_SMAC_ID = PiActionParamId.of("smac");
+ public static final PiActionParamId ACT_PRM_GID_ID = PiActionParamId.of("gid");
+ public static final PiActionParamId ACT_PRM_NEW_VLAN_ID_ID = PiActionParamId.of("new_vlan_id");
+ public static final PiActionParamId ACT_PRM_FWD_TYPE_ID = PiActionParamId.of("fwd_type");
+ public static final PiActionParamId ACT_PRM_NEXT_TYPE_ID = PiActionParamId.of("next_type");
+ public static final PiActionParamId ACT_PRM_NEXT_ID_ID = PiActionParamId.of("next_id");
+
+ // Action Profile IDs
+ public static final PiActionProfileId ACT_PRF_ECMP_SELECTOR_ID = PiActionProfileId.of("ecmp_selector");
+
+ // Packet Metadata IDs
+ public static final PiControlMetadataId CTRL_META_EGRESS_PORT_ID = PiControlMetadataId.of("egress_port");
+ public static final PiControlMetadataId CTRL_META_INGRESS_PORT_ID = PiControlMetadataId.of("ingress_port");
+}
\ No newline at end of file
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java
new file mode 100644
index 0000000..a9e3f3b
--- /dev/null
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pipelines.fabric;
+
+
+import org.onosproject.net.pi.model.PiCounterId;
+import org.onosproject.pipelines.basic.PortStatisticsDiscoveryImpl;
+
+/**
+ * Implementation of the PortStatisticsBehaviour for fabric.p4.
+ */
+public class FabricPortStatisticsDiscovery extends PortStatisticsDiscoveryImpl {
+
+ /**
+ * Returns the ID of the ingress port counter.
+ *
+ * @return counter ID
+ */
+ @Override
+ public PiCounterId ingressCounterId() {
+ return FabricConstants.CNT_INGRESS_PORT_COUNTER_ID;
+ }
+
+ /**
+ * Returns the ID of the egress port counter.
+ *
+ * @return counter ID
+ */
+ @Override
+ public PiCounterId egressCounterId() {
+ return FabricConstants.CNT_EGRESS_PORT_COUNTER_ID;
+ }
+}
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/PipeconfLoader.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/PipeconfLoader.java
new file mode 100644
index 0000000..f7fc45f
--- /dev/null
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/PipeconfLoader.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pipelines.fabric;
+
+import com.google.common.collect.ImmutableList;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onosproject.net.device.PortStatisticsDiscovery;
+import org.onosproject.net.pi.model.DefaultPiPipeconf;
+import org.onosproject.net.pi.model.PiPipeconf;
+import org.onosproject.net.pi.model.PiPipeconfId;
+import org.onosproject.net.pi.model.PiPipelineModel;
+import org.onosproject.net.pi.service.PiPipeconfService;
+import org.onosproject.p4runtime.model.P4InfoParser;
+import org.onosproject.p4runtime.model.P4InfoParserException;
+
+import java.net.URL;
+import java.util.Collection;
+
+import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.BMV2_JSON;
+import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.P4_INFO_TEXT;
+
+/**
+ * Pipeline config loader for fabric pipeline.
+ */
+@Component(immediate = true)
+public class PipeconfLoader {
+
+ private static final PiPipeconfId FABRIC_PIPECONF_ID =
+ new PiPipeconfId("org.onosproject.pipelines.fabric");
+ private static final String FABRIC_JSON_PATH = "/p4c-out/bmv2/fabric.json";
+ private static final String FABRIC_P4INFO_PATH = "/p4c-out/bmv2/fabric.p4info";
+
+ public static final PiPipeconf FABRIC_PIPECONF = buildFabricPipeconf();
+
+ // XXX: Use a collection to hold only one pipeconf because we might separate
+ // fabric pipeconf to leaf/spine pipeconf in the future.
+ private static final Collection<PiPipeconf> ALL_PIPECONFS =
+ ImmutableList.of(FABRIC_PIPECONF);
+
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ private PiPipeconfService piPipeconfService;
+
+ @Activate
+ public void activate() {
+ // Registers all pipeconf at component activation.
+ ALL_PIPECONFS.forEach(piPipeconfService::register);
+ }
+
+ @Deactivate
+ public void deactivate() {
+ ALL_PIPECONFS.stream().map(PiPipeconf::id).forEach(piPipeconfService::remove);
+ }
+
+ private static PiPipeconf buildFabricPipeconf() {
+ final URL jsonUrl = PipeconfLoader.class.getResource(FABRIC_JSON_PATH);
+ final URL p4InfoUrl = PipeconfLoader.class.getResource(FABRIC_P4INFO_PATH);
+ final PiPipelineModel model = parseP4Info(p4InfoUrl);
+ return DefaultPiPipeconf.builder()
+ .withId(FABRIC_PIPECONF_ID)
+ .withPipelineModel(model)
+ .addBehaviour(PortStatisticsDiscovery.class, FabricPortStatisticsDiscovery.class)
+ .addExtension(P4_INFO_TEXT, p4InfoUrl)
+ .addExtension(BMV2_JSON, jsonUrl)
+ // Put here other target-specific extensions,
+ // e.g. Tofino's bin and context.json.
+ .build();
+ }
+
+ private static PiPipelineModel parseP4Info(URL p4InfoUrl) {
+ try {
+ return P4InfoParser.parse(p4InfoUrl);
+ } catch (P4InfoParserException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/package-info.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/package-info.java
new file mode 100644
index 0000000..1cd2d1f
--- /dev/null
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * CORD underlay fabric pipeline.
+ */
+package org.onosproject.pipelines.fabric;
diff --git a/pipelines/fabric/src/main/resources/Makefile b/pipelines/fabric/src/main/resources/Makefile
new file mode 100644
index 0000000..4ff94e0
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/Makefile
@@ -0,0 +1,10 @@
+all: fabric.json
+
+fabric.json: fabric.p4
+ p4c-bm2-ss -o p4c-out/bmv2/fabric.json \
+ --p4runtime-file p4c-out/bmv2/fabric.p4info --p4runtime-format text \
+ fabric.p4
+
+clean:
+ rm -rf p4c-out/bmv2/*.json
+ rm -rf p4c-out/bmv2/*.p4info
diff --git a/pipelines/fabric/src/main/resources/fabric.p4 b/pipelines/fabric/src/main/resources/fabric.p4
new file mode 100644
index 0000000..e417e4b
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/fabric.p4
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <core.p4>
+#include <v1model.p4>
+
+#include "include/control/filtering.p4"
+#include "include/control/forwarding.p4"
+#include "include/control/next.p4"
+#include "include/control/packetio.p4"
+#include "include/control/port_counter.p4"
+#include "include/header.p4"
+#include "include/checksum.p4"
+#include "include/parser.p4"
+
+control FabricIngress (
+inout parsed_headers_t hdr,
+inout fabric_metadata_t fabric_metadata,
+inout standard_metadata_t standard_metadata) {
+ PacketIoIngress() packet_io_ingress;
+ Filtering() filtering;
+ Forwarding() forwarding;
+ Next() next;
+ PortCountersControl() port_counters_control;
+
+ apply {
+ packet_io_ingress.apply(hdr, fabric_metadata, standard_metadata);
+ filtering.apply(hdr, fabric_metadata, standard_metadata);
+ forwarding.apply(hdr, fabric_metadata, standard_metadata);
+ next.apply(hdr, fabric_metadata, standard_metadata);
+ port_counters_control.apply(hdr, fabric_metadata, standard_metadata);
+ }
+}
+
+control FabricEgress (inout parsed_headers_t hdr,
+ inout fabric_metadata_t fabric_metadata,
+ inout standard_metadata_t standard_metadata) {
+ PacketIoEgress() pktIoEgress;
+ EgressNextControl() egress_next;
+ apply {
+ egress_next.apply(hdr, fabric_metadata, standard_metadata);
+ pktIoEgress.apply(hdr, fabric_metadata, standard_metadata);
+ }
+}
+
+V1Switch(
+ FabricParser(),
+ FabricVerifyChecksum(),
+ FabricIngress(),
+ FabricEgress(),
+ FabricComputeChecksum(),
+ FabricDeparser()
+) main;
diff --git a/pipelines/fabric/src/main/resources/include/action.p4 b/pipelines/fabric/src/main/resources/include/action.p4
new file mode 100644
index 0000000..c76334a
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/action.p4
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __ACTION__
+#define __ACTION__
+#include "header.p4"
+
+action nop() {
+}
+
+action drop() {
+ mark_to_drop();
+}
+
+#endif
diff --git a/pipelines/fabric/src/main/resources/include/checksum.p4 b/pipelines/fabric/src/main/resources/include/checksum.p4
new file mode 100644
index 0000000..9931090
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/checksum.p4
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CHECKSUM__
+#define __CHECKSUM__
+
+control FabricComputeChecksum(inout parsed_headers_t hdr,
+ inout fabric_metadata_t meta)
+{
+ apply {
+ update_checksum(hdr.ipv4.isValid(),
+ {
+ hdr.ipv4.version,
+ hdr.ipv4.ihl,
+ hdr.ipv4.diffserv,
+ hdr.ipv4.total_len,
+ hdr.ipv4.identification,
+ hdr.ipv4.flags,
+ hdr.ipv4.frag_offset,
+ hdr.ipv4.ttl,
+ hdr.ipv4.protocol,
+ hdr.ipv4.src_addr,
+ hdr.ipv4.dst_addr
+ },
+ hdr.ipv4.hdr_checksum,
+ HashAlgorithm.csum16
+ );
+ update_checksum(hdr.icmp.isValid(),
+ {
+ hdr.icmp.icmp_type,
+ hdr.icmp.icmp_code
+ },
+ hdr.icmp.checksum,
+ HashAlgorithm.csum16
+ );
+ }
+}
+
+control FabricVerifyChecksum(inout parsed_headers_t hdr,
+ inout fabric_metadata_t meta)
+{
+ apply {
+ verify_checksum(hdr.ipv4.isValid(),
+ {
+ hdr.ipv4.version,
+ hdr.ipv4.ihl,
+ hdr.ipv4.diffserv,
+ hdr.ipv4.total_len,
+ hdr.ipv4.identification,
+ hdr.ipv4.flags,
+ hdr.ipv4.frag_offset,
+ hdr.ipv4.ttl,
+ hdr.ipv4.protocol,
+ hdr.ipv4.src_addr,
+ hdr.ipv4.dst_addr
+ },
+ hdr.ipv4.hdr_checksum,
+ HashAlgorithm.csum16
+ );
+ verify_checksum(hdr.icmp.isValid(),
+ {
+ hdr.icmp.icmp_type,
+ hdr.icmp.icmp_code
+ },
+ hdr.icmp.checksum,
+ HashAlgorithm.csum16
+ );
+ }
+}
+
+#endif
diff --git a/pipelines/fabric/src/main/resources/include/control/filtering.p4 b/pipelines/fabric/src/main/resources/include/control/filtering.p4
new file mode 100644
index 0000000..a66657f
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/control/filtering.p4
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <core.p4>
+#include <v1model.p4>
+
+#include "../header.p4"
+#include "../action.p4"
+
+control Filtering (
+ inout parsed_headers_t hdr,
+ inout fabric_metadata_t fabric_metadata,
+ inout standard_metadata_t standard_metadata) {
+
+ direct_counter(CounterType.packets_and_bytes) ingress_port_vlan_counter;
+ direct_counter(CounterType.packets_and_bytes) fwd_classifier_counter;
+
+ action set_vlan(vlan_id_t new_vlan_id) {
+ hdr.vlan_tag.vlan_id = new_vlan_id;
+ }
+
+ action push_internal_vlan(vlan_id_t new_vlan_id) {
+ // Add internal VLAN header, will be removed before packet emission.
+ // cfi and pri values are dummy.
+ hdr.vlan_tag.setValid();
+ hdr.vlan_tag.cfi = 0;
+ hdr.vlan_tag.pri = 0;
+ hdr.vlan_tag.ether_type = ETHERTYPE_VLAN;
+ set_vlan(new_vlan_id);
+
+ // pop internal vlan before output
+ fabric_metadata.pop_vlan_at_egress = true;
+ }
+
+ action set_forwarding_type(fwd_type_t fwd_type) {
+ fabric_metadata.fwd_type = fwd_type;
+ }
+
+ // Originally Ingress port and Vlan table in OF-DPA pipeline
+ table ingress_port_vlan {
+ key = {
+ standard_metadata.ingress_port: exact;
+ hdr.vlan_tag.isValid(): exact @name("hdr.vlan_tag.is_valid");
+ hdr.vlan_tag.vlan_id: ternary;
+ }
+
+ actions = {
+ push_internal_vlan;
+ set_vlan;
+ nop;
+ drop;
+ }
+ const default_action = drop();
+ counters = ingress_port_vlan_counter;
+ }
+
+ // Originally TMAC table in OF-DPA pipeline
+ table fwd_classifier {
+ key = {
+ standard_metadata.ingress_port: exact;
+ hdr.ethernet.dst_addr: exact;
+ hdr.ethernet.ether_type: exact;
+ }
+
+ actions = {
+ set_forwarding_type;
+ }
+
+ const default_action = set_forwarding_type(FWD_BRIDGING);
+ counters = fwd_classifier_counter;
+ }
+
+ apply {
+ ingress_port_vlan.apply();
+ fwd_classifier.apply();
+ }
+}
diff --git a/pipelines/fabric/src/main/resources/include/control/forwarding.p4 b/pipelines/fabric/src/main/resources/include/control/forwarding.p4
new file mode 100644
index 0000000..fb5f231
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/control/forwarding.p4
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <core.p4>
+#include <v1model.p4>
+
+#include "../define.p4"
+#include "../header.p4"
+#include "../action.p4"
+
+
+control Forwarding (
+ inout parsed_headers_t hdr,
+ inout fabric_metadata_t fabric_metadata,
+ inout standard_metadata_t standard_metadata) {
+
+ direct_counter(CounterType.packets_and_bytes) bridging_counter;
+ direct_counter(CounterType.packets_and_bytes) mpls_counter;
+ direct_counter(CounterType.packets_and_bytes) unicast_v4_counter;
+ direct_counter(CounterType.packets_and_bytes) multicast_v4_counter;
+ direct_counter(CounterType.packets_and_bytes) unicast_v6_counter;
+ direct_counter(CounterType.packets_and_bytes) multicast_v6_counter;
+ direct_counter(CounterType.packets_and_bytes) acl_counter;
+
+ action set_next_id(next_id_t next_id) {
+ fabric_metadata.next_id = next_id;
+ }
+
+ action pop_mpls_and_next(next_id_t next_id) {
+ hdr.mpls.setInvalid();
+ if (hdr.ipv4.isValid()) {
+ hdr.ethernet.ether_type = ETHERTYPE_IPV4;
+ } else {
+ hdr.ethernet.ether_type = ETHERTYPE_IPV6;
+ }
+ fabric_metadata.next_id = next_id;
+ }
+
+ action push_mpls (mpls_label_t label, bit<3> tc) {
+ //Suppose that the maximum number of label is one.
+ hdr.mpls.setValid();
+ hdr.ethernet.ether_type = ETHERTYPE_MPLS;
+ hdr.mpls.label = label;
+ hdr.mpls.tc = tc;
+ hdr.mpls.bos = 1;
+ hdr.mpls.ttl = 64;
+ }
+
+ action push_mpls_and_next_v4 (mpls_label_t label,
+ next_id_t next_id) {
+ set_next_id(next_id);
+ push_mpls(label, hdr.ipv4.diffserv[7:5]);
+ }
+
+ action push_mpls_and_next_v6 (mpls_label_t label, next_id_t next_id) {
+ set_next_id(next_id);
+ push_mpls(label, hdr.ipv6.traffic_class[7:5]);
+ }
+
+ action duplicate_to_controller() {
+ fabric_metadata.next_type = NEXT_TYPE_PUNT;
+ standard_metadata.egress_spec = CPU_PORT;
+ }
+
+
+
+ table bridging {
+ key = {
+ hdr.vlan_tag.vlan_id: exact;
+ hdr.ethernet.dst_addr: ternary;
+ }
+
+ actions = {
+ set_next_id;
+ }
+ counters = bridging_counter;
+ }
+
+ table mpls {
+ key = {
+ hdr.mpls.label: exact;
+ }
+
+ actions = {
+ pop_mpls_and_next;
+ }
+ counters = mpls_counter;
+ }
+
+ table unicast_v4 {
+ key = {
+ hdr.ipv4.dst_addr: lpm;
+ }
+
+ actions = {
+ set_next_id;
+ push_mpls_and_next_v4;
+ }
+ counters = unicast_v4_counter;
+ }
+
+ table multicast_v4 {
+ key = {
+ hdr.vlan_tag.vlan_id: exact;
+ hdr.ipv4.dst_addr: lpm;
+ }
+
+ actions = {
+ set_next_id;
+ }
+ counters = multicast_v4_counter;
+ }
+
+ table unicast_v6 {
+ key = {
+ hdr.ipv6.dst_addr: lpm;
+ }
+
+ actions = {
+ set_next_id;
+ push_mpls_and_next_v6;
+ }
+ counters = unicast_v6_counter;
+ }
+
+ table multicast_v6 {
+ key = {
+ hdr.vlan_tag.vlan_id: exact;
+ hdr.ipv6.dst_addr: lpm;
+ }
+
+ actions = {
+ set_next_id;
+ }
+ counters = multicast_v6_counter;
+ }
+
+ table acl {
+ key = {
+ standard_metadata.ingress_port: ternary;
+ fabric_metadata.ip_proto: ternary;
+ hdr.ethernet.dst_addr: ternary;
+ hdr.ethernet.src_addr: ternary;
+ hdr.ethernet.ether_type: ternary;
+ hdr.vlan_tag.vlan_id: ternary;
+ hdr.vlan_tag.pri: ternary;
+ hdr.mpls.tc: ternary;
+ hdr.mpls.bos: ternary;
+ hdr.mpls.label: ternary;
+ hdr.ipv4.src_addr: ternary;
+ hdr.ipv4.dst_addr: ternary;
+ hdr.ipv4.protocol: ternary;
+ hdr.ipv6.src_addr: ternary;
+ hdr.ipv6.dst_addr: ternary;
+ hdr.ipv6.next_hdr: ternary;
+ hdr.tcp.src_port: ternary;
+ hdr.tcp.dst_port: ternary;
+ hdr.udp.src_port: ternary;
+ hdr.udp.dst_port: ternary;
+ hdr.icmp.icmp_type: ternary;
+ hdr.icmp.icmp_code: ternary;
+ }
+
+ actions = {
+ set_next_id;
+ duplicate_to_controller;
+ drop;
+ nop;
+ }
+
+ const default_action = nop();
+ counters = acl_counter;
+ }
+
+ apply {
+ if(fabric_metadata.fwd_type == FWD_BRIDGING) bridging.apply();
+ else if (fabric_metadata.fwd_type == FWD_MPLS) mpls.apply();
+ else if (fabric_metadata.fwd_type == FWD_IPV4_UNICAST) unicast_v4.apply();
+ else if (fabric_metadata.fwd_type == FWD_IPV4_MULTICAST) multicast_v4.apply();
+ else if (fabric_metadata.fwd_type == FWD_IPV6_UNICAST) unicast_v6.apply();
+ else if (fabric_metadata.fwd_type == FWD_IPV6_MULTICAST) multicast_v6.apply();
+ acl.apply();
+ }
+}
diff --git a/pipelines/fabric/src/main/resources/include/control/next.p4 b/pipelines/fabric/src/main/resources/include/control/next.p4
new file mode 100644
index 0000000..5ab18fa
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/control/next.p4
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <core.p4>
+#include <v1model.p4>
+
+#include "../header.p4"
+#include "../action.p4"
+
+control Next (
+ inout parsed_headers_t hdr,
+ inout fabric_metadata_t fabric_metadata,
+ inout standard_metadata_t standard_metadata) {
+ direct_counter(CounterType.packets_and_bytes) next_id_mapping_counter;
+ direct_counter(CounterType.packets_and_bytes) simple_counter;
+ direct_counter(CounterType.packets_and_bytes) hashed_counter;
+ direct_counter(CounterType.packets_and_bytes) broadcast_counter;
+ action_selector(HashAlgorithm.crc16, 32w64, 32w16) ecmp_selector;
+
+ action set_next_type(next_type_t next_type) {
+ fabric_metadata.next_type = next_type;
+ }
+
+ action output(port_num_t port_num) {
+ standard_metadata.egress_spec = port_num;
+ if(!hdr.mpls.isValid()) {
+ if(hdr.ipv4.isValid()) {
+ hdr.ipv4.ttl = hdr.ipv4.ttl - 1;
+ }
+ else if (hdr.ipv6.isValid()) {
+ hdr.ipv6.hop_limit = hdr.ipv6.hop_limit - 1;
+ }
+ }
+ }
+
+ action set_vlan_output(vlan_id_t new_vlan_id, port_num_t port_num){
+ hdr.vlan_tag.vlan_id = new_vlan_id;
+
+ // don't remove the vlan from egress since we set the vlan to it.
+ fabric_metadata.pop_vlan_at_egress = false;
+ output(port_num);
+ }
+
+ action rewrite_smac(mac_addr_t smac) {
+ hdr.ethernet.src_addr = smac;
+ }
+
+ action rewrite_dmac(mac_addr_t dmac) {
+ hdr.ethernet.dst_addr = dmac;
+ }
+
+ action l3_routing(port_num_t port_num, mac_addr_t smac, mac_addr_t dmac) {
+ rewrite_smac(smac);
+ rewrite_dmac(dmac);
+ output(port_num);
+ }
+
+ action set_mcast_group(group_id_t gid, mac_addr_t smac) {
+ standard_metadata.mcast_grp = gid;
+ rewrite_smac(smac);
+ }
+
+ table next_id_mapping {
+ key = {
+ fabric_metadata.next_id: exact;
+ }
+
+ actions = {
+ set_next_type;
+ }
+ counters = next_id_mapping_counter;
+ }
+
+ table simple {
+ key = {
+ fabric_metadata.next_id: exact;
+ }
+
+ actions = {
+ output;
+ set_vlan_output;
+ l3_routing;
+ }
+ counters = simple_counter;
+ }
+
+ table hashed {
+ key = {
+ fabric_metadata.next_id: exact;
+ hdr.ipv4.src_addr: selector;
+ hdr.ipv4.dst_addr: selector;
+ hdr.ipv4.protocol: selector;
+ hdr.ipv6.src_addr: selector;
+ hdr.ipv6.dst_addr: selector;
+ hdr.ipv6.next_hdr: selector;
+ fabric_metadata.l4_src_port: selector;
+ fabric_metadata.l4_dst_port: selector;
+ }
+
+ actions = {
+ l3_routing;
+ }
+
+ implementation = ecmp_selector;
+ counters = hashed_counter;
+ }
+
+ /*
+ * Work in progress
+ */
+ table broadcast {
+ key = {
+ fabric_metadata.next_id: exact;
+ }
+ actions = {
+ set_mcast_group;
+ }
+ counters = broadcast_counter;
+ }
+
+ apply {
+ next_id_mapping.apply();
+ if (fabric_metadata.next_type == NEXT_TYPE_SIMPLE) simple.apply();
+ else if (fabric_metadata.next_type == NEXT_TYPE_HASHED) hashed.apply();
+ else if (fabric_metadata.next_type == NEXT_TYPE_BROADCAST) broadcast.apply();
+ // next_type == PUNT, leave it to packet-io egress
+ }
+}
+
+control EgressNextControl (
+ inout parsed_headers_t hdr,
+ inout fabric_metadata_t fabric_metadata,
+ inout standard_metadata_t standard_metadata){
+
+ apply {
+ // pop internal vlan if the meta is set
+ if (fabric_metadata.pop_vlan_at_egress) {
+ hdr.vlan_tag.setInvalid();
+ }
+ }
+}
diff --git a/pipelines/fabric/src/main/resources/include/control/packetio.p4 b/pipelines/fabric/src/main/resources/include/control/packetio.p4
new file mode 100644
index 0000000..fb5d731
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/control/packetio.p4
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../header.p4"
+#include "../action.p4"
+
+control PacketIoIngress(
+inout parsed_headers_t hdr,
+inout fabric_metadata_t fabric_metadata,
+inout standard_metadata_t standard_metadata) {
+ apply {
+ if (hdr.packet_out.isValid()) {
+ standard_metadata.egress_spec = hdr.packet_out.egress_port;
+ exit;
+ }
+ }
+}
+
+control PacketIoEgress(
+inout parsed_headers_t hdr,
+inout fabric_metadata_t fabric_metadata,
+inout standard_metadata_t standard_metadata) {
+ apply {
+ hdr.packet_out.setInvalid();
+ if (standard_metadata.egress_port == CPU_PORT) {
+ hdr.packet_in.setValid();
+ hdr.packet_in.ingress_port = standard_metadata.ingress_port;
+ }
+ }
+}
diff --git a/pipelines/fabric/src/main/resources/include/control/port_counter.p4 b/pipelines/fabric/src/main/resources/include/control/port_counter.p4
new file mode 100644
index 0000000..80ec64f
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/control/port_counter.p4
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __PORT_COUNTER__
+#define __PORT_COUNTER__
+#include "../define.p4"
+#include "../header.p4"
+
+control PortCountersControl(inout parsed_headers_t hdr, inout fabric_metadata_t fabric_metadata, inout standard_metadata_t standard_metadata) {
+ counter(MAX_PORTS, CounterType.packets) egress_port_counter;
+ counter(MAX_PORTS, CounterType.packets) ingress_port_counter;
+
+ apply {
+ if (standard_metadata.egress_spec < MAX_PORTS) {
+ egress_port_counter.count((bit<32>)standard_metadata.egress_spec);
+ }
+ if (standard_metadata.ingress_port < MAX_PORTS) {
+ ingress_port_counter.count((bit<32>)standard_metadata.ingress_port);
+ }
+ }
+}
+#endif
diff --git a/pipelines/fabric/src/main/resources/include/define.p4 b/pipelines/fabric/src/main/resources/include/define.p4
new file mode 100644
index 0000000..9ba84e9
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/define.p4
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DEFINE__
+#define __DEFINE__
+
+#define MAX_PORTS 511
+
+typedef bit<3> fwd_type_t;
+typedef bit<32> next_id_t;
+typedef bit<3> next_type_t;
+typedef bit<20> mpls_label_t;
+typedef bit<9> port_num_t;
+typedef bit<48> mac_addr_t;
+typedef bit<16> group_id_t;
+typedef bit<12> vlan_id_t;
+
+const bit<16> ETHERTYPE_QINQ = 0x88A8;
+const bit<16> ETHERTYPE_QINQ_NON_STD = 0x9100;
+const bit<16> ETHERTYPE_VLAN = 0x8100;
+const bit<16> ETHERTYPE_MPLS = 0x8847;
+const bit<16> ETHERTYPE_MPLS_MULTICAST =0x8848;
+const bit<16> ETHERTYPE_IPV4 = 0x0800;
+const bit<16> ETHERTYPE_IPV6 = 0x86dd;
+const bit<16> ETHERTYPE_ARP = 0x0806;
+
+const bit<4> IP_VERSION_4 = 4;
+const bit<4> IP_VERSION_6 = 6;
+
+const bit<8> PROTO_ICMP = 1;
+const bit<8> PROTO_TCP = 6;
+const bit<8> PROTO_UDP = 17;
+const bit<8> PROTO_ICMPV6 = 58;
+
+const port_num_t CPU_PORT = 255;
+const port_num_t DROP_PORT = 511;
+
+const fwd_type_t FWD_BRIDGING = 0;
+const fwd_type_t FWD_MPLS = 1;
+const fwd_type_t FWD_IPV4_UNICAST = 2;
+const fwd_type_t FWD_IPV4_MULTICAST = 3;
+const fwd_type_t FWD_IPV6_UNICAST = 4;
+const fwd_type_t FWD_IPV6_MULTICAST = 5;
+
+const next_type_t NEXT_TYPE_SIMPLE = 0;
+const next_type_t NEXT_TYPE_HASHED = 1;
+const next_type_t NEXT_TYPE_BROADCAST = 2;
+const next_type_t NEXT_TYPE_PUNT = 3;
+
+#endif
diff --git a/pipelines/fabric/src/main/resources/include/header.p4 b/pipelines/fabric/src/main/resources/include/header.p4
new file mode 100644
index 0000000..b243c94
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/header.p4
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HEADER__
+#define __HEADER__
+
+#include "define.p4"
+
+@controller_header("packet_in")
+header packet_in_header_t {
+ port_num_t ingress_port;
+}
+
+@controller_header("packet_out")
+header packet_out_header_t {
+ port_num_t egress_port;
+}
+
+header ethernet_t {
+ mac_addr_t dst_addr;
+ mac_addr_t src_addr;
+ bit<16> ether_type;
+}
+
+header vlan_tag_t {
+ bit<3> pri;
+ bit<1> cfi;
+ vlan_id_t vlan_id;
+ bit<16> ether_type;
+}
+
+header mpls_t {
+ bit<20> label;
+ bit<3> tc;
+ bit<1> bos;
+ bit<8> ttl;
+}
+
+header ipv4_t {
+ bit<4> version;
+ bit<4> ihl;
+ bit<8> diffserv;
+ bit<16> total_len;
+ bit<16> identification;
+ bit<3> flags;
+ bit<13> frag_offset;
+ bit<8> ttl;
+ bit<8> protocol;
+ bit<16> hdr_checksum;
+ bit<32> src_addr;
+ bit<32> dst_addr;
+}
+
+header ipv6_t {
+ bit<4> version;
+ bit<8> traffic_class;
+ bit<20> flow_label;
+ bit<16> payload_len;
+ bit<8> next_hdr;
+ bit<8> hop_limit;
+ bit<128> src_addr;
+ bit<128> dst_addr;
+}
+
+header arp_t {
+ bit<16> hw_type;
+ bit<16> proto_type;
+ bit<8> hw_addr_len;
+ bit<8> proto_addr_len;
+ bit<16> opcode;
+}
+
+header tcp_t {
+ bit<16> src_port;
+ bit<16> dst_port;
+ bit<32> seq_no;
+ bit<32> ack_no;
+ bit<4> data_offset;
+ bit<3> res;
+ bit<3> ecn;
+ bit<6> ctrl;
+ bit<16> window;
+ bit<16> checksum;
+ bit<16> urgent_ptr;
+}
+
+header udp_t {
+ bit<16> src_port;
+ bit<16> dst_port;
+ bit<16> len;
+ bit<16> checksum;
+}
+
+header icmp_t {
+ bit<8> icmp_type;
+ bit<8> icmp_code;
+ bit<16> checksum;
+}
+
+//Custom metadata definition
+struct fabric_metadata_t {
+ fwd_type_t fwd_type;
+ next_id_t next_id;
+ next_type_t next_type;
+ bool pop_vlan_at_egress;
+ bit<8> ip_proto;
+ bit<16> l4_src_port;
+ bit<16> l4_dst_port;
+}
+
+struct parsed_headers_t {
+ ethernet_t ethernet;
+ vlan_tag_t vlan_tag;
+ vlan_tag_t inner_vlan_tag;
+ mpls_t mpls;
+ ipv4_t ipv4;
+ ipv6_t ipv6;
+ arp_t arp;
+ tcp_t tcp;
+ udp_t udp;
+ icmp_t icmp;
+ packet_out_header_t packet_out;
+ packet_in_header_t packet_in;
+}
+
+#endif
diff --git a/pipelines/fabric/src/main/resources/include/parser.p4 b/pipelines/fabric/src/main/resources/include/parser.p4
new file mode 100644
index 0000000..0e13cfd
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/include/parser.p4
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __PARSER__
+#define __PARSER__
+
+#include "define.p4"
+
+parser FabricParser (
+packet_in packet,
+out parsed_headers_t hdr,
+inout fabric_metadata_t fabric_metadata,
+inout standard_metadata_t standard_metadata) {
+ state start {
+ transition select(standard_metadata.ingress_port) {
+ CPU_PORT: parse_packet_out;
+ default: parse_ethernet;
+ }
+ }
+
+ state parse_packet_out {
+ packet.extract(hdr.packet_out);
+ transition parse_ethernet;
+ }
+
+ state parse_ethernet {
+ packet.extract(hdr.ethernet);
+ transition select(hdr.ethernet.ether_type){
+ ETHERTYPE_QINQ_NON_STD: parse_vlan_tag;
+ ETHERTYPE_QINQ: parse_vlan_tag;
+ ETHERTYPE_VLAN: parse_vlan_tag;
+ ETHERTYPE_MPLS: parse_mpls;
+ ETHERTYPE_ARP: parse_arp;
+ ETHERTYPE_IPV4: parse_ipv4;
+ ETHERTYPE_IPV6: parse_ipv6;
+ default: accept;
+ }
+ }
+
+ state parse_vlan_tag {
+ packet.extract(hdr.vlan_tag);
+ transition select(hdr.vlan_tag.ether_type){
+ ETHERTYPE_VLAN: parse_inner_vlan_tag;
+ ETHERTYPE_ARP: parse_arp;
+ ETHERTYPE_IPV4: parse_ipv4;
+ ETHERTYPE_IPV6: parse_ipv6;
+ default: accept;
+ }
+ }
+
+ state parse_inner_vlan_tag {
+ packet.extract(hdr.inner_vlan_tag);
+ transition select(hdr.vlan_tag.ether_type){
+ ETHERTYPE_ARP: parse_arp;
+ ETHERTYPE_IPV4: parse_ipv4;
+ ETHERTYPE_IPV6: parse_ipv6;
+ default: accept;
+ }
+ }
+
+ state parse_mpls {
+ packet.extract(hdr.mpls);
+
+ //There is only one MPLS label for this fabric.
+ transition select(packet.lookahead<ipv4_t>().version) {
+ //The packet should be either IPv4 or IPv6.
+ IP_VERSION_4: parse_ipv4;
+ IP_VERSION_6: parse_ipv6;
+ default: parse_ethernet;
+ }
+ }
+
+ state parse_ipv4 {
+ packet.extract(hdr.ipv4);
+ fabric_metadata.ip_proto = hdr.ipv4.protocol;
+ //Need header verification?
+ transition select(hdr.ipv4.protocol) {
+ PROTO_TCP: parse_tcp;
+ PROTO_UDP: parse_udp;
+ PROTO_ICMP: parse_icmp;
+ default: accept;
+ }
+ }
+
+ state parse_ipv6 {
+ packet.extract(hdr.ipv6);
+ fabric_metadata.ip_proto = hdr.ipv6.next_hdr;
+ transition select(hdr.ipv6.next_hdr) {
+ PROTO_TCP: parse_tcp;
+ PROTO_UDP: parse_udp;
+ PROTO_ICMPV6: parse_icmp;
+ default: accept;
+ }
+ }
+
+ state parse_arp {
+ packet.extract(hdr.arp);
+ transition accept;
+ }
+
+ state parse_tcp {
+ packet.extract(hdr.tcp);
+ fabric_metadata.l4_src_port = hdr.tcp.src_port;
+ fabric_metadata.l4_dst_port = hdr.tcp.dst_port;
+ transition accept;
+ }
+
+ state parse_udp {
+ packet.extract(hdr.udp);
+ fabric_metadata.l4_src_port = hdr.udp.src_port;
+ fabric_metadata.l4_dst_port = hdr.udp.dst_port;
+ transition accept;
+ }
+
+ state parse_icmp {
+ packet.extract(hdr.icmp);
+ transition accept;
+ }
+}
+
+control FabricDeparser(packet_out packet, in parsed_headers_t hdr) {
+ apply{
+ packet.emit(hdr.packet_in);
+ packet.emit(hdr.ethernet);
+ packet.emit(hdr.vlan_tag);
+ packet.emit(hdr.inner_vlan_tag);
+ packet.emit(hdr.mpls);
+ packet.emit(hdr.arp);
+ packet.emit(hdr.ipv4);
+ packet.emit(hdr.ipv6);
+ packet.emit(hdr.tcp);
+ packet.emit(hdr.udp);
+ }
+}
+
+#endif
diff --git a/pipelines/fabric/src/main/resources/p4c-out/bmv2/fabric.json b/pipelines/fabric/src/main/resources/p4c-out/bmv2/fabric.json
new file mode 100644
index 0000000..79089dc
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/p4c-out/bmv2/fabric.json
@@ -0,0 +1,5322 @@
+{
+ "program" : "fabric.p4",
+ "__meta__" : {
+ "version" : [2, 7],
+ "compiler" : "https://github.com/p4lang/p4c"
+ },
+ "header_types" : [
+ {
+ "name" : "scalars_0",
+ "id" : 0,
+ "fields" : [
+ ["tmp", 161, false],
+ ["tmp_1", 32, false],
+ ["tmp_2", 32, false],
+ ["fabric_metadata_t.fwd_type", 3, false],
+ ["fabric_metadata_t.next_id", 32, false],
+ ["fabric_metadata_t.next_type", 3, false],
+ ["fabric_metadata_t.pop_vlan_at_egress", 1, false],
+ ["fabric_metadata_t.ip_proto", 8, false],
+ ["fabric_metadata_t.l4_src_port", 16, false],
+ ["fabric_metadata_t.l4_dst_port", 16, false]
+ ]
+ },
+ {
+ "name" : "ipv4_t",
+ "id" : 1,
+ "fields" : [
+ ["version", 4, false],
+ ["ihl", 4, false],
+ ["diffserv", 8, false],
+ ["total_len", 16, false],
+ ["identification", 16, false],
+ ["flags", 3, false],
+ ["frag_offset", 13, false],
+ ["ttl", 8, false],
+ ["protocol", 8, false],
+ ["hdr_checksum", 16, false],
+ ["src_addr", 32, false],
+ ["dst_addr", 32, false]
+ ]
+ },
+ {
+ "name" : "ethernet_t",
+ "id" : 2,
+ "fields" : [
+ ["dst_addr", 48, false],
+ ["src_addr", 48, false],
+ ["ether_type", 16, false]
+ ]
+ },
+ {
+ "name" : "vlan_tag_t",
+ "id" : 3,
+ "fields" : [
+ ["pri", 3, false],
+ ["cfi", 1, false],
+ ["vlan_id", 12, false],
+ ["ether_type", 16, false]
+ ]
+ },
+ {
+ "name" : "mpls_t",
+ "id" : 4,
+ "fields" : [
+ ["label", 20, false],
+ ["tc", 3, false],
+ ["bos", 1, false],
+ ["ttl", 8, false]
+ ]
+ },
+ {
+ "name" : "ipv6_t",
+ "id" : 5,
+ "fields" : [
+ ["version", 4, false],
+ ["traffic_class", 8, false],
+ ["flow_label", 20, false],
+ ["payload_len", 16, false],
+ ["next_hdr", 8, false],
+ ["hop_limit", 8, false],
+ ["src_addr", 128, false],
+ ["dst_addr", 128, false]
+ ]
+ },
+ {
+ "name" : "arp_t",
+ "id" : 6,
+ "fields" : [
+ ["hw_type", 16, false],
+ ["proto_type", 16, false],
+ ["hw_addr_len", 8, false],
+ ["proto_addr_len", 8, false],
+ ["opcode", 16, false]
+ ]
+ },
+ {
+ "name" : "tcp_t",
+ "id" : 7,
+ "fields" : [
+ ["src_port", 16, false],
+ ["dst_port", 16, false],
+ ["seq_no", 32, false],
+ ["ack_no", 32, false],
+ ["data_offset", 4, false],
+ ["res", 3, false],
+ ["ecn", 3, false],
+ ["ctrl", 6, false],
+ ["window", 16, false],
+ ["checksum", 16, false],
+ ["urgent_ptr", 16, false]
+ ]
+ },
+ {
+ "name" : "udp_t",
+ "id" : 8,
+ "fields" : [
+ ["src_port", 16, false],
+ ["dst_port", 16, false],
+ ["len", 16, false],
+ ["checksum", 16, false]
+ ]
+ },
+ {
+ "name" : "icmp_t",
+ "id" : 9,
+ "fields" : [
+ ["icmp_type", 8, false],
+ ["icmp_code", 8, false],
+ ["checksum", 16, false]
+ ]
+ },
+ {
+ "name" : "packet_out_header_t",
+ "id" : 10,
+ "fields" : [
+ ["egress_port", 9, false],
+ ["_padding", 7, false]
+ ]
+ },
+ {
+ "name" : "packet_in_header_t",
+ "id" : 11,
+ "fields" : [
+ ["ingress_port", 9, false],
+ ["_padding_0", 7, false]
+ ]
+ },
+ {
+ "name" : "standard_metadata",
+ "id" : 12,
+ "fields" : [
+ ["ingress_port", 9, false],
+ ["egress_spec", 9, false],
+ ["egress_port", 9, false],
+ ["clone_spec", 32, false],
+ ["instance_type", 32, false],
+ ["drop", 1, false],
+ ["recirculate_port", 16, false],
+ ["packet_length", 32, false],
+ ["enq_timestamp", 32, false],
+ ["enq_qdepth", 19, false],
+ ["deq_timedelta", 32, false],
+ ["deq_qdepth", 19, false],
+ ["ingress_global_timestamp", 48, false],
+ ["lf_field_list", 32, false],
+ ["mcast_grp", 16, false],
+ ["resubmit_flag", 1, false],
+ ["egress_rid", 16, false],
+ ["checksum_error", 1, false],
+ ["_padding_1", 4, false]
+ ]
+ }
+ ],
+ "headers" : [
+ {
+ "name" : "tmp_0",
+ "id" : 0,
+ "header_type" : "ipv4_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "scalars",
+ "id" : 1,
+ "header_type" : "scalars_0",
+ "metadata" : true,
+ "pi_omit" : true
+ },
+ {
+ "name" : "standard_metadata",
+ "id" : 2,
+ "header_type" : "standard_metadata",
+ "metadata" : true,
+ "pi_omit" : true
+ },
+ {
+ "name" : "ethernet",
+ "id" : 3,
+ "header_type" : "ethernet_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "vlan_tag",
+ "id" : 4,
+ "header_type" : "vlan_tag_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "inner_vlan_tag",
+ "id" : 5,
+ "header_type" : "vlan_tag_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "mpls",
+ "id" : 6,
+ "header_type" : "mpls_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "ipv4",
+ "id" : 7,
+ "header_type" : "ipv4_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "ipv6",
+ "id" : 8,
+ "header_type" : "ipv6_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "arp",
+ "id" : 9,
+ "header_type" : "arp_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "tcp",
+ "id" : 10,
+ "header_type" : "tcp_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "udp",
+ "id" : 11,
+ "header_type" : "udp_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "icmp",
+ "id" : 12,
+ "header_type" : "icmp_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "packet_out",
+ "id" : 13,
+ "header_type" : "packet_out_header_t",
+ "metadata" : false,
+ "pi_omit" : true
+ },
+ {
+ "name" : "packet_in",
+ "id" : 14,
+ "header_type" : "packet_in_header_t",
+ "metadata" : false,
+ "pi_omit" : true
+ }
+ ],
+ "header_stacks" : [],
+ "header_union_types" : [],
+ "header_unions" : [],
+ "header_union_stacks" : [],
+ "field_lists" : [],
+ "errors" : [
+ ["NoError", 0],
+ ["PacketTooShort", 1],
+ ["NoMatch", 2],
+ ["StackOutOfBounds", 3],
+ ["HeaderTooShort", 4],
+ ["ParserTimeout", 5]
+ ],
+ "enums" : [],
+ "parsers" : [
+ {
+ "name" : "parser",
+ "id" : 0,
+ "init_state" : "start",
+ "parse_states" : [
+ {
+ "name" : "start",
+ "id" : 0,
+ "parser_ops" : [],
+ "transitions" : [
+ {
+ "value" : "0x00ff",
+ "mask" : null,
+ "next_state" : "parse_packet_out"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_packet_out",
+ "id" : 1,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "packet_out"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_ethernet",
+ "id" : 2,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "ethernet"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "0x9100",
+ "mask" : null,
+ "next_state" : "parse_vlan_tag"
+ },
+ {
+ "value" : "0x88a8",
+ "mask" : null,
+ "next_state" : "parse_vlan_tag"
+ },
+ {
+ "value" : "0x8100",
+ "mask" : null,
+ "next_state" : "parse_vlan_tag"
+ },
+ {
+ "value" : "0x8847",
+ "mask" : null,
+ "next_state" : "parse_mpls"
+ },
+ {
+ "value" : "0x0806",
+ "mask" : null,
+ "next_state" : "parse_arp"
+ },
+ {
+ "value" : "0x0800",
+ "mask" : null,
+ "next_state" : "parse_ipv4"
+ },
+ {
+ "value" : "0x86dd",
+ "mask" : null,
+ "next_state" : "parse_ipv6"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_vlan_tag",
+ "id" : 3,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "vlan_tag"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "0x8100",
+ "mask" : null,
+ "next_state" : "parse_inner_vlan_tag"
+ },
+ {
+ "value" : "0x0806",
+ "mask" : null,
+ "next_state" : "parse_arp"
+ },
+ {
+ "value" : "0x0800",
+ "mask" : null,
+ "next_state" : "parse_ipv4"
+ },
+ {
+ "value" : "0x86dd",
+ "mask" : null,
+ "next_state" : "parse_ipv6"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "ether_type"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_inner_vlan_tag",
+ "id" : 4,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "inner_vlan_tag"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "0x0806",
+ "mask" : null,
+ "next_state" : "parse_arp"
+ },
+ {
+ "value" : "0x0800",
+ "mask" : null,
+ "next_state" : "parse_ipv4"
+ },
+ {
+ "value" : "0x86dd",
+ "mask" : null,
+ "next_state" : "parse_ipv6"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "ether_type"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_mpls",
+ "id" : 5,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "mpls"
+ }
+ ],
+ "op" : "extract"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ {
+ "type" : "lookahead",
+ "value" : [0, 161]
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "tmp_0"
+ }
+ ],
+ "op" : "add_header"
+ }
+ ],
+ "op" : "primitive"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "version"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x9d"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x0f"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "ihl"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x99"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x0f"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "diffserv"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x91"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "total_len"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x81"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "identification"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x71"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "flags"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x6e"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x07"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "frag_offset"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x61"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x1fff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "ttl"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x59"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "protocol"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x51"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "hdr_checksum"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x41"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "src_addr"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x21"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffffffff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "dst_addr"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x1"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ffffffffffffffffffffffffffffffffffffffff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffffffff"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "$valid$"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "tmp"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ ],
+ "op" : "set"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "0x04",
+ "mask" : null,
+ "next_state" : "parse_ipv4"
+ },
+ {
+ "value" : "0x06",
+ "mask" : null,
+ "next_state" : "parse_ipv6"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : "parse_ethernet"
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["tmp_0", "version"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_ipv4",
+ "id" : 6,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "ipv4"
+ }
+ ],
+ "op" : "extract"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.ip_proto"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "protocol"]
+ }
+ ],
+ "op" : "set"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "0x06",
+ "mask" : null,
+ "next_state" : "parse_tcp"
+ },
+ {
+ "value" : "0x11",
+ "mask" : null,
+ "next_state" : "parse_udp"
+ },
+ {
+ "value" : "0x01",
+ "mask" : null,
+ "next_state" : "parse_icmp"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "protocol"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_ipv6",
+ "id" : 7,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "ipv6"
+ }
+ ],
+ "op" : "extract"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.ip_proto"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv6", "next_hdr"]
+ }
+ ],
+ "op" : "set"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "0x06",
+ "mask" : null,
+ "next_state" : "parse_tcp"
+ },
+ {
+ "value" : "0x11",
+ "mask" : null,
+ "next_state" : "parse_udp"
+ },
+ {
+ "value" : "0x3a",
+ "mask" : null,
+ "next_state" : "parse_icmp"
+ },
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : [
+ {
+ "type" : "field",
+ "value" : ["ipv6", "next_hdr"]
+ }
+ ]
+ },
+ {
+ "name" : "parse_arp",
+ "id" : 8,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "arp"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_tcp",
+ "id" : 9,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "tcp"
+ }
+ ],
+ "op" : "extract"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.l4_src_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["tcp", "src_port"]
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.l4_dst_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["tcp", "dst_port"]
+ }
+ ],
+ "op" : "set"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_udp",
+ "id" : 10,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "udp"
+ }
+ ],
+ "op" : "extract"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.l4_src_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["udp", "src_port"]
+ }
+ ],
+ "op" : "set"
+ },
+ {
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.l4_dst_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["udp", "dst_port"]
+ }
+ ],
+ "op" : "set"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : []
+ },
+ {
+ "name" : "parse_icmp",
+ "id" : 11,
+ "parser_ops" : [
+ {
+ "parameters" : [
+ {
+ "type" : "regular",
+ "value" : "icmp"
+ }
+ ],
+ "op" : "extract"
+ }
+ ],
+ "transitions" : [
+ {
+ "value" : "default",
+ "mask" : null,
+ "next_state" : null
+ }
+ ],
+ "transition_key" : []
+ }
+ ]
+ }
+ ],
+ "deparsers" : [
+ {
+ "name" : "deparser",
+ "id" : 0,
+ "source_info" : {
+ "filename" : "./include/parser.p4",
+ "line" : 134,
+ "column" : 8,
+ "source_fragment" : "FabricDeparser"
+ },
+ "order" : ["packet_in", "ethernet", "vlan_tag", "inner_vlan_tag", "mpls", "arp", "ipv4", "ipv6", "tcp", "udp"]
+ }
+ ],
+ "meter_arrays" : [],
+ "counter_arrays" : [
+ {
+ "name" : "filtering.ingress_port_vlan_counter",
+ "id" : 0,
+ "is_direct" : true,
+ "binding" : "filtering.ingress_port_vlan"
+ },
+ {
+ "name" : "filtering.fwd_classifier_counter",
+ "id" : 1,
+ "is_direct" : true,
+ "binding" : "filtering.fwd_classifier"
+ },
+ {
+ "name" : "forwarding.bridging_counter",
+ "id" : 2,
+ "is_direct" : true,
+ "binding" : "forwarding.bridging"
+ },
+ {
+ "name" : "forwarding.mpls_counter",
+ "id" : 3,
+ "is_direct" : true,
+ "binding" : "forwarding.mpls"
+ },
+ {
+ "name" : "forwarding.unicast_v4_counter",
+ "id" : 4,
+ "is_direct" : true,
+ "binding" : "forwarding.unicast_v4"
+ },
+ {
+ "name" : "forwarding.multicast_v4_counter",
+ "id" : 5,
+ "is_direct" : true,
+ "binding" : "forwarding.multicast_v4"
+ },
+ {
+ "name" : "forwarding.unicast_v6_counter",
+ "id" : 6,
+ "is_direct" : true,
+ "binding" : "forwarding.unicast_v6"
+ },
+ {
+ "name" : "forwarding.multicast_v6_counter",
+ "id" : 7,
+ "is_direct" : true,
+ "binding" : "forwarding.multicast_v6"
+ },
+ {
+ "name" : "forwarding.acl_counter",
+ "id" : 8,
+ "is_direct" : true,
+ "binding" : "forwarding.acl"
+ },
+ {
+ "name" : "next.next_id_mapping_counter",
+ "id" : 9,
+ "is_direct" : true,
+ "binding" : "next.next_id_mapping"
+ },
+ {
+ "name" : "next.simple_counter",
+ "id" : 10,
+ "is_direct" : true,
+ "binding" : "next.simple"
+ },
+ {
+ "name" : "next.hashed_counter",
+ "id" : 11,
+ "is_direct" : true,
+ "binding" : "next.hashed"
+ },
+ {
+ "name" : "next.broadcast_counter",
+ "id" : 12,
+ "is_direct" : true,
+ "binding" : "next.broadcast"
+ },
+ {
+ "name" : "port_counters_control.egress_port_counter",
+ "id" : 13,
+ "source_info" : {
+ "filename" : "./include/control/port_counter.p4",
+ "line" : 23,
+ "column" : 38,
+ "source_fragment" : "egress_port_counter"
+ },
+ "size" : 511,
+ "is_direct" : false
+ },
+ {
+ "name" : "port_counters_control.ingress_port_counter",
+ "id" : 14,
+ "source_info" : {
+ "filename" : "./include/control/port_counter.p4",
+ "line" : 24,
+ "column" : 38,
+ "source_fragment" : "ingress_port_counter"
+ },
+ "size" : 511,
+ "is_direct" : false
+ }
+ ],
+ "register_arrays" : [],
+ "calculations" : [
+ {
+ "name" : "calc",
+ "id" : 0,
+ "source_info" : {
+ "filename" : "./include/checksum.p4",
+ "line" : 56,
+ "column" : 8,
+ "source_fragment" : "verify_checksum(hdr.ipv4.isValid(), ..."
+ },
+ "algo" : "csum16",
+ "input" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "version"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ihl"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "diffserv"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "total_len"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "identification"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "flags"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "frag_offset"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "protocol"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "src_addr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "dst_addr"]
+ }
+ ]
+ },
+ {
+ "name" : "calc_0",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "./include/checksum.p4",
+ "line" : 73,
+ "column" : 8,
+ "source_fragment" : "verify_checksum(hdr.icmp.isValid(), ..."
+ },
+ "algo" : "csum16",
+ "input" : [
+ {
+ "type" : "field",
+ "value" : ["icmp", "icmp_type"]
+ },
+ {
+ "type" : "field",
+ "value" : ["icmp", "icmp_code"]
+ }
+ ]
+ },
+ {
+ "name" : "calc_1",
+ "id" : 2,
+ "source_info" : {
+ "filename" : "./include/checksum.p4",
+ "line" : 24,
+ "column" : 8,
+ "source_fragment" : "update_checksum(hdr.ipv4.isValid(), ..."
+ },
+ "algo" : "csum16",
+ "input" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "version"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ihl"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "diffserv"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "total_len"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "identification"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "flags"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "frag_offset"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "protocol"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "src_addr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "dst_addr"]
+ }
+ ]
+ },
+ {
+ "name" : "calc_2",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "./include/checksum.p4",
+ "line" : 41,
+ "column" : 8,
+ "source_fragment" : "update_checksum(hdr.icmp.isValid(), ..."
+ },
+ "algo" : "csum16",
+ "input" : [
+ {
+ "type" : "field",
+ "value" : ["icmp", "icmp_type"]
+ },
+ {
+ "type" : "field",
+ "value" : ["icmp", "icmp_code"]
+ }
+ ]
+ }
+ ],
+ "learn_lists" : [],
+ "actions" : [
+ {
+ "name" : "nop",
+ "id" : 0,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "nop",
+ "id" : 1,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "drop",
+ "id" : 2,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "drop",
+ "parameters" : [],
+ "source_info" : {
+ "filename" : "./include/control/../action.p4",
+ "line" : 25,
+ "column" : 4,
+ "source_fragment" : "mark_to_drop()"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "drop",
+ "id" : 3,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "drop",
+ "parameters" : [],
+ "source_info" : {
+ "filename" : "./include/control/../action.p4",
+ "line" : 25,
+ "column" : 4,
+ "source_fragment" : "mark_to_drop()"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "NoAction",
+ "id" : 4,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 5,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 6,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 7,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 8,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 9,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 10,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 11,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 12,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "NoAction",
+ "id" : 13,
+ "runtime_data" : [],
+ "primitives" : []
+ },
+ {
+ "name" : "filtering.set_vlan",
+ "id" : 14,
+ "runtime_data" : [
+ {
+ "name" : "new_vlan_id",
+ "bitwidth" : 12
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "vlan_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 32,
+ "column" : 8,
+ "source_fragment" : "hdr.vlan_tag.vlan_id = new_vlan_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "filtering.push_internal_vlan",
+ "id" : 15,
+ "runtime_data" : [
+ {
+ "name" : "new_vlan_id",
+ "bitwidth" : 12
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "vlan_tag"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 38,
+ "column" : 8,
+ "source_fragment" : "hdr.vlan_tag.setValid()"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "cfi"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x00"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "hdr.vlan_tag.cfi = 0"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "pri"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x00"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 40,
+ "column" : 8,
+ "source_fragment" : "hdr.vlan_tag.pri = 0"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "ether_type"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x8100"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/../define.p4",
+ "line" : 33,
+ "column" : 31,
+ "source_fragment" : "0x8100; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "vlan_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 32,
+ "column" : 8,
+ "source_fragment" : "hdr.vlan_tag.vlan_id = new_vlan_id; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.pop_vlan_at_egress"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "b2d",
+ "left" : null,
+ "right" : {
+ "type" : "bool",
+ "value" : true
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 45,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.pop_vlan_at_egress = true"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "filtering.set_forwarding_type",
+ "id" : 16,
+ "runtime_data" : [
+ {
+ "name" : "fwd_type",
+ "bitwidth" : 3
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 49,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.fwd_type = fwd_type"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.set_next_id",
+ "id" : 17,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.set_next_id",
+ "id" : 18,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.set_next_id",
+ "id" : 19,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.set_next_id",
+ "id" : 20,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.set_next_id",
+ "id" : 21,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.set_next_id",
+ "id" : 22,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.pop_mpls_and_next",
+ "id" : 23,
+ "runtime_data" : [
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "remove_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "mpls"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 43,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.setInvalid()"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "hexstr",
+ "value" : "0x0800"
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 45,
+ "column" : 12,
+ "source_fragment" : "hdr.ethernet.ether_type ="
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "hexstr",
+ "value" : "0x86dd"
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "not",
+ "left" : null,
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 47,
+ "column" : 12,
+ "source_fragment" : "hdr.ethernet.ether_type ="
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 49,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.push_mpls_and_next_v4",
+ "id" : 24,
+ "runtime_data" : [
+ {
+ "name" : "label",
+ "bitwidth" : 20
+ },
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 1
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id; ..."
+ }
+ },
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "mpls"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 54,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.setValid()"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x8847"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/../define.p4",
+ "line" : 34,
+ "column" : 31,
+ "source_fragment" : "0x8847; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "label"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 56,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.label = label; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "tc"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "diffserv"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x5"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x07"
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 57,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.tc = tc; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "bos"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 58,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.bos = 1"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "ttl"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x40"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 59,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.ttl = 64"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.push_mpls_and_next_v6",
+ "id" : 25,
+ "runtime_data" : [
+ {
+ "name" : "label",
+ "bitwidth" : 20
+ },
+ {
+ "name" : "next_id",
+ "bitwidth" : 32
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 1
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 39,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_id = next_id; ..."
+ }
+ },
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "mpls"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 54,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.setValid()"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "ether_type"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x8847"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/../define.p4",
+ "line" : 34,
+ "column" : 31,
+ "source_fragment" : "0x8847; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "label"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 56,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.label = label; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "tc"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : ">>",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "traffic_class"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x5"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x07"
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 57,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.tc = tc; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "bos"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 58,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.bos = 1"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["mpls", "ttl"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x40"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 59,
+ "column" : 8,
+ "source_fragment" : "hdr.mpls.ttl = 64"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "forwarding.duplicate_to_controller",
+ "id" : 26,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_type"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x03"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/../header.p4",
+ "line" : 19,
+ "column" : 35,
+ "source_fragment" : "3; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ {
+ "type" : "hexstr",
+ "value" : "0x00ff"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/../define.p4",
+ "line" : 48,
+ "column" : 28,
+ "source_fragment" : "255; ..."
+ }
+ }
+ ]
+ },
+ {
+ "name" : "next.set_next_type",
+ "id" : 27,
+ "runtime_data" : [
+ {
+ "name" : "next_type",
+ "bitwidth" : 3
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_type"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 34,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.next_type = next_type"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "next.output",
+ "id" : 28,
+ "runtime_data" : [
+ {
+ "name" : "port_num",
+ "bitwidth" : 9
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 38,
+ "column" : 8,
+ "source_fragment" : "standard_metadata.egress_spec = port_num"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 41,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv4.ttl ="
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "not",
+ "left" : null,
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 44,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv6.hop_limit ="
+ }
+ }
+ ]
+ },
+ {
+ "name" : "next.set_vlan_output",
+ "id" : 29,
+ "runtime_data" : [
+ {
+ "name" : "new_vlan_id",
+ "bitwidth" : 12
+ },
+ {
+ "name" : "port_num",
+ "bitwidth" : 9
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["vlan_tag", "vlan_id"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 50,
+ "column" : 8,
+ "source_fragment" : "hdr.vlan_tag.vlan_id = new_vlan_id"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.pop_vlan_at_egress"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "b2d",
+ "left" : null,
+ "right" : {
+ "type" : "bool",
+ "value" : false
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 53,
+ "column" : 8,
+ "source_fragment" : "fabric_metadata.pop_vlan_at_egress = false"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 1
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 38,
+ "column" : 8,
+ "source_fragment" : "standard_metadata.egress_spec = port_num; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 41,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv4.ttl ="
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "not",
+ "left" : null,
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 44,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv6.hop_limit ="
+ }
+ }
+ ]
+ },
+ {
+ "name" : "next.l3_routing",
+ "id" : 30,
+ "runtime_data" : [
+ {
+ "name" : "port_num",
+ "bitwidth" : 9
+ },
+ {
+ "name" : "smac",
+ "bitwidth" : 48
+ },
+ {
+ "name" : "dmac",
+ "bitwidth" : 48
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "src_addr"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 1
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 58,
+ "column" : 8,
+ "source_fragment" : "hdr.ethernet.src_addr = smac; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "dst_addr"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 2
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 62,
+ "column" : 8,
+ "source_fragment" : "hdr.ethernet.dst_addr = dmac; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 38,
+ "column" : 8,
+ "source_fragment" : "standard_metadata.egress_spec = port_num; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 41,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv4.ttl ="
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "not",
+ "left" : null,
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 44,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv6.hop_limit ="
+ }
+ }
+ ]
+ },
+ {
+ "name" : "next.l3_routing",
+ "id" : 31,
+ "runtime_data" : [
+ {
+ "name" : "port_num",
+ "bitwidth" : 9
+ },
+ {
+ "name" : "smac",
+ "bitwidth" : 48
+ },
+ {
+ "name" : "dmac",
+ "bitwidth" : 48
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "src_addr"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 1
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 58,
+ "column" : 8,
+ "source_fragment" : "hdr.ethernet.src_addr = smac; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "dst_addr"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 2
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 62,
+ "column" : 8,
+ "source_fragment" : "hdr.ethernet.dst_addr = dmac; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 38,
+ "column" : 8,
+ "source_fragment" : "standard_metadata.egress_spec = port_num; ..."
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv4", "ttl"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 41,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv4.ttl ="
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "?",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "+",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xff"
+ }
+ }
+ },
+ "right" : {
+ "type" : "field",
+ "value" : ["ipv6", "hop_limit"]
+ },
+ "cond" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "and",
+ "left" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "!=",
+ "left" : {
+ "type" : "field",
+ "value" : ["mpls", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "not",
+ "left" : null,
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv4", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "right" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["ipv6", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 44,
+ "column" : 16,
+ "source_fragment" : "hdr.ipv6.hop_limit ="
+ }
+ }
+ ]
+ },
+ {
+ "name" : "next.set_mcast_group",
+ "id" : 32,
+ "runtime_data" : [
+ {
+ "name" : "gid",
+ "bitwidth" : 16
+ },
+ {
+ "name" : "smac",
+ "bitwidth" : 48
+ }
+ ],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "mcast_grp"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 0
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 72,
+ "column" : 8,
+ "source_fragment" : "standard_metadata.mcast_grp = gid"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["ethernet", "src_addr"]
+ },
+ {
+ "type" : "runtime_data",
+ "value" : 1
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 58,
+ "column" : 8,
+ "source_fragment" : "hdr.ethernet.src_addr = smac; ..."
+ }
+ }
+ ]
+ },
+ {
+ "name" : "act",
+ "id" : 33,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ {
+ "type" : "field",
+ "value" : ["packet_out", "egress_port"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/packetio.p4",
+ "line" : 26,
+ "column" : 12,
+ "source_fragment" : "standard_metadata.egress_spec = hdr.packet_out.egress_port"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "act_0",
+ "id" : 34,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_1"]
+ },
+ {
+ "type" : "expression",
+ "value" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "&",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0xffffffff"
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ "op" : "count",
+ "parameters" : [
+ {
+ "type" : "counter_array",
+ "value" : "port_counters_control.egress_port_counter"
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_1"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/port_counter.p4",
+ "line" : 28,
+ "column" : 12,
+ "source_fragment" : "egress_port_counter.count((bit<32>)standard_metadata.egress_spec)"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "act_1",
+ "id" : 35,
+ "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" : "port_counters_control.ingress_port_counter"
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "tmp_2"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/port_counter.p4",
+ "line" : 31,
+ "column" : 12,
+ "source_fragment" : "ingress_port_counter.count((bit<32>)standard_metadata.ingress_port)"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "act_2",
+ "id" : 36,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "remove_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "vlan_tag"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 151,
+ "column" : 12,
+ "source_fragment" : "hdr.vlan_tag.setInvalid()"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "act_3",
+ "id" : 37,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "add_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_in"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/packetio.p4",
+ "line" : 39,
+ "column" : 12,
+ "source_fragment" : "hdr.packet_in.setValid()"
+ }
+ },
+ {
+ "op" : "assign",
+ "parameters" : [
+ {
+ "type" : "field",
+ "value" : ["packet_in", "ingress_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/packetio.p4",
+ "line" : 40,
+ "column" : 12,
+ "source_fragment" : "hdr.packet_in.ingress_port = standard_metadata.ingress_port"
+ }
+ }
+ ]
+ },
+ {
+ "name" : "act_4",
+ "id" : 38,
+ "runtime_data" : [],
+ "primitives" : [
+ {
+ "op" : "remove_header",
+ "parameters" : [
+ {
+ "type" : "header",
+ "value" : "packet_out"
+ }
+ ],
+ "source_info" : {
+ "filename" : "./include/control/packetio.p4",
+ "line" : 37,
+ "column" : 8,
+ "source_fragment" : "hdr.packet_out.setInvalid()"
+ }
+ }
+ ]
+ }
+ ],
+ "pipelines" : [
+ {
+ "name" : "ingress",
+ "id" : 0,
+ "source_info" : {
+ "filename" : "fabric.p4",
+ "line" : 29,
+ "column" : 8,
+ "source_fragment" : "FabricIngress"
+ },
+ "init_table" : "node_2",
+ "tables" : [
+ {
+ "name" : "tbl_act",
+ "id" : 0,
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [33],
+ "actions" : ["act"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "act" : null
+ },
+ "default_entry" : {
+ "action_id" : 33,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "filtering.ingress_port_vlan",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 53,
+ "column" : 10,
+ "source_fragment" : "ingress_port_vlan"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["standard_metadata", "ingress_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "exact",
+ "target" : ["vlan_tag", "$valid$"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["vlan_tag", "vlan_id"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "ternary",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [15, 14, 0, 2],
+ "actions" : ["filtering.push_internal_vlan", "filtering.set_vlan", "nop", "drop"],
+ "base_default_next" : "filtering.fwd_classifier",
+ "next_tables" : {
+ "filtering.push_internal_vlan" : "filtering.fwd_classifier",
+ "filtering.set_vlan" : "filtering.fwd_classifier",
+ "nop" : "filtering.fwd_classifier",
+ "drop" : "filtering.fwd_classifier"
+ },
+ "default_entry" : {
+ "action_id" : 2,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "filtering.fwd_classifier",
+ "id" : 2,
+ "source_info" : {
+ "filename" : "./include/control/filtering.p4",
+ "line" : 71,
+ "column" : 10,
+ "source_fragment" : "fwd_classifier"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["standard_metadata", "ingress_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "exact",
+ "target" : ["ethernet", "dst_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "exact",
+ "target" : ["ethernet", "ether_type"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [16],
+ "actions" : ["filtering.set_forwarding_type"],
+ "base_default_next" : "node_6",
+ "next_tables" : {
+ "filtering.set_forwarding_type" : "node_6"
+ },
+ "default_entry" : {
+ "action_id" : 16,
+ "action_const" : true,
+ "action_data" : ["0x0"],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "forwarding.bridging",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 80,
+ "column" : 10,
+ "source_fragment" : "bridging"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["vlan_tag", "vlan_id"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ethernet", "dst_addr"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "ternary",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [17, 4],
+ "actions" : ["forwarding.set_next_id", "NoAction"],
+ "base_default_next" : "forwarding.acl",
+ "next_tables" : {
+ "forwarding.set_next_id" : "forwarding.acl",
+ "NoAction" : "forwarding.acl"
+ },
+ "default_entry" : {
+ "action_id" : 4,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "forwarding.mpls",
+ "id" : 4,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 92,
+ "column" : 10,
+ "source_fragment" : "mpls"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["mpls", "label"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [23, 5],
+ "actions" : ["forwarding.pop_mpls_and_next", "NoAction"],
+ "base_default_next" : "forwarding.acl",
+ "next_tables" : {
+ "forwarding.pop_mpls_and_next" : "forwarding.acl",
+ "NoAction" : "forwarding.acl"
+ },
+ "default_entry" : {
+ "action_id" : 5,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "forwarding.unicast_v4",
+ "id" : 5,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 103,
+ "column" : 10,
+ "source_fragment" : "unicast_v4"
+ },
+ "key" : [
+ {
+ "match_type" : "lpm",
+ "target" : ["ipv4", "dst_addr"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "lpm",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [18, 24, 6],
+ "actions" : ["forwarding.set_next_id", "forwarding.push_mpls_and_next_v4", "NoAction"],
+ "base_default_next" : "forwarding.acl",
+ "next_tables" : {
+ "forwarding.set_next_id" : "forwarding.acl",
+ "forwarding.push_mpls_and_next_v4" : "forwarding.acl",
+ "NoAction" : "forwarding.acl"
+ },
+ "default_entry" : {
+ "action_id" : 6,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "forwarding.multicast_v4",
+ "id" : 6,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 115,
+ "column" : 10,
+ "source_fragment" : "multicast_v4"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["vlan_tag", "vlan_id"],
+ "mask" : null
+ },
+ {
+ "match_type" : "lpm",
+ "target" : ["ipv4", "dst_addr"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "lpm",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [19, 7],
+ "actions" : ["forwarding.set_next_id", "NoAction"],
+ "base_default_next" : "forwarding.acl",
+ "next_tables" : {
+ "forwarding.set_next_id" : "forwarding.acl",
+ "NoAction" : "forwarding.acl"
+ },
+ "default_entry" : {
+ "action_id" : 7,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "forwarding.unicast_v6",
+ "id" : 7,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 127,
+ "column" : 10,
+ "source_fragment" : "unicast_v6"
+ },
+ "key" : [
+ {
+ "match_type" : "lpm",
+ "target" : ["ipv6", "dst_addr"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "lpm",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [20, 25, 8],
+ "actions" : ["forwarding.set_next_id", "forwarding.push_mpls_and_next_v6", "NoAction"],
+ "base_default_next" : "forwarding.acl",
+ "next_tables" : {
+ "forwarding.set_next_id" : "forwarding.acl",
+ "forwarding.push_mpls_and_next_v6" : "forwarding.acl",
+ "NoAction" : "forwarding.acl"
+ },
+ "default_entry" : {
+ "action_id" : 8,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "forwarding.multicast_v6",
+ "id" : 8,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 139,
+ "column" : 10,
+ "source_fragment" : "multicast_v6"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["vlan_tag", "vlan_id"],
+ "mask" : null
+ },
+ {
+ "match_type" : "lpm",
+ "target" : ["ipv6", "dst_addr"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "lpm",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [21, 9],
+ "actions" : ["forwarding.set_next_id", "NoAction"],
+ "base_default_next" : "forwarding.acl",
+ "next_tables" : {
+ "forwarding.set_next_id" : "forwarding.acl",
+ "NoAction" : "forwarding.acl"
+ },
+ "default_entry" : {
+ "action_id" : 9,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "forwarding.acl",
+ "id" : 9,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 151,
+ "column" : 10,
+ "source_fragment" : "acl"
+ },
+ "key" : [
+ {
+ "match_type" : "ternary",
+ "target" : ["standard_metadata", "ingress_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["scalars", "fabric_metadata_t.ip_proto"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ethernet", "dst_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ethernet", "src_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ethernet", "ether_type"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["vlan_tag", "vlan_id"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["vlan_tag", "pri"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["mpls", "tc"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["mpls", "bos"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["mpls", "label"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ipv4", "src_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ipv4", "dst_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ipv4", "protocol"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ipv6", "src_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ipv6", "dst_addr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["ipv6", "next_hdr"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["tcp", "src_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["tcp", "dst_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["udp", "src_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["udp", "dst_port"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["icmp", "icmp_type"],
+ "mask" : null
+ },
+ {
+ "match_type" : "ternary",
+ "target" : ["icmp", "icmp_code"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "ternary",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [22, 26, 3, 1],
+ "actions" : ["forwarding.set_next_id", "forwarding.duplicate_to_controller", "drop", "nop"],
+ "base_default_next" : "next.next_id_mapping",
+ "next_tables" : {
+ "forwarding.set_next_id" : "next.next_id_mapping",
+ "forwarding.duplicate_to_controller" : "next.next_id_mapping",
+ "drop" : "next.next_id_mapping",
+ "nop" : "next.next_id_mapping"
+ },
+ "default_entry" : {
+ "action_id" : 1,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "next.next_id_mapping",
+ "id" : 10,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 76,
+ "column" : 10,
+ "source_fragment" : "next_id_mapping"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["scalars", "fabric_metadata_t.next_id"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [27, 10],
+ "actions" : ["next.set_next_type", "NoAction"],
+ "base_default_next" : "node_20",
+ "next_tables" : {
+ "next.set_next_type" : "node_20",
+ "NoAction" : "node_20"
+ },
+ "default_entry" : {
+ "action_id" : 10,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "next.simple",
+ "id" : 11,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 87,
+ "column" : 10,
+ "source_fragment" : "simple"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["scalars", "fabric_metadata_t.next_id"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [28, 29, 30, 11],
+ "actions" : ["next.output", "next.set_vlan_output", "next.l3_routing", "NoAction"],
+ "base_default_next" : "node_26",
+ "next_tables" : {
+ "next.output" : "node_26",
+ "next.set_vlan_output" : "node_26",
+ "next.l3_routing" : "node_26",
+ "NoAction" : "node_26"
+ },
+ "default_entry" : {
+ "action_id" : 11,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "next.hashed",
+ "id" : 12,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 100,
+ "column" : 10,
+ "source_fragment" : "hashed"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["scalars", "fabric_metadata_t.next_id"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "exact",
+ "type" : "indirect_ws",
+ "action_profile" : "next.ecmp_selector",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [31, 12],
+ "actions" : ["next.l3_routing", "NoAction"],
+ "base_default_next" : "node_26",
+ "next_tables" : {
+ "next.l3_routing" : "node_26",
+ "NoAction" : "node_26"
+ }
+ },
+ {
+ "name" : "next.broadcast",
+ "id" : 13,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 124,
+ "column" : 10,
+ "source_fragment" : "broadcast"
+ },
+ "key" : [
+ {
+ "match_type" : "exact",
+ "target" : ["scalars", "fabric_metadata_t.next_id"],
+ "mask" : null
+ }
+ ],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [32, 13],
+ "actions" : ["next.set_mcast_group", "NoAction"],
+ "base_default_next" : "node_26",
+ "next_tables" : {
+ "next.set_mcast_group" : "node_26",
+ "NoAction" : "node_26"
+ },
+ "default_entry" : {
+ "action_id" : 13,
+ "action_const" : false,
+ "action_data" : [],
+ "action_entry_const" : false
+ }
+ },
+ {
+ "name" : "tbl_act_0",
+ "id" : 14,
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [34],
+ "actions" : ["act_0"],
+ "base_default_next" : "node_28",
+ "next_tables" : {
+ "act_0" : "node_28"
+ },
+ "default_entry" : {
+ "action_id" : 34,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "tbl_act_1",
+ "id" : 15,
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [35],
+ "actions" : ["act_1"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "act_1" : null
+ },
+ "default_entry" : {
+ "action_id" : 35,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ }
+ ],
+ "action_profiles" : [
+ {
+ "name" : "next.ecmp_selector",
+ "id" : 0,
+ "max_size" : 64,
+ "selector" : {
+ "algo" : "crc16",
+ "input" : [
+ {
+ "type" : "field",
+ "value" : ["ipv4", "src_addr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "dst_addr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv4", "protocol"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv6", "src_addr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv6", "dst_addr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["ipv6", "next_hdr"]
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.l4_src_port"]
+ },
+ {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.l4_dst_port"]
+ }
+ ]
+ }
+ }
+ ],
+ "conditionals" : [
+ {
+ "name" : "node_2",
+ "id" : 0,
+ "source_info" : {
+ "filename" : "./include/control/packetio.p4",
+ "line" : 25,
+ "column" : 12,
+ "source_fragment" : "hdr.packet_out.isValid()"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["packet_out", "$valid$"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "tbl_act",
+ "false_next" : "filtering.ingress_port_vlan"
+ },
+ {
+ "name" : "node_6",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 189,
+ "column" : 11,
+ "source_fragment" : "fabric_metadata.fwd_type == FWD_BRIDGING"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x00"
+ }
+ }
+ },
+ "true_next" : "forwarding.bridging",
+ "false_next" : "node_8"
+ },
+ {
+ "name" : "node_8",
+ "id" : 2,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 190,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.fwd_type == FWD_MPLS"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "forwarding.mpls",
+ "false_next" : "node_10"
+ },
+ {
+ "name" : "node_10",
+ "id" : 3,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 191,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x02"
+ }
+ }
+ },
+ "true_next" : "forwarding.unicast_v4",
+ "false_next" : "node_12"
+ },
+ {
+ "name" : "node_12",
+ "id" : 4,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 192,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_MULTICAST"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x03"
+ }
+ }
+ },
+ "true_next" : "forwarding.multicast_v4",
+ "false_next" : "node_14"
+ },
+ {
+ "name" : "node_14",
+ "id" : 5,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 193,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV6_UNICAST"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x04"
+ }
+ }
+ },
+ "true_next" : "forwarding.unicast_v6",
+ "false_next" : "node_16"
+ },
+ {
+ "name" : "node_16",
+ "id" : 6,
+ "source_info" : {
+ "filename" : "./include/control/forwarding.p4",
+ "line" : 194,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV6_MULTICAST"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.fwd_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x05"
+ }
+ }
+ },
+ "true_next" : "forwarding.multicast_v6",
+ "false_next" : "forwarding.acl"
+ },
+ {
+ "name" : "node_20",
+ "id" : 7,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 136,
+ "column" : 12,
+ "source_fragment" : "fabric_metadata.next_type == NEXT_TYPE_SIMPLE"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x00"
+ }
+ }
+ },
+ "true_next" : "next.simple",
+ "false_next" : "node_22"
+ },
+ {
+ "name" : "node_22",
+ "id" : 8,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 137,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.next_type == NEXT_TYPE_HASHED"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01"
+ }
+ }
+ },
+ "true_next" : "next.hashed",
+ "false_next" : "node_24"
+ },
+ {
+ "name" : "node_24",
+ "id" : 9,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 138,
+ "column" : 17,
+ "source_fragment" : "fabric_metadata.next_type == NEXT_TYPE_BROADCAST"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.next_type"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x02"
+ }
+ }
+ },
+ "true_next" : "next.broadcast",
+ "false_next" : "node_26"
+ },
+ {
+ "name" : "node_26",
+ "id" : 10,
+ "source_info" : {
+ "filename" : "./include/control/port_counter.p4",
+ "line" : 27,
+ "column" : 12,
+ "source_fragment" : "standard_metadata.egress_spec < 511"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "<",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_spec"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ff"
+ }
+ }
+ },
+ "true_next" : "tbl_act_0",
+ "false_next" : "node_28"
+ },
+ {
+ "name" : "node_28",
+ "id" : 11,
+ "source_info" : {
+ "filename" : "./include/control/port_counter.p4",
+ "line" : 30,
+ "column" : 12,
+ "source_fragment" : "standard_metadata.ingress_port < 511"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "<",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "ingress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x01ff"
+ }
+ }
+ },
+ "false_next" : null,
+ "true_next" : "tbl_act_1"
+ }
+ ]
+ },
+ {
+ "name" : "egress",
+ "id" : 1,
+ "source_info" : {
+ "filename" : "fabric.p4",
+ "line" : 48,
+ "column" : 8,
+ "source_fragment" : "FabricEgress"
+ },
+ "init_table" : "node_32",
+ "tables" : [
+ {
+ "name" : "tbl_act_2",
+ "id" : 16,
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [36],
+ "actions" : ["act_2"],
+ "base_default_next" : "tbl_act_3",
+ "next_tables" : {
+ "act_2" : "tbl_act_3"
+ },
+ "default_entry" : {
+ "action_id" : 36,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "tbl_act_3",
+ "id" : 17,
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [38],
+ "actions" : ["act_4"],
+ "base_default_next" : "node_35",
+ "next_tables" : {
+ "act_4" : "node_35"
+ },
+ "default_entry" : {
+ "action_id" : 38,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ },
+ {
+ "name" : "tbl_act_4",
+ "id" : 18,
+ "key" : [],
+ "match_type" : "exact",
+ "type" : "simple",
+ "max_size" : 1024,
+ "with_counters" : false,
+ "support_timeout" : false,
+ "direct_meters" : null,
+ "action_ids" : [37],
+ "actions" : ["act_3"],
+ "base_default_next" : null,
+ "next_tables" : {
+ "act_3" : null
+ },
+ "default_entry" : {
+ "action_id" : 37,
+ "action_const" : true,
+ "action_data" : [],
+ "action_entry_const" : true
+ }
+ }
+ ],
+ "action_profiles" : [],
+ "conditionals" : [
+ {
+ "name" : "node_32",
+ "id" : 12,
+ "source_info" : {
+ "filename" : "./include/control/next.p4",
+ "line" : 150,
+ "column" : 12,
+ "source_fragment" : "fabric_metadata.pop_vlan_at_egress"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "d2b",
+ "left" : null,
+ "right" : {
+ "type" : "field",
+ "value" : ["scalars", "fabric_metadata_t.pop_vlan_at_egress"]
+ }
+ }
+ },
+ "true_next" : "tbl_act_2",
+ "false_next" : "tbl_act_3"
+ },
+ {
+ "name" : "node_35",
+ "id" : 13,
+ "source_info" : {
+ "filename" : "./include/control/packetio.p4",
+ "line" : 38,
+ "column" : 12,
+ "source_fragment" : "standard_metadata.egress_port == CPU_PORT"
+ },
+ "expression" : {
+ "type" : "expression",
+ "value" : {
+ "op" : "==",
+ "left" : {
+ "type" : "field",
+ "value" : ["standard_metadata", "egress_port"]
+ },
+ "right" : {
+ "type" : "hexstr",
+ "value" : "0x00ff"
+ }
+ }
+ },
+ "false_next" : null,
+ "true_next" : "tbl_act_4"
+ }
+ ]
+ }
+ ],
+ "checksums" : [
+ {
+ "name" : "cksum",
+ "id" : 0,
+ "target" : ["ipv4", "hdr_checksum"],
+ "type" : "generic",
+ "calculation" : "calc"
+ },
+ {
+ "name" : "cksum_0",
+ "id" : 1,
+ "target" : ["icmp", "checksum"],
+ "type" : "generic",
+ "calculation" : "calc_0"
+ },
+ {
+ "name" : "cksum_1",
+ "id" : 2,
+ "target" : ["ipv4", "hdr_checksum"],
+ "type" : "generic",
+ "calculation" : "calc_1"
+ },
+ {
+ "name" : "cksum_2",
+ "id" : 3,
+ "target" : ["icmp", "checksum"],
+ "type" : "generic",
+ "calculation" : "calc_2"
+ }
+ ],
+ "force_arith" : [],
+ "extern_instances" : [],
+ "field_aliases" : [
+ [
+ "queueing_metadata.enq_timestamp",
+ ["standard_metadata", "enq_timestamp"]
+ ],
+ [
+ "queueing_metadata.enq_qdepth",
+ ["standard_metadata", "enq_qdepth"]
+ ],
+ [
+ "queueing_metadata.deq_timedelta",
+ ["standard_metadata", "deq_timedelta"]
+ ],
+ [
+ "queueing_metadata.deq_qdepth",
+ ["standard_metadata", "deq_qdepth"]
+ ],
+ [
+ "intrinsic_metadata.ingress_global_timestamp",
+ ["standard_metadata", "ingress_global_timestamp"]
+ ],
+ [
+ "intrinsic_metadata.lf_field_list",
+ ["standard_metadata", "lf_field_list"]
+ ],
+ [
+ "intrinsic_metadata.mcast_grp",
+ ["standard_metadata", "mcast_grp"]
+ ],
+ [
+ "intrinsic_metadata.resubmit_flag",
+ ["standard_metadata", "resubmit_flag"]
+ ],
+ [
+ "intrinsic_metadata.egress_rid",
+ ["standard_metadata", "egress_rid"]
+ ]
+ ]
+}
\ No newline at end of file
diff --git a/pipelines/fabric/src/main/resources/p4c-out/bmv2/fabric.p4info b/pipelines/fabric/src/main/resources/p4c-out/bmv2/fabric.p4info
new file mode 100644
index 0000000..377d2f9
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/p4c-out/bmv2/fabric.p4info
@@ -0,0 +1,877 @@
+tables {
+ preamble {
+ id: 33578399
+ name: "filtering.ingress_port_vlan"
+ alias: "ingress_port_vlan"
+ }
+ match_fields {
+ id: 1
+ name: "standard_metadata.ingress_port"
+ bitwidth: 9
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "hdr.vlan_tag.is_valid"
+ bitwidth: 1
+ match_type: EXACT
+ }
+ match_fields {
+ id: 3
+ name: "hdr.vlan_tag.vlan_id"
+ bitwidth: 12
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16794505
+ }
+ action_refs {
+ id: 16782367
+ }
+ action_refs {
+ id: 16819938
+ }
+ action_refs {
+ id: 16793508
+ }
+ const_default_action_id: 16793508
+ direct_resource_ids: 302015144
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33619540
+ name: "filtering.fwd_classifier"
+ alias: "fwd_classifier"
+ }
+ match_fields {
+ id: 1
+ name: "standard_metadata.ingress_port"
+ bitwidth: 9
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "hdr.ethernet.dst_addr"
+ bitwidth: 48
+ match_type: EXACT
+ }
+ match_fields {
+ id: 3
+ name: "hdr.ethernet.ether_type"
+ bitwidth: 16
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16838162
+ }
+ const_default_action_id: 16838162
+ direct_resource_ids: 302033694
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33569146
+ name: "forwarding.bridging"
+ alias: "bridging"
+ }
+ match_fields {
+ id: 1
+ name: "hdr.vlan_tag.vlan_id"
+ bitwidth: 12
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "hdr.ethernet.dst_addr"
+ bitwidth: 48
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16829931
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302047449
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33565386
+ name: "forwarding.mpls"
+ alias: "mpls"
+ }
+ match_fields {
+ id: 1
+ name: "hdr.mpls.label"
+ bitwidth: 20
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16842717
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302001577
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33589684
+ name: "forwarding.unicast_v4"
+ alias: "unicast_v4"
+ }
+ match_fields {
+ id: 1
+ name: "hdr.ipv4.dst_addr"
+ bitwidth: 32
+ match_type: LPM
+ }
+ action_refs {
+ id: 16829931
+ }
+ action_refs {
+ id: 16788751
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302038636
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33615204
+ name: "forwarding.multicast_v4"
+ alias: "multicast_v4"
+ }
+ match_fields {
+ id: 1
+ name: "hdr.vlan_tag.vlan_id"
+ bitwidth: 12
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "hdr.ipv4.dst_addr"
+ bitwidth: 32
+ match_type: LPM
+ }
+ action_refs {
+ id: 16829931
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302009236
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33608345
+ name: "forwarding.unicast_v6"
+ alias: "unicast_v6"
+ }
+ match_fields {
+ id: 1
+ name: "hdr.ipv6.dst_addr"
+ bitwidth: 128
+ match_type: LPM
+ }
+ action_refs {
+ id: 16829931
+ }
+ action_refs {
+ id: 16827504
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 301998193
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33592333
+ name: "forwarding.multicast_v6"
+ alias: "multicast_v6"
+ }
+ match_fields {
+ id: 1
+ name: "hdr.vlan_tag.vlan_id"
+ bitwidth: 12
+ match_type: EXACT
+ }
+ match_fields {
+ id: 2
+ name: "hdr.ipv6.dst_addr"
+ bitwidth: 128
+ match_type: LPM
+ }
+ action_refs {
+ id: 16829931
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302003792
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33587782
+ name: "forwarding.acl"
+ alias: "acl"
+ }
+ match_fields {
+ id: 1
+ name: "standard_metadata.ingress_port"
+ bitwidth: 9
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 2
+ name: "fabric_metadata.ip_proto"
+ bitwidth: 8
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 3
+ name: "hdr.ethernet.dst_addr"
+ bitwidth: 48
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 4
+ name: "hdr.ethernet.src_addr"
+ bitwidth: 48
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 5
+ name: "hdr.ethernet.ether_type"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 6
+ name: "hdr.vlan_tag.vlan_id"
+ bitwidth: 12
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 7
+ name: "hdr.vlan_tag.pri"
+ bitwidth: 3
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 8
+ name: "hdr.mpls.tc"
+ bitwidth: 3
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 9
+ name: "hdr.mpls.bos"
+ bitwidth: 1
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 10
+ name: "hdr.mpls.label"
+ bitwidth: 20
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 11
+ name: "hdr.ipv4.src_addr"
+ bitwidth: 32
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 12
+ name: "hdr.ipv4.dst_addr"
+ bitwidth: 32
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 13
+ name: "hdr.ipv4.protocol"
+ bitwidth: 8
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 14
+ name: "hdr.ipv6.src_addr"
+ bitwidth: 128
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 15
+ name: "hdr.ipv6.dst_addr"
+ bitwidth: 128
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 16
+ name: "hdr.ipv6.next_hdr"
+ bitwidth: 8
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 17
+ name: "hdr.tcp.src_port"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 18
+ name: "hdr.tcp.dst_port"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 19
+ name: "hdr.udp.src_port"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 20
+ name: "hdr.udp.dst_port"
+ bitwidth: 16
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 21
+ name: "hdr.icmp.icmp_type"
+ bitwidth: 8
+ match_type: TERNARY
+ }
+ match_fields {
+ id: 22
+ name: "hdr.icmp.icmp_code"
+ bitwidth: 8
+ match_type: TERNARY
+ }
+ action_refs {
+ id: 16829931
+ }
+ action_refs {
+ id: 16805452
+ }
+ action_refs {
+ id: 16793508
+ }
+ action_refs {
+ id: 16819938
+ }
+ const_default_action_id: 16819938
+ direct_resource_ids: 302000008
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33589605
+ name: "next.next_id_mapping"
+ alias: "next_id_mapping"
+ }
+ match_fields {
+ id: 1
+ name: "fabric_metadata.next_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16800774
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 302015538
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33615740
+ name: "next.simple"
+ alias: "simple"
+ }
+ match_fields {
+ id: 1
+ name: "fabric_metadata.next_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16818315
+ }
+ action_refs {
+ id: 16837690
+ }
+ action_refs {
+ id: 16804266
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 301991179
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33569488
+ name: "next.hashed"
+ alias: "hashed"
+ }
+ match_fields {
+ id: 1
+ name: "fabric_metadata.next_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16804266
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ implementation_id: 285225078
+ direct_resource_ids: 301993193
+ size: 1024
+}
+tables {
+ preamble {
+ id: 33608545
+ name: "next.broadcast"
+ alias: "broadcast"
+ }
+ match_fields {
+ id: 1
+ name: "fabric_metadata.next_id"
+ bitwidth: 32
+ match_type: EXACT
+ }
+ action_refs {
+ id: 16778974
+ }
+ action_refs {
+ id: 16800567
+ annotations: "@defaultonly()"
+ }
+ direct_resource_ids: 301995093
+ size: 1024
+}
+actions {
+ preamble {
+ id: 16819938
+ name: "nop"
+ alias: "nop"
+ }
+}
+actions {
+ preamble {
+ id: 16793508
+ name: "drop"
+ alias: "drop"
+ }
+}
+actions {
+ preamble {
+ id: 16800567
+ name: "NoAction"
+ alias: "NoAction"
+ }
+}
+actions {
+ preamble {
+ id: 16782367
+ name: "filtering.set_vlan"
+ alias: "set_vlan"
+ }
+ params {
+ id: 1
+ name: "new_vlan_id"
+ bitwidth: 12
+ }
+}
+actions {
+ preamble {
+ id: 16794505
+ name: "filtering.push_internal_vlan"
+ alias: "push_internal_vlan"
+ }
+ params {
+ id: 1
+ name: "new_vlan_id"
+ bitwidth: 12
+ }
+}
+actions {
+ preamble {
+ id: 16838162
+ name: "filtering.set_forwarding_type"
+ alias: "set_forwarding_type"
+ }
+ params {
+ id: 1
+ name: "fwd_type"
+ bitwidth: 3
+ }
+}
+actions {
+ preamble {
+ id: 16829931
+ name: "forwarding.set_next_id"
+ alias: "set_next_id"
+ }
+ params {
+ id: 1
+ name: "next_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16842717
+ name: "forwarding.pop_mpls_and_next"
+ alias: "pop_mpls_and_next"
+ }
+ params {
+ id: 1
+ name: "next_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16788751
+ name: "forwarding.push_mpls_and_next_v4"
+ alias: "push_mpls_and_next_v4"
+ }
+ params {
+ id: 1
+ name: "label"
+ bitwidth: 20
+ }
+ params {
+ id: 2
+ name: "next_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16827504
+ name: "forwarding.push_mpls_and_next_v6"
+ alias: "push_mpls_and_next_v6"
+ }
+ params {
+ id: 1
+ name: "label"
+ bitwidth: 20
+ }
+ params {
+ id: 2
+ name: "next_id"
+ bitwidth: 32
+ }
+}
+actions {
+ preamble {
+ id: 16805452
+ name: "forwarding.duplicate_to_controller"
+ alias: "duplicate_to_controller"
+ }
+}
+actions {
+ preamble {
+ id: 16800774
+ name: "next.set_next_type"
+ alias: "set_next_type"
+ }
+ params {
+ id: 1
+ name: "next_type"
+ bitwidth: 3
+ }
+}
+actions {
+ preamble {
+ id: 16818315
+ name: "next.output"
+ alias: "output"
+ }
+ params {
+ id: 1
+ name: "port_num"
+ bitwidth: 9
+ }
+}
+actions {
+ preamble {
+ id: 16837690
+ name: "next.set_vlan_output"
+ alias: "set_vlan_output"
+ }
+ params {
+ id: 1
+ name: "new_vlan_id"
+ bitwidth: 12
+ }
+ params {
+ id: 2
+ name: "port_num"
+ bitwidth: 9
+ }
+}
+actions {
+ preamble {
+ id: 16804266
+ name: "next.l3_routing"
+ alias: "l3_routing"
+ }
+ params {
+ id: 1
+ name: "port_num"
+ bitwidth: 9
+ }
+ params {
+ id: 2
+ name: "smac"
+ bitwidth: 48
+ }
+ params {
+ id: 3
+ name: "dmac"
+ bitwidth: 48
+ }
+}
+actions {
+ preamble {
+ id: 16778974
+ name: "next.set_mcast_group"
+ alias: "set_mcast_group"
+ }
+ params {
+ id: 1
+ name: "gid"
+ bitwidth: 16
+ }
+ params {
+ id: 2
+ name: "smac"
+ bitwidth: 48
+ }
+}
+action_profiles {
+ preamble {
+ id: 285225078
+ name: "next.ecmp_selector"
+ alias: "ecmp_selector"
+ }
+ table_ids: 33569488
+ with_selector: true
+ size: 64
+}
+counters {
+ preamble {
+ id: 302025528
+ name: "port_counters_control.egress_port_counter"
+ alias: "egress_port_counter"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 511
+}
+counters {
+ preamble {
+ id: 301999025
+ name: "port_counters_control.ingress_port_counter"
+ alias: "ingress_port_counter"
+ }
+ spec {
+ unit: PACKETS
+ }
+ size: 511
+}
+direct_counters {
+ preamble {
+ id: 302015144
+ name: "filtering.ingress_port_vlan_counter"
+ alias: "ingress_port_vlan_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33578399
+}
+direct_counters {
+ preamble {
+ id: 302033694
+ name: "filtering.fwd_classifier_counter"
+ alias: "fwd_classifier_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33619540
+}
+direct_counters {
+ preamble {
+ id: 302047449
+ name: "forwarding.bridging_counter"
+ alias: "bridging_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33569146
+}
+direct_counters {
+ preamble {
+ id: 302001577
+ name: "forwarding.mpls_counter"
+ alias: "mpls_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33565386
+}
+direct_counters {
+ preamble {
+ id: 302038636
+ name: "forwarding.unicast_v4_counter"
+ alias: "unicast_v4_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33589684
+}
+direct_counters {
+ preamble {
+ id: 302009236
+ name: "forwarding.multicast_v4_counter"
+ alias: "multicast_v4_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33615204
+}
+direct_counters {
+ preamble {
+ id: 301998193
+ name: "forwarding.unicast_v6_counter"
+ alias: "unicast_v6_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33608345
+}
+direct_counters {
+ preamble {
+ id: 302003792
+ name: "forwarding.multicast_v6_counter"
+ alias: "multicast_v6_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33592333
+}
+direct_counters {
+ preamble {
+ id: 302000008
+ name: "forwarding.acl_counter"
+ alias: "acl_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33587782
+}
+direct_counters {
+ preamble {
+ id: 302015538
+ name: "next.next_id_mapping_counter"
+ alias: "next_id_mapping_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33589605
+}
+direct_counters {
+ preamble {
+ id: 301991179
+ name: "next.simple_counter"
+ alias: "simple_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33615740
+}
+direct_counters {
+ preamble {
+ id: 301993193
+ name: "next.hashed_counter"
+ alias: "hashed_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33569488
+}
+direct_counters {
+ preamble {
+ id: 301995093
+ name: "next.broadcast_counter"
+ alias: "broadcast_counter"
+ }
+ spec {
+ unit: BOTH
+ }
+ direct_table_id: 33608545
+}
+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
+ }
+}