Search in sources :

Example 71 with InstructionInfo

use of org.opendaylight.genius.mdsalutil.InstructionInfo 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)

Example 72 with InstructionInfo

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

the class EgressCountersServiceImpl method syncCounterFlows.

@Override
public void syncCounterFlows(ElementCountersRequest ecr, int operation) {
    int lportTag = ecr.getLportTag();
    List<MatchInfoBase> flowMatches = CountersServiceUtils.getCounterFlowMatch(ecr, lportTag, ElementCountersDirection.EGRESS);
    List<ActionInfo> actionsInfos = new ArrayList<>();
    List<InstructionInfo> instructions = CountersServiceUtils.getDispatcherTableResubmitInstructions(actionsInfos, ElementCountersDirection.EGRESS);
    BigInteger dpn = ecr.getDpn();
    String flowName = createFlowName(ecr, lportTag, dpn);
    syncFlow(dpn, NwConstants.EGRESS_COUNTERS_TABLE, flowName, CountersServiceUtils.COUNTER_TABLE_COUNTER_FLOW_PRIORITY, CountersServiceUtils.COUNTER_FLOW_NAME, 0, 0, CountersServiceUtils.COOKIE_COUNTERS_BASE, flowMatches, instructions, operation);
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) BigInteger(java.math.BigInteger) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 73 with InstructionInfo

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

the class EgressCountersServiceImpl method installDefaultCounterRules.

@Override
public void installDefaultCounterRules(String interfaceId) {
    BigInteger dpn = interfaceManager.getDpnForInterface(interfaceId);
    String defaultFlowName = CountersServiceUtils.DEFAULT_EGRESS_COUNTER_FLOW_PREFIX + dpn + interfaceId;
    List<MatchInfoBase> defaultFlowMatches = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    List<InstructionInfo> instructions = CountersServiceUtils.getDispatcherTableResubmitInstructions(actionsInfos, ElementCountersDirection.EGRESS);
    syncFlow(dpn, NwConstants.EGRESS_COUNTERS_TABLE, defaultFlowName, CountersServiceUtils.COUNTER_TABLE_DEFAULT_FLOW_PRIORITY, CountersServiceUtils.COUNTER_FLOW_NAME, 0, 0, CountersServiceUtils.COOKIE_COUNTERS_BASE, defaultFlowMatches, instructions, NwConstants.ADD_FLOW);
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) BigInteger(java.math.BigInteger) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 74 with InstructionInfo

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

the class IngressCountersServiceImpl method installDefaultCounterRules.

@Override
public void installDefaultCounterRules(String interfaceId) {
    BigInteger dpn = interfaceManager.getDpnForInterface(interfaceId);
    String defaultFlowName = CountersServiceUtils.DEFAULT_INGRESS_COUNTER_FLOW_PREFIX + dpn + interfaceId;
    List<MatchInfoBase> defaultFlowMatches = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    List<InstructionInfo> instructions = CountersServiceUtils.getDispatcherTableResubmitInstructions(actionsInfos, ElementCountersDirection.INGRESS);
    syncFlow(dpn, NwConstants.INGRESS_COUNTERS_TABLE, defaultFlowName, CountersServiceUtils.COUNTER_TABLE_DEFAULT_FLOW_PRIORITY, CountersServiceUtils.COUNTER_FLOW_NAME, 0, 0, CountersServiceUtils.COOKIE_COUNTERS_BASE, defaultFlowMatches, instructions, NwConstants.ADD_FLOW);
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) BigInteger(java.math.BigInteger) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 75 with InstructionInfo

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

the class VpnServiceChainUtils method buildLportFlowDispForVpnToScf.

/**
 * Creates the flow that sends the packet from the VPN to the SCF pipeline.
 * This usually happens when there is an ScHop whose ingressPort is a
 * VpnPseudoPort.
 * <ul>
 * <li>Matches: lportTag = vpnPseudoLPortTag, SI = 1
 * <li>Actions: setMetadata(scfTag), Go to: UpSubFilter table
 * </ul>
 */
public static FlowEntity buildLportFlowDispForVpnToScf(BigInteger dpId, int lportTag, long scfTag, short gotoTableId) {
    List<InstructionInfo> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionRegLoad(NxmNxReg2.class, 0, 31, scfTag));
    instructions.add(new InstructionApplyActions(actionsInfos));
    instructions.add(new InstructionGotoTable(gotoTableId));
    String flowRef = getL3VpnToScfLportDispatcherFlowRef(lportTag);
    List<MatchInfo> matches = buildMatchOnLportTagAndSI(lportTag, ServiceIndex.getIndex(NwConstants.SCF_SERVICE_NAME, NwConstants.SCF_SERVICE_INDEX));
    return MDSALUtil.buildFlowEntity(dpId, NwConstants.LPORT_DISPATCHER_TABLE, flowRef, CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY, flowRef, 0, 0, getCookieSCHop(scfTag), matches, instructions);
}
Also used : NxmNxReg2(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2) InstructionGotoTable(org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList) ActionRegLoad(org.opendaylight.genius.mdsalutil.actions.ActionRegLoad) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Aggregations

InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)120 ArrayList (java.util.ArrayList)113 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)74 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)74 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)63 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)52 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)41 InstructionGotoTable (org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable)34 BigInteger (java.math.BigInteger)33 MatchInfoBase (org.opendaylight.genius.mdsalutil.MatchInfoBase)33 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)27 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)17 InstructionWriteMetadata (org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata)16 ActionGroup (org.opendaylight.genius.mdsalutil.actions.ActionGroup)13 ActionNxConntrack (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack)12 ActionPuntToController (org.opendaylight.genius.mdsalutil.actions.ActionPuntToController)11 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)10 NxCtAction (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack.NxCtAction)10 MatchTunnelId (org.opendaylight.genius.mdsalutil.matches.MatchTunnelId)10 MatchIpv4Destination (org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination)9