Bug 1825 - L2Fwding service should not inherit actions from the AbstractServiceInstance 72/11172/1
authorMadhu Venugopal <mavenugo@gmail.com>
Sun, 14 Sep 2014 21:07:02 +0000 (14:07 -0700)
committerMadhu Venugopal <mavenugo@gmail.com>
Sun, 14 Sep 2014 21:07:02 +0000 (14:07 -0700)
Due to the Write-Actions vs Apply-Actions issue, L2Fwd service is moved to the end of the pipeline.
When it is moved, it should not inherit the Drop-flow from AbstractServiceInstance parent.

Change-Id: I14acc18ca0e9a9485d2cfcea53a4a0910f9db35e
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/L2ForwardingService.java

index 199055779da1baa34b10e3aefe3db07b6c79de3b..0cca6cd20b4303bbe40e96e84f9cd8c724cd2366 100644 (file)
@@ -102,12 +102,6 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
             // Instructions List Stores Individual Instructions
             List<Instruction> instructions = Lists.newArrayList();
 
-            // GOTO Instructions Need to be added first to the List
-            ib = this.getMutablePipelineInstructionBuilder();
-            ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
-            instructions.add(ib.build());
-
             // Set the Output Port/Iface
             InstructionUtils.createOutputPortInstructions(ib, dpidLong, localPort);
             ib.setOrder(0);
@@ -166,12 +160,6 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
             List<Instruction> instructions = Lists.newArrayList();
             List<Instruction> instructions_tmp = Lists.newArrayList();
 
-            // GOTO Instructions Need to be added first to the List
-            ib = this.getMutablePipelineInstructionBuilder();
-            ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
-            instructions.add(ib.build());
-
             /* Strip vlan and store to tmp instruction space*/
             InstructionUtils.createPopVlanInstructions(ib);
             ib.setOrder(0);
@@ -181,7 +169,7 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
             // Set the Output Port/Iface
             ib = new InstructionBuilder();
             InstructionUtils.addOutputPortInstructions(ib, dpidLong, localPort, instructions_tmp);
-            ib.setOrder(0);
+            ib.setOrder(1);
             ib.setKey(new InstructionKey(0));
             instructions.add(ib.build());
 
@@ -555,14 +543,9 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
             // Instructions List Stores Individual Instructions
             List<Instruction> instructions = Lists.newArrayList();
 
-            // GOTO Instructions
-            ib = this.getMutablePipelineInstructionBuilder();
-            ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
-            instructions.add(ib.build());
             // Set the Output Port/Iface
             InstructionUtils.createOutputPortInstructions(ib, dpidLong, OFPortOut);
-            ib.setOrder(1);
+            ib.setOrder(0);
             ib.setKey(new InstructionKey(1));
             instructions.add(ib.build());
 
@@ -619,11 +602,9 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
 
             // Instructions List Stores Individual Instructions
             List<Instruction> instructions = Lists.newArrayList();
-
-            // GOTO Instructions
-            ib = this.getMutablePipelineInstructionBuilder();
+            InstructionUtils.createOutputPortInstructions(ib, dpidLong, ethPort);
             ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
+            ib.setKey(new InstructionKey(1));
             instructions.add(ib.build());
 
             // Add InstructionBuilder to the Instruction(s)Builder List
@@ -688,15 +669,10 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
         }
 
         if (write) {
-            // GOTO Instruction
-            ib = this.getMutablePipelineInstructionBuilder();
-            ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
-            instructions.add(ib.build());
             // Set the Output Port/Iface
             //createOutputGroupInstructions(nodeBuilder, ib, dpidLong, OFPortOut, existingInstructions);
             createOutputPortInstructions(ib, dpidLong, OFPortOut, existingInstructions);
-            ib.setOrder(1);
+            ib.setOrder(0);
             ib.setKey(new InstructionKey(1));
             instructions.add(ib.build());
 
@@ -775,14 +751,9 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
         List<Instruction> instructions = Lists.newArrayList();
 
         if (write) {
-            // GOTO Instruction
-            ib = this.getMutablePipelineInstructionBuilder();
-            ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
-            instructions.add(ib.build());
             // Set the Output Port/Iface
             InstructionUtils.createOutputPortInstructions(ib, dpidLong, ethPort);
-            ib.setOrder(1);
+            ib.setOrder(0);
             ib.setKey(new InstructionKey(1));
             instructions.add(ib.build());
 
@@ -884,12 +855,6 @@ public class L2ForwardingService extends AbstractServiceInstance implements L2Fo
             // Instructions List Stores Individual Instructions
             List<Instruction> instructions = Lists.newArrayList();
 
-            // Call the InstructionBuilder Methods Containing Actions
-            ib = this.getMutablePipelineInstructionBuilder();
-            ib.setOrder(0);
-            ib.setKey(new InstructionKey(0));
-            instructions.add(ib.build());
-
             // Set the Output Port/Iface
             InstructionUtils.createOutputPortInstructions(ib, dpidLong, ethPort);
             ib.setOrder(0);