Removing dependency on lower level drivers for the BGPRouter application.
Also a couple of bug fixes Change-Id: I8f2ec58ed3403ae03cf7c068dabb30ae4272ff85
Showing
7 changed files
with
72 additions
and
56 deletions
... | @@ -252,10 +252,8 @@ public class BgpRouter { | ... | @@ -252,10 +252,8 @@ public class BgpRouter { |
252 | 252 | ||
253 | flowObjectiveService.forward(deviceId, | 253 | flowObjectiveService.forward(deviceId, |
254 | generateRibFlowRule(fibEntry.prefix(), nextId).add()); | 254 | generateRibFlowRule(fibEntry.prefix(), nextId).add()); |
255 | - | 255 | + log.trace("Sending flow forwarding objective {}->{}", fibEntry, nextId); |
256 | - | ||
257 | } | 256 | } |
258 | - log.info("Sending flow forwarding objective"); | ||
259 | 257 | ||
260 | } | 258 | } |
261 | 259 | ||
... | @@ -325,8 +323,10 @@ public class BgpRouter { | ... | @@ -325,8 +323,10 @@ public class BgpRouter { |
325 | .setOutput(egressIntf.connectPoint().port()) | 323 | .setOutput(egressIntf.connectPoint().port()) |
326 | .build(); | 324 | .build(); |
327 | 325 | ||
326 | + int nextId = flowObjectiveService.allocateNextId(); | ||
327 | + | ||
328 | NextObjective nextObjective = DefaultNextObjective.builder() | 328 | NextObjective nextObjective = DefaultNextObjective.builder() |
329 | - .withId(entry.hashCode()) | 329 | + .withId(nextId) |
330 | .addTreatment(treatment) | 330 | .addTreatment(treatment) |
331 | .withType(NextObjective.Type.SIMPLE) | 331 | .withType(NextObjective.Type.SIMPLE) |
332 | .fromApp(appId) | 332 | .fromApp(appId) |
... | @@ -348,7 +348,7 @@ public class BgpRouter { | ... | @@ -348,7 +348,7 @@ public class BgpRouter { |
348 | groupService.addGroup(groupDescription); | 348 | groupService.addGroup(groupDescription); |
349 | */ | 349 | */ |
350 | 350 | ||
351 | - nextHops.put(nextHop.ip(), flowObjectiveService.allocateNextId()); | 351 | + nextHops.put(nextHop.ip(), nextId); |
352 | 352 | ||
353 | } | 353 | } |
354 | 354 | ... | ... |
... | @@ -365,7 +365,7 @@ public class DefaultFlowRule implements FlowRule { | ... | @@ -365,7 +365,7 @@ public class DefaultFlowRule implements FlowRule { |
365 | "a timeout or be permanent"); | 365 | "a timeout or be permanent"); |
366 | checkNotNull(deviceId != null, "Must refer to a device"); | 366 | checkNotNull(deviceId != null, "Must refer to a device"); |
367 | checkNotNull(priority != null, "Priority cannot be null"); | 367 | checkNotNull(priority != null, "Priority cannot be null"); |
368 | - checkArgument(priority < MIN_PRIORITY, "Priority cannot be less than " + | 368 | + checkArgument(priority >= MIN_PRIORITY, "Priority cannot be less than " + |
369 | MIN_PRIORITY); | 369 | MIN_PRIORITY); |
370 | 370 | ||
371 | return new DefaultFlowRule(deviceId, selector, treatment, priority, | 371 | return new DefaultFlowRule(deviceId, selector, treatment, priority, | ... | ... |
... | @@ -178,7 +178,7 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -178,7 +178,7 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
178 | private boolean queueObjective(DeviceId deviceId, ForwardingObjective fwd) { | 178 | private boolean queueObjective(DeviceId deviceId, ForwardingObjective fwd) { |
179 | if (fwd.nextId() != null && | 179 | if (fwd.nextId() != null && |
180 | flowObjectiveStore.getNextGroup(fwd.nextId()) == null) { | 180 | flowObjectiveStore.getNextGroup(fwd.nextId()) == null) { |
181 | - log.warn("Queuing forwarding objective."); | 181 | + log.trace("Queuing forwarding objective for nextId {}", fwd.nextId()); |
182 | if (pendingForwards.putIfAbsent(fwd.nextId(), | 182 | if (pendingForwards.putIfAbsent(fwd.nextId(), |
183 | Sets.newHashSet(new PendingNext(deviceId, fwd))) != null) { | 183 | Sets.newHashSet(new PendingNext(deviceId, fwd))) != null) { |
184 | Set<PendingNext> pending = pendingForwards.get(fwd.nextId()); | 184 | Set<PendingNext> pending = pendingForwards.get(fwd.nextId()); |
... | @@ -226,10 +226,11 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -226,10 +226,11 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
226 | } | 226 | } |
227 | 227 | ||
228 | // Always (re)initialize the pipeline behaviour | 228 | // Always (re)initialize the pipeline behaviour |
229 | + log.info("Driver {} bound to device {} ... initializing driver", | ||
230 | + handler.driver().name(), deviceId); | ||
229 | Pipeliner pipeliner = handler.behaviour(Pipeliner.class); | 231 | Pipeliner pipeliner = handler.behaviour(Pipeliner.class); |
230 | pipeliner.init(deviceId, context); | 232 | pipeliner.init(deviceId, context); |
231 | pipeliners.putIfAbsent(deviceId, pipeliner); | 233 | pipeliners.putIfAbsent(deviceId, pipeliner); |
232 | - log.info("Driver {} bound to device {}", handler.driver().name(), deviceId); | ||
233 | } | 234 | } |
234 | } | 235 | } |
235 | 236 | ||
... | @@ -241,6 +242,7 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -241,6 +242,7 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
241 | case MASTER_CHANGED: | 242 | case MASTER_CHANGED: |
242 | if (event.roleInfo().master() != null) { | 243 | if (event.roleInfo().master() != null) { |
243 | setupPipelineHandler(event.subject()); | 244 | setupPipelineHandler(event.subject()); |
245 | + log.info("mastership changed on device {}", event.subject()); | ||
244 | } | 246 | } |
245 | break; | 247 | break; |
246 | case BACKUPS_CHANGED: | 248 | case BACKUPS_CHANGED: |
... | @@ -258,7 +260,10 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -258,7 +260,10 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
258 | switch (event.type()) { | 260 | switch (event.type()) { |
259 | case DEVICE_ADDED: | 261 | case DEVICE_ADDED: |
260 | case DEVICE_AVAILABILITY_CHANGED: | 262 | case DEVICE_AVAILABILITY_CHANGED: |
263 | + log.info("Device either added or availability changed {}", | ||
264 | + event.subject().id()); | ||
261 | if (deviceService.isAvailable(event.subject().id())) { | 265 | if (deviceService.isAvailable(event.subject().id())) { |
266 | + log.info("Device is now available {}", event.subject().id()); | ||
262 | setupPipelineHandler(event.subject().id()); | 267 | setupPipelineHandler(event.subject().id()); |
263 | processPendingObjectives(event.subject().id()); | 268 | processPendingObjectives(event.subject().id()); |
264 | } | 269 | } |
... | @@ -281,6 +286,8 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -281,6 +286,8 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
281 | } | 286 | } |
282 | 287 | ||
283 | private void processPendingObjectives(DeviceId deviceId) { | 288 | private void processPendingObjectives(DeviceId deviceId) { |
289 | + log.debug("Processing pending objectives for device {}", deviceId); | ||
290 | + | ||
284 | pendingObjectives.getOrDefault(deviceId, | 291 | pendingObjectives.getOrDefault(deviceId, |
285 | Collections.emptySet()).forEach(obj -> { | 292 | Collections.emptySet()).forEach(obj -> { |
286 | if (obj instanceof NextObjective) { | 293 | if (obj instanceof NextObjective) { |
... | @@ -313,13 +320,15 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -313,13 +320,15 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
313 | private class InternalStoreDelegate implements FlowObjectiveStoreDelegate { | 320 | private class InternalStoreDelegate implements FlowObjectiveStoreDelegate { |
314 | @Override | 321 | @Override |
315 | public void notify(ObjectiveEvent event) { | 322 | public void notify(ObjectiveEvent event) { |
323 | + log.debug("Received notification of obj event {}", event); | ||
316 | Set<PendingNext> pending = pendingForwards.remove(event.subject()); | 324 | Set<PendingNext> pending = pendingForwards.remove(event.subject()); |
317 | 325 | ||
318 | if (pending == null) { | 326 | if (pending == null) { |
327 | + log.debug("Nothing pending for this obj event"); | ||
319 | return; | 328 | return; |
320 | } | 329 | } |
321 | 330 | ||
322 | - log.info("Processing pending objectives {}", pending.size()); | 331 | + log.debug("Processing pending forwarding objectives {}", pending.size()); |
323 | 332 | ||
324 | pending.forEach(p -> getDevicePipeliner(p.deviceId()) | 333 | pending.forEach(p -> getDevicePipeliner(p.deviceId()) |
325 | .forward(p.forwardingObjective())); | 334 | .forward(p.forwardingObjective())); | ... | ... |
... | @@ -79,7 +79,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -79,7 +79,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | - protected static final int FIRST_TABLE = 0; | 82 | + protected static final int MAC_TABLE = 0; |
83 | protected static final int VLAN_MPLS_TABLE = 1; | 83 | protected static final int VLAN_MPLS_TABLE = 1; |
84 | protected static final int VLAN_TABLE = 2; | 84 | protected static final int VLAN_TABLE = 2; |
85 | //protected static final int MPLS_TABLE = 3; | 85 | //protected static final int MPLS_TABLE = 3; |
... | @@ -329,7 +329,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -329,7 +329,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
329 | .withPriority(CONTROLLER_PRIORITY) | 329 | .withPriority(CONTROLLER_PRIORITY) |
330 | .fromApp(applicationId) | 330 | .fromApp(applicationId) |
331 | .makePermanent() | 331 | .makePermanent() |
332 | - .forTable(FIRST_TABLE).build(); | 332 | + .forTable(MAC_TABLE).build(); |
333 | ops = install ? ops.add(rule) : ops.remove(rule); | 333 | ops = install ? ops.add(rule) : ops.remove(rule); |
334 | } else if (c.type() == Criterion.Type.VLAN_VID) { | 334 | } else if (c.type() == Criterion.Type.VLAN_VID) { |
335 | Criteria.VlanIdCriterion v = (Criteria.VlanIdCriterion) c; | 335 | Criteria.VlanIdCriterion v = (Criteria.VlanIdCriterion) c; |
... | @@ -378,13 +378,13 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -378,13 +378,13 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
378 | @Override | 378 | @Override |
379 | public void onSuccess(FlowRuleOperations ops) { | 379 | public void onSuccess(FlowRuleOperations ops) { |
380 | pass(filt); | 380 | pass(filt); |
381 | - log.info("Provisioned default table for bgp router"); | 381 | + log.info("Applied filtering rules"); |
382 | } | 382 | } |
383 | 383 | ||
384 | @Override | 384 | @Override |
385 | public void onError(FlowRuleOperations ops) { | 385 | public void onError(FlowRuleOperations ops) { |
386 | fail(filt, ObjectiveError.FLOWINSTALLATIONFAILED); | 386 | fail(filt, ObjectiveError.FLOWINSTALLATIONFAILED); |
387 | - log.info("Failed to provision default table for bgp router"); | 387 | + log.info("Failed to apply filtering rules"); |
388 | } | 388 | } |
389 | })); | 389 | })); |
390 | } | 390 | } |
... | @@ -402,16 +402,16 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -402,16 +402,16 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
402 | } | 402 | } |
403 | 403 | ||
404 | private void pushDefaultRules() { | 404 | private void pushDefaultRules() { |
405 | - processTableZero(true); | 405 | + processMacTable(true); |
406 | - processTableOne(true); | 406 | + processVlanMplsTable(true); |
407 | - processTableTwo(true); | 407 | + processVlanTable(true); |
408 | - processTableFour(true); | 408 | + processEtherTable(true); |
409 | - processTableFive(true); | 409 | + processCosTable(true); |
410 | - processTableSix(true); | 410 | + processFibTable(true); |
411 | - processTableNine(true); | 411 | + processLocalTable(true); |
412 | } | 412 | } |
413 | 413 | ||
414 | - private void processTableZero(boolean install) { | 414 | + private void processMacTable(boolean install) { |
415 | TrafficSelector.Builder selector; | 415 | TrafficSelector.Builder selector; |
416 | TrafficTreatment.Builder treatment; | 416 | TrafficTreatment.Builder treatment; |
417 | 417 | ||
... | @@ -429,7 +429,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -429,7 +429,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
429 | .withPriority(CONTROLLER_PRIORITY) | 429 | .withPriority(CONTROLLER_PRIORITY) |
430 | .fromApp(appId) | 430 | .fromApp(appId) |
431 | .makePermanent() | 431 | .makePermanent() |
432 | - .forTable(FIRST_TABLE).build(); | 432 | + .forTable(MAC_TABLE).build(); |
433 | 433 | ||
434 | 434 | ||
435 | FlowRuleOperations.Builder ops = FlowRuleOperations.builder(); | 435 | FlowRuleOperations.Builder ops = FlowRuleOperations.builder(); |
... | @@ -450,7 +450,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -450,7 +450,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
450 | .withPriority(DROP_PRIORITY) | 450 | .withPriority(DROP_PRIORITY) |
451 | .fromApp(appId) | 451 | .fromApp(appId) |
452 | .makePermanent() | 452 | .makePermanent() |
453 | - .forTable(FIRST_TABLE).build(); | 453 | + .forTable(MAC_TABLE).build(); |
454 | 454 | ||
455 | 455 | ||
456 | ops = install ? ops.add(rule) : ops.remove(rule); | 456 | ops = install ? ops.add(rule) : ops.remove(rule); |
... | @@ -458,18 +458,18 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -458,18 +458,18 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
458 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 458 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
459 | @Override | 459 | @Override |
460 | public void onSuccess(FlowRuleOperations ops) { | 460 | public void onSuccess(FlowRuleOperations ops) { |
461 | - log.info("Provisioned default table for bgp router"); | 461 | + log.info("Provisioned mac table"); |
462 | } | 462 | } |
463 | 463 | ||
464 | @Override | 464 | @Override |
465 | public void onError(FlowRuleOperations ops) { | 465 | public void onError(FlowRuleOperations ops) { |
466 | - log.info("Failed to provision default table for bgp router"); | 466 | + log.info("Failed to provision mac table"); |
467 | } | 467 | } |
468 | })); | 468 | })); |
469 | 469 | ||
470 | } | 470 | } |
471 | 471 | ||
472 | - private void processTableOne(boolean install) { | 472 | + private void processVlanMplsTable(boolean install) { |
473 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | 473 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); |
474 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment | 474 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment |
475 | .builder(); | 475 | .builder(); |
... | @@ -494,19 +494,19 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -494,19 +494,19 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
494 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 494 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
495 | @Override | 495 | @Override |
496 | public void onSuccess(FlowRuleOperations ops) { | 496 | public void onSuccess(FlowRuleOperations ops) { |
497 | - log.info("Provisioned vlan/mpls table for bgp router"); | 497 | + log.info("Provisioned vlan/mpls table"); |
498 | } | 498 | } |
499 | 499 | ||
500 | @Override | 500 | @Override |
501 | public void onError(FlowRuleOperations ops) { | 501 | public void onError(FlowRuleOperations ops) { |
502 | log.info( | 502 | log.info( |
503 | - "Failed to provision vlan/mpls table for bgp router"); | 503 | + "Failed to provision vlan/mpls table"); |
504 | } | 504 | } |
505 | })); | 505 | })); |
506 | 506 | ||
507 | } | 507 | } |
508 | 508 | ||
509 | - private void processTableTwo(boolean install) { | 509 | + private void processVlanTable(boolean install) { |
510 | TrafficSelector.Builder selector; | 510 | TrafficSelector.Builder selector; |
511 | TrafficTreatment.Builder treatment; | 511 | TrafficTreatment.Builder treatment; |
512 | FlowRuleOperations.Builder ops = FlowRuleOperations.builder(); | 512 | FlowRuleOperations.Builder ops = FlowRuleOperations.builder(); |
... | @@ -533,17 +533,17 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -533,17 +533,17 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
533 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 533 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
534 | @Override | 534 | @Override |
535 | public void onSuccess(FlowRuleOperations ops) { | 535 | public void onSuccess(FlowRuleOperations ops) { |
536 | - log.info("Provisioned vlan table for bgp router"); | 536 | + log.info("Provisioned vlan table"); |
537 | } | 537 | } |
538 | 538 | ||
539 | @Override | 539 | @Override |
540 | public void onError(FlowRuleOperations ops) { | 540 | public void onError(FlowRuleOperations ops) { |
541 | - log.info("Failed to provision vlan table for bgp router"); | 541 | + log.info("Failed to provision vlan table"); |
542 | } | 542 | } |
543 | })); | 543 | })); |
544 | } | 544 | } |
545 | 545 | ||
546 | - private void processTableFour(boolean install) { | 546 | + private void processEtherTable(boolean install) { |
547 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | 547 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); |
548 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment | 548 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment |
549 | .builder(); | 549 | .builder(); |
... | @@ -602,18 +602,18 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -602,18 +602,18 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
602 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 602 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
603 | @Override | 603 | @Override |
604 | public void onSuccess(FlowRuleOperations ops) { | 604 | public void onSuccess(FlowRuleOperations ops) { |
605 | - log.info("Provisioned ether table for bgp router"); | 605 | + log.info("Provisioned ether table"); |
606 | } | 606 | } |
607 | 607 | ||
608 | @Override | 608 | @Override |
609 | public void onError(FlowRuleOperations ops) { | 609 | public void onError(FlowRuleOperations ops) { |
610 | - log.info("Failed to provision ether table for bgp router"); | 610 | + log.info("Failed to provision ether table"); |
611 | } | 611 | } |
612 | })); | 612 | })); |
613 | 613 | ||
614 | } | 614 | } |
615 | 615 | ||
616 | - private void processTableFive(boolean install) { | 616 | + private void processCosTable(boolean install) { |
617 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | 617 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); |
618 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment | 618 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment |
619 | .builder(); | 619 | .builder(); |
... | @@ -636,18 +636,18 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -636,18 +636,18 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
636 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 636 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
637 | @Override | 637 | @Override |
638 | public void onSuccess(FlowRuleOperations ops) { | 638 | public void onSuccess(FlowRuleOperations ops) { |
639 | - log.info("Provisioned cos table for bgp router"); | 639 | + log.info("Provisioned cos table"); |
640 | } | 640 | } |
641 | 641 | ||
642 | @Override | 642 | @Override |
643 | public void onError(FlowRuleOperations ops) { | 643 | public void onError(FlowRuleOperations ops) { |
644 | - log.info("Failed to provision cos table for bgp router"); | 644 | + log.info("Failed to provision cos table"); |
645 | } | 645 | } |
646 | })); | 646 | })); |
647 | 647 | ||
648 | } | 648 | } |
649 | 649 | ||
650 | - private void processTableSix(boolean install) { | 650 | + private void processFibTable(boolean install) { |
651 | TrafficSelector.Builder selector; | 651 | TrafficSelector.Builder selector; |
652 | TrafficTreatment.Builder treatment; | 652 | TrafficTreatment.Builder treatment; |
653 | FlowRuleOperations.Builder ops = FlowRuleOperations.builder(); | 653 | FlowRuleOperations.Builder ops = FlowRuleOperations.builder(); |
... | @@ -673,17 +673,17 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -673,17 +673,17 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
673 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 673 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
674 | @Override | 674 | @Override |
675 | public void onSuccess(FlowRuleOperations ops) { | 675 | public void onSuccess(FlowRuleOperations ops) { |
676 | - log.info("Provisioned FIB table for bgp router"); | 676 | + log.info("Provisioned FIB table"); |
677 | } | 677 | } |
678 | 678 | ||
679 | @Override | 679 | @Override |
680 | public void onError(FlowRuleOperations ops) { | 680 | public void onError(FlowRuleOperations ops) { |
681 | - log.info("Failed to provision FIB table for bgp router"); | 681 | + log.info("Failed to provision FIB table"); |
682 | } | 682 | } |
683 | })); | 683 | })); |
684 | } | 684 | } |
685 | 685 | ||
686 | - private void processTableNine(boolean install) { | 686 | + private void processLocalTable(boolean install) { |
687 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | 687 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); |
688 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment | 688 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment |
689 | .builder(); | 689 | .builder(); |
... | @@ -706,12 +706,12 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -706,12 +706,12 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
706 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { | 706 | flowRuleService.apply(ops.build(new FlowRuleOperationsContext() { |
707 | @Override | 707 | @Override |
708 | public void onSuccess(FlowRuleOperations ops) { | 708 | public void onSuccess(FlowRuleOperations ops) { |
709 | - log.info("Provisioned Local table for bgp router"); | 709 | + log.info("Provisioned Local table"); |
710 | } | 710 | } |
711 | 711 | ||
712 | @Override | 712 | @Override |
713 | public void onError(FlowRuleOperations ops) { | 713 | public void onError(FlowRuleOperations ops) { |
714 | - log.info("Failed to provision Local table for bgp router"); | 714 | + log.info("Failed to provision Local table"); |
715 | } | 715 | } |
716 | })); | 716 | })); |
717 | } | 717 | } |
... | @@ -748,6 +748,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli | ... | @@ -748,6 +748,7 @@ public class OVSCorsaPipeline extends AbstractHandlerBehaviour implements Pipeli |
748 | } | 748 | } |
749 | pass(obj); | 749 | pass(obj); |
750 | pendingGroups.invalidate(key); | 750 | pendingGroups.invalidate(key); |
751 | + log.info("Heard back from group service for group {}", obj.id()); | ||
751 | flowObjectiveStore.putNextGroup(obj.id(), new CorsaGroup(key)); | 752 | flowObjectiveStore.putNextGroup(obj.id(), new CorsaGroup(key)); |
752 | }); | 753 | }); |
753 | } | 754 | } | ... | ... |
... | @@ -38,7 +38,7 @@ import org.projectfloodlight.openflow.types.OFGroup; | ... | @@ -38,7 +38,7 @@ import org.projectfloodlight.openflow.types.OFGroup; |
38 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; | 38 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; |
39 | import org.projectfloodlight.openflow.types.TableId; | 39 | import org.projectfloodlight.openflow.types.TableId; |
40 | 40 | ||
41 | -import java.util.ArrayList; | 41 | +//import java.util.ArrayList; |
42 | import java.util.Collections; | 42 | import java.util.Collections; |
43 | import java.util.List; | 43 | import java.util.List; |
44 | import java.util.concurrent.atomic.AtomicBoolean; | 44 | import java.util.concurrent.atomic.AtomicBoolean; |
... | @@ -79,7 +79,7 @@ public class OFCorsaSwitchDriver extends AbstractOpenFlowSwitch { | ... | @@ -79,7 +79,7 @@ public class OFCorsaSwitchDriver extends AbstractOpenFlowSwitch { |
79 | */ | 79 | */ |
80 | @Override | 80 | @Override |
81 | public void write(OFMessage msg) { | 81 | public void write(OFMessage msg) { |
82 | - if (msg.getType() == OFType.FLOW_MOD) { | 82 | +/* if (msg.getType() == OFType.FLOW_MOD) { |
83 | OFFlowMod flowMod = (OFFlowMod) msg; | 83 | OFFlowMod flowMod = (OFFlowMod) msg; |
84 | OFFlowMod.Builder builder = flowMod.createBuilder(); | 84 | OFFlowMod.Builder builder = flowMod.createBuilder(); |
85 | builder.setTableId(TableId.of(LOCAL_TABLE)); | 85 | builder.setTableId(TableId.of(LOCAL_TABLE)); |
... | @@ -87,11 +87,13 @@ public class OFCorsaSwitchDriver extends AbstractOpenFlowSwitch { | ... | @@ -87,11 +87,13 @@ public class OFCorsaSwitchDriver extends AbstractOpenFlowSwitch { |
87 | } else { | 87 | } else { |
88 | channel.write(Collections.singletonList(msg)); | 88 | channel.write(Collections.singletonList(msg)); |
89 | } | 89 | } |
90 | +*/ | ||
91 | + channel.write(Collections.singletonList(msg)); | ||
90 | } | 92 | } |
91 | 93 | ||
92 | @Override | 94 | @Override |
93 | public void write(List<OFMessage> msgs) { | 95 | public void write(List<OFMessage> msgs) { |
94 | - List<OFMessage> newMsgs = new ArrayList<OFMessage>(); | 96 | +/* List<OFMessage> newMsgs = new ArrayList<OFMessage>(); |
95 | for (OFMessage msg : msgs) { | 97 | for (OFMessage msg : msgs) { |
96 | if (msg.getType() == OFType.FLOW_MOD) { | 98 | if (msg.getType() == OFType.FLOW_MOD) { |
97 | OFFlowMod flowMod = (OFFlowMod) msg; | 99 | OFFlowMod flowMod = (OFFlowMod) msg; |
... | @@ -103,6 +105,8 @@ public class OFCorsaSwitchDriver extends AbstractOpenFlowSwitch { | ... | @@ -103,6 +105,8 @@ public class OFCorsaSwitchDriver extends AbstractOpenFlowSwitch { |
103 | } | 105 | } |
104 | } | 106 | } |
105 | channel.write(newMsgs); | 107 | channel.write(newMsgs); |
108 | +*/ | ||
109 | + channel.write(msgs); | ||
106 | } | 110 | } |
107 | 111 | ||
108 | @Override | 112 | @Override | ... | ... |
... | @@ -15,18 +15,18 @@ | ... | @@ -15,18 +15,18 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.openflow.drivers; | 16 | package org.onosproject.openflow.drivers; |
17 | 17 | ||
18 | -import com.google.common.collect.Lists; | ||
19 | import org.onosproject.openflow.controller.Dpid; | 18 | import org.onosproject.openflow.controller.Dpid; |
20 | import org.projectfloodlight.openflow.protocol.OFDescStatsReply; | 19 | import org.projectfloodlight.openflow.protocol.OFDescStatsReply; |
21 | -import org.projectfloodlight.openflow.protocol.OFFlowMod; | ||
22 | import org.projectfloodlight.openflow.protocol.OFMessage; | 20 | import org.projectfloodlight.openflow.protocol.OFMessage; |
21 | +/*import com.google.common.collect.Lists; | ||
22 | +import org.projectfloodlight.openflow.protocol.OFFlowMod; | ||
23 | import org.projectfloodlight.openflow.protocol.OFType; | 23 | import org.projectfloodlight.openflow.protocol.OFType; |
24 | import org.projectfloodlight.openflow.protocol.instruction.OFInstruction; | 24 | import org.projectfloodlight.openflow.protocol.instruction.OFInstruction; |
25 | import org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable; | 25 | import org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable; |
26 | import org.projectfloodlight.openflow.types.TableId; | 26 | import org.projectfloodlight.openflow.types.TableId; |
27 | - | ||
28 | -import java.util.Collections; | ||
29 | import java.util.List; | 27 | import java.util.List; |
28 | +*/ | ||
29 | +import java.util.Collections; | ||
30 | 30 | ||
31 | public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { | 31 | public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { |
32 | 32 | ||
... | @@ -36,7 +36,7 @@ public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { | ... | @@ -36,7 +36,7 @@ public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { |
36 | 36 | ||
37 | @Override | 37 | @Override |
38 | public void transformAndSendMsg(OFMessage msg, TableType type) { | 38 | public void transformAndSendMsg(OFMessage msg, TableType type) { |
39 | - log.trace("Trying to send {} of TableType {}", msg, type); | 39 | + /*log.trace("Trying to send {} of TableType {}", msg, type); |
40 | if (msg.getType() == OFType.FLOW_MOD) { | 40 | if (msg.getType() == OFType.FLOW_MOD) { |
41 | OFFlowMod flowMod = (OFFlowMod) msg; | 41 | OFFlowMod flowMod = (OFFlowMod) msg; |
42 | OFFlowMod.Builder builder = flowMod.createBuilder(); | 42 | OFFlowMod.Builder builder = flowMod.createBuilder(); |
... | @@ -84,10 +84,10 @@ public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { | ... | @@ -84,10 +84,10 @@ public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { |
84 | break; | 84 | break; |
85 | case NONE: | 85 | case NONE: |
86 | log.error("Should never have to go to Table 0"); | 86 | log.error("Should never have to go to Table 0"); |
87 | - /*newInstructions.add( | 87 | + newInstructions.add( |
88 | gotoTable.createBuilder() | 88 | gotoTable.createBuilder() |
89 | .setTableId(TableId.of(0)).build()); | 89 | .setTableId(TableId.of(0)).build()); |
90 | - */ | 90 | + |
91 | break; | 91 | break; |
92 | default: | 92 | default: |
93 | log.warn("Unknown table type: {}", tid); | 93 | log.warn("Unknown table type: {}", tid); |
... | @@ -134,6 +134,7 @@ public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { | ... | @@ -134,6 +134,7 @@ public class OFOVSSwitchCorsaTTP extends OFCorsaSwitchDriver { |
134 | 134 | ||
135 | } else { | 135 | } else { |
136 | channel.write(Collections.singletonList(msg)); | 136 | channel.write(Collections.singletonList(msg)); |
137 | - } | 137 | + }*/ |
138 | + channel.write(Collections.singletonList(msg)); | ||
138 | } | 139 | } |
139 | } | 140 | } | ... | ... |
... | @@ -211,11 +211,12 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr | ... | @@ -211,11 +211,12 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr |
211 | fbe.operator(), fbe); | 211 | fbe.operator(), fbe); |
212 | continue; | 212 | continue; |
213 | } | 213 | } |
214 | - if (fbe.target().tableId() == 0) { | 214 | + /*if (fbe.target().tableId() == 0) { |
215 | sw.sendMsg(mod); | 215 | sw.sendMsg(mod); |
216 | } else { | 216 | } else { |
217 | sw.transformAndSendMsg(mod, getTableType(fbe.target().tableId())); | 217 | sw.transformAndSendMsg(mod, getTableType(fbe.target().tableId())); |
218 | - } | 218 | + }*/ |
219 | + sw.sendMsg(mod); | ||
219 | } | 220 | } |
220 | OFBarrierRequest.Builder builder = sw.factory() | 221 | OFBarrierRequest.Builder builder = sw.factory() |
221 | .buildBarrierRequest() | 222 | .buildBarrierRequest() | ... | ... |
-
Please register or login to post a comment