From 82277ea4281618008be01c6f1d6e02a552e0d891 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 Feb 2017 13:27:26 +0200 Subject: [PATCH] Bug-7718 Operational neutron port status networking-odl requires feedback as to when a neutron port can be marked as "ACTIVE". This commit places an estimation of that information in the operational data store. For ports that connect to OVS we wait for them to connect and for basic L2 flows to be configured. Note that we do not validate the flows in operational nor do we check all flows. Ports that are implemented purely as flows are marked ACTIVE immediately. The plan is for networking-odl to receive notifications of these status changes via a websocket. It was decided at the time being to keep the port status out of the ODL neutron project since (a) functionally, this issue is mainly an issue for netvirt and (b) to do it right in netvirt would require some re-architecting. Change-Id: Id719e904b277fe4dbb9c3d118d24c3bedf110a33 Signed-off-by: Josh --- .../elan/internal/ElanInterfaceManager.java | 9 +- .../neutronvpn/api/utils/NeutronUtils.java | 90 ++++++++++++++++++- .../neutronvpn/NeutronPortChangeListener.java | 9 +- 3 files changed, 102 insertions(+), 6 deletions(-) diff --git a/vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java b/vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java index 4c4537ce20..2e9bf03f4a 100644 --- a/vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java +++ b/vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/internal/ElanInterfaceManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -65,6 +65,7 @@ import org.opendaylight.netvirt.elan.utils.ElanForwardingEntriesHandler; import org.opendaylight.netvirt.elan.utils.ElanUtils; import org.opendaylight.netvirt.elanmanager.utils.ElanL2GwCacheUtils; import org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice; +import org.opendaylight.netvirt.neutronvpn.api.utils.NeutronUtils; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; @@ -690,8 +691,8 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase staticMacEntriesList = elanInterface.getStaticMacEntries(); List staticMacAddresses = Lists.newArrayList(); + boolean isInterfaceOperational = isOperational(interfaceInfo); if (ElanUtils.isNotEmpty(staticMacEntriesList)) { - boolean isInterfaceOperational = isOperational(interfaceInfo); for (StaticMacEntries staticMacEntry : staticMacEntriesList) { InstanceIdentifier macId = getMacEntryOperationalDataPath(elanInstanceName, staticMacEntry.getMacAddress()); @@ -729,6 +730,10 @@ public class ElanInterfaceManager extends AsyncDataTreeChangeListenerBase