Merge "BVI fix for L3 scenario with LISP"
authorTomas Cechvala <tcechval@cisco.com>
Thu, 11 May 2017 12:23:12 +0000 (12:23 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 11 May 2017 12:23:12 +0000 (12:23 +0000)
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java

index 070828d56f23d92db98ae3b41b13f8365a9aa4c1..d8da5666930fad1cb5ad951e432f2838b773bea0 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.groupbasedpolicy.renderer.vpp.commands.TapPortCommand;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.commands.VhostUserCommand;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.commands.VhostUserCommand.VhostUserCommandBuilder;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.commands.interfaces.InterfaceCommand;
+import org.opendaylight.groupbasedpolicy.renderer.vpp.config.ConfigUtil;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.event.NodeOperEvent;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.event.VppEndpointConfEvent;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.policy.acl.AccessListWrapper;
@@ -177,7 +178,12 @@ public class InterfaceManager implements AutoCloseable {
         } else if (interfaceTypeChoice instanceof TapCase) {
             potentialIfaceCommand = createTapInterfaceWithoutBdCommand(vppEndpoint, Operations.PUT);
         } else if (interfaceTypeChoice instanceof LoopbackCase){
-            potentialIfaceCommand = createLoopbackWithoutBdCommand(vppEndpoint, Operations.PUT);
+            if (!ConfigUtil.getInstance().isL3FlatEnabled()) {
+                potentialIfaceCommand = createLoopbackWithoutBdCommand(vppEndpoint, Operations.PUT);
+            }
+            else {
+                LOG.trace("L3 flat enabled: Creating of Loopback BVI disabled in InterfaceManager. LISP in VPP renderer will take care of this.");
+            }
         }
         if (!potentialIfaceCommand.isPresent()) {
             LOG.debug("Interface/PUT command was not created for VppEndpoint point {}", vppEndpoint);
@@ -247,7 +253,12 @@ public class InterfaceManager implements AutoCloseable {
         } else if (interfaceTypeChoice instanceof TapCase) {
             potentialIfaceCommand = createTapInterfaceWithoutBdCommand(vppEndpoint, Operations.DELETE);
         } else if (interfaceTypeChoice instanceof LoopbackCase){
-            potentialIfaceCommand = createLoopbackWithoutBdCommand(vppEndpoint, Operations.DELETE);
+            if (!ConfigUtil.getInstance().isL3FlatEnabled()) {
+                potentialIfaceCommand = createLoopbackWithoutBdCommand(vppEndpoint, Operations.DELETE);
+            }
+            else {
+                LOG.trace("L3 flat enabled: Deleting of Loopback BVI disabled in InterfaceManager. LISP in VPP renderer will take care of this.");
+            }
         }
 
         if (!potentialIfaceCommand.isPresent()) {