Avoid egress processing for controller packet-in/out in fabric.p4

Change-Id: If8ac129efd11a437054ed6b7178e167eff9c6e74
diff --git a/pipelines/fabric/src/main/resources/include/control/packetio.p4 b/pipelines/fabric/src/main/resources/include/control/packetio.p4
index fa447e7..1086dac 100644
--- a/pipelines/fabric/src/main/resources/include/control/packetio.p4
+++ b/pipelines/fabric/src/main/resources/include/control/packetio.p4
@@ -25,6 +25,7 @@
         if (hdr.packet_out.isValid()) {
             standard_metadata.egress_spec = hdr.packet_out.egress_port;
             hdr.packet_out.setInvalid();
+            fabric_metadata.is_controller_packet_out = _TRUE;
             exit;
         }
     }
@@ -39,6 +40,10 @@
         hdr.vlan_tag.setInvalid();
     }
     apply {
+        if (fabric_metadata.is_controller_packet_out == _TRUE) {
+            // No need to process through the rest of the pipeline.
+            exit;
+        }
         if (standard_metadata.egress_port == CPU_PORT) {
             if (hdr.vlan_tag.isValid() && fabric_metadata.pop_vlan_when_packet_in == _TRUE) {
                 pop_vlan();
@@ -50,6 +55,8 @@
             }
             hdr.packet_in.setValid();
             hdr.packet_in.ingress_port = standard_metadata.ingress_port;
+            // No need to process through the rest of the pipeline.
+            exit;
         }
     }
 }