Charles Chan
Committed by Gerrit Code Review

Driver bugfix

For OF-DPA
- Set VLAN in L3 unicast and MPLS group (required by spec)
- L3 unicast and MPLS tables do not support immediate action.
  Defer all of them.

For CpqD OF-DPA
- L3 unicast and MPLS tables do not support immediate action.
  Defer all of them.

Change-Id: I4140051d64bc5d01258b7fee2aa1faa7c8963370
...@@ -258,7 +258,11 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline { ...@@ -258,7 +258,11 @@ public class CpqdOFDPA2Pipeline extends OFDPA2Pipeline {
258 TrafficTreatment.Builder tb = DefaultTrafficTreatment.builder(); 258 TrafficTreatment.Builder tb = DefaultTrafficTreatment.builder();
259 if (fwd.treatment() != null) { 259 if (fwd.treatment() != null) {
260 for (Instruction i : fwd.treatment().allInstructions()) { 260 for (Instruction i : fwd.treatment().allInstructions()) {
261 - tb.add(i); 261 + /*
262 + * NOTE: OF-DPA does not support immediate instruction in
263 + * L3 unicast and MPLS table.
264 + */
265 + tb.deferred().add(i);
262 } 266 }
263 } 267 }
264 268
......
...@@ -766,7 +766,11 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline ...@@ -766,7 +766,11 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline
766 boolean popMpls = false; 766 boolean popMpls = false;
767 if (fwd.treatment() != null) { 767 if (fwd.treatment() != null) {
768 for (Instruction i : fwd.treatment().allInstructions()) { 768 for (Instruction i : fwd.treatment().allInstructions()) {
769 - tb.add(i); 769 + /*
770 + * NOTE: OF-DPA does not support immediate instruction in
771 + * L3 unicast and MPLS table.
772 + */
773 + tb.deferred().add(i);
770 if (i instanceof L2ModificationInstruction && 774 if (i instanceof L2ModificationInstruction &&
771 ((L2ModificationInstruction) i).subtype() == L2SubType.MPLS_POP) { 775 ((L2ModificationInstruction) i).subtype() == L2SubType.MPLS_POP) {
772 popMpls = true; 776 popMpls = true;
...@@ -1155,17 +1159,16 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline ...@@ -1155,17 +1159,16 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline
1155 } 1159 }
1156 } 1160 }
1157 1161
1158 - if (vlanid == null) {
1159 - //use the vlanid associated with the port
1160 - vlanid = port2Vlan.get(PortNumber.portNumber(portNum));
1161 - }
1162 -
1163 if (vlanid == null && meta != null) { 1162 if (vlanid == null && meta != null) {
1164 // use metadata if available 1163 // use metadata if available
1165 Criterion vidCriterion = meta.getCriterion(Type.VLAN_VID); 1164 Criterion vidCriterion = meta.getCriterion(Type.VLAN_VID);
1166 if (vidCriterion != null) { 1165 if (vidCriterion != null) {
1167 vlanid = ((VlanIdCriterion) vidCriterion).vlanId(); 1166 vlanid = ((VlanIdCriterion) vidCriterion).vlanId();
1168 } 1167 }
1168 + // if vlan is not set, use the vlan in metadata for outerTtb
1169 + if (vlanid != null && !setVlan) {
1170 + outerTtb.setVlanId(vlanid);
1171 + }
1169 } 1172 }
1170 1173
1171 if (vlanid == null) { 1174 if (vlanid == null) {
......