use of org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired in project netvirt by opendaylight.
the class ElanUtils method setupMacFlows.
/**
* Setting SMAC, DMAC, UDMAC in this DPN and optionally in other DPNs.
*
* @param elanInfo
* the elan info
* @param interfaceInfo
* the interface info
* @param macTimeout
* the mac timeout
* @param macAddress
* the mac address
* @param configureRemoteFlows
* true if remote dmac flows should be configured as well
* @param writeFlowGroupTx
* the flow group tx
*/
public void setupMacFlows(ElanInstance elanInfo, InterfaceInfo interfaceInfo, long macTimeout, String macAddress, boolean configureRemoteFlows, TypedWriteTransaction<Configuration> writeFlowGroupTx) {
try (Acquired lock = lockElanMacDPN(elanInfo.getElanTag().toJava(), macAddress, interfaceInfo.getDpId())) {
setupKnownSmacFlow(elanInfo, interfaceInfo, macTimeout, macAddress, mdsalManager, writeFlowGroupTx);
setupOrigDmacFlows(elanInfo, interfaceInfo, macAddress, configureRemoteFlows, mdsalManager, writeFlowGroupTx);
}
}
use of org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired in project netvirt by opendaylight.
the class ElanEvpnFlowUtils method evpnDeleteDmacFlowsToExternalMac.
public List<ListenableFuture<?>> evpnDeleteDmacFlowsToExternalMac(EvpnDmacFlow evpnDmacFlow) {
List<ListenableFuture<?>> futures = new ArrayList<>();
try (Acquired lock = ElanUtils.lockElanMacDPN(evpnDmacFlow.getElanTag(), evpnDmacFlow.getDstMacAddress(), evpnDmacFlow.getDpId())) {
futures.addAll(evpnRemoveFlowThatSendsThePacketOnAnExternalTunnel(evpnDmacFlow.getElanTag(), evpnDmacFlow.dpId, evpnDmacFlow.getNexthopIP(), evpnDmacFlow.getDstMacAddress()));
futures.addAll(evpnDeleteEtreeDmacFlowsToExternalMac(evpnDmacFlow.getElanTag(), evpnDmacFlow.getDpId(), evpnDmacFlow.getNexthopIP(), evpnDmacFlow.getDstMacAddress()));
}
return futures;
}
use of org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired in project netvirt by opendaylight.
the class ElanInterfaceManager method installDMacAddressTables.
// Install DMAC entry on dst DPN
public List<ListenableFuture<?>> installDMacAddressTables(ElanInstance elanInfo, InterfaceInfo interfaceInfo, Uint64 dstDpId) {
String interfaceName = interfaceInfo.getInterfaceName();
ElanInterfaceMac elanInterfaceMac = elanUtils.getElanInterfaceMacByInterfaceName(interfaceName);
if (elanInterfaceMac != null && elanInterfaceMac.getMacEntry() != null) {
Map<MacEntryKey, MacEntry> macEntries = elanInterfaceMac.nonnullMacEntry();
return Collections.singletonList(ElanUtils.waitForTransactionToComplete(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> {
for (MacEntry macEntry : macEntries.values()) {
String macAddress = macEntry.getMacAddress().getValue();
LOG.info("Installing remote dmac for mac address {} and interface {}", macAddress, interfaceName);
try (Acquired lock = ElanUtils.lockElanMacDPN(elanInfo.getElanTag().toJava(), macAddress, interfaceInfo.getDpId())) {
LOG.info("Acquired lock for mac : {}, proceeding with remote dmac install operation", macAddress);
elanUtils.setupDMacFlowOnRemoteDpn(elanInfo, interfaceInfo, dstDpId, macAddress, tx);
}
}
})));
}
return emptyList();
}
Aggregations