Committed by
Ray Milkey
CORD-48 Added support for broadcast next objective in OFDPA driver.
Changed groupid to show in hex for cli command 'groups' Change-Id: I86474912a9fd775c36d5bc49545eaa58ecc46b47
Showing
5 changed files
with
27 additions
and
4 deletions
... | @@ -577,6 +577,7 @@ public class DefaultGroupHandler { | ... | @@ -577,6 +577,7 @@ public class DefaultGroupHandler { |
577 | 577 | ||
578 | ports.forEach(port -> { | 578 | ports.forEach(port -> { |
579 | TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); | 579 | TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); |
580 | + tBuilder.popVlan(); | ||
580 | tBuilder.setOutput(port); | 581 | tBuilder.setOutput(port); |
581 | nextObjBuilder.addTreatment(tBuilder.build()); | 582 | nextObjBuilder.addTreatment(tBuilder.build()); |
582 | }); | 583 | }); | ... | ... |
... | @@ -121,11 +121,11 @@ public class GroupsListCommand extends AbstractShellCommand { | ... | @@ -121,11 +121,11 @@ public class GroupsListCommand extends AbstractShellCommand { |
121 | private void printGroups(DeviceId deviceId, List<Group> groups) { | 121 | private void printGroups(DeviceId deviceId, List<Group> groups) { |
122 | print("deviceId=%s", deviceId); | 122 | print("deviceId=%s", deviceId); |
123 | for (Group group : groups) { | 123 | for (Group group : groups) { |
124 | - print(FORMAT, group.id().id(), group.state(), group.type(), | 124 | + print(FORMAT, Integer.toHexString(group.id().id()), group.state(), group.type(), |
125 | group.bytes(), group.packets(), group.appId().name()); | 125 | group.bytes(), group.packets(), group.appId().name()); |
126 | int i = 0; | 126 | int i = 0; |
127 | for (GroupBucket bucket:group.buckets().buckets()) { | 127 | for (GroupBucket bucket:group.buckets().buckets()) { |
128 | - print(BUCKET_FORMAT, group.id().id(), ++i, | 128 | + print(BUCKET_FORMAT, Integer.toHexString(group.id().id()), ++i, |
129 | bucket.bytes(), bucket.packets(), | 129 | bucket.bytes(), bucket.packets(), |
130 | bucket.treatment().allInstructions()); | 130 | bucket.treatment().allInstructions()); |
131 | } | 131 | } | ... | ... |
... | @@ -630,7 +630,8 @@ public final class Instructions { | ... | @@ -630,7 +630,8 @@ public final class Instructions { |
630 | @Override | 630 | @Override |
631 | public String toString() { | 631 | public String toString() { |
632 | return toStringHelper(type().toString()) | 632 | return toStringHelper(type().toString()) |
633 | - .add("group ID", groupId.id()).toString(); | 633 | + .addValue("group ID=0x" + Integer.toHexString(groupId.id())) |
634 | + .toString(); | ||
634 | } | 635 | } |
635 | 636 | ||
636 | @Override | 637 | @Override | ... | ... |
... | @@ -18,7 +18,10 @@ package org.onosproject.driver.pipeline; | ... | @@ -18,7 +18,10 @@ package org.onosproject.driver.pipeline; |
18 | import static org.slf4j.LoggerFactory.getLogger; | 18 | import static org.slf4j.LoggerFactory.getLogger; |
19 | 19 | ||
20 | import java.util.ArrayList; | 20 | import java.util.ArrayList; |
21 | +import java.util.Collections; | ||
21 | import java.util.List; | 22 | import java.util.List; |
23 | +import java.util.Set; | ||
24 | +import java.util.concurrent.ConcurrentHashMap; | ||
22 | 25 | ||
23 | import org.onlab.packet.VlanId; | 26 | import org.onlab.packet.VlanId; |
24 | import org.onosproject.core.ApplicationId; | 27 | import org.onosproject.core.ApplicationId; |
... | @@ -54,11 +57,16 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { | ... | @@ -54,11 +57,16 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { |
54 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); | 57 | TrafficSelector.Builder selector = DefaultTrafficSelector.builder(); |
55 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder(); | 58 | TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder(); |
56 | selector.matchVlanId(vidCriterion.vlanId()); | 59 | selector.matchVlanId(vidCriterion.vlanId()); |
60 | + treatment.transition(TMAC_TABLE); | ||
61 | + | ||
62 | + VlanId storeVlan = null; | ||
57 | if (vidCriterion.vlanId() == VlanId.NONE) { | 63 | if (vidCriterion.vlanId() == VlanId.NONE) { |
58 | // untagged packets are assigned vlans | 64 | // untagged packets are assigned vlans |
59 | treatment.pushVlan().setVlanId(assignedVlan); | 65 | treatment.pushVlan().setVlanId(assignedVlan); |
66 | + storeVlan = assignedVlan; | ||
67 | + } else { | ||
68 | + storeVlan = vidCriterion.vlanId(); | ||
60 | } | 69 | } |
61 | - treatment.transition(TMAC_TABLE); | ||
62 | 70 | ||
63 | // ofdpa cannot match on ALL portnumber, so we need to use separate | 71 | // ofdpa cannot match on ALL portnumber, so we need to use separate |
64 | // rules for each port. | 72 | // rules for each port. |
... | @@ -72,7 +80,20 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { | ... | @@ -72,7 +80,20 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { |
72 | } else { | 80 | } else { |
73 | portnums.add(portCriterion.port()); | 81 | portnums.add(portCriterion.port()); |
74 | } | 82 | } |
83 | + | ||
75 | for (PortNumber pnum : portnums) { | 84 | for (PortNumber pnum : portnums) { |
85 | + // update storage | ||
86 | + port2Vlan.put(pnum, storeVlan); | ||
87 | + Set<PortNumber> vlanPorts = vlan2Port.get(storeVlan); | ||
88 | + if (vlanPorts == null) { | ||
89 | + vlanPorts = Collections.newSetFromMap( | ||
90 | + new ConcurrentHashMap<PortNumber, Boolean>()); | ||
91 | + vlanPorts.add(pnum); | ||
92 | + vlan2Port.put(storeVlan, vlanPorts); | ||
93 | + } else { | ||
94 | + vlanPorts.add(pnum); | ||
95 | + } | ||
96 | + // create rest of flowrule | ||
76 | selector.matchInPort(pnum); | 97 | selector.matchInPort(pnum); |
77 | FlowRule rule = DefaultFlowRule.builder() | 98 | FlowRule rule = DefaultFlowRule.builder() |
78 | .forDevice(deviceId) | 99 | .forDevice(deviceId) | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment