Search in sources :

Example 31 with ActionNxResubmit

use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.

the class VxlanGreConntrackBasedSnatService method installNaptPfibFlowForVxlanGre.

protected void installNaptPfibFlowForVxlanGre(Routers routers, BigInteger dpnId, Long extNetVpnId, int addOrRemove) {
    LOG.info("installNaptPfibFlowForVxlanGre: Install Napt preFibFlow on dpId {} with matching extNetVpnId {} " + "for router {}", dpnId, extNetVpnId, routers.getRouterName());
    List<MatchInfoBase> matches = new ArrayList<>();
    matches.add(MatchEthernetType.IPV4);
    if (addOrRemove == NwConstants.ADD_FLOW) {
        matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(extNetVpnId), MetaDataUtil.METADATA_MASK_VRFID));
    }
    ArrayList<ActionInfo> listActionInfo = new ArrayList<>();
    ArrayList<InstructionInfo> instructions = new ArrayList<>();
    listActionInfo.add(new ActionNxLoadInPort(BigInteger.ZERO));
    listActionInfo.add(new ActionNxResubmit(NwConstants.L3_FIB_TABLE));
    instructions.add(new InstructionApplyActions(listActionInfo));
    String flowRef = getFlowRef(dpnId, NwConstants.NAPT_PFIB_TABLE, extNetVpnId);
    syncFlow(dpnId, NwConstants.NAPT_PFIB_TABLE, flowRef, NatConstants.SNAT_TRK_FLOW_PRIORITY, flowRef, NwConstants.COOKIE_SNAT_TABLE, matches, instructions, addOrRemove);
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) ActionNxLoadInPort(org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort) 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) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 32 with ActionNxResubmit

use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.

the class Ipv6NodeListener method createTableMissEntry.

private void createTableMissEntry(BigInteger dpnId) {
    if (!ipv6ServiceEosHandler.isClusterOwner()) {
        LOG.trace("Not a cluster Owner, skip flow programming.");
        return;
    }
    List<MatchInfo> matches = new ArrayList<>();
    List<InstructionInfo> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionNxResubmit(NwConstants.LPORT_DISPATCHER_TABLE));
    instructions.add(new InstructionApplyActions(actionsInfos));
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.IPV6_TABLE, "IPv6TableMissFlow", 0, "IPv6 Table Miss Flow", 0, 0, NwConstants.COOKIE_IPV6_TABLE, matches, instructions);
    mdsalUtil.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 33 with ActionNxResubmit

use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.

the class AclServiceOFFlowBuilder method getResubmitInstructionInfo.

/**
 * Returns resubmit instruction info to the given table ID.
 *
 * @param tableId the table id
 * @return resubmit list of InstructionInfo objects
 */
public static List<InstructionInfo> getResubmitInstructionInfo(short tableId) {
    List<InstructionInfo> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionNxResubmit(tableId));
    instructions.add(new InstructionApplyActions(actionsInfos));
    return instructions;
}
Also used : 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)

Example 34 with ActionNxResubmit

use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.

the class AbstractAclServiceImpl method getDispatcherTableResubmitInstructions.

/**
 * Gets the dispatcher table resubmit instructions based on ingress/egress service mode w.r.t switch.
 *
 * @param actionsInfos
 *            the actions infos
 * @return the instructions for dispatcher table resubmit
 */
protected List<InstructionInfo> getDispatcherTableResubmitInstructions(List<ActionInfo> actionsInfos) {
    short dispatcherTableId = NwConstants.LPORT_DISPATCHER_TABLE;
    if (ServiceModeEgress.class.equals(this.serviceMode)) {
        dispatcherTableId = NwConstants.EGRESS_LPORT_DISPATCHER_TABLE;
    }
    List<InstructionInfo> instructions = new ArrayList<>();
    actionsInfos.add(new ActionNxResubmit(dispatcherTableId));
    instructions.add(new InstructionApplyActions(actionsInfos));
    return instructions;
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Example 35 with ActionNxResubmit

use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.

the class QosNeutronUtils method addFlow.

private void addFlow(BigInteger dpnId, Short dscpValue, String ifName, IpAddress ipAddress, Interface ifState) {
    if (ifState == null) {
        LOG.trace("Could not find the ifState for interface {}", ifName);
        return;
    }
    Integer ifIndex = ifState.getIfIndex();
    List<MatchInfo> matches = new ArrayList<>();
    if (ipAddress.getIpv4Address() != null) {
        matches.add(new MatchEthernetType(NwConstants.ETHTYPE_IPV4));
    } else {
        matches.add(new MatchEthernetType(NwConstants.ETHTYPE_IPV6));
    }
    matches.add(new MatchMetadata(MetaDataUtil.getLportTagMetaData(ifIndex), MetaDataUtil.METADATA_MASK_LPORT_TAG));
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionSetFieldDscp(dscpValue));
    actionsInfos.add(new ActionNxResubmit(NwConstants.LPORT_DISPATCHER_TABLE));
    List<InstructionInfo> instructions = Collections.singletonList(new InstructionApplyActions(actionsInfos));
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.QOS_DSCP_TABLE, getQosFlowId(NwConstants.QOS_DSCP_TABLE, dpnId, ifIndex), QosConstants.QOS_DEFAULT_FLOW_PRIORITY, "QoSConfigFlow", 0, 0, NwConstants.COOKIE_QOS_TABLE, matches, instructions);
    mdsalUtils.installFlow(flowEntity);
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) ArrayList(java.util.ArrayList) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) MatchEthernetType(org.opendaylight.genius.mdsalutil.matches.MatchEthernetType) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity) BigInteger(java.math.BigInteger) ActionSetFieldDscp(org.opendaylight.genius.mdsalutil.actions.ActionSetFieldDscp) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Aggregations

ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)35 ArrayList (java.util.ArrayList)32 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)30 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)28 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)26 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)19 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)17 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)14 ActionNxLoadInPort (org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort)7 BigInteger (java.math.BigInteger)5 MatchInfoBase (org.opendaylight.genius.mdsalutil.MatchInfoBase)5 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)5 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)4 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)4 ActionSetFieldEthernetSource (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldEthernetSource)4 NxMatchCtState (org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState)4 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)4 ActionRegLoad (org.opendaylight.genius.mdsalutil.actions.ActionRegLoad)3 MatchIpv4Destination (org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination)3 List (java.util.List)2