Small fixes and improvements on fabric.p4
- setting s_tag and c_tag for BNG as early as possible in the pipeline
- ingress_port_vlan was matching on inner_vlan_tag but that field could be not present

Change-Id: Id4d51159a314d45cec370471ed244a51fd74338b
diff --git a/pipelines/fabric/impl/src/main/resources/include/bng.p4 b/pipelines/fabric/impl/src/main/resources/include/bng.p4
index 9ef9e17..5deb8ee 100644
--- a/pipelines/fabric/impl/src/main/resources/include/bng.p4
+++ b/pipelines/fabric/impl/src/main/resources/include/bng.p4
@@ -310,9 +310,6 @@
         bng_ingress_upstream() upstream;
         bng_ingress_downstream() downstream;
 
-        vlan_id_t s_tag = 0;
-        vlan_id_t c_tag = 0;
-
         // TABLE: t_line_map
         // Map s_tag and c_tag to a line ID to uniquely identify a subscriber
 
@@ -322,8 +319,8 @@
 
         table t_line_map {
             key = {
-                s_tag : exact @name("s_tag");
-                c_tag : exact @name("c_tag");
+                fmeta.bng.s_tag : exact @name("s_tag");
+                fmeta.bng.c_tag : exact @name("c_tag");
             }
              actions = {
                 set_line;
@@ -334,17 +331,7 @@
         }
 
         apply {
-            if(hdr.pppoe.isValid()) {
-                s_tag = hdr.vlan_tag.vlan_id;
-                c_tag = hdr.inner_vlan_tag.vlan_id;
-            } else {
-                // We expect the packet to be downstream,
-                // the tags are set by the next stage in the metadata.
-                s_tag = fmeta.vlan_id;
-                c_tag = fmeta.inner_vlan_id;
-            }
-
-            // First map the double VLAN tags to a line ID
+             // First map the double VLAN tags to a line ID
             // If table miss line ID will be 0.
             t_line_map.apply();