Bug 7034 : Replace all write_actions by apply_actions. 80/47580/4
authorSlava Radune <slava.radune@hpe.com>
Wed, 26 Oct 2016 07:41:31 +0000 (10:41 +0300)
committerSam Hague <shague@redhat.com>
Tue, 8 Nov 2016 18:52:29 +0000 (18:52 +0000)
write_actions is used to aggregate action (in actions set) to be apllied once there is no more goto table instruction.
In our case there is no need of this, only complicates the debugability and causing bugs.

Related review:
https://git.opendaylight.org/gerrit/#/c/46538/

Change-Id: I3324e25ed30b876d2ee0fea30c2c53b24cedf528
Signed-off-by: Slava Radune <slava.radune@hpe.com>
vpnservice/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/listeners/AclNodeListener.java
vpnservice/dhcpservice/dhcpservice-impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpServiceUtils.java
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/FibRpcServiceImpl.java
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/VrfEntryListener.java
vpnservice/ipv6service/impl/src/main/java/org/opendaylight/netvirt/ipv6service/utils/Ipv6ServiceUtils.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/ExternalRoutersListener.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptSwitchHA.java
vpnservice/natservice/natservice-impl/src/test/java/org/opendaylight/netvirt/natservice/internal/test/ExternalNetworksChangeListenerTest.java

index 4b184d511e27700911be1d2750620b986f7ae105..2e52a4acb69bc50ebb4c0389e891dba2c3b2eff1 100644 (file)
@@ -521,7 +521,7 @@ public class AclNodeListener extends AsyncDataTreeChangeListenerBase<FlowCapable
         List<InstructionInfo> instructions = new ArrayList<>();
         List<ActionInfo> actionsInfos = new ArrayList<>();
         actionsInfos.add(new ActionInfo(ActionType.drop_action, new String[] {}));
-        instructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfos));
+        instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
         flowId = "Fixed_Conntrk_NewDrop_" + dpId + "_" + flowId + tableId;
         syncFlow(dpId, tableId, flowId, priority, "ACL", 0, 0,
                 AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
index 59c9635a70b7386ea7a4a9d144889a2978c7dbbf..1033e4ee992307bd6e6a693f2ddc0cff596a1984 100644 (file)
@@ -117,7 +117,7 @@ public class DhcpServiceUtils {
 
         List<ActionInfo> actionsInfos = new ArrayList<>();
         List<InstructionInfo> instructions = new ArrayList<>();
-        instructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfos));
+        instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
         // Drop Action
         actionsInfos.add(new ActionInfo(ActionType.drop_action,
                 new String[] {}));
