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)
1  2 
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java

index 070828d56f23d92db98ae3b41b13f8365a9aa4c1,987b126192393bf91a0b0d1bc617f159f43b92e9..d8da5666930fad1cb5ad951e432f2838b773bea0
@@@ -30,6 -30,7 +30,7 @@@ import org.opendaylight.groupbasedpolic
  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 +178,12 @@@ public class InterfaceManager implement
          } 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);
          } 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()) {
          }
      }
  
 -    static ExternalLocationCase resolveAndValidateLocation(AddressEndpointWithLocation addrEpWithLoc) {
 +    public static ExternalLocationCase resolveAndValidateLocation(AddressEndpointWithLocation addrEpWithLoc) {
          LocationType locationType = addrEpWithLoc.getAbsoluteLocation().getLocationType();
          if (!(locationType instanceof ExternalLocationCase)) {
              throw new IllegalArgumentException("Endpoint does not have external location " + addrEpWithLoc);