use of org.opendaylight.genius.mdsalutil.InstructionInfo 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.InstructionInfo 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.InstructionInfo 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.InstructionInfo in project netvirt by opendaylight.
the class ElanNodeListener method addSmacBaseTableFlow.
private void addSmacBaseTableFlow(BigInteger dpId) {
// T48 - resubmit to T49 & T50
List<ActionInfo> actionsInfo = new ArrayList<>();
actionsInfo.add(new ActionNxResubmit(NwConstants.ELAN_SMAC_LEARNED_TABLE));
actionsInfo.add(new ActionNxResubmit(NwConstants.ELAN_SMAC_TABLE));
List<InstructionInfo> mkInstruct = new ArrayList<>();
mkInstruct.add(new InstructionApplyActions(actionsInfo));
List<MatchInfo> mkMatch = new ArrayList<>();
FlowEntity doubleResubmitTable = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_BASE_TABLE, getTableMissFlowRef(NwConstants.ELAN_BASE_TABLE), 0, "Elan sMac resubmit table", 0, 0, ElanConstants.COOKIE_ELAN_BASE_SMAC, mkMatch, mkInstruct);
mdsalManager.installFlow(doubleResubmitTable);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class ElanNodeListener method createLldpFlow.
private void createLldpFlow(BigInteger dpId, String dstMac, String flowName) {
List<MatchInfo> mkMatches = new ArrayList<>();
mkMatches.add(new MatchEthernetType(ElanConstants.LLDP_ETH_TYPE));
mkMatches.add(new MatchEthernetDestination(new MacAddress(dstMac)));
List<ActionInfo> listActionInfo = new ArrayList<>();
listActionInfo.add(new ActionPuntToController());
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(listActionInfo));
String flowId = dpId.toString() + NwConstants.ELAN_DMAC_TABLE + "lldp" + ElanConstants.LLDP_ETH_TYPE + dstMac;
FlowEntity lldpFlow = MDSALUtil.buildFlowEntity(dpId, NwConstants.ELAN_DMAC_TABLE, flowId, 16, flowName, 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_DMAC, mkMatches, mkInstructions);
mdsalManager.installFlow(lldpFlow);
}
Aggregations