Minor refactor fabric.p4

Remove origin_ether_type from fabric.p4
We can use ether_type from VLAN header since ingress_port_vlan table
always push a VLAN header to the packet if there is no VLAN header.

For configured interface, there exists flow rules to push VLAN.
For ports which not configured (infrastructure ports), the segment routing
application installs a rule which pushed internal VLAN to the packet (4094)

Change-Id: Ifae0b79a9d92b73a2a22cb33864e5bd5b6c95bfb
diff --git a/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/bmv2.json b/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/bmv2.json
index 14fa6ca..f0f4ba3 100644
--- a/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/bmv2.json
+++ b/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/bmv2.json
@@ -23,7 +23,6 @@
         ["fabric_metadata_t.ip_proto", 8, false],
         ["fabric_metadata_t.l4_src_port", 16, false],
         ["fabric_metadata_t.l4_dst_port", 16, false],
-        ["fabric_metadata_t.original_ether_type", 16, false],
         ["_padding_1", 6, false]
       ]
     },
@@ -382,19 +381,6 @@
                 }
               ],
               "op" : "extract"
-            },
-            {
-              "parameters" : [
-                {
-                  "type" : "field",
-                  "value" : ["scalars", "fabric_metadata_t.original_ether_type"]
-                },
-                {
-                  "type" : "field",
-                  "value" : ["ethernet", "ether_type"]
-                }
-              ],
-              "op" : "set"
             }
           ],
           "transitions" : [
@@ -447,19 +433,6 @@
                 }
               ],
               "op" : "extract"
-            },
-            {
-              "parameters" : [
-                {
-                  "type" : "field",
-                  "value" : ["scalars", "fabric_metadata_t.original_ether_type"]
-                },
-                {
-                  "type" : "field",
-                  "value" : ["vlan_tag", "ether_type"]
-                }
-              ],
-              "op" : "set"
             }
           ],
           "transitions" : [
@@ -869,7 +842,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "include/parser.p4",
-        "line" : 165,
+        "line" : 163,
         "column" : 8,
         "source_fragment" : "FabricDeparser"
       },
@@ -3601,25 +3574,6 @@
             "column" : 31,
             "source_fragment" : "0x0800; ..."
           }
-        },
-        {
-          "op" : "assign",
-          "parameters" : [
-            {
-              "type" : "field",
-              "value" : ["scalars", "fabric_metadata_t.original_ether_type"]
-            },
-            {
-              "type" : "hexstr",
-              "value" : "0x0800"
-            }
-          ],
-          "source_info" : {
-            "filename" : "include/control/../define.p4",
-            "line" : 69,
-            "column" : 31,
-            "source_fragment" : "0x0800; ..."
-          }
         }
       ]
     },
@@ -5423,8 +5377,8 @@
             },
             {
               "match_type" : "exact",
-              "name" : "fabric_metadata.original_ether_type",
-              "target" : ["scalars", "fabric_metadata_t.original_ether_type"],
+              "name" : "hdr.vlan_tag.ether_type",
+              "target" : ["vlan_tag", "ether_type"],
               "mask" : null
             }
           ],
@@ -5623,12 +5577,6 @@
             },
             {
               "match_type" : "ternary",
-              "name" : "fabric_metadata.original_ether_type",
-              "target" : ["scalars", "fabric_metadata_t.original_ether_type"],
-              "mask" : null
-            },
-            {
-              "match_type" : "ternary",
               "name" : "hdr.ethernet.dst_addr",
               "target" : ["ethernet", "dst_addr"],
               "mask" : null
@@ -5647,6 +5595,12 @@
             },
             {
               "match_type" : "ternary",
+              "name" : "hdr.vlan_tag.ether_type",
+              "target" : ["vlan_tag", "ether_type"],
+              "mask" : null
+            },
+            {
+              "match_type" : "ternary",
               "name" : "hdr.ipv4.src_addr",
               "target" : ["ipv4", "src_addr"],
               "mask" : null
@@ -5672,7 +5626,7 @@
           ],
           "match_type" : "ternary",
           "type" : "simple",
-          "max_size" : 256,
+          "max_size" : 128,
           "with_counters" : true,
           "support_timeout" : false,
           "direct_meters" : null,
@@ -6399,7 +6353,7 @@
           "id" : 11,
           "source_info" : {
             "filename" : "include/control/forwarding.p4",
-            "line" : 247,
+            "line" : 246,
             "column" : 17,
             "source_fragment" : "fabric_metadata.fwd_type == FWD_IPV4_UNICAST"
           },
diff --git a/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/p4info.txt b/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/p4info.txt
index b82cd69..f480540 100644
--- a/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/p4info.txt
+++ b/pipelines/fabric/src/main/resources/p4c-out/fabric-spgw/bmv2/default/p4info.txt
@@ -141,7 +141,7 @@
   }
   match_fields {
     id: 3
-    name: "fabric_metadata.original_ether_type"
+    name: "hdr.vlan_tag.ether_type"
     bitwidth: 16
     match_type: EXACT
   }
@@ -260,29 +260,29 @@
   }
   match_fields {
     id: 5
-    name: "fabric_metadata.original_ether_type"
-    bitwidth: 16
-    match_type: TERNARY
-  }
-  match_fields {
-    id: 6
     name: "hdr.ethernet.dst_addr"
     bitwidth: 48
     match_type: TERNARY
   }
   match_fields {
-    id: 7
+    id: 6
     name: "hdr.ethernet.src_addr"
     bitwidth: 48
     match_type: TERNARY
   }
   match_fields {
-    id: 8
+    id: 7
     name: "hdr.vlan_tag.vlan_id"
     bitwidth: 12
     match_type: TERNARY
   }
   match_fields {
+    id: 8
+    name: "hdr.vlan_tag.ether_type"
+    bitwidth: 16
+    match_type: TERNARY
+  }
+  match_fields {
     id: 9
     name: "hdr.ipv4.src_addr"
     bitwidth: 32
@@ -324,7 +324,7 @@
   }
   const_default_action_id: 16819938
   direct_resource_ids: 318772272
-  size: 256
+  size: 128
   idle_timeout_behavior: NO_TIMEOUT
 }
 tables {