Segment Routing bug fix and enhancement
Bugfix: - Add MPLS BOS matching - Fix NPE caused by race between filter objective and broadcast next objective Enhancement: - Move group handler out from OFDPA pipeline - Move ARP request from rule populator to packet request Change-Id: I0ba40e10f7cb7f97277df86725fbd2546a62e890
Showing
12 changed files
with
81 additions
and
65 deletions
| ... | @@ -513,7 +513,6 @@ public class DefaultRoutingHandler { | ... | @@ -513,7 +513,6 @@ public class DefaultRoutingHandler { |
| 513 | public void populatePortAddressingRules(DeviceId deviceId) { | 513 | public void populatePortAddressingRules(DeviceId deviceId) { |
| 514 | rulePopulator.populateRouterMacVlanFilters(deviceId); | 514 | rulePopulator.populateRouterMacVlanFilters(deviceId); |
| 515 | rulePopulator.populateRouterIpPunts(deviceId); | 515 | rulePopulator.populateRouterIpPunts(deviceId); |
| 516 | - rulePopulator.populateArpPunts(deviceId); | ||
| 517 | } | 516 | } |
| 518 | 517 | ||
| 519 | /** | 518 | /** | ... | ... |
| ... | @@ -303,6 +303,7 @@ public class RoutingRulePopulator { | ... | @@ -303,6 +303,7 @@ public class RoutingRulePopulator { |
| 303 | // TODO Handle the case of Bos == false | 303 | // TODO Handle the case of Bos == false |
| 304 | sbuilder.matchEthType(Ethernet.MPLS_UNICAST); | 304 | sbuilder.matchEthType(Ethernet.MPLS_UNICAST); |
| 305 | sbuilder.matchMplsLabel(MplsLabel.mplsLabel(segmentId)); | 305 | sbuilder.matchMplsLabel(MplsLabel.mplsLabel(segmentId)); |
| 306 | + sbuilder.matchMplsBos(true); | ||
| 306 | TrafficSelector selector = sbuilder.build(); | 307 | TrafficSelector selector = sbuilder.build(); |
| 307 | 308 | ||
| 308 | // setup metadata to pass to nextObjective - indicate the vlan on egress | 309 | // setup metadata to pass to nextObjective - indicate the vlan on egress |
| ... | @@ -525,39 +526,6 @@ public class RoutingRulePopulator { | ... | @@ -525,39 +526,6 @@ public class RoutingRulePopulator { |
| 525 | } | 526 | } |
| 526 | 527 | ||
| 527 | /** | 528 | /** |
| 528 | - * Creates a forwarding objective to punt all IP packets, destined to the | ||
| 529 | - * router's port IP addresses, to the controller. Note that the input | ||
| 530 | - * port should not be matched on, as these packets can come from any input. | ||
| 531 | - * Furthermore, these are applied only by the master instance. | ||
| 532 | - * | ||
| 533 | - * @param deviceId the switch dpid for the router | ||
| 534 | - */ | ||
| 535 | - public void populateArpPunts(DeviceId deviceId) { | ||
| 536 | - if (!srManager.mastershipService.isLocalMaster(deviceId)) { | ||
| 537 | - log.debug("Not installing port-IP punts - not the master for dev:{} ", | ||
| 538 | - deviceId); | ||
| 539 | - return; | ||
| 540 | - } | ||
| 541 | - | ||
| 542 | - ForwardingObjective.Builder puntArp = DefaultForwardingObjective.builder(); | ||
| 543 | - TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder(); | ||
| 544 | - TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder(); | ||
| 545 | - sbuilder.matchEthType(Ethernet.TYPE_ARP); | ||
| 546 | - tbuilder.setOutput(PortNumber.CONTROLLER); | ||
| 547 | - puntArp.withSelector(sbuilder.build()); | ||
| 548 | - puntArp.withTreatment(tbuilder.build()); | ||
| 549 | - puntArp.withFlag(Flag.VERSATILE) | ||
| 550 | - .withPriority(HIGHEST_PRIORITY) | ||
| 551 | - .makePermanent() | ||
| 552 | - .fromApp(srManager.appId); | ||
| 553 | - log.debug("Installing forwarding objective to punt ARPs"); | ||
| 554 | - srManager.flowObjectiveService. | ||
| 555 | - forward(deviceId, | ||
| 556 | - puntArp.add(new SRObjectiveContext(deviceId, | ||
| 557 | - SRObjectiveContext.ObjectiveType.FORWARDING))); | ||
| 558 | - } | ||
| 559 | - | ||
| 560 | - /** | ||
| 561 | * Populates a forwarding objective to send packets that miss other high | 529 | * Populates a forwarding objective to send packets that miss other high |
| 562 | * priority Bridging Table entries to a group that contains all ports of | 530 | * priority Bridging Table entries to a group that contains all ports of |
| 563 | * its subnet. | 531 | * its subnet. | ... | ... |
| ... | @@ -51,6 +51,7 @@ import org.onosproject.net.flowobjective.ObjectiveContext; | ... | @@ -51,6 +51,7 @@ import org.onosproject.net.flowobjective.ObjectiveContext; |
| 51 | import org.onosproject.net.flowobjective.ObjectiveError; | 51 | import org.onosproject.net.flowobjective.ObjectiveError; |
| 52 | import org.onosproject.net.host.HostEvent; | 52 | import org.onosproject.net.host.HostEvent; |
| 53 | import org.onosproject.net.host.HostListener; | 53 | import org.onosproject.net.host.HostListener; |
| 54 | +import org.onosproject.net.packet.PacketPriority; | ||
| 54 | import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; | 55 | import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; |
| 55 | import org.onosproject.segmentrouting.config.DeviceConfiguration; | 56 | import org.onosproject.segmentrouting.config.DeviceConfiguration; |
| 56 | import org.onosproject.segmentrouting.config.SegmentRoutingConfig; | 57 | import org.onosproject.segmentrouting.config.SegmentRoutingConfig; |
| ... | @@ -90,6 +91,7 @@ import java.util.Collections; | ... | @@ -90,6 +91,7 @@ import java.util.Collections; |
| 90 | import java.util.HashSet; | 91 | import java.util.HashSet; |
| 91 | import java.util.List; | 92 | import java.util.List; |
| 92 | import java.util.Map; | 93 | import java.util.Map; |
| 94 | +import java.util.Optional; | ||
| 93 | import java.util.Set; | 95 | import java.util.Set; |
| 94 | import java.util.concurrent.ConcurrentHashMap; | 96 | import java.util.concurrent.ConcurrentHashMap; |
| 95 | import java.util.concurrent.ConcurrentLinkedQueue; | 97 | import java.util.concurrent.ConcurrentLinkedQueue; |
| ... | @@ -297,6 +299,11 @@ public class SegmentRoutingManager implements SegmentRoutingService { | ... | @@ -297,6 +299,11 @@ public class SegmentRoutingManager implements SegmentRoutingService { |
| 297 | linkService.addListener(linkListener); | 299 | linkService.addListener(linkListener); |
| 298 | deviceService.addListener(deviceListener); | 300 | deviceService.addListener(deviceListener); |
| 299 | 301 | ||
| 302 | + // Request ARP packet-in | ||
| 303 | + TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | ||
| 304 | + selector.matchEthType(Ethernet.TYPE_ARP); | ||
| 305 | + packetService.requestPackets(selector.build(), PacketPriority.CONTROL, appId, Optional.empty()); | ||
| 306 | + | ||
| 300 | cfgListener.configureNetwork(); | 307 | cfgListener.configureNetwork(); |
| 301 | 308 | ||
| 302 | log.info("Started"); | 309 | log.info("Started"); |
| ... | @@ -307,6 +314,11 @@ public class SegmentRoutingManager implements SegmentRoutingService { | ... | @@ -307,6 +314,11 @@ public class SegmentRoutingManager implements SegmentRoutingService { |
| 307 | cfgService.removeListener(cfgListener); | 314 | cfgService.removeListener(cfgListener); |
| 308 | cfgService.unregisterConfigFactory(cfgFactory); | 315 | cfgService.unregisterConfigFactory(cfgFactory); |
| 309 | 316 | ||
| 317 | + // Withdraw ARP packet-in | ||
| 318 | + TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | ||
| 319 | + selector.matchEthType(Ethernet.TYPE_ARP); | ||
| 320 | + packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId, Optional.empty()); | ||
| 321 | + | ||
| 310 | packetService.removeProcessor(processor); | 322 | packetService.removeProcessor(processor); |
| 311 | linkService.removeListener(linkListener); | 323 | linkService.removeListener(linkListener); |
| 312 | deviceService.removeListener(deviceListener); | 324 | deviceService.removeListener(deviceListener); |
| ... | @@ -697,7 +709,8 @@ public class SegmentRoutingManager implements SegmentRoutingService { | ... | @@ -697,7 +709,8 @@ public class SegmentRoutingManager implements SegmentRoutingService { |
| 697 | flowObjectiveService, | 709 | flowObjectiveService, |
| 698 | nsNextObjStore, | 710 | nsNextObjStore, |
| 699 | subnetNextObjStore, | 711 | subnetNextObjStore, |
| 700 | - portNextObjStore); | 712 | + portNextObjStore, |
| 713 | + this); | ||
| 701 | } catch (DeviceConfigNotFoundException e) { | 714 | } catch (DeviceConfigNotFoundException e) { |
| 702 | log.warn(e.getMessage() + " Aborting processDeviceAdded."); | 715 | log.warn(e.getMessage() + " Aborting processDeviceAdded."); |
| 703 | return; | 716 | return; |
| ... | @@ -766,7 +779,8 @@ public class SegmentRoutingManager implements SegmentRoutingService { | ... | @@ -766,7 +779,8 @@ public class SegmentRoutingManager implements SegmentRoutingService { |
| 766 | flowObjectiveService, | 779 | flowObjectiveService, |
| 767 | nsNextObjStore, | 780 | nsNextObjStore, |
| 768 | subnetNextObjStore, | 781 | subnetNextObjStore, |
| 769 | - portNextObjStore); | 782 | + portNextObjStore, |
| 783 | + segmentRoutingManager); | ||
| 770 | } catch (DeviceConfigNotFoundException e) { | 784 | } catch (DeviceConfigNotFoundException e) { |
| 771 | log.warn(e.getMessage() + " Aborting configureNetwork."); | 785 | log.warn(e.getMessage() + " Aborting configureNetwork."); |
| 772 | return; | 786 | return; |
| ... | @@ -836,23 +850,33 @@ public class SegmentRoutingManager implements SegmentRoutingService { | ... | @@ -836,23 +850,33 @@ public class SegmentRoutingManager implements SegmentRoutingService { |
| 836 | private ForwardingObjective.Builder getForwardingObjectiveBuilder( | 850 | private ForwardingObjective.Builder getForwardingObjectiveBuilder( |
| 837 | DeviceId deviceId, MacAddress mac, VlanId vlanId, | 851 | DeviceId deviceId, MacAddress mac, VlanId vlanId, |
| 838 | PortNumber outport) { | 852 | PortNumber outport) { |
| 853 | + // Get assigned VLAN for the subnet | ||
| 854 | + VlanId outvlan = null; | ||
| 855 | + Ip4Prefix subnet = deviceConfiguration.getPortSubnet(deviceId, outport); | ||
| 856 | + if (subnet == null) { | ||
| 857 | + outvlan = VlanId.vlanId(ASSIGNED_VLAN_NO_SUBNET); | ||
| 858 | + } else { | ||
| 859 | + outvlan = getSubnetAssignedVlanId(deviceId, subnet); | ||
| 860 | + } | ||
| 861 | + | ||
| 839 | // match rule | 862 | // match rule |
| 840 | TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder(); | 863 | TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder(); |
| 841 | sbuilder.matchEthDst(mac); | 864 | sbuilder.matchEthDst(mac); |
| 865 | + /* | ||
| 866 | + * Note: for untagged packets, match on the assigned VLAN. | ||
| 867 | + * for tagged packets, match on its incoming VLAN. | ||
| 868 | + */ | ||
| 869 | + if (vlanId.equals(VlanId.NONE)) { | ||
| 870 | + sbuilder.matchVlanId(outvlan); | ||
| 871 | + } else { | ||
| 842 | sbuilder.matchVlanId(vlanId); | 872 | sbuilder.matchVlanId(vlanId); |
| 873 | + } | ||
| 843 | 874 | ||
| 844 | TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder(); | 875 | TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder(); |
| 845 | tbuilder.immediate().popVlan(); | 876 | tbuilder.immediate().popVlan(); |
| 846 | tbuilder.immediate().setOutput(outport); | 877 | tbuilder.immediate().setOutput(outport); |
| 847 | 878 | ||
| 848 | // for switch pipelines that need it, provide outgoing vlan as metadata | 879 | // for switch pipelines that need it, provide outgoing vlan as metadata |
| 849 | - VlanId outvlan = null; | ||
| 850 | - Ip4Prefix subnet = deviceConfiguration.getPortSubnet(deviceId, outport); | ||
| 851 | - if (subnet == null) { | ||
| 852 | - outvlan = VlanId.vlanId(ASSIGNED_VLAN_NO_SUBNET); | ||
| 853 | - } else { | ||
| 854 | - outvlan = getSubnetAssignedVlanId(deviceId, subnet); | ||
| 855 | - } | ||
| 856 | TrafficSelector meta = DefaultTrafficSelector.builder() | 880 | TrafficSelector meta = DefaultTrafficSelector.builder() |
| 857 | .matchVlanId(outvlan).build(); | 881 | .matchVlanId(outvlan).build(); |
| 858 | 882 | ... | ... |
| ... | @@ -24,6 +24,7 @@ import org.onosproject.net.DeviceId; | ... | @@ -24,6 +24,7 @@ import org.onosproject.net.DeviceId; |
| 24 | import org.onosproject.net.Link; | 24 | import org.onosproject.net.Link; |
| 25 | import org.onosproject.net.flowobjective.FlowObjectiveService; | 25 | import org.onosproject.net.flowobjective.FlowObjectiveService; |
| 26 | import org.onosproject.net.link.LinkService; | 26 | import org.onosproject.net.link.LinkService; |
| 27 | +import org.onosproject.segmentrouting.SegmentRoutingManager; | ||
| 27 | import org.onosproject.segmentrouting.config.DeviceProperties; | 28 | import org.onosproject.segmentrouting.config.DeviceProperties; |
| 28 | import org.onosproject.store.service.EventuallyConsistentMap; | 29 | import org.onosproject.store.service.EventuallyConsistentMap; |
| 29 | 30 | ||
| ... | @@ -46,7 +47,7 @@ import org.onosproject.store.service.EventuallyConsistentMap; | ... | @@ -46,7 +47,7 @@ import org.onosproject.store.service.EventuallyConsistentMap; |
| 46 | * 8) what about ecmp no label case | 47 | * 8) what about ecmp no label case |
| 47 | */ | 48 | */ |
| 48 | public class DefaultEdgeGroupHandler extends DefaultGroupHandler { | 49 | public class DefaultEdgeGroupHandler extends DefaultGroupHandler { |
| 49 | - | 50 | + // TODO Access stores through srManager |
| 50 | protected DefaultEdgeGroupHandler(DeviceId deviceId, | 51 | protected DefaultEdgeGroupHandler(DeviceId deviceId, |
| 51 | ApplicationId appId, | 52 | ApplicationId appId, |
| 52 | DeviceProperties config, | 53 | DeviceProperties config, |
| ... | @@ -58,9 +59,10 @@ public class DefaultEdgeGroupHandler extends DefaultGroupHandler { | ... | @@ -58,9 +59,10 @@ public class DefaultEdgeGroupHandler extends DefaultGroupHandler { |
| 58 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, | 59 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, |
| 59 | Integer> subnetNextObjStore, | 60 | Integer> subnetNextObjStore, |
| 60 | EventuallyConsistentMap<PortNextObjectiveStoreKey, | 61 | EventuallyConsistentMap<PortNextObjectiveStoreKey, |
| 61 | - Integer> portNextObjStore) { | 62 | + Integer> portNextObjStore, |
| 63 | + SegmentRoutingManager srManager) { | ||
| 62 | super(deviceId, appId, config, linkService, flowObjService, | 64 | super(deviceId, appId, config, linkService, flowObjService, |
| 63 | - nsNextObjStore, subnetNextObjStore, portNextObjStore); | 65 | + nsNextObjStore, subnetNextObjStore, portNextObjStore, srManager); |
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | @Override | 68 | @Override | ... | ... |
| ... | @@ -87,6 +87,7 @@ public class DefaultGroupHandler { | ... | @@ -87,6 +87,7 @@ public class DefaultGroupHandler { |
| 87 | SubnetNextObjectiveStoreKey, Integer> subnetNextObjStore = null; | 87 | SubnetNextObjectiveStoreKey, Integer> subnetNextObjStore = null; |
| 88 | protected EventuallyConsistentMap< | 88 | protected EventuallyConsistentMap< |
| 89 | PortNextObjectiveStoreKey, Integer> portNextObjStore = null; | 89 | PortNextObjectiveStoreKey, Integer> portNextObjStore = null; |
| 90 | + private SegmentRoutingManager srManager; | ||
| 90 | 91 | ||
| 91 | protected KryoNamespace.Builder kryo = new KryoNamespace.Builder() | 92 | protected KryoNamespace.Builder kryo = new KryoNamespace.Builder() |
| 92 | .register(URI.class).register(HashSet.class) | 93 | .register(URI.class).register(HashSet.class) |
| ... | @@ -96,6 +97,7 @@ public class DefaultGroupHandler { | ... | @@ -96,6 +97,7 @@ public class DefaultGroupHandler { |
| 96 | .register(GroupBucketIdentifier.class) | 97 | .register(GroupBucketIdentifier.class) |
| 97 | .register(GroupBucketIdentifier.BucketOutputType.class); | 98 | .register(GroupBucketIdentifier.BucketOutputType.class); |
| 98 | 99 | ||
| 100 | + // TODO Access stores through srManager | ||
| 99 | protected DefaultGroupHandler(DeviceId deviceId, ApplicationId appId, | 101 | protected DefaultGroupHandler(DeviceId deviceId, ApplicationId appId, |
| 100 | DeviceProperties config, | 102 | DeviceProperties config, |
| 101 | LinkService linkService, | 103 | LinkService linkService, |
| ... | @@ -105,7 +107,8 @@ public class DefaultGroupHandler { | ... | @@ -105,7 +107,8 @@ public class DefaultGroupHandler { |
| 105 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, | 107 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, |
| 106 | Integer> subnetNextObjStore, | 108 | Integer> subnetNextObjStore, |
| 107 | EventuallyConsistentMap<PortNextObjectiveStoreKey, | 109 | EventuallyConsistentMap<PortNextObjectiveStoreKey, |
| 108 | - Integer> portNextObjStore) { | 110 | + Integer> portNextObjStore, |
| 111 | + SegmentRoutingManager srManager) { | ||
| 109 | this.deviceId = checkNotNull(deviceId); | 112 | this.deviceId = checkNotNull(deviceId); |
| 110 | this.appId = checkNotNull(appId); | 113 | this.appId = checkNotNull(appId); |
| 111 | this.deviceConfig = checkNotNull(config); | 114 | this.deviceConfig = checkNotNull(config); |
| ... | @@ -123,6 +126,7 @@ public class DefaultGroupHandler { | ... | @@ -123,6 +126,7 @@ public class DefaultGroupHandler { |
| 123 | this.nsNextObjStore = nsNextObjStore; | 126 | this.nsNextObjStore = nsNextObjStore; |
| 124 | this.subnetNextObjStore = subnetNextObjStore; | 127 | this.subnetNextObjStore = subnetNextObjStore; |
| 125 | this.portNextObjStore = portNextObjStore; | 128 | this.portNextObjStore = portNextObjStore; |
| 129 | + this.srManager = srManager; | ||
| 126 | 130 | ||
| 127 | populateNeighborMaps(); | 131 | populateNeighborMaps(); |
| 128 | } | 132 | } |
| ... | @@ -153,7 +157,8 @@ public class DefaultGroupHandler { | ... | @@ -153,7 +157,8 @@ public class DefaultGroupHandler { |
| 153 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, | 157 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, |
| 154 | Integer> subnetNextObjStore, | 158 | Integer> subnetNextObjStore, |
| 155 | EventuallyConsistentMap<PortNextObjectiveStoreKey, | 159 | EventuallyConsistentMap<PortNextObjectiveStoreKey, |
| 156 | - Integer> portNextObjStore) | 160 | + Integer> portNextObjStore, |
| 161 | + SegmentRoutingManager srManager) | ||
| 157 | throws DeviceConfigNotFoundException { | 162 | throws DeviceConfigNotFoundException { |
| 158 | // handle possible exception in the caller | 163 | // handle possible exception in the caller |
| 159 | if (config.isEdgeDevice(deviceId)) { | 164 | if (config.isEdgeDevice(deviceId)) { |
| ... | @@ -162,14 +167,17 @@ public class DefaultGroupHandler { | ... | @@ -162,14 +167,17 @@ public class DefaultGroupHandler { |
| 162 | flowObjService, | 167 | flowObjService, |
| 163 | nsNextObjStore, | 168 | nsNextObjStore, |
| 164 | subnetNextObjStore, | 169 | subnetNextObjStore, |
| 165 | - portNextObjStore); | 170 | + portNextObjStore, |
| 171 | + srManager | ||
| 172 | + ); | ||
| 166 | } else { | 173 | } else { |
| 167 | return new DefaultTransitGroupHandler(deviceId, appId, config, | 174 | return new DefaultTransitGroupHandler(deviceId, appId, config, |
| 168 | linkService, | 175 | linkService, |
| 169 | flowObjService, | 176 | flowObjService, |
| 170 | nsNextObjStore, | 177 | nsNextObjStore, |
| 171 | subnetNextObjStore, | 178 | subnetNextObjStore, |
| 172 | - portNextObjStore); | 179 | + portNextObjStore, |
| 180 | + srManager); | ||
| 173 | } | 181 | } |
| 174 | } | 182 | } |
| 175 | 183 | ||
| ... | @@ -663,11 +671,17 @@ public class DefaultGroupHandler { | ... | @@ -663,11 +671,17 @@ public class DefaultGroupHandler { |
| 663 | return; | 671 | return; |
| 664 | } | 672 | } |
| 665 | 673 | ||
| 674 | + VlanId assignedVlanId = | ||
| 675 | + srManager.getSubnetAssignedVlanId(this.deviceId, subnet); | ||
| 676 | + TrafficSelector metadata = | ||
| 677 | + DefaultTrafficSelector.builder().matchVlanId(assignedVlanId).build(); | ||
| 678 | + | ||
| 666 | int nextId = flowObjectiveService.allocateNextId(); | 679 | int nextId = flowObjectiveService.allocateNextId(); |
| 667 | 680 | ||
| 668 | NextObjective.Builder nextObjBuilder = DefaultNextObjective | 681 | NextObjective.Builder nextObjBuilder = DefaultNextObjective |
| 669 | .builder().withId(nextId) | 682 | .builder().withId(nextId) |
| 670 | - .withType(NextObjective.Type.BROADCAST).fromApp(appId); | 683 | + .withType(NextObjective.Type.BROADCAST).fromApp(appId) |
| 684 | + .withMeta(metadata); | ||
| 671 | 685 | ||
| 672 | ports.forEach(port -> { | 686 | ports.forEach(port -> { |
| 673 | TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); | 687 | TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); | ... | ... |
| ... | @@ -23,6 +23,7 @@ import org.onosproject.net.DeviceId; | ... | @@ -23,6 +23,7 @@ import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.net.Link; | 23 | import org.onosproject.net.Link; |
| 24 | import org.onosproject.net.flowobjective.FlowObjectiveService; | 24 | import org.onosproject.net.flowobjective.FlowObjectiveService; |
| 25 | import org.onosproject.net.link.LinkService; | 25 | import org.onosproject.net.link.LinkService; |
| 26 | +import org.onosproject.segmentrouting.SegmentRoutingManager; | ||
| 26 | import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; | 27 | import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; |
| 27 | import org.onosproject.segmentrouting.config.DeviceProperties; | 28 | import org.onosproject.segmentrouting.config.DeviceProperties; |
| 28 | import org.onosproject.store.service.EventuallyConsistentMap; | 29 | import org.onosproject.store.service.EventuallyConsistentMap; |
| ... | @@ -40,7 +41,7 @@ import org.onosproject.store.service.EventuallyConsistentMap; | ... | @@ -40,7 +41,7 @@ import org.onosproject.store.service.EventuallyConsistentMap; |
| 40 | * 2) all ports to D3 + with no label push, | 41 | * 2) all ports to D3 + with no label push, |
| 41 | */ | 42 | */ |
| 42 | public class DefaultTransitGroupHandler extends DefaultGroupHandler { | 43 | public class DefaultTransitGroupHandler extends DefaultGroupHandler { |
| 43 | - | 44 | + // TODO Access stores through srManager |
| 44 | protected DefaultTransitGroupHandler(DeviceId deviceId, | 45 | protected DefaultTransitGroupHandler(DeviceId deviceId, |
| 45 | ApplicationId appId, | 46 | ApplicationId appId, |
| 46 | DeviceProperties config, | 47 | DeviceProperties config, |
| ... | @@ -52,9 +53,10 @@ public class DefaultTransitGroupHandler extends DefaultGroupHandler { | ... | @@ -52,9 +53,10 @@ public class DefaultTransitGroupHandler extends DefaultGroupHandler { |
| 52 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, | 53 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, |
| 53 | Integer> subnetNextObjStore, | 54 | Integer> subnetNextObjStore, |
| 54 | EventuallyConsistentMap<PortNextObjectiveStoreKey, | 55 | EventuallyConsistentMap<PortNextObjectiveStoreKey, |
| 55 | - Integer> portNextObjStore) { | 56 | + Integer> portNextObjStore, |
| 57 | + SegmentRoutingManager srManager) { | ||
| 56 | super(deviceId, appId, config, linkService, flowObjService, | 58 | super(deviceId, appId, config, linkService, flowObjService, |
| 57 | - nsNextObjStore, subnetNextObjStore, portNextObjStore); | 59 | + nsNextObjStore, subnetNextObjStore, portNextObjStore, srManager); |
| 58 | } | 60 | } |
| 59 | 61 | ||
| 60 | @Override | 62 | @Override | ... | ... |
| ... | @@ -27,6 +27,7 @@ import java.util.List; | ... | @@ -27,6 +27,7 @@ import java.util.List; |
| 27 | import org.onlab.packet.MacAddress; | 27 | import org.onlab.packet.MacAddress; |
| 28 | import org.onlab.packet.MplsLabel; | 28 | import org.onlab.packet.MplsLabel; |
| 29 | import org.onosproject.core.ApplicationId; | 29 | import org.onosproject.core.ApplicationId; |
| 30 | +import org.onosproject.segmentrouting.SegmentRoutingManager; | ||
| 30 | import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; | 31 | import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; |
| 31 | import org.onosproject.segmentrouting.config.DeviceProperties; | 32 | import org.onosproject.segmentrouting.config.DeviceProperties; |
| 32 | import org.onosproject.segmentrouting.grouphandler.GroupBucketIdentifier.BucketOutputType; | 33 | import org.onosproject.segmentrouting.grouphandler.GroupBucketIdentifier.BucketOutputType; |
| ... | @@ -60,6 +61,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -60,6 +61,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 60 | * @param nsNextObjStore NeighborSet next objective store map | 61 | * @param nsNextObjStore NeighborSet next objective store map |
| 61 | * @param subnetNextObjStore subnet next objective store map | 62 | * @param subnetNextObjStore subnet next objective store map |
| 62 | */ | 63 | */ |
| 64 | + // TODO Access stores through srManager | ||
| 63 | public PolicyGroupHandler(DeviceId deviceId, | 65 | public PolicyGroupHandler(DeviceId deviceId, |
| 64 | ApplicationId appId, | 66 | ApplicationId appId, |
| 65 | DeviceProperties config, | 67 | DeviceProperties config, |
| ... | @@ -70,9 +72,10 @@ public class PolicyGroupHandler extends DefaultGroupHandler { | ... | @@ -70,9 +72,10 @@ public class PolicyGroupHandler extends DefaultGroupHandler { |
| 70 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, | 72 | EventuallyConsistentMap<SubnetNextObjectiveStoreKey, |
| 71 | Integer> subnetNextObjStore, | 73 | Integer> subnetNextObjStore, |
| 72 | EventuallyConsistentMap<PortNextObjectiveStoreKey, | 74 | EventuallyConsistentMap<PortNextObjectiveStoreKey, |
| 73 | - Integer> portNextObjStore) { | 75 | + Integer> portNextObjStore, |
| 76 | + SegmentRoutingManager srManager) { | ||
| 74 | super(deviceId, appId, config, linkService, flowObjService, | 77 | super(deviceId, appId, config, linkService, flowObjService, |
| 75 | - nsNextObjStore, subnetNextObjStore, portNextObjStore); | 78 | + nsNextObjStore, subnetNextObjStore, portNextObjStore, srManager); |
| 76 | } | 79 | } |
| 77 | 80 | ||
| 78 | public PolicyGroupIdentifier createPolicyGroupChain(String id, | 81 | public PolicyGroupIdentifier createPolicyGroupChain(String id, | ... | ... |
| ... | @@ -106,13 +106,13 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { | ... | @@ -106,13 +106,13 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { |
| 106 | 106 | ||
| 107 | for (PortNumber pnum : portnums) { | 107 | for (PortNumber pnum : portnums) { |
| 108 | // update storage | 108 | // update storage |
| 109 | - port2Vlan.put(pnum, storeVlan); | 109 | + ofdpa2GroupHandler.port2Vlan.put(pnum, storeVlan); |
| 110 | - Set<PortNumber> vlanPorts = vlan2Port.get(storeVlan); | 110 | + Set<PortNumber> vlanPorts = ofdpa2GroupHandler.vlan2Port.get(storeVlan); |
| 111 | if (vlanPorts == null) { | 111 | if (vlanPorts == null) { |
| 112 | vlanPorts = Collections.newSetFromMap( | 112 | vlanPorts = Collections.newSetFromMap( |
| 113 | new ConcurrentHashMap<PortNumber, Boolean>()); | 113 | new ConcurrentHashMap<PortNumber, Boolean>()); |
| 114 | vlanPorts.add(pnum); | 114 | vlanPorts.add(pnum); |
| 115 | - vlan2Port.put(storeVlan, vlanPorts); | 115 | + ofdpa2GroupHandler.vlan2Port.put(storeVlan, vlanPorts); |
| 116 | } else { | 116 | } else { |
| 117 | vlanPorts.add(pnum); | 117 | vlanPorts.add(pnum); |
| 118 | } | 118 | } | ... | ... |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
| ... | @@ -51,6 +51,7 @@ import org.onosproject.net.flow.criteria.Criterion.Type; | ... | @@ -51,6 +51,7 @@ import org.onosproject.net.flow.criteria.Criterion.Type; |
| 51 | import org.onosproject.net.flow.criteria.EthCriterion; | 51 | import org.onosproject.net.flow.criteria.EthCriterion; |
| 52 | import org.onosproject.net.flow.criteria.EthTypeCriterion; | 52 | import org.onosproject.net.flow.criteria.EthTypeCriterion; |
| 53 | import org.onosproject.net.flow.criteria.IPCriterion; | 53 | import org.onosproject.net.flow.criteria.IPCriterion; |
| 54 | +import org.onosproject.net.flow.criteria.MplsBosCriterion; | ||
| 54 | import org.onosproject.net.flow.criteria.MplsCriterion; | 55 | import org.onosproject.net.flow.criteria.MplsCriterion; |
| 55 | import org.onosproject.net.flow.criteria.PortCriterion; | 56 | import org.onosproject.net.flow.criteria.PortCriterion; |
| 56 | import org.onosproject.net.flow.criteria.VlanIdCriterion; | 57 | import org.onosproject.net.flow.criteria.VlanIdCriterion; |
| ... | @@ -593,9 +594,10 @@ public class SpringOpenTTP extends AbstractHandlerBehaviour | ... | @@ -593,9 +594,10 @@ public class SpringOpenTTP extends AbstractHandlerBehaviour |
| 593 | .matchEthType(Ethernet.MPLS_UNICAST) | 594 | .matchEthType(Ethernet.MPLS_UNICAST) |
| 594 | .matchMplsLabel(((MplsCriterion) | 595 | .matchMplsLabel(((MplsCriterion) |
| 595 | selector.getCriterion(Criterion.Type.MPLS_LABEL)).label()); | 596 | selector.getCriterion(Criterion.Type.MPLS_LABEL)).label()); |
| 596 | - //TODO: Add Match for BoS | 597 | + if (selector.getCriterion(Criterion.Type.MPLS_BOS) != null) { |
| 597 | - //if (selector.getCriterion(Criterion.Type.MPLS_BOS) != null) { | 598 | + filteredSelectorBuilder.matchMplsBos(((MplsBosCriterion) |
| 598 | - //} | 599 | + selector.getCriterion(Type.MPLS_BOS)).mplsBos()); |
| 600 | + } | ||
| 599 | forTableId = mplsTableId; | 601 | forTableId = mplsTableId; |
| 600 | log.debug("processing MPLS specific forwarding objective:{} in dev:{}", | 602 | log.debug("processing MPLS specific forwarding objective:{} in dev:{}", |
| 601 | fwd.id(), deviceId); | 603 | fwd.id(), deviceId); | ... | ... |
| ... | @@ -34,6 +34,7 @@ import org.onosproject.net.flow.criteria.Criterion; | ... | @@ -34,6 +34,7 @@ import org.onosproject.net.flow.criteria.Criterion; |
| 34 | import org.onosproject.net.flow.criteria.EthCriterion; | 34 | import org.onosproject.net.flow.criteria.EthCriterion; |
| 35 | import org.onosproject.net.flow.criteria.EthTypeCriterion; | 35 | import org.onosproject.net.flow.criteria.EthTypeCriterion; |
| 36 | import org.onosproject.net.flow.criteria.IPCriterion; | 36 | import org.onosproject.net.flow.criteria.IPCriterion; |
| 37 | +import org.onosproject.net.flow.criteria.MplsBosCriterion; | ||
| 37 | import org.onosproject.net.flow.criteria.MplsCriterion; | 38 | import org.onosproject.net.flow.criteria.MplsCriterion; |
| 38 | import org.onosproject.net.flow.criteria.VlanIdCriterion; | 39 | import org.onosproject.net.flow.criteria.VlanIdCriterion; |
| 39 | import org.onosproject.net.flow.instructions.Instruction; | 40 | import org.onosproject.net.flow.instructions.Instruction; |
| ... | @@ -116,9 +117,10 @@ public class SpringOpenTTPDell extends SpringOpenTTP { | ... | @@ -116,9 +117,10 @@ public class SpringOpenTTPDell extends SpringOpenTTP { |
| 116 | .matchEthType(Ethernet.MPLS_UNICAST) | 117 | .matchEthType(Ethernet.MPLS_UNICAST) |
| 117 | .matchMplsLabel(((MplsCriterion) | 118 | .matchMplsLabel(((MplsCriterion) |
| 118 | selector.getCriterion(Criterion.Type.MPLS_LABEL)).label()); | 119 | selector.getCriterion(Criterion.Type.MPLS_LABEL)).label()); |
| 119 | - //TODO: Add Match for BoS | 120 | + if (selector.getCriterion(Criterion.Type.MPLS_BOS) != null) { |
| 120 | - //if (selector.getCriterion(Criterion.Type.MPLS_BOS) != null) { | 121 | + filteredSelectorBuilder.matchMplsBos(((MplsBosCriterion) |
| 121 | - //} | 122 | + selector.getCriterion(Criterion.Type.MPLS_BOS)).mplsBos()); |
| 123 | + } | ||
| 122 | forTableId = mplsTableId; | 124 | forTableId = mplsTableId; |
| 123 | log.debug("processing MPLS specific forwarding objective"); | 125 | log.debug("processing MPLS specific forwarding objective"); |
| 124 | } | 126 | } | ... | ... |
-
Please register or login to post a comment