use of org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable in project netvirt by opendaylight.
the class ElanInterfaceManager method getInstructionsIntOrExtTunnelTable.
/**
* Builds the list of instructions to be installed in the INTERNAL_TUNNEL_TABLE (36) / EXTERNAL_TUNNEL_TABLE (38)
* which so far consists of writing the elanTag in metadata and send the packet to ELAN_DMAC_TABLE.
*
* @param elanTag
* elanTag to be written in metadata when flow is selected
* @return the instructions ready to be installed in a flow
*/
private List<InstructionInfo> getInstructionsIntOrExtTunnelTable(Long elanTag) {
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionWriteMetadata(ElanHelper.getElanMetadataLabel(elanTag), ElanHelper.getElanMetadataMask()));
/* applicable for EXTERNAL_TUNNEL_TABLE only
* TODO: We should point to SMAC or DMAC depending on a configuration property to enable mac learning
*/
mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_DMAC_TABLE));
return mkInstructions;
}
use of org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable in project netvirt by opendaylight.
the class ElanNodeListener method setupTableMissDmacFlow.
private void setupTableMissDmacFlow(BigInteger dpId) {
List<MatchInfo> mkMatches = new ArrayList<>();
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_UNKNOWN_DMAC_TABLE));
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_DMAC_TABLE, getTableMissFlowRef(NwConstants.ELAN_DMAC_TABLE), 0, "ELAN dMac Table Miss Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_DMAC, mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable in project netvirt by opendaylight.
the class ElanNodeListener method setupTableMissSmacFlow.
private void setupTableMissSmacFlow(BigInteger dpId) {
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionPuntToController());
actionsInfos.add(new ActionLearn(0, tempSmacLearnTimeout, 0, ElanConstants.COOKIE_ELAN_LEARNED_SMAC, 0, NwConstants.ELAN_SMAC_LEARNED_TABLE, 0, 0, Arrays.asList(new ActionLearn.MatchFromField(NwConstants.NxmOfFieldType.NXM_OF_ETH_SRC.getType(), NwConstants.NxmOfFieldType.NXM_OF_ETH_SRC.getType(), NwConstants.NxmOfFieldType.NXM_OF_ETH_SRC.getFlowModHeaderLenInt()), new ActionLearn.MatchFromField(NwConstants.NxmOfFieldType.NXM_NX_REG1.getType(), NwConstants.NxmOfFieldType.NXM_NX_REG1.getType(), ElanConstants.INTERFACE_TAG_LENGTH), new ActionLearn.CopyFromValue(LEARN_MATCH_REG4_VALUE, NwConstants.NxmOfFieldType.NXM_NX_REG4.getType(), 8))));
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(actionsInfos));
mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_DMAC_TABLE));
List<MatchInfo> mkMatches = new ArrayList<>();
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE, getTableMissFlowRef(NwConstants.ELAN_SMAC_TABLE), 0, "ELAN sMac Table Miss Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_SMAC, mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
addSmacBaseTableFlow(dpId);
addSmacLearnedTableFlow(dpId);
}
use of org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable in project netvirt by opendaylight.
the class ElanNodeListener method addSmacLearnedTableFlow.
private void addSmacLearnedTableFlow(BigInteger dpId) {
// T50 - match on Reg4 and goto T51
List<MatchInfoBase> mkMatches = new ArrayList<>();
mkMatches.add(new NxMatchRegister(NxmNxReg4.class, LEARN_MATCH_REG4_VALUE));
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionGotoTable(NwConstants.ELAN_DMAC_TABLE));
String flowRef = new StringBuffer().append(NwConstants.ELAN_SMAC_TABLE).append(NwConstants.FLOWID_SEPARATOR).append(LEARN_MATCH_REG4_VALUE).toString();
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_SMAC_TABLE, flowRef, 10, "ELAN sMac Table Reg4 Flow", 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_SMAC.add(BigInteger.valueOf(LEARN_MATCH_REG4_VALUE)), mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable in project netvirt by opendaylight.
the class AclServiceUtils method createCtMarkInstructionForNewState.
/**
* This method creates and returns the ct_mark instruction when a ACL rule removed from the
* instance. This instruction will reset the ct_mark value and stops the existing traffics.
*
* @param filterTable the filterTable
* @param elanId the Elan id
* @return list of instruction
*/
public static List<InstructionInfo> createCtMarkInstructionForNewState(Short filterTable, Long elanId) {
List<InstructionInfo> instructions = new ArrayList<>();
List<ActionInfo> actionsInfos = new ArrayList<>();
List<NxCtAction> ctActionsList = new ArrayList<>();
NxCtAction nxCtMarkClearAction = new ActionNxConntrack.NxCtMark(AclConstants.CT_MARK_NEW_STATE);
ctActionsList.add(nxCtMarkClearAction);
ActionNxConntrack actionNxConntrack = new ActionNxConntrack(2, 1, 0, elanId.intValue(), (short) 255, ctActionsList);
actionsInfos.add(actionNxConntrack);
instructions.add(new InstructionApplyActions(actionsInfos));
instructions.add(new InstructionGotoTable(filterTable));
return instructions;
}
Aggregations