Search in sources :

Example 71 with MatchInfo

use of org.opendaylight.genius.mdsalutil.MatchInfo in project netvirt by opendaylight.

the class ElanInterfaceManager method getMatchesForFilterEqualsLPortTag.

private List<MatchInfo> getMatchesForFilterEqualsLPortTag(int lportTag) {
    List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchMetadata(MetaDataUtil.getLportTagMetaData(lportTag), MetaDataUtil.METADATA_MASK_LPORT_TAG));
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(lportTag)));
    return mkMatches;
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList)

Example 72 with MatchInfo

use of org.opendaylight.genius.mdsalutil.MatchInfo in project netvirt by opendaylight.

the class ElanEvpnFlowUtils method evpnBuildDmacFlowForExternalRemoteMac.

public Flow evpnBuildDmacFlowForExternalRemoteMac(EvpnDmacFlow evpnDmacFlow) {
    List<MatchInfo> mkMatches = ElanUtils.buildMatchesForElanTagShFlagAndDstMac(evpnDmacFlow.getElanTag(), false, evpnDmacFlow.getDstMacAddress());
    List<Instruction> mkInstructions = new ArrayList<>();
    List<Action> actions = elanItmUtils.getExternalTunnelItmEgressAction(evpnDmacFlow.getDpId(), evpnDmacFlow.getNexthopIP(), evpnDmacFlow.getVni());
    mkInstructions.add(MDSALUtil.buildApplyActionsInstruction(actions));
    Flow flow = MDSALUtil.buildFlowNew(NwConstants.ELAN_DMAC_TABLE, ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, evpnDmacFlow.getDpId(), evpnDmacFlow.getNexthopIP(), evpnDmacFlow.getDstMacAddress(), evpnDmacFlow.getElanTag(), false), 20, evpnDmacFlow.getElanName(), 0, 0, ElanConstants.COOKIE_ELAN_KNOWN_DMAC.add(BigInteger.valueOf(evpnDmacFlow.getElanTag())), mkMatches, mkInstructions);
    return flow;
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)

Example 73 with MatchInfo

use of org.opendaylight.genius.mdsalutil.MatchInfo in project netvirt by opendaylight.

the class EvpnUtils method programEvpnL2vniFlow.

private void programEvpnL2vniFlow(ElanInstance elanInfo, BiConsumer<BigInteger, FlowEntity> flowHandler) {
    long elanTag = elanInfo.getElanTag();
    List<MatchInfo> mkMatches = new ArrayList<>();
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(elanUtils.getVxlanSegmentationId(elanInfo))));
    NWUtil.getOperativeDPNs(broker).forEach(dpnId -> {
        LOG.debug("Updating tunnel flow to dpnid {}", dpnId);
        List<InstructionInfo> instructions = getInstructionsForExtTunnelTable(elanTag);
        String flowRef = getFlowRef(NwConstants.L2VNI_EXTERNAL_TUNNEL_DEMUX_TABLE, elanTag, dpnId);
        FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.L2VNI_EXTERNAL_TUNNEL_DEMUX_TABLE, flowRef, // prio
        5, // flowName
        elanInfo.getElanInstanceName(), // idleTimeout
        0, // hardTimeout
        0, ITMConstants.COOKIE_ITM_EXTERNAL.add(BigInteger.valueOf(elanTag)), mkMatches, instructions);
        flowHandler.accept(dpnId, flowEntity);
    });
}
Also used : MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity)

Example 74 with MatchInfo

use of org.opendaylight.genius.mdsalutil.MatchInfo in project netvirt by opendaylight.

the class ElanInterfaceManager method buildMatchesForVni.

private List<MatchInfo> buildMatchesForVni(Long vni) {
    List<MatchInfo> mkMatches = new ArrayList<>();
    MatchInfo match = new MatchTunnelId(BigInteger.valueOf(vni));
    mkMatches.add(match);
    return mkMatches;
}
Also used : MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList)

Example 75 with MatchInfo

use of org.opendaylight.genius.mdsalutil.MatchInfo in project netvirt by opendaylight.

the class ElanNodeListener method setupExternalL2vniTableMissFlow.

private void setupExternalL2vniTableMissFlow(BigInteger dpnId) {
    List<MatchInfo> matches = new ArrayList<>();
    List<ActionInfo> actionsInfos = Collections.singletonList(new ActionNxResubmit(NwConstants.LPORT_DISPATCHER_TABLE));
    List<InstructionInfo> instructions = Collections.singletonList(new InstructionApplyActions(actionsInfos));
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.L2VNI_EXTERNAL_TUNNEL_DEMUX_TABLE, getTableMissFlowRef(NwConstants.L2VNI_EXTERNAL_TUNNEL_DEMUX_TABLE), 0, "External L2VNI Table Miss Flow", 0, 0, ElanConstants.COOKIE_L2VNI_DEMUX, matches, instructions);
    mdsalManager.installFlow(flowEntity);
}
Also used : MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity)

Aggregations

MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)117 ArrayList (java.util.ArrayList)107 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)63 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)52 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)51 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)50 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)49 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)35 MatchTunnelId (org.opendaylight.genius.mdsalutil.matches.MatchTunnelId)24 InstructionGotoTable (org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable)23 BigInteger (java.math.BigInteger)22 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)18 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)15 Instruction (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction)15 ActionPuntToController (org.opendaylight.genius.mdsalutil.actions.ActionPuntToController)11 MatchIpv4Destination (org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination)11 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)10 MatchEthernetDestination (org.opendaylight.genius.mdsalutil.matches.MatchEthernetDestination)10 FlowId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId)10 InstructionWriteMetadata (org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata)9