mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-05 20:26:16 +02:00
Do not send table stats request if unsupported
Change-Id: Ia66447aad1eeb0a01577215e4c5985526dadd274
This commit is contained in:
parent
c45ede5f1c
commit
edadbe2574
@ -17,6 +17,7 @@ package org.onosproject.openflow.controller;
|
||||
|
||||
import org.onosproject.net.Device;
|
||||
import org.projectfloodlight.openflow.protocol.OFFactory;
|
||||
import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
|
||||
import org.projectfloodlight.openflow.protocol.OFMessage;
|
||||
import org.projectfloodlight.openflow.protocol.OFMeterFeatures;
|
||||
import org.projectfloodlight.openflow.protocol.OFPortDesc;
|
||||
@ -80,6 +81,14 @@ public interface OpenFlowSwitch {
|
||||
*/
|
||||
OFMeterFeatures getMeterFeatures();
|
||||
|
||||
/**
|
||||
* Fetches the features of this switch.
|
||||
* @return unmodifiable features
|
||||
*/
|
||||
default OFFeaturesReply features() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the factory for this OF version.
|
||||
* @return OF version specific factory.
|
||||
|
||||
@ -527,6 +527,11 @@ public abstract class AbstractOpenFlowSwitch extends AbstractHandlerBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OFFeaturesReply features() {
|
||||
return this.features;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String manufacturerDescription() {
|
||||
return this.desc.getMfrDesc();
|
||||
|
||||
@ -66,6 +66,7 @@ import org.onosproject.provider.of.flow.util.FlowEntryBuilder;
|
||||
import org.osgi.service.component.ComponentContext;
|
||||
import org.projectfloodlight.openflow.protocol.OFBadRequestCode;
|
||||
import org.projectfloodlight.openflow.protocol.OFBarrierRequest;
|
||||
import org.projectfloodlight.openflow.protocol.OFCapabilities;
|
||||
import org.projectfloodlight.openflow.protocol.OFErrorMsg;
|
||||
import org.projectfloodlight.openflow.protocol.OFFlowLightweightStatsReply;
|
||||
import org.projectfloodlight.openflow.protocol.OFFlowMod;
|
||||
@ -253,9 +254,11 @@ public class OpenFlowRuleProvider extends AbstractProvider
|
||||
stopCollectorIfNeeded(simpleCollectors.put(new Dpid(sw.getId()), fsc));
|
||||
fsc.start();
|
||||
}
|
||||
TableStatisticsCollector tsc = new TableStatisticsCollector(timer, sw, flowPollFrequency);
|
||||
stopCollectorIfNeeded(tableStatsCollectors.put(new Dpid(sw.getId()), tsc));
|
||||
tsc.start();
|
||||
if (sw.features().getCapabilities().contains(OFCapabilities.TABLE_STATS)) {
|
||||
TableStatisticsCollector tsc = new TableStatisticsCollector(timer, sw, flowPollFrequency);
|
||||
stopCollectorIfNeeded(tableStatsCollectors.put(new Dpid(sw.getId()), tsc));
|
||||
tsc.start();
|
||||
}
|
||||
}
|
||||
|
||||
private void stopCollectorIfNeeded(SwitchDataCollector collector) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user