Driver fix for OF-DPA 3.0 EA3. With this change both EA0 and EA3 are compatible
with the ofdpa3 driver. EA3 is available with fix for CORD-80.

Change-Id: Ie92d5bdec666bd702b17251cf7d0273d4cd08e5b
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2Pipeline.java
index 42701c0..c0ae6a5 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/Ofdpa2Pipeline.java
@@ -901,7 +901,9 @@
                 for (Instruction instr : fwd.treatment().allInstructions()) {
                     if (instr instanceof L3ModificationInstruction &&
                             ((L3ModificationInstruction) instr).subtype() == L3SubType.DEC_TTL) {
-                        tb.deferred().add(instr);
+                        // XXX decrementing IP ttl is done automatically for routing, this
+                        // action is ignored or rejected in ofdpa as it is not fully implemented
+                        //tb.deferred().add(instr);
                     }
                 }
             }
@@ -925,7 +927,8 @@
                     if (instr instanceof L2ModificationInstruction &&
                             ((L2ModificationInstruction) instr).subtype() == L2SubType.MPLS_POP) {
                         popMpls = true;
-                        tb.immediate().add(instr);
+                        // OF-DPA does not pop in MPLS table. Instead it requires
+                        // setting the MPLS_TYPE so pop can happen down the pipeline
                     }
                     if (instr instanceof L3ModificationInstruction &&
                             ((L3ModificationInstruction) instr).subtype() == L3SubType.DEC_TTL) {
@@ -982,7 +985,8 @@
         if (forTableId == MPLS_TABLE_1) {
             if (mplsNextTable == MPLS_L3_TYPE) {
                 Ofdpa3SetMplsType setMplsType = new Ofdpa3SetMplsType(Ofdpa3MplsType.L3_PHP);
-                tb.extension(setMplsType, deviceId);
+                // set mpls type as apply_action
+                tb.immediate().extension(setMplsType, deviceId);
             }
             tb.transition(mplsNextTable);
         } else {