Backport fabric-spgw TNA changes to v1model
This branch ports the SPGW pipeline of fabric-tna back to v1model to
make the tables and actions consistent across the two versions. This
consistency will allow for testing of ONOS apps on both software and
hardware targets, since the only available software target that works
with ONOS requires v1model p4 programs. Changes to the fabric testing
suite (fabric-p4test) will be pushed in parallel.
Change-Id: Iad393b27f08a4fcd29f82e59d181871475ef2b10
diff --git a/pipelines/fabric/impl/src/main/resources/include/define.p4 b/pipelines/fabric/impl/src/main/resources/include/define.p4
index 5dfcb95..bfb7b44 100644
--- a/pipelines/fabric/impl/src/main/resources/include/define.p4
+++ b/pipelines/fabric/impl/src/main/resources/include/define.p4
@@ -97,13 +97,21 @@
// SPGW types
typedef bit<2> direction_t;
+typedef bit<8> spgw_interface_t;
typedef bit pcc_gate_status_t;
typedef bit<32> sdf_rule_id_t;
typedef bit<32> pcc_rule_id_t;
typedef bit<32> far_id_t;
-typedef bit<32> ctr_id_t;
+typedef bit<32> pdr_ctr_id_t;
typedef bit<32> teid_t;
+const spgw_interface_t SPGW_IFACE_UNKNOWN = 8w0;
+const spgw_interface_t SPGW_IFACE_ACCESS = 8w1;
+const spgw_interface_t SPGW_IFACE_CORE = 8w2;
+const direction_t SPGW_DIR_UNKNOWN = 2w0;
+const direction_t SPGW_DIR_UPLINK = 2w1;
+const direction_t SPGW_DIR_DOWNLINK = 2w2;
+
#ifndef S1U_SGW_PREFIX
// By default spgw.p4 expects uplink packets with IP dst matching 140.0.0.0/8
// FIXME: refactor pipeline to remove dependency on this value or allow setting it at runtime
@@ -147,13 +155,7 @@
const bit<8> DEFAULT_MPLS_TTL = 64;
const bit<8> DEFAULT_IPV4_TTL = 64;
-const sdf_rule_id_t DEFAULT_SDF_RULE_ID = 0;
-const pcc_rule_id_t DEFAULT_PCC_RULE_ID = 0;
-const direction_t SPGW_DIR_UNKNOWN = 2w0;
-const direction_t SPGW_DIR_UPLINK = 2w1;
-const direction_t SPGW_DIR_DOWNLINK = 2w2;
-const pcc_gate_status_t PCC_GATE_OPEN = 1w0;
-const pcc_gate_status_t PCC_GATE_CLOSED = 1w1;
+
/* indicate INT at LSB of DSCP */
const bit<6> INT_DSCP = 0x1;