From 836f466366cdb9b9b195ed144d646510197ff9e6 Mon Sep 17 00:00:00 2001 From: Shakib Ahmed Date: Thu, 27 Apr 2017 10:20:58 -0700 Subject: [PATCH] Add L3 flat overlay config in startup.cfg A new config is being added to decide whether to use vxlan tunnel to for L2 or should we just create a flat L3 and eliminate the L2 boardcast domain and communication should be done by L3. Change-Id: I1d78df38dab9f84dfdb8e5a7c3d709a2b2ee7fd3 Signed-off-by: Shakib Ahmed --- .../renderer/vpp/config/ConfigUtil.java | 24 +++++++++++++++++++ .../vpp/config/ConfigurationService.java | 2 ++ renderers/vpp/src/main/resources/startup.cfg | 11 ++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigUtil.java b/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigUtil.java index fe2209da4..76532393d 100644 --- a/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigUtil.java +++ b/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigUtil.java @@ -21,14 +21,18 @@ public class ConfigUtil { private static boolean DEFAULT_LISP_OVERLAY_ENABLED = false; private static boolean DEFAULT_LISP_MAPREGISTER_ENABLED = true; + private static boolean DEFAULT_L3_FLAT_ENABLED = false; private IpAddress odlTenantIp; private boolean lispOverlayEnabled = DEFAULT_LISP_OVERLAY_ENABLED; private boolean lispMapRegisterEnbled = DEFAULT_LISP_MAPREGISTER_ENABLED; + private boolean l3FlatEnabled = DEFAULT_L3_FLAT_ENABLED; + public static String ODL_TENANT_IP = "odl.ip.tenant"; public static String LISP_OVERLAY_ENABLED = "gbp.lisp.enabled"; public static String LISP_MAPREGISTER_ENABLED = "vpp.lisp.mapregister.enabled"; + public static String L3_FLAT_ENABLED = "vpp.l3.flat.enabled"; private static ConfigUtil INSTANCE = new ConfigUtil(); @@ -96,6 +100,22 @@ public class ConfigUtil { } } + public void configL3FlatEnabled(String configStr) { + if (configStr == null) { + l3FlatEnabled = DEFAULT_L3_FLAT_ENABLED; + LOG.debug("Configuration variable {} is being unset. Setting the variable to {}", + L3_FLAT_ENABLED, DEFAULT_L3_FLAT_ENABLED); + } + + configStr = configStr.trim(); + + if (configStr.equalsIgnoreCase("true")) { + l3FlatEnabled = true; + } else { + l3FlatEnabled = false; + } + } + public IpAddress getOdlTenantIp() { return odlTenantIp; } @@ -111,4 +131,8 @@ public class ConfigUtil { public boolean isLispMapRegisterEnbled() { return lispMapRegisterEnbled; } + + public boolean isL3FlatEnabled() { + return l3FlatEnabled; + } } diff --git a/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigurationService.java b/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigurationService.java index 4041a9459..14977b45c 100644 --- a/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigurationService.java +++ b/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/config/ConfigurationService.java @@ -77,5 +77,7 @@ public class ConfigurationService implements ManagedService{ mrConfig -> configUtil.configureMapRegister((String) mrConfig)); configMethods.put(ConfigUtil.LISP_OVERLAY_ENABLED, overlayConfig -> configUtil.configureLispOverlayEnabled((String) overlayConfig)); + configMethods.put(ConfigUtil.L3_FLAT_ENABLED, + l3FlatConfig -> configUtil.configL3FlatEnabled((String) l3FlatConfig)); } } diff --git a/renderers/vpp/src/main/resources/startup.cfg b/renderers/vpp/src/main/resources/startup.cfg index b58f5597b..5ebd8d874 100644 --- a/renderers/vpp/src/main/resources/startup.cfg +++ b/renderers/vpp/src/main/resources/startup.cfg @@ -25,4 +25,13 @@ gbp.lisp.enabled = true # Valid config: true/false # Required config: gbp.lisp.enabled is set to be true. # Default value: true -vpp.lisp.mapregister.enabled = true \ No newline at end of file +vpp.lisp.mapregister.enabled = true + +# This property determines whether a flat l3 overlay will created. +# If true, there will not be any vxlan involved for L2. There will +# not be any L2 broadcast domain. All VMs will communicate via L3 +# only. +# Valid config: true/false +# Required config: gbp.lisp.enabled is set to be true. +# Default value: true +vpp.l3.flat.enabled = true \ No newline at end of file -- 2.36.6