Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java b/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java
index bd4c7f3..ad22160 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java
@@ -150,7 +150,7 @@
if (this == obj) {
return true;
}
- if (obj instanceof FlowRule) {
+ if (obj instanceof DefaultFlowRule) {
DefaultFlowRule that = (DefaultFlowRule) obj;
return Objects.equals(deviceId, that.deviceId) &&
Objects.equals(id, that.id);
diff --git a/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
index 7b11798..b3481c1 100644
--- a/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
@@ -138,7 +138,7 @@
public void flowMissing(FlowRule flowRule) {
checkNotNull(flowRule, FLOW_RULE_NULL);
checkValidity();
- log.info("Flow {} has not been installed.", flowRule);
+ log.debug("Flow {} has not been installed.", flowRule);
}
@@ -146,7 +146,7 @@
public void extraneousFlow(FlowRule flowRule) {
checkNotNull(flowRule, FLOW_RULE_NULL);
checkValidity();
- log.info("Flow {} is on switch but not in store.", flowRule);
+ log.debug("Flow {} is on switch but not in store.", flowRule);
}
@Override
@@ -188,8 +188,10 @@
}
}
for (FlowRule rule : storedRules) {
+
// there are rules in the store that aren't on the switch
flowMissing(rule);
+
}
}
}
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
index dd5e8bf..8faf5ab 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
@@ -79,8 +79,6 @@
.setActions(actions)
.setMatch(match)
.setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM))
- .setIdleTimeout(10)
- .setHardTimeout(10)
.setPriority(priority)
.build();
@@ -98,8 +96,6 @@
.setActions(actions)
.setMatch(match)
.setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM))
- .setIdleTimeout(10)
- .setHardTimeout(10)
.setPriority(priority)
.build();
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java
index 7ddc65d..eeffe85 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java
@@ -2,7 +2,6 @@
import static org.slf4j.LoggerFactory.getLogger;
-import java.util.List;
import java.util.Map;
import org.apache.felix.scr.annotations.Activate;
@@ -29,11 +28,13 @@
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortStatus;
import org.projectfloodlight.openflow.protocol.OFStatsReply;
+import org.projectfloodlight.openflow.protocol.OFStatsReplyFlags;
import org.projectfloodlight.openflow.protocol.OFStatsType;
import org.slf4j.Logger;
-import com.google.common.collect.Lists;
+import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
/**
* Provider which uses an OpenFlow controller to detect network
@@ -114,6 +115,8 @@
implements OpenFlowSwitchListener, OpenFlowEventListener {
private final Map<Dpid, FlowStatsCollector> collectors = Maps.newHashMap();
+ private final Multimap<DeviceId, FlowRule> completeEntries =
+ ArrayListMultimap.create();
@Override
public void switchAdded(Dpid dpid) {
@@ -153,17 +156,24 @@
}
- private void pushFlowMetrics(Dpid dpid, OFStatsReply stats) {
+ private synchronized void pushFlowMetrics(Dpid dpid, OFStatsReply stats) {
if (stats.getStatsType() != OFStatsType.FLOW) {
return;
}
+ DeviceId did = DeviceId.deviceId(Dpid.uri(dpid));
final OFFlowStatsReply replies = (OFFlowStatsReply) stats;
- final List<FlowRule> entries = Lists.newLinkedList();
+ //final List<FlowRule> entries = Lists.newLinkedList();
+
for (OFFlowStatsEntry reply : replies.getEntries()) {
- entries.add(new FlowRuleBuilder(dpid, reply).build());
+ completeEntries.put(did, new FlowRuleBuilder(dpid, reply).build());
+ //entries.add(new FlowRuleBuilder(dpid, reply).build());
}
- log.debug("sending flowstats to core {}", entries);
- providerService.pushFlowMetrics(DeviceId.deviceId(Dpid.uri(dpid)), entries);
+
+ if (!stats.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
+ log.debug("sending flowstats to core {}", completeEntries.get(did));
+ providerService.pushFlowMetrics(did, completeEntries.get(did));
+ completeEntries.removeAll(did);
+ }
}
}