Skip to content
Snippets Groups Projects
Commit c2a9a2e7 authored by abat's avatar abat
Browse files

Merge into master from pull request #3389:

[BVS-498] Prefixes for port names can be specified in the properties file in order to classify the ports as uplink ports, thus not autoportfast them. (https://github.com/bigswitch/bigswitchcontroller/pull/3389)
parents 48a8f128 2e19be37
No related branches found
No related tags found
No related merge requests found
...@@ -321,4 +321,10 @@ public interface IFloodlightProviderService extends ...@@ -321,4 +321,10 @@ public interface IFloodlightProviderService extends
*/ */
public EventHistory<EventHistorySwitch> getSwitchEventHistory(); public EventHistory<EventHistorySwitch> getSwitchEventHistory();
/**
* Get the set of port prefixes that will define an UPLINK port.
* @return The set of prefixes
*/
public Set<String> getUplinkPortPrefixSet();
} }
...@@ -24,6 +24,7 @@ import java.lang.management.RuntimeMXBean; ...@@ -24,6 +24,7 @@ import java.lang.management.RuntimeMXBean;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -203,6 +204,17 @@ public class Controller implements IFloodlightProviderService, ...@@ -203,6 +204,17 @@ public class Controller implements IFloodlightProviderService,
public static final int BATCH_MAX_SIZE = 100; public static final int BATCH_MAX_SIZE = 100;
protected static final boolean ALWAYS_DECODE_ETH = true; protected static final boolean ALWAYS_DECODE_ETH = true;
// Set of port name prefixes that will be classified as uplink ports,
// hence will not be autoportfast.
Set<String> uplinkPortPrefixSet;
public Set<String> getUplinkPortPrefixSet() {
return uplinkPortPrefixSet;
}
public void setUplinkPortPrefixSet(Set<String> prefixSet) {
this.uplinkPortPrefixSet = prefixSet;
}
// Load monitor for overload protection // Load monitor for overload protection
protected final boolean overload_drop = protected final boolean overload_drop =
...@@ -2201,6 +2213,22 @@ public class Controller implements IFloodlightProviderService, ...@@ -2201,6 +2213,22 @@ public class Controller implements IFloodlightProviderService,
this.setAlwaysClearFlowsOnSwActivate(false); this.setAlwaysClearFlowsOnSwActivate(false);
log.info("Flush switches on reconnect -- Disabled"); log.info("Flush switches on reconnect -- Disabled");
} }
uplinkPortPrefixSet = new HashSet<String>();
uplinkPortPrefixSet.add("eth");
uplinkPortPrefixSet.add("bond");
String str = configParams.get("uplinkPortPrefix");
if (str != null) {
List<String> items = Arrays.asList(str.split("\\s*,\\s*"));
if (items != null) {
for (String s: items) {
if (s.length() > 0) {
uplinkPortPrefixSet.add(s);
}
}
}
}
this.roleManager = new RoleManager(this.notifiedRole, this.roleManager = new RoleManager(this.notifiedRole,
INITIAL_ROLE_CHANGE_DESCRIPTION); INITIAL_ROLE_CHANGE_DESCRIPTION);
this.switchManager = new SwitchManager(this.notifiedRole); this.switchManager = new SwitchManager(this.notifiedRole);
...@@ -2511,5 +2539,4 @@ public class Controller implements IFloodlightProviderService, ...@@ -2511,5 +2539,4 @@ public class Controller implements IFloodlightProviderService,
IStoreListener<Long> getStoreListener() { IStoreListener<Long> getStoreListener() {
return this.switchManager; return this.switchManager;
} }
} }
...@@ -416,4 +416,10 @@ public class MockFloodlightProvider implements IFloodlightModule, IFloodlightPro ...@@ -416,4 +416,10 @@ public class MockFloodlightProvider implements IFloodlightModule, IFloodlightPro
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
@Override
public Set<String> getUplinkPortPrefixSet() {
// TODO Auto-generated method stub
return null;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment