BVI fix for L3 scenario with LISP 28/56728/2
authorMichal Cmarada <mcmarada@cisco.com>
Tue, 9 May 2017 10:23:26 +0000 (12:23 +0200)
committerMichal Cmarada <mcmarada@cisco.com>
Wed, 10 May 2017 08:56:05 +0000 (10:56 +0200)
in case when LISP L3 scenario is used we need to
leave the creation of BVI loopback interface on LISP
in VPP renderer.

Change-Id: I9b6d9a798baaf5c38f5e12e6f7d78bd29a91551d
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java

index cf1ad19a3132df4d1ff906fb6a5d92084469f239..987b126192393bf91a0b0d1bc617f159f43b92e9 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()) {