}
if (!isCurrentServiceHighestPriority) {
- FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundServiceNew, iface, dataBroker, t,
+ FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundServiceNew, iface, t,
ifState.getIfIndex());
} else {
BoundServices serviceToReplace = tmpServicesMap.get(highestPriority);
- FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, serviceToReplace, iface, dataBroker, t,
+ FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, serviceToReplace, iface, t,
ifState.getIfIndex());
int vlanId = 0;
List<MatchInfo> matches = null;
}
if (matches != null) {
- FlowBasedServicesUtils.removeIngressFlow(iface, serviceToReplace, dpId, dataBroker, t);
+ FlowBasedServicesUtils.removeIngressFlow(iface, serviceToReplace, dpId, t);
FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, iface.getName(), vlanId, boundServiceNew, dataBroker, t,
matches, ifState.getIfIndex(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE);
}
List<BoundServices> boundServices = servicesInfo.getBoundServices();
if (boundServices.isEmpty()) {
// Remove entry from Ingress Table.
- FlowBasedServicesUtils.removeIngressFlow(iface, boundServiceOld, dpId, dataBroker, t);
+ FlowBasedServicesUtils.removeIngressFlow(iface, boundServiceOld, dpId, t);
if (t != null) {
futures.add(t.submit());
}
}
if (highestPriority < boundServiceOld.getServicePriority()) {
- FlowBasedServicesUtils.removeLPortDispatcherFlow(dpId, iface, boundServiceOld, dataBroker, t);
+ FlowBasedServicesUtils.removeLPortDispatcherFlow(dpId, iface, boundServiceOld, t);
if (t != null) {
futures.add(t.submit());
}
}
BoundServices toBeMoved = tmpServicesMap.get(highestPriority);
- FlowBasedServicesUtils.removeIngressFlow(iface, boundServiceOld, dpId, dataBroker, t);
+ FlowBasedServicesUtils.removeIngressFlow(iface, boundServiceOld, dpId, t);
FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, iface.getName(), vlanId, toBeMoved, dataBroker, t,
matches, ifState.getIfIndex(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE);
- FlowBasedServicesUtils.removeLPortDispatcherFlow(dpId, iface, toBeMoved, dataBroker, t);
+ FlowBasedServicesUtils.removeLPortDispatcherFlow(dpId, iface, toBeMoved, t);
if (t != null) {
futures.add(t.submit());
NodeConnectorId nodeConnectorId = FlowBasedServicesUtils.getNodeConnectorIdFromInterface(iface, dataBroker);
long portNo = Long.parseLong(IfmUtil.getPortNoFromNodeConnectorId(nodeConnectorId));
BigInteger dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId));
- Long lportTag = FlowBasedServicesUtils.getLPortTag(iface, dataBroker);
int vlanId = 0;
List<MatchInfo> matches = null;
if (iface.getType().isAssignableFrom(L2vlan.class)) {
if (matches != null) {
FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, iface.getName(), vlanId, highestPriorityBoundService,
- dataBroker, t, matches, lportTag.intValue(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE);
+ dataBroker, t, matches, ifaceState.getIfIndex(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE);
}
for (BoundServices boundService : allServices) {
if (!boundService.equals(highestPriorityBoundService)) {
- FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundService, iface,
- dataBroker, t, lportTag.intValue());
+ FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundService, iface, t, ifaceState.getIfIndex());
}
}
return futures;
}
BigInteger dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId));
- FlowBasedServicesUtils.removeIngressFlow(iface, highestPriorityBoundService, dpId,
- dataBroker, t);
+ FlowBasedServicesUtils.removeIngressFlow(iface, highestPriorityBoundService, dpId, t);
for (BoundServices boundService : allServices) {
if (!boundService.equals(highestPriorityBoundService)) {
- FlowBasedServicesUtils.removeLPortDispatcherFlow(dpId, iface, boundService, dataBroker, t);
+ FlowBasedServicesUtils.removeLPortDispatcherFlow(dpId, iface, boundService, t);
}
}
}
public static void installLPortDispatcherFlow(BigInteger dpId, BoundServices boundService, Interface iface,
- DataBroker dataBroker, WriteTransaction t, int interfaceTag) {
+ WriteTransaction t, int interfaceTag) {
LOG.debug("Installing LPort Dispatcher Flows {}, {}", dpId, iface);
short serviceIndex = boundService.getServicePriority();
String serviceRef = boundService.getServiceName();
installFlow(dpId, ingressFlow, t);
}
- public static void removeIngressFlow(Interface iface, BoundServices serviceOld, BigInteger dpId,
- DataBroker dataBroker, WriteTransaction t) {
+ public static void removeIngressFlow(Interface iface, BoundServices serviceOld, BigInteger dpId, WriteTransaction t) {
LOG.debug("Removing Ingress Flows");
String flowKeyStr = getFlowRef(dpId, iface.getName(), serviceOld);
FlowKey flowKey = new FlowKey(new FlowId(flowKeyStr));
t.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
}
- public static void removeLPortDispatcherFlow(BigInteger dpId, Interface iface, BoundServices boundServicesOld,
- DataBroker dataBroker, WriteTransaction t) {
+ public static void removeLPortDispatcherFlow(BigInteger dpId, Interface iface, BoundServices boundServicesOld, WriteTransaction t) {
LOG.debug("Removing LPort Dispatcher Flows {}, {}", dpId, iface);
- Long interfaceTag = FlowBasedServicesUtils.getLPortTag(iface, dataBroker);
StypeOpenflow stypeOpenFlow = boundServicesOld.getAugmentation(StypeOpenflow.class);
- String flowKeyStr = iface.getName() + boundServicesOld.getServicePriority() +
- boundServicesOld.getServiceName() + stypeOpenFlow.getDispatcherTableId();
- FlowKey flowKey = new FlowKey(new FlowId(flowKeyStr));
+ // build the flow and install it
+ String flowRef = getFlowRef(dpId, iface.getName(), boundServicesOld);
+ FlowKey flowKey = new FlowKey(new FlowId(flowRef));
Node nodeDpn = buildInventoryDpnNode(dpId);
InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)