mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 18:02:05 +02:00
[ONOS-6409] Minor modification to fix the expectation count while posting flow objectives
Change-Id: I9d882884afcacaff9179e9d8998687d13511d73a
This commit is contained in:
parent
4922a06097
commit
89a09ecd57
@ -66,7 +66,7 @@ import org.onosproject.net.flow.FlowRuleOperationsContext;
|
|||||||
import org.onosproject.net.flow.FlowRuleService;
|
import org.onosproject.net.flow.FlowRuleService;
|
||||||
import org.onosproject.net.flow.TrafficSelector;
|
import org.onosproject.net.flow.TrafficSelector;
|
||||||
import org.onosproject.net.flow.TrafficTreatment;
|
import org.onosproject.net.flow.TrafficTreatment;
|
||||||
import org.onosproject.net.flow.criteria.Criteria;
|
import org.onosproject.net.flow.criteria.Criterion;
|
||||||
import org.onosproject.net.flow.instructions.Instructions;
|
import org.onosproject.net.flow.instructions.Instructions;
|
||||||
import org.onosproject.net.flowobjective.FlowObjectiveService;
|
import org.onosproject.net.flowobjective.FlowObjectiveService;
|
||||||
import org.onosproject.net.flowobjective.DefaultFilteringObjective;
|
import org.onosproject.net.flowobjective.DefaultFilteringObjective;
|
||||||
@ -725,7 +725,7 @@ public class DemoInstaller implements DemoApi {
|
|||||||
private ObjectNode installForward() {
|
private ObjectNode installForward() {
|
||||||
ObjectNode node = mapper.createObjectNode();
|
ObjectNode node = mapper.createObjectNode();
|
||||||
long addStartTime = System.currentTimeMillis();
|
long addStartTime = System.currentTimeMillis();
|
||||||
int totalFlowObj = (flowObjPerDevice * deviceService.getDeviceCount());
|
int totalFlowObj = (flowObjPerDevice * forwardingObj.keySet().size());
|
||||||
CountDownLatch installationLatch = new CountDownLatch(totalFlowObj);
|
CountDownLatch installationLatch = new CountDownLatch(totalFlowObj);
|
||||||
for (DeviceId dId : forwardingObj.keySet()) {
|
for (DeviceId dId : forwardingObj.keySet()) {
|
||||||
Set<ForwardingObjective.Builder> fObjs = forwardingObj.get(dId);
|
Set<ForwardingObjective.Builder> fObjs = forwardingObj.get(dId);
|
||||||
@ -740,7 +740,7 @@ public class DemoInstaller implements DemoApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
installationLatch.await();
|
installationLatch.await(10, TimeUnit.SECONDS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.interrupted();
|
Thread.interrupted();
|
||||||
}
|
}
|
||||||
@ -769,10 +769,14 @@ public class DemoInstaller implements DemoApi {
|
|||||||
for (int i = 0; i < flowObjPerDevice; i++) {
|
for (int i = 0; i < flowObjPerDevice; i++) {
|
||||||
TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder();
|
TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder();
|
||||||
tbuilder.add(Instructions.createOutput(PortNumber.portNumber(2)));
|
tbuilder.add(Instructions.createOutput(PortNumber.portNumber(2)));
|
||||||
|
TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder();
|
||||||
|
sbuilder.matchInPort(PortNumber.portNumber(i + 3));
|
||||||
|
sbuilder.matchEthDst(MacAddress.valueOf("12:00:00:00:00:10"));
|
||||||
|
|
||||||
FilteringObjective.Builder fobBuilder = DefaultFilteringObjective.builder();
|
FilteringObjective.Builder fobBuilder = DefaultFilteringObjective.builder();
|
||||||
fobBuilder.fromApp(appId)
|
fobBuilder.fromApp(appId)
|
||||||
.addCondition(Criteria.matchEthType(2))
|
.withKey(sbuilder.build().getCriterion(Criterion.Type.IN_PORT))
|
||||||
|
.addCondition(sbuilder.build().getCriterion(Criterion.Type.ETH_DST))
|
||||||
.withMeta(tbuilder.build())
|
.withMeta(tbuilder.build())
|
||||||
.permit()
|
.permit()
|
||||||
.withPriority(i + 1)
|
.withPriority(i + 1)
|
||||||
@ -790,7 +794,7 @@ public class DemoInstaller implements DemoApi {
|
|||||||
private ObjectNode installFilter() {
|
private ObjectNode installFilter() {
|
||||||
ObjectNode node = mapper.createObjectNode();
|
ObjectNode node = mapper.createObjectNode();
|
||||||
long addStartTime = System.currentTimeMillis();
|
long addStartTime = System.currentTimeMillis();
|
||||||
int totalFlowObj = (flowObjPerDevice * deviceService.getDeviceCount());
|
int totalFlowObj = (flowObjPerDevice * filteringObj.keySet().size());
|
||||||
CountDownLatch installationLatch = new CountDownLatch(totalFlowObj);
|
CountDownLatch installationLatch = new CountDownLatch(totalFlowObj);
|
||||||
for (DeviceId dId : filteringObj.keySet()) {
|
for (DeviceId dId : filteringObj.keySet()) {
|
||||||
Set<FilteringObjective.Builder> fObjs = filteringObj.get(dId);
|
Set<FilteringObjective.Builder> fObjs = filteringObj.get(dId);
|
||||||
@ -805,7 +809,7 @@ public class DemoInstaller implements DemoApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
installationLatch.await();
|
installationLatch.await(10, TimeUnit.SECONDS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.interrupted();
|
Thread.interrupted();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user