index a42ef8ac2cc335afcb9d70bf8fad2a62c0cf7949..78626a5717aa0bc0b3dcaba93b01cd513346829d 100644 (file)
@@ -265,7 +265,7 @@ public class FibRpcServiceImpl implements FibRpcService {
         List<Instruction> instructions = new ArrayList<Instruction>();
         List<ActionInfo> actionsInfos = new ArrayList<ActionInfo>();
         actionsInfos.add(new ActionInfo(ActionType.pop_mpls, new String[]{}));
-        Instruction writeInstruction = new InstructionInfo(InstructionType.write_actions, actionsInfos).buildInstruction(0);
+        Instruction writeInstruction = new InstructionInfo(InstructionType.apply_actions, actionsInfos).buildInstruction(0);
         instructions.add(writeInstruction);
         instructions.addAll(customInstructions);
 
index 013bb1c14d500d5df77bb57bc49535a51bbd42c8..7227c6364458ee4377327b38848075a1b489882b 100644 (file)
@@ -781,10 +781,10 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
             List<ActionInfo> actionsInfos =
                     Arrays.asList(new ActionInfo(ActionType.group, new String[] { String.valueOf(groupId)}));
             final List<InstructionInfo> instructions =
-                    Arrays.asList(new InstructionInfo(InstructionType.write_actions, actionsInfos));
+                    Arrays.asList(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
             actionsInfos = Arrays.asList(new ActionInfo(ActionType.pop_mpls, new String[]{}),
                     new ActionInfo(ActionType.group, new String[] { String.valueOf(groupId) }) );
-            final List<InstructionInfo> lfibinstructions = Arrays.asList(new InstructionInfo(InstructionType.write_actions, actionsInfos));
+            final List<InstructionInfo> lfibinstructions = Arrays.asList(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
             if (RouteOrigin.value(vrfEntry.getOrigin()) != RouteOrigin.SELF_IMPORTED) {
                 LOG.debug("Installing tunnel table entry on dpn {} for interface {} with label {}",
                         dpnId, localNextHopInfo.getVpnInterfaceName(), vrfEntry.getLabel());
@@ -878,7 +878,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
         mkMatches.add(new MatchInfo(MatchFieldType.tunnel_id, new BigInteger[] {BigInteger.valueOf(label)}));
 
         List<InstructionInfo> mkInstructions = new ArrayList<>();
-        mkInstructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfos));
+        mkInstructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
 
         FlowEntity terminatingServiceTableFlowEntity = MDSALUtil.buildFlowEntity(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE,
                 getTableMissFlowRef(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE,label), 5, String.format("%s:%d","TST Flow Entry ",label),
@@ -1094,7 +1094,7 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
                 return;
             }
             actionInfos.addAll(egressActions);
-            instructions.add(new InstructionInfo(InstructionType.write_actions, actionInfos));
+            instructions.add(new InstructionInfo(InstructionType.apply_actions, actionInfos));
             makeConnectedRoute(remoteDpnId, vpnId, vrfEntry, rd, instructions, NwConstants.ADD_FLOW, tx);
         }
         if(!wrTxPresent ){
index 3fb6241707f5dd8cce7f26ed421225f6ab8f0d8b..6b659056254762d22496f280ebda80d6578ee4e0 100644 (file)
@@ -339,7 +339,7 @@ public class Ipv6ServiceUtils {
         List<ActionInfo> actionsInfos = new ArrayList<>();
         actionsInfos.add(new ActionInfo(ActionType.punt_to_controller,
                 new String[] {}));
-        instructions.add(new InstructionInfo(InstructionType.write_actions,
+        instructions.add(new InstructionInfo(InstructionType.apply_actions,
                 actionsInfos));
         FlowEntity rsFlowEntity = MDSALUtil.buildFlowEntity(dpId, tableId,
                 getIPv6FlowRef(dpId, elanTag, ipv6Address),Ipv6Constants.DEFAULT_FLOW_PRIORITY, "IPv6NS",
@@ -364,7 +364,7 @@ public class Ipv6ServiceUtils {
         // Punt to controller
         actionsInfos.add(new ActionInfo(ActionType.punt_to_controller,
                 new String[] {}));
-        instructions.add(new InstructionInfo(InstructionType.write_actions,
+        instructions.add(new InstructionInfo(InstructionType.apply_actions,
                 actionsInfos));
         FlowEntity rsFlowEntity = MDSALUtil.buildFlowEntity(dpId, tableId,
                 getIPv6FlowRef(dpId, elanTag, "IPv6RS"),Ipv6Constants.DEFAULT_FLOW_PRIORITY, "IPv6RS", 0, 0,
index cbf3685f3464e939d4f000d1547788562c50c08d..f8df941d7fdaed096e2b72e8dcf4d46391cda4a6 100644 (file)
@@ -692,7 +692,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
         actionsInfo.add(actionSetField);
         LOG.debug("NAT Service : Setting the tunnel to the list of action infos {}", actionsInfo);
         actionsInfo.add(new ActionInfo(ActionType.group, new String[] {String.valueOf(groupId)}));
-        instructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfo));
+        instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfo));
         String flowRef = getFlowRefSnat(dpId, NwConstants.PSNAT_TABLE, routerName);
         FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.PSNAT_TABLE, flowRef,
                 NatConstants.DEFAULT_PSNAT_FLOW_PRIORITY, flowRef, 0, 0,
@@ -2159,7 +2159,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
         actionsInfo.add(actionSetField);
         LOG.debug("NAT Service : Setting the tunnel to the list of action infos {}", actionsInfo);
         actionsInfo.add(new ActionInfo(ActionType.group, new String[] {String.valueOf(groupId)}));
-        instructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfo));
+        instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfo));
         String flowRef = getFlowRefSnat(dpId, NwConstants.PSNAT_TABLE, routerName);
         FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.PSNAT_TABLE, flowRef,
                 NatConstants.DEFAULT_PSNAT_FLOW_PRIORITY, flowRef, 0, 0,
index 73d8203c7c905c42761f0dd60615c44c4843a292..96186f64ed1b3a5c5f715b784228a37f79642713 100644 (file)
@@ -676,7 +676,7 @@ public class NaptSwitchHA {
             actionsInfo.add(actionSetField);
             LOG.debug("Setting the tunnel to the list of action infos {}", actionsInfo);
             actionsInfo.add(new ActionInfo(ActionType.group, new String[] {String.valueOf(groupId)}));
-            instructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfo));
+            instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfo));
 
             flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.PSNAT_TABLE, flowRef,
                     NatConstants.DEFAULT_PSNAT_FLOW_PRIORITY, flowRef, 0, 0,
index 2b8ee8c681e4018e6318187d55e835a67a8f3ed7..57747c45d0b44ddcde4b93bc62cfc2ac557fa435 100644 (file)
@@ -119,7 +119,7 @@ public class ExternalNetworksChangeListenerTest {
         List<InstructionInfo> instructions = new ArrayList<>();
         List<ActionInfo> actionsInfos = new ArrayList<>();
         actionsInfos.add(new ActionInfo(ActionType.group, new String[] {String.valueOf(groupId)}));
-        instructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfos));
+        instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
 
 
         String flowRef =  new StringBuffer().append(SNAT_FLOWID_PREFIX).append(dpnId).append(FLOWID_SEPARATOR).