Removing dependency on lower level drivers for the BGPRouter application.
Also a couple of bug fixes
Change-Id: I8f2ec58ed3403ae03cf7c068dabb30ae4272ff85
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
index f944f4b..81c0638 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
@@ -365,7 +365,7 @@
"a timeout or be permanent");
checkNotNull(deviceId != null, "Must refer to a device");
checkNotNull(priority != null, "Priority cannot be null");
- checkArgument(priority < MIN_PRIORITY, "Priority cannot be less than " +
+ checkArgument(priority >= MIN_PRIORITY, "Priority cannot be less than " +
MIN_PRIORITY);
return new DefaultFlowRule(deviceId, selector, treatment, priority,
diff --git a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
index 6b84bfa..7f6b0ee 100644
--- a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
@@ -178,7 +178,7 @@
private boolean queueObjective(DeviceId deviceId, ForwardingObjective fwd) {
if (fwd.nextId() != null &&
flowObjectiveStore.getNextGroup(fwd.nextId()) == null) {
- log.warn("Queuing forwarding objective.");
+ log.trace("Queuing forwarding objective for nextId {}", fwd.nextId());
if (pendingForwards.putIfAbsent(fwd.nextId(),
Sets.newHashSet(new PendingNext(deviceId, fwd))) != null) {
Set<PendingNext> pending = pendingForwards.get(fwd.nextId());
@@ -226,10 +226,11 @@
}
// Always (re)initialize the pipeline behaviour
+ log.info("Driver {} bound to device {} ... initializing driver",
+ handler.driver().name(), deviceId);
Pipeliner pipeliner = handler.behaviour(Pipeliner.class);
pipeliner.init(deviceId, context);
pipeliners.putIfAbsent(deviceId, pipeliner);
- log.info("Driver {} bound to device {}", handler.driver().name(), deviceId);
}
}
@@ -241,6 +242,7 @@
case MASTER_CHANGED:
if (event.roleInfo().master() != null) {
setupPipelineHandler(event.subject());
+ log.info("mastership changed on device {}", event.subject());
}
break;
case BACKUPS_CHANGED:
@@ -258,7 +260,10 @@
switch (event.type()) {
case DEVICE_ADDED:
case DEVICE_AVAILABILITY_CHANGED:
+ log.info("Device either added or availability changed {}",
+ event.subject().id());
if (deviceService.isAvailable(event.subject().id())) {
+ log.info("Device is now available {}", event.subject().id());
setupPipelineHandler(event.subject().id());
processPendingObjectives(event.subject().id());
}
@@ -281,6 +286,8 @@
}
private void processPendingObjectives(DeviceId deviceId) {
+ log.debug("Processing pending objectives for device {}", deviceId);
+
pendingObjectives.getOrDefault(deviceId,
Collections.emptySet()).forEach(obj -> {
if (obj instanceof NextObjective) {
@@ -313,13 +320,15 @@
private class InternalStoreDelegate implements FlowObjectiveStoreDelegate {
@Override
public void notify(ObjectiveEvent event) {
+ log.debug("Received notification of obj event {}", event);
Set<PendingNext> pending = pendingForwards.remove(event.subject());
if (pending == null) {
+ log.debug("Nothing pending for this obj event");
return;
}
- log.info("Processing pending objectives {}", pending.size());
+ log.debug("Processing pending forwarding objectives {}", pending.size());
pending.forEach(p -> getDevicePipeliner(p.deviceId())
.forward(p.forwardingObjective()));