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 {
TrafficTreatment.Builder tb = DefaultTrafficTreatment.builder();
if (fwd.treatment() != null) {
for (Instruction i : fwd.treatment().allInstructions()) {
tb.add(i);
/*
* NOTE: OF-DPA does not support immediate instruction in
* L3 unicast and MPLS table.
*/
tb.deferred().add(i);
}
}
......
......@@ -766,7 +766,11 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline
boolean popMpls = false;
if (fwd.treatment() != null) {
for (Instruction i : fwd.treatment().allInstructions()) {
tb.add(i);
/*
* NOTE: OF-DPA does not support immediate instruction in
* L3 unicast and MPLS table.
*/
tb.deferred().add(i);
if (i instanceof L2ModificationInstruction &&
((L2ModificationInstruction) i).subtype() == L2SubType.MPLS_POP) {
popMpls = true;
......@@ -1155,17 +1159,16 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline
}
}
if (vlanid == null) {
//use the vlanid associated with the port
vlanid = port2Vlan.get(PortNumber.portNumber(portNum));
}
if (vlanid == null && meta != null) {
// use metadata if available
Criterion vidCriterion = meta.getCriterion(Type.VLAN_VID);
if (vidCriterion != null) {
vlanid = ((VlanIdCriterion) vidCriterion).vlanId();
}
// if vlan is not set, use the vlan in metadata for outerTtb
if (vlanid != null && !setVlan) {
outerTtb.setVlanId(vlanid);
}
}
if (vlanid == null) {
......