Backport fabric-spgw TNA changes to v1model

Allow building fabric.p4 with custom S1U_SGW_PREFIX

Change-Id: I4fcaf3f2b56e6d024e54f8897467c280be73e001

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/fabric.p4 b/pipelines/fabric/impl/src/main/resources/fabric.p4
index 86bd764..9f6b27d 100644
--- a/pipelines/fabric/impl/src/main/resources/fabric.p4
+++ b/pipelines/fabric/impl/src/main/resources/fabric.p4
@@ -32,7 +32,7 @@
 #endif // WITH_PORT_COUNTER
 
 #ifdef WITH_SPGW
-#include "include/spgw.p4"
+#include "include/control/spgw.p4"
 #endif // WITH_SPGW
 
 #ifdef WITH_BNG
@@ -55,19 +55,17 @@
 #ifdef WITH_PORT_COUNTER
     PortCountersControl() port_counters_control;
 #endif // WITH_PORT_COUNTER
+#ifdef WITH_SPGW
+    SpgwIngress() spgw_ingress;
+#endif // WITH_SPGW
 
     apply {
         _PRE_INGRESS
-#ifdef WITH_SPGW
-        spgw_normalizer.apply(hdr.gtpu.isValid(), hdr.gtpu_ipv4, hdr.gtpu_udp,
-                              hdr.ipv4, hdr.udp, hdr.inner_ipv4, hdr.inner_udp);
-#endif // WITH_SPGW
         pkt_io_ingress.apply(hdr, fabric_metadata, standard_metadata);
-        filtering.apply(hdr, fabric_metadata, standard_metadata);
 #ifdef WITH_SPGW
-        spgw_ingress.apply(hdr.gtpu_ipv4, hdr.gtpu_udp, hdr.gtpu,
-                           hdr.ipv4, hdr.udp, fabric_metadata, standard_metadata);
+        spgw_ingress.apply(hdr, fabric_metadata, standard_metadata);
 #endif // WITH_SPGW
+        filtering.apply(hdr, fabric_metadata, standard_metadata);
         if (fabric_metadata.skip_forwarding == _FALSE) {
             forwarding.apply(hdr, fabric_metadata, standard_metadata);
         }
@@ -96,14 +94,16 @@
 
     PacketIoEgress() pkt_io_egress;
     EgressNextControl() egress_next;
+#ifdef WITH_SPGW
+    SpgwEgress() spgw_egress;
+#endif // WITH_SPGW
 
     apply {
         _PRE_EGRESS
         pkt_io_egress.apply(hdr, fabric_metadata, standard_metadata);
         egress_next.apply(hdr, fabric_metadata, standard_metadata);
 #ifdef WITH_SPGW
-        spgw_egress.apply(hdr.ipv4, hdr.gtpu_ipv4, hdr.gtpu_udp, hdr.gtpu,
-                          fabric_metadata, standard_metadata);
+        spgw_egress.apply(hdr, fabric_metadata);
 #endif // WITH_SPGW
 #ifdef WITH_BNG
         bng_egress.apply(hdr, fabric_metadata, standard_metadata);