Fixed spgw.p4 decapping GTP packets not meant to be decapped

Also reduces the number of tables used for downlink processing.

Change-Id: I09a67cfac335b805d80e90cf5bb69fbab931e80b
diff --git a/pipelines/fabric/src/main/resources/include/define.p4 b/pipelines/fabric/src/main/resources/include/define.p4
index 74c964e..d717853 100644
--- a/pipelines/fabric/src/main/resources/include/define.p4
+++ b/pipelines/fabric/src/main/resources/include/define.p4
@@ -68,6 +68,21 @@
 typedef bit<48> mac_addr_t;
 typedef bit<16> group_id_t;
 typedef bit<12> vlan_id_t;
+typedef bit<48> timestamp_t;
+typedef bit<32> switch_id_t;
+typedef bit<32> ipv4_addr_t;
+typedef bit<16> l4_port_t;
+
+// SPGW types
+typedef bit<2> direction_t;
+typedef bit pcc_gate_status_t;
+typedef bit<32> sdf_rule_id_t;
+typedef bit<32> pcc_rule_id_t;
+
+// spgw.p4 expects uplink packets with IP dst on this subnet
+// 140.0.0.0/8
+const ipv4_addr_t S1U_SGW_PREFIX = 2348810240;
+#define S1U_SGW_PREFIX_LEN 8
 
 const bit<16> ETHERTYPE_QINQ = 0x88A8;
 const bit<16> ETHERTYPE_QINQ_NON_STD = 0x9100;
@@ -95,28 +110,17 @@
 const bit<8> DEFAULT_MPLS_TTL = 64;
 const bit<8> DEFAULT_IPV4_TTL = 64;
 
-typedef bit direction_t;
-typedef bit pcc_gate_status_t;
-typedef bit<32> sdf_rule_id_t;
-typedef bit<32> pcc_rule_id_t;
-
 const sdf_rule_id_t DEFAULT_SDF_RULE_ID = 0;
 const pcc_rule_id_t DEFAULT_PCC_RULE_ID = 0;
-
-const direction_t DIR_UPLINK = 1w0;
-const direction_t DIR_DOWNLINK = 1w1;
-
+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;
 
-typedef bit<48> timestamp_t;
-typedef bit<32> switch_id_t;
-typedef bit<32> ip_address_t;
-typedef bit<16> l4_port_t;
-
 const bit<8> INT_HEADER_LEN_WORD = 4;
 
 const bit<8> CPU_MIRROR_SESSION_ID = 250;