use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class ItmTunnelAggregationHelper method updateTunnelAggregationGroup.
private void updateTunnelAggregationGroup(InterfaceParentEntry parentEntry) {
String logicTunnelName = parentEntry.getParentInterface();
InternalTunnel logicInternalTunnel = ItmUtils.ITM_CACHE.getInternalTunnel(logicTunnelName);
if (logicInternalTunnel == null) {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: {} not found in internal tunnels list", logicTunnelName);
return;
}
InterfaceInfo ifLogicTunnel = interfaceManager.getInterfaceInfoFromOperationalDataStore(logicTunnelName);
long groupId = ifLogicTunnel != null ? interfaceManager.getLogicalTunnelSelectGroupId(ifLogicTunnel.getInterfaceTag()) : INVALID_ID;
BigInteger srcDpnId = logicInternalTunnel.getSourceDPN();
List<Bucket> listBuckets = new ArrayList<>();
List<InterfaceChildEntry> interfaceChildEntries = parentEntry.getInterfaceChildEntry();
if (interfaceChildEntries == null || interfaceChildEntries.isEmpty()) {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: empty child list in group {}", parentEntry.getParentInterface());
return;
}
for (InterfaceChildEntry interfaceChildEntry : interfaceChildEntries) {
String curChildName = interfaceChildEntry.getChildInterface();
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface childIface = ItmUtils.getInterface(curChildName, interfaceManager);
IfTunnel ifTunnel = childIface != null ? childIface.getAugmentation(IfTunnel.class) : null;
if (ifTunnel == null || !ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: not tunnel interface {} found in group {}", curChildName, logicTunnelName);
continue;
}
ParentRefs parentRefs = childIface.getAugmentation(ParentRefs.class);
if (parentRefs == null) {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: parent refs not specified for interface {} in group {}", curChildName, logicTunnelName);
continue;
}
InterfaceInfo ifInfo = interfaceManager.getInterfaceInfoFromOperationalDataStore(curChildName);
if (ifInfo == null) {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: interface state not found for {} in groupId {}", curChildName, groupId);
continue;
}
int bucketId = interfaceChildEntries.indexOf(interfaceChildEntry);
LOG.debug("MULTIPLE_VxLAN_TUNNELS: updateTunnelAggregationGroup - add bucketId {} to groupId {}", bucketId, groupId);
listBuckets.add(createBucket(curChildName, ifTunnel, bucketId, ifInfo.getPortNo()));
}
if (!listBuckets.isEmpty()) {
Group group = MDSALUtil.buildGroup(groupId, logicTunnelName, GroupTypes.GroupSelect, MDSALUtil.buildBucketLists(listBuckets));
mdsalManager.syncInstallGroup(srcDpnId, group);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class InterfacemgrProvider method getChildInterfaces.
@Override
public List<Interface> getChildInterfaces(ReadTransaction tx, String parentInterface) throws ReadFailedException {
InterfaceParentEntry parentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(tx, parentInterface);
if (parentEntry == null) {
LOG.debug("No parent entry found for {}", parentInterface);
return Collections.emptyList();
}
List<InterfaceChildEntry> childEntries = parentEntry.getInterfaceChildEntry();
if (childEntries == null || childEntries.isEmpty()) {
LOG.debug("No child entries found for parent {}", parentInterface);
return Collections.emptyList();
}
List<Interface> childInterfaces = new ArrayList<>();
for (InterfaceChildEntry childEntry : childEntries) {
String interfaceName = childEntry.getChildInterface();
Interface iface = interfaceManagerCommonUtils.getInterfaceFromConfigDS(tx, interfaceName);
if (iface != null) {
childInterfaces.add(iface);
} else {
LOG.debug("Child interface {} not found in config DS for parent interface {}", interfaceName, parentInterface);
}
}
LOG.trace("Found child interfaces {} for parent {}", childInterfaces, parentInterface);
return childInterfaces;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class OvsVlanMemberConfigRemoveHelper method removeConfiguration.
public List<ListenableFuture<Void>> removeConfiguration(ParentRefs parentRefs, Interface interfaceOld) {
LOG.debug("remove vlan member configuration {}", interfaceOld.getName());
List<ListenableFuture<Void>> futures = new ArrayList<>();
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(parentRefs.getParentInterface());
InstanceIdentifier<InterfaceParentEntry> interfaceParentEntryIid = InterfaceMetaUtils.getInterfaceParentEntryIdentifier(interfaceParentEntryKey);
InterfaceParentEntry interfaceParentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(interfaceParentEntryIid);
if (interfaceParentEntry == null) {
return futures;
}
// Configuration changes
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
// Delete the interface child information
List<InterfaceChildEntry> interfaceChildEntries = interfaceParentEntry.getInterfaceChildEntry();
InterfaceChildEntryKey interfaceChildEntryKey = new InterfaceChildEntryKey(interfaceOld.getName());
InstanceIdentifier<InterfaceChildEntry> interfaceChildEntryIid = InterfaceMetaUtils.getInterfaceChildEntryIdentifier(interfaceParentEntryKey, interfaceChildEntryKey);
tx.delete(LogicalDatastoreType.CONFIGURATION, interfaceChildEntryIid);
// If this is the last child, remove the interface parent info as well.
if (interfaceChildEntries.size() <= 1) {
tx.delete(LogicalDatastoreType.CONFIGURATION, interfaceParentEntryIid);
}
}));
// Operational changes
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = interfaceManagerCommonUtils.getInterfaceState(parentRefs.getParentInterface());
if (ifState != null) {
LOG.debug("delete vlan member interface state {}", interfaceOld.getName());
BigInteger dpId = IfmUtil.getDpnFromInterface(ifState);
interfaceManagerCommonUtils.deleteInterfaceStateInformation(interfaceOld.getName(), tx);
FlowBasedServicesUtils.removeIngressFlow(interfaceOld.getName(), dpId, txRunner, futures);
}
}));
return futures;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class OvsInterfaceConfigUpdateHelper method handleInterfaceAdminStateUpdates.
private void handleInterfaceAdminStateUpdates(WriteTransaction transaction, Interface interfaceNew, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
IfL2vlan ifL2vlan = interfaceNew.getAugmentation(IfL2vlan.class);
if (ifL2vlan == null || IfL2vlan.L2vlanMode.Trunk != ifL2vlan.getL2vlanMode() && IfL2vlan.L2vlanMode.Transparent != ifL2vlan.getL2vlanMode()) {
return;
}
LOG.info("admin-state modified for interface {}", interfaceNew.getName());
OperStatus operStatus = interfaceManagerCommonUtils.updateStateEntry(interfaceNew, transaction, ifState);
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceNew.getName());
InterfaceParentEntry interfaceParentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(interfaceParentEntryKey);
if (interfaceParentEntry == null || interfaceParentEntry.getInterfaceChildEntry() == null) {
return;
}
VlanMemberStateUpdateWorker vlanMemberStateUpdateWorker = new VlanMemberStateUpdateWorker(txRunner, operStatus, interfaceParentEntry.getInterfaceChildEntry());
coordinator.enqueueJob(interfaceNew.getName(), vlanMemberStateUpdateWorker, IfmConstants.JOB_MAX_RETRIES);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class ItmTunnelAggregationHelper method updateLogicalTunnelAdminStatus.
private void updateLogicalTunnelAdminStatus(String logicalTunnelName, Interface ifOrigin, Interface ifUpdated, InterfaceParentEntry parentEntry, WriteTransaction tx) {
if (ifOrigin == null || ifUpdated == null || ifOrigin.getAdminStatus() == ifUpdated.getAdminStatus()) {
return;
}
List<InterfaceChildEntry> interfaceChildEntries = parentEntry.getInterfaceChildEntry();
if (interfaceChildEntries == null || interfaceChildEntries.isEmpty()) {
LOG.debug("MULTIPLE_VxLAN_TUNNELS: empty child list in group {}", logicalTunnelName);
return;
}
for (InterfaceChildEntry interfaceChildEntry : interfaceChildEntries) {
String curChildInterface = interfaceChildEntry.getChildInterface();
updateInterfaceAdminStatus(curChildInterface, ifUpdated.getAdminStatus(), tx);
}
}
Aggregations