netvirt.git
6 years agoDrop obsolete Maven site configuration 34/65934/1
Stephen Kitt [Mon, 27 Nov 2017 17:03:47 +0000 (18:03 +0100)]
Drop obsolete Maven site configuration

See
https://lists.opendaylight.org/pipermail/odlparent-dev/2017-November/001492.html

Change-Id: Id3fb2f82521cfe9ac7f0e2d0356a3b59db0f36a2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoRemove Ipv6ServiceUtils static instance 78/65878/3
Tom Pantelis [Fri, 24 Nov 2017 01:34:46 +0000 (20:34 -0500)]
Remove Ipv6ServiceUtils static instance

Make it a proper singleton. Also some of the conversion and
calculation methods are true utilities and thus were made static
to avoid having to inject it.

Change-Id: If96656895c5150024ab5b9d56fc3fed8ce26ba89
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoMake ipv6service-impl classes thread-safe 77/65877/2
Tom Pantelis [Fri, 24 Nov 2017 00:17:46 +0000 (19:17 -0500)]
Make ipv6service-impl classes thread-safe

IfMgr, VirtualPort, VirtualRouter et al contain fields and Maps that aren't
synchronized. Make mutable fields volatile and use ConcurrentMaps.

Also Ipv6TimerWheel is only used by IfMgr so create a local instance instead
of a static instance and close it properly.

Change-Id: I2fef4df14a4efa5d65984040b40deade9d71bfe7
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert elanmanager-impl to use JobCoordinator 70/65670/10
Tom Pantelis [Fri, 17 Nov 2017 04:45:21 +0000 (23:45 -0500)]
Convert elanmanager-impl to use JobCoordinator

Change-Id: I8c104820589bab6a395e70545486007033a0ef6d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in elanmanager-impl 20/65520/25
Tom Pantelis [Wed, 22 Nov 2017 13:07:05 +0000 (08:07 -0500)]
Fix FindBugs violations and enable enforcement in elanmanager-impl

See in-line comments

Change-Id: I4d8b7cf418ebb0aa46435de3c5cb2b3b06440b71
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in natservice 46/65846/3
Tom Pantelis [Wed, 22 Nov 2017 16:27:13 +0000 (11:27 -0500)]
Fix FindBugs violations and enable enforcement in natservice

See in-line comments

Change-Id: I831e0a60048cddce1224356ae27f3e8359ea17d2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in ipv6service 56/65856/3
Tom Pantelis [Wed, 22 Nov 2017 22:20:46 +0000 (17:20 -0500)]
Fix FindBugs violations and enable enforcement in ipv6service

See in-line comments.

Eliminated the static instances for IfMgr and Ipv6PeriodicTrQueue.

The ShowIpv6Command class referenced the static IfMgr instance.
I extracted an interface, ElementCache, for the IfMgr whicb is
advertsed as a service and injected into ShowIpv6Command. The shell
bundle shouldn't reference packages in the impl bundle so I also
extracted interfaces for VirtualRouter, VirtualPort et al.

Ipv6ServiceImpl basically just wired the static instances - since
this is no longer needed, Ipv6ServiceImpl was removed.

Change-Id: I635ff43cffded41c7a32079214cff48a057f4fac
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in aclservice 77/65777/5
Tom Pantelis [Tue, 21 Nov 2017 02:29:12 +0000 (21:29 -0500)]
Fix FindBugs violations and enable enforcement in aclservice

See in-line comments

Change-Id: If57c4a0c1a9478daaffeb08132bdf117ecbd59a6
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix the fix for the bad transaction leak in VpnInterfaceManager 35/65835/1
Michael Vorburger [Wed, 22 Nov 2017 09:58:20 +0000 (10:58 +0100)]
Fix the fix for the bad transaction leak in VpnInterfaceManager

In 0c3a7e3103fea3dc039519ab4d4497fd218dc3d8 for
I0f62fcc17c037365c9384e56c9f6f5a430693c20 there was a left-over
tx.submit() that should have also been removed as part of it (because
callWithNewWriteOnlyTransactionAndSubmit already does that, as its name
says).  This fixes the follow new error which started appearing in CSIT
logs since that was merged:

2017-11-21 18:05:05,592 | ERROR | ChangeHandler-77 | L3vpnPopulator
| 349 - org.opendaylight.netvirt.vpnmanager-impl - 0.6.0.SNAPSHOT |
Future (eventually) failed: addToLabelMapper
java.lang.UnsupportedOperationException: submit() cannot be used inside
a Managed[New]TransactionRunner

see https://jira.opendaylight.org/browse/NETVIRT-985

Change-Id: Ic2c8b02670242f3a3f190860c205d7d70c2939b3
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoEVPN RT2 : L2VNI demux table changes 27/58927/15
Vyshakh Krishnan CH [Mon, 10 Jul 2017 14:11:37 +0000 (19:41 +0530)]
EVPN RT2 : L2VNI demux table changes

When a packet comes from another DC in evpn RT2 scenario, it lands up in
table 24(l2vni demux table) from where the elan tag is derived and send
to destination mac table

Change-Id: I3ddf1b0d086a78eb1b2cc7a2760f02bf1c55ae4d
Signed-off-by: Vyshakh Krishnan CH <vyshakh.krishnan.c.h@ericsson.com>
6 years agoNETVIRT-937: Fix NPE in ElanInstanceManager 21/65821/2
Tom Pantelis [Tue, 21 Nov 2017 22:50:27 +0000 (17:50 -0500)]
NETVIRT-937: Fix NPE in ElanInstanceManager

2017-11-21 16:21:43,179 | ERROR | nPool-1-worker-2 | JobCoordinatorImpl               | 261 - org.opendaylight.infrautils.jobcoordinator-impl - 1.3.0.SNAPSHOT | Runnnable likely about to terminate thread due to uncaught exception; but here is useful debugging context: JobEntry{key='elaninterface-963a4d35-297e-4757-be14-6c3dec354221', mainWorker=org.opendaylight.netvirt.elan.internal.ElanInstanceManagerElanInstanceManager$$Lambda$774/1098386956@516cbba2, rollbackWorker=null, retryCount=6, futures=[null, com.google.common.util.concurrent.ImmediateFuture$ImmediateSuccessfulCheckedFuture@39325841]}
java.lang.NullPointerException: at index 0
at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:235)[27:com.google.guava:22.0.0]
at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:225)[27:com.google.guava:22.0.0]
at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:219)[27:com.google.guava:22.0.0]
at com.google.common.collect.ImmutableList.construct(ImmutableList.java:342)[27:com.google.guava:22.0.0]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:257)[27:com.google.guava:22.0.0]
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:228)[27:com.google.guava:22.0.0]
at com.google.common.util.concurrent.Futures.allAsList(Futures.java:835)[27:com.google.guava:22.0.0]
at org.opendaylight.infrautils.jobcoordinator.internal.JobCoordinatorImpl$MainTask.runWithUncheckedExceptionLogging(JobCoordinatorImpl.java:369)[261:org.opendaylight.infrautils.jobcoordinator-impl:1.3.0.SNAPSHOT]

The futures List in remove is reused across the submitted jobs in the forEach loop
which is unsafe as the List is accessed by multiple threads. Each job now returns its
own local futures List.

The futures returned from elanInterfaceManager.removeElanInterface
were also added to the List but I don't see the purpose of this. removeElanInterface
waits for those tx's to complete. Maybe it was so the JC would retry them? If so, this
entire code path has a mix of sync and async transactions which is a bit confusing -
some are submitted to the JC, ohers aren't; some may be retried, others aren't.

Change-Id: I82193fc36a339db42b83df5bfa3d17ff0a88dfa0
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix NPE in NeutronvpnManager 19/65819/2
Tom Pantelis [Tue, 21 Nov 2017 20:54:24 +0000 (15:54 -0500)]
Fix NPE in NeutronvpnManager

CSIT log shows:

2017-11-21 17:20:01,945 | ERROR | nPool-1-worker-3 | JobCoordinatorImpl               | 261 - org.opendaylight.infrautils.jobcoordinator-impl - 1.3.0.SNAPSHOT | Exception when executing jobEntry: JobEntry{key='PORT-f08a0cc9-49aa-4db8-b69b-dcc486817764', mainWorker=org.opendaylight.netvirt.neutronvpn.NeutronvpnManager$$Lambda$825/713684833@92010fc, rollbackWorker=null, retryCount=0, futures=null}
java.lang.NullPointerException
at org.opendaylight.netvirt.neutronvpn.NeutronvpnManager.withdrawPortIpFromVpnIface(NeutronvpnManager.java:817)
at org.opendaylight.netvirt.neutronvpn.NeutronvpnManager.lambda$removeSubnetFromVpn$2(NeutronvpnManager.java:1413)

This line:

  if (sn == null || !adj.getSubnetId().equals(sn.getId()))

I assume adj isn't null in which case getSubnetId() must be null. I changed it to
use Objects.equals which means the equals check would evaluate to false if
getSubnetId() is null (unless sn.getId() is also null). I assume this is correct.

Change-Id: Ib769273ee805e333fc96d0fcb83db15da056f69e
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix NPE in VpnSubnetRouteHandler 18/65818/2
Tom Pantelis [Tue, 21 Nov 2017 20:36:14 +0000 (15:36 -0500)]
Fix NPE in VpnSubnetRouteHandler

CSIT log shows several of these:

2017-11-21 16:51:37,973 | ERROR | nPool-1-worker-0 | VpnSubnetRouteHandler            | 349 - org.opendaylight.netvirt.vpnmanager-impl - 0.6.0.SNAPSHOT | SUBNETROUTE: onInterfaceDown: SubnetOpDataEntry update on interface 174fcd9a-f2fc-4f70-bc1e-9a42755175ea down event for subnet 9189b34e-b7be-40ff-9bd4-8c0d0a4f96f3 falied {}
java.lang.NullPointerException
at org.opendaylight.netvirt.vpnmanager.VpnSubnetRouteHandler.electNewDpnForSubnetRoute(VpnSubnetRouteHandler.java:988)
at org.opendaylight.netvirt.vpnmanager.VpnSubnetRouteHandler.onInterfaceDown(VpnSubnetRouteHandler.java:649)
at org.opendaylight.netvirt.vpnmanager.SubnetRouteInterfaceStateChangeListener.lambda$remove$1(SubnetRouteInterfaceStateChangeListener.java:154)

networkId is purposely passed as null in several call sites. It is only used to extract
the String value to pass to addSubnetRouteToFib which passes to L3vpnInput#setNetworkName.
From there is looks like null network name is handled.

Change-Id: Ie86c2ead79d4431a06e04526dc415f58c893d461
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix NPE in SubnetmapChangeListener 17/65817/2
Tom Pantelis [Tue, 21 Nov 2017 20:26:02 +0000 (15:26 -0500)]
Fix NPE in SubnetmapChangeListener

CSIT log shows a ton of these:

java.lang.NullPointerException
at org.opendaylight.netvirt.vpnmanager.SubnetmapChangeListener.update(SubnetmapChangeListener.java:119)[349:org.opendaylight.netvirt.vpnmanager-impl:0.6.0.SNAPSHOT]
at org.opendaylight.netvirt.vpnmanager.SubnetmapChangeListener.update(SubnetmapChangeListener.java:31)[349:org.opendaylight.netvirt.vpnmanager-impl:0.6.0.SNAPSHOT]
at org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase$DataTreeChangeHandler.run(AsyncDataTreeChangeListenerBase.java:152)[247:org.opendaylight.genius.mdsalutil-api:0.4.0.SNAPSHOT]

Either vpnIdOld or subnetId was null when calling getValue(). We could check for
null in all places they're being logged but I just changed it to pass the
reference as Uuid's toString will print the internal value.

Change-Id: I6c88177a476f38c38189bddfb55a62cfba61d9a9
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoBug 9188 Removing the ODL thrift IP check 04/65704/2
Loshmitha [Mon, 20 Nov 2017 09:34:00 +0000 (15:04 +0530)]
Bug 9188 Removing the ODL thrift IP check

In RHEL,ODL MIP will not be hosted in the BGP EOS owner and it will be
in HA proxy.So removing the availability and check for this IP in the
code.Check was not required as QBGP has replay mechanism whenever the IP
comes up

Change-Id: I79a6cfddb36dd9c7b2322615bf3871a9bfdc7e44
Signed-off-by: Loshmitha <loshmitha@ericsson.com>
6 years agoSmall optimization in ipv6service code 01/65801/3
Sridhar Gaddam [Tue, 21 Nov 2017 14:31:49 +0000 (20:01 +0530)]
Small optimization in ipv6service code

Change-Id: Ibc6d4431d9139826ede38c6708b70130d5a32030
Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
6 years agoFix FindBugs violations and enable enforcement in qosservice 06/65806/3
Tom Pantelis [Tue, 21 Nov 2017 15:49:37 +0000 (10:49 -0500)]
Fix FindBugs violations and enable enforcement in qosservice

See in-line comments.

Change-Id: I323e23bccdfcc526ceb3f62148292152f5dc5738
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoNETVIRT-1000: protect VpnInterfaceManager::remove 43/65743/5
Stephen Kitt [Mon, 20 Nov 2017 16:53:11 +0000 (17:53 +0100)]
NETVIRT-1000: protect VpnInterfaceManager::remove

This patch ensures that the write transactions in
VpnInterfaceManager::remove are always closed.

Change-Id: Iaca016e08fed88f8cb34afbef702465ba152bbe0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoNETVIRT-1000: protect VrfEntryListener (partially) 32/65732/5
Stephen Kitt [Mon, 20 Nov 2017 14:55:39 +0000 (15:55 +0100)]
NETVIRT-1000: protect VrfEntryListener (partially)

This patch ensures that the write transactions in
VrfEntryListener.CleanupVpnInterfaceWorker::call and
::deleteFibEntries are always closed.

Change-Id: I57a6912fa162d3e37792d479ad76ae0879c3ae35
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoNETVIRT-1000: protect TunnelEndPointChangeListener 18/65718/6
Stephen Kitt [Mon, 20 Nov 2017 13:28:23 +0000 (14:28 +0100)]
NETVIRT-1000: protect TunnelEndPointChangeListener

This patch ensures that the write transactions in
TunnelEndPointChangeListener::add are always closed.

Change-Id: I79af37a9c046a405113c1fd408098b06fb59d028
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoNETVIRT-1000: protect manageRemoteRouteOnDPN 13/65713/7
Stephen Kitt [Mon, 20 Nov 2017 11:59:52 +0000 (12:59 +0100)]
NETVIRT-1000: protect manageRemoteRouteOnDPN

This patch ensures that the write transaction in
VrfEntryListener::manageRemoteRouteOnDPN is always closed.

Change-Id: I4add610addb470bea3ceda9736f9cbc457adcb44
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoFix wrong use of JobCoordinator in ElanInstanceManager 02/65802/2
Michael Vorburger [Tue, 21 Nov 2017 14:41:08 +0000 (15:41 +0100)]
Fix wrong use of JobCoordinator in ElanInstanceManager

found by chance during analysis of
https://jira.opendaylight.org/browse/NETVIRT-937, but then realised that
this will not fix that NPE - but would be good to rectify anyway.

Change-Id: If49efc13855ddeb085256ce0a6d5c093f42687f8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoNETVIRT-1000: protect handleNeutronPortUpdated 10/65710/6
Stephen Kitt [Mon, 20 Nov 2017 10:15:33 +0000 (11:15 +0100)]
NETVIRT-1000: protect handleNeutronPortUpdated

This patch ensures that the write transaction in
NeutronPortChangeListener::handleNeutronPortUpdated is always closed.

Change-Id: I56557db7fc4852100599379b0b32267a94ed9807
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit 9448a059037d75fc3d1a307ee47031b890b1b0d3)
(cherry picked from commit 040f5af4bff626b56e7ed51e1e25fc3c773abafa)

6 years agoInfrautils DiagStatus Integration For ELAN 00/64000/10
Faseela K [Thu, 5 Oct 2017 18:50:01 +0000 (00:20 +0530)]
Infrautils DiagStatus Integration For ELAN

Change-Id: Ifc2b79e370def61728929ba7ba8d22289510cff8
Signed-off-by: Faseela K <faseela.k@ericsson.com>
6 years agovpnmanager: various support for vpn-interface-op in operDS 13/59413/100
Philippe Guibert [Mon, 10 Jul 2017 11:54:32 +0000 (12:54 +0100)]
vpnmanager: various support for vpn-interface-op in operDS

Misc changes in vpn-manager related to the support of two router setup:
- tunnelinterface state changes
This commit enhances API changes for the following:
o updateVpnInterfaceOnTepDelete
o updateVpnInterfaceOnTepDelete
Instead of looking for a VPNInterface in operDS and refreshing context,
the VPNInterfaceOpDataEntries are looked up. Contexts are refreshed
accordingly.
- vpn-subnet: update packet processing with correct router-id
The metadata retrieved from the packet is compared against the router
used in the VPN interface. Action is done accordingly.
Also, upon interface going down, a check is done on the retrieving
datapath ID and performing subnet propagation, provided that
vpninterface-op-data-entry is present.

- vpn-util: check ARP learning against VPN interface
When receiving an ARP response on a VPN interface, the metadata is
checked against the list of routers in that VPN interface.

- vpnmanager-interface-op-data: adapt vpnInterfaceOpDataEntry listener
This change handles the update and deletion of operDS vpnInterfaceOpDataEntry
 entries. It replaces the old code that was expecting vpnInterface entries.

- vpnmanager-shell: dump the list of vpnInterfaceOpDataEntry()
This lists the whole list of vpnInterfaceOpDataEntry() previously
created when a vpnInterface was created in config DS.

Change-Id: Ia0a8845464912a56a16e87649c2adaf74c71d5de
Signed-off-by: Noel de Prandieres <prandieres@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Valentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
6 years agovpnservice: various changes to support vpn-interface-op-data-entry 45/59445/92
Philippe Guibert [Thu, 22 Jun 2017 13:35:42 +0000 (14:35 +0100)]
vpnservice: various changes to support vpn-interface-op-data-entry

- natservice: misc nat changes while using vpn-interface-op-data-entry
On some cases where a VM interface is connected to two routers ( case
with dual stack IPs), then the router which has nat enabled is searched.
The changes parse the list of router per VPN interface, and return the
first router which has NAT enabled.
Obviously, that kind of setup may have only one router with NAT enabled,
at maximum.
On EVPN flow programmation, on removing floating IPs, the vpnInterfaces
operational is removed too.
On Interface state change, the vpnInterfaces will be updated, added or
removed.

- cloud-service-chain: update VpnToPseudoPortData with VpnInterfaces
Because VpnInterface can support more than one VPN, when a new VPN
interface is created or removed, the list of its VPN should be parsed
against the VpnToPseudoPortData contexts.

- fib-manager: update operational Adjacencies by using vpnInterfaceOpDataEntry
This commit deletes the adjacenciesOp entry related to a vrfEntry, in
vpnInstanceOpDataEntry. The list of vpnRouterIds() is parsed in config
DS vpnInstance, to check is there is a vpnInstanceOpDataEntry existing.
Then if present, the associated adjacenciesOp is deleted.

The commit introduces a new function called getAdjacencyIdentifierOp().
It replaces getAdjacencyIdentifier, and will search for adjacencies that
are relying on vpninterfaceopdataentry.

Change-Id: I5a676b15dfdb415064a2e9daba5f4c7b4d584fe9
Signed-off-by: Valentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Noel de Prandières <prandieres@6wind.com>
6 years agovpninterface-manager: introduce vpn-interface-op-data context in oper DS 00/59700/99
Philippe Guibert [Mon, 10 Jul 2017 11:26:36 +0000 (12:26 +0100)]
vpninterface-manager: introduce vpn-interface-op-data context in oper DS

This commit includes the following:
- upon add() and remove() event, create/or remove vpn-interface-op-data-entry
for each pair (interface,vpnname) in operDS.
- BGP advertisement related to adjacencies from VPN
- support for AdjacenciesOp new yang model for operDS
- vpninterface-manager: update router interface FIB entry if a new vpn interface
is updated, the extraroutes are being added accordingly. The same is done for
FIB entries.
- vpninterface-manager: support for update operation upon the list of routers
changed for a vpn interface, the vpnInterfaceOpDataEntry are removed, then
readded.

Following API changed: replaced VpnInterface with VpnInterfaceOpDataEntry
o processExternalVpnInterface
o processVpnInterfaceDown
o withdrawAdjacenciesForVpnFromBgp and advertiseAdjacenciesForVpnToBgp
o processVpnInterfaceUp use VpnInterface as new parameter
o addVpnInterfaceVpn and addNewAdjToVpnInterface and delAdjFromVpnInterface
Change InterfaceStateChangeListener accordingly

The two following APIs
are being added vpnName as parameter:
- deleteFibEntryForRouterInterface
- createFibEntryForRouterInterface

Change-Id: I6320c7839c274fcf5d7779ce15a89733dd97217f
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Noel de Prandieres <prandieres@6wind.com>
6 years agovpnmanager: vpn-interfaces yang container has vpn-instance-name list 80/57780/112
Philippe Guibert [Wed, 24 May 2017 14:34:48 +0000 (15:34 +0100)]
vpnmanager: vpn-interfaces yang container has vpn-instance-name list

- In order to handle internal VPN or BGPVPN in a two router case solution,
some yang changes is needed.
Config DS is being added a list of vpn-instance configuration for one
VPN interface. The need is to have two vpn instances configurable for one VPN.
This commit change only handles the compilation by adapting java code
to as to care about the first element of vpn-instance.

- vpnmanager: basis changes for two router case solution

o vpnmanager-api: yang changes for two router case solution
In order to handle internal VPN or BGPVPN in a two router case solution,
some yang changes is needed. In a dual router case solution, one vpn
Instance and two vpn Interfaces will lead to create one structure for
config DS and two structures for oper DS.
This commit is change for OperDS. Oper DS is using a vpn-interface-op
structure instead of using vpn-interface structure. The structure is indexed
by interface name and by vpn-instance.
Add adjacencies in vpn-interface-op-data. In oper DS,
vpn-interface-op-data will benefit from adjacencies like it has been
done for config DS with vpn-interface structure.

o vpn-util: introduction of vpn-interface-op-data related functions
This commit introduces some utility routines to handle
vpn-interface-op-data structures within operDS context.
New functions are:
 o getVpnInterfaceOpDataEntryIdentifier
 o getVpnInterfaceOpDataEntry
This function is modified, because now, the operational VpnInterface is
VpnInterfaceOpDataEntry:
 o getOperationalVpnInterface
 o scheduleVpnInterfaceForRemoval
Add utility functions to handle adjacenciesOp. The introduction of
AdjacenciesOp structure, based on VpnInterfaceOpDataEntry introduces two
new routines.
 o getVpnInterfaceOpDataEntry
 o getVpnInterfaceOpDataEntryAugmentation

Change-Id: I87a4919899b0c702267977e5942ff8589f77de55
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Noel de Prandieres <prandieres@6wind.com>
6 years agoFix compiler errors in aclservice 72/65772/2
Tom Pantelis [Tue, 21 Nov 2017 01:33:52 +0000 (20:33 -0500)]
Fix compiler errors in aclservice

Patches https://git.opendaylight.org/gerrit/#/c/62955/ and
https://git.opendaylight.org/gerrit/#/c/64684/ crossed while
merging and cause compile errors.

The first patch introduced an AclDataUtil interface which has the
same name as the AclDataUtil impl. It's confusing to have classes
with the same name and it's also a bit strange to have an interface
with Util in the name so I renamed the interface to AclDataCache.

I also changed the Map getters in AclDataUtil to return copies
as the caller shouldn't modify them.

Change-Id: I1f818d06f967665fe677ddf7b0bad71f7640f8ac
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoNETVIRT-1000: protect handleNeutronPortCreated 05/65705/3
Stephen Kitt [Mon, 20 Nov 2017 09:55:38 +0000 (10:55 +0100)]
NETVIRT-1000: protect handleNeutronPortCreated

This patch ensures that the write transaction in
NeutronPortChangeListener::handleNeutronPortCreated is always closed.

Change-Id: I97fed4d99d0c81bf4f8c2704233238884dbb2a0d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoChanges are related to provide a command to display acl caches. 55/62955/23
Nishchya Gupta [Mon, 11 Sep 2017 09:12:41 +0000 (14:42 +0530)]
Changes are related to provide a command to display acl caches.

Added a new command display-acl-data-cache with aclservice scope,this
command displays the data for in total 4 caches of acl module.
Three cache from AclDatautils and one cache from AclInterfaceCacheUtil.

Usages for command will be shown if input command is improper.

Change-Id: Ide45e04b41747ddc1dd59fbad8e05b1d61e6964b
Signed-off-by: Nishchya Gupta <nishchyag@altencalsoftlabs.com>
6 years agoFix bad transaction leak in VpnInterfaceManager 19/65619/4
Michael Vorburger [Mon, 20 Nov 2017 17:02:14 +0000 (18:02 +0100)]
Fix bad transaction leak in VpnInterfaceManager

see https://jira.opendaylight.org/browse/NETVIRT-985

  292x transactions opened here, which are not closed:
    org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter.newWriteOnlyTransaction(BindingDOMDataBrokerAdapter.java:69)
    (...)
    org.opendaylight.netvirt.vpnmanager.VpnInterfaceManager.addToLabelMapper(VpnInterfaceManager.java:1594)
    org.opendaylight.netvirt.vpnmanager.populator.impl.L3vpnPopulator.addSubnetRouteFibEntry(L3vpnPopulator.java:104)
    org.opendaylight.netvirt.vpnmanager.populator.impl.L3vpnOverMplsGrePopulator.populateFib(L3vpnOverMplsGrePopulator.java:57)
    org.opendaylight.netvirt.vpnmanager.VpnSubnetRouteHandler.addSubnetRouteToFib(VpnSubnetRouteHandler.java:827)
    org.opendaylight.netvirt.vpnmanager.VpnSubnetRouteHandler.electNewDpnForSubnetRoute(VpnSubnetRouteHandler.java:906)
    org.opendaylight.netvirt.vpnmanager.VpnSubnetRouteHandler.onSubnetAddedToVpn(VpnSubnetRouteHandler.java:241)
    org.opendaylight.netvirt.vpnmanager.SubnetmapChangeListener.add(SubnetmapChangeListener.java:89)
    org.opendaylight.netvirt.vpnmanager.SubnetmapChangeListener.add(SubnetmapChangeListener.java:29)
    org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase$DataTreeChangeHandler.run(AsyncDataTreeChangeListenerBase.java:158)

Change-Id: I0f62fcc17c037365c9384e56c9f6f5a430693c20
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoFix FindBugs violations and enable enforcement in dhcpservice 89/65689/3
Tom Pantelis [Sat, 18 Nov 2017 02:09:24 +0000 (21:09 -0500)]
Fix FindBugs violations and enable enforcement in dhcpservice

See in-line comments

Change-Id: Ib1a0b983f1bf89516a55002bbbb7ddb1f6e61d14
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoNETVIRT-999 - Interface leak when subnet deleted 72/65672/4
Victor Pickard [Fri, 17 Nov 2017 14:31:06 +0000 (09:31 -0500)]
NETVIRT-999 - Interface leak when subnet deleted

https://jira.opendaylight.org/browse/NETVIRT-999

Cleanup/remove Interface when subnet is deleted to
fix resource leak.

Change-Id: Iac96a91de9dbdeeb19f8df3d35cd3e7e514e9471
Signed-off-by: Victor Pickard <vpickard@redhat.com>
6 years agoBugId: NETVIRT-989 TEP not deleted when subnet is deleted 88/65488/7
Victor Pickard [Mon, 13 Nov 2017 15:04:25 +0000 (10:04 -0500)]
BugId: NETVIRT-989 TEP not deleted when subnet is deleted

https://jira.opendaylight.org/browse/NETVIRT-989

Remove TEP from ds when subnet is deleted.

Change-Id: I5db9902c53a4021609718330406ad65985e0dffb
Signed-off-by: Victor Pickard <vpickard@redhat.com>
6 years agoRemove static VrfEntryListener.isOpenStackVniSemanticsEnforced 31/65531/4
Tom Pantelis [Wed, 15 Nov 2017 07:44:44 +0000 (02:44 -0500)]
Remove static VrfEntryListener.isOpenStackVniSemanticsEnforced

VrfEntryListener defines a static isOpenStackVniSemanticsEnforced
which is set in the ctor via the IElanService. FindBugs flags this
as a violation although it technically is safe b/c VrfEntryListener
is a singleton. However statics in this manner aren't good practice.
Users of the static flag should instead inject and obtain the flag
from IElanService.

One user was the static FibUtil class. FibUtil was converted to a
singleton. It also had static methods that take the DataBroker
and IdManagerService. Thee services are now injected and the methods
changed to non-static to make it cleaner. All users of these methods
now inject the FibUtil instance.

Change-Id: Ifecd9511568e263545ca7ce1c486483f67f9fe85
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in fibmanager-impl 27/65527/4
Tom Pantelis [Wed, 15 Nov 2017 03:49:12 +0000 (22:49 -0500)]
Fix FindBugs violations and enable enforcement in fibmanager-impl

See in-line comments

Change-Id: I7eeaa287693922b26d92bef840680858b5519845
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in bgpmanager-impl 55/64855/6
Tom Pantelis [Sun, 29 Oct 2017 04:02:45 +0000 (00:02 -0400)]
Fix FindBugs violations and enable enforcement in bgpmanager-impl

See in-line comments (most on patch set 1)

The thrift-generated code has a quite a few violations and, as
we do with other generated code, I excluded it from analysis.
Only one of the violations in was serious:

   Impossible cast from org.apache.thrift.TApplicationException to
   org.apache.thrift.TBase

This occurs in every BgpConfigurator inner class that creates an
anonymous AsyncMethodCallback instance from its getResultHandler
method. The generated code in onError method does a blind cast
to a clearly incompatible class. I'm not sure what the correct
solution is if we wanted to manual fix the generated code as I'm
not familiar with how thrift works. There isn't a TBase
implementation for an Exception and the generated *_result classes
don't have a field for an Exception.

Change-Id: I3a6a2fd60f2088e307a213563f267bdf00bdd1ef
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRemove NeutronUtils#lock/unLock in favor of KeyedLock 36/65636/3
Tom Pantelis [Thu, 16 Nov 2017 20:07:36 +0000 (15:07 -0500)]
Remove NeutronUtils#lock/unLock in favor of KeyedLock

The lock/unLock code in NeutronUtils should not be static and
doesn't really belong in a static utils class. A new KeyedLock
class was aded to infrautils so utilize that in NeutronvpnManager
and NeutronFloatingToFixedIpMappingChangeListener. Instead of a
shared, global KeyedLock, each class creates local instances
per resource to lock (router, vpn, interface).

Change-Id: Icbd9c341c8d7399e31ed8c38b92177a7fa8ed666
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFixes/cleanup in aclservice-impl 84/64684/8
Tom Pantelis [Wed, 25 Oct 2017 02:01:21 +0000 (22:01 -0400)]
Fixes/cleanup in aclservice-impl

See inline comments.

Change-Id: I03ec0d7e1a5fd44d617e2e9486714c8e76a1418d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert vpnmanager-impl to use blueprint annotations 88/65688/2
Tom Pantelis [Sat, 18 Nov 2017 00:20:04 +0000 (19:20 -0500)]
Convert vpnmanager-impl to use blueprint annotations

Now that the circular dependencies have been eliminated, we can
blueprint annotations.

Change-Id: I10d0849e885cff3cb721ca44d84a4c2c3afa92a9
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix transaction leak in NeutronvpnManager 98/65598/2
Michael Vorburger [Thu, 16 Nov 2017 10:59:32 +0000 (11:59 +0100)]
Fix transaction leak in NeutronvpnManager

see https://jira.opendaylight.org/browse/NETVIRT-886

Change-Id: I4b0d73203c46087d35cbfccc8aaf5d29d39d89b0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoFIXUP ipVersionChoice in case of mutiple add of ipversion 18/65618/2
Noel de Prandières [Thu, 16 Nov 2017 14:06:53 +0000 (15:06 +0100)]
FIXUP ipVersionChoice in case of mutiple add of ipversion

Change-Id: I4c80912f515eb18c14b332215f026557f7b53785
Signed-off-by: Noel de Prandières <prandieres@6wind.com>
6 years agoEliminate statistics-impl dependency on vpnmanagr-impl 54/65654/4
Tom Pantelis [Fri, 17 Nov 2017 02:33:27 +0000 (21:33 -0500)]
Eliminate statistics-impl dependency on vpnmanagr-impl

statistics-impl depends on vpnmanagr-impl to get access to the
InterfaceUtils class. This is problematic for converting vpnmanagr-impl
to use blueprint injection annotations b/c all the @Singleton classes
get included in the statistics-impl blueprint xml. It appears the
plugin scans @Singleton classes in all dependencies. I don't know if
there's a way to prevent that but eliminating the dependency on
vpnmanagr-impl would fix it. It is better not to depend on an impl
bundle anyway. Therefore I moved the InterfaceUtils class to the
vpnmanagr-api bunndle. In addition I modified the maven-bundle-plugin
instructions to not export any packages to prevent a dependency on
vpnmanagr-impl in the future.

Change-Id: I3731a4faf37a1ba56659346cb0a5697707acbc32
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoEliminate circular dependencies in vpnmanager-impl 31/65631/4
Tom Pantelis [Thu, 16 Nov 2017 18:24:50 +0000 (13:24 -0500)]
Eliminate circular dependencies in vpnmanager-impl

There's several circular dependencies surrounding the
VpnManagerImpl that was cleverly worked around by importing
IVpnManager as an optional service. However circular dependencies
and unnecessary coupling are difficult to understand and maintain
and eliminating them will allow us to use injection annotations.

vpnInstanceListener -> vpnInterfaceManager -> vpnManagerImpl -> vpnInstanceListener

  This one was easy by moving the isVPNConfigured code from VpnInstanceListener
  to VpnManagerImpl, which was the only caller.

vpnInterfaceManager -> vpnManagerImpl -> vpnInterfaceManager

  VpnManagerImpl's IVpnManager interface methods addExtraRoute/delExtraRoute
  called a corresponding method on the VpnInterfaceManager so the methods were
  moved to IVpnManager/VpnManagerImpl.

vpnSubnetRouteHandler -> vpnInterfaceManager -> vpnManagerImpl -> vpnSubnetRouteHandler

  Broke the vpnSubnetRouteHandler -> vpnInterfaceManager by moving
  deleteSubnetRouteFibEntryFromDS VpnSubnetRouteHandler which was the only caller.
  However this called getVpnsImportingMyRoute et al which are used by
  VpnInterfaceManager so these were moved to VpnUtil as they're pretty simple
  and mainly use VpnUtil methods anyway.

Also moved addToLabelMapper from VpnInterfaceManager to L3vpnPopulator as it's not
called VpnInterfaceManager. This eliminates unnecessary coupling between
L3vpnPopulator and VpnInterfaceManager.

Change-Id: Ib93a17d2150e5dd758fc294276906d3c4d7c636c
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoShell Commands to Display Ipv6Service Cache 92/65692/1
Sridhar Gaddam [Wed, 11 Oct 2017 07:23:16 +0000 (12:53 +0530)]
Shell Commands to Display Ipv6Service Cache

IPv6Service in netvirt maintains a cache of various Neutron resources to
honor the Router Solicitation/Neighbor Solicitation requests (which are
time sensitive) coming from the VMs spawned on the IPv6 Network.

This patch implements the necessary shell commands to dump the ipv6Cache.

Conflicts:
    vpnservice/features/vpnservice-features/pom.xml
    vpnservice/features/vpnservice-features/src/main/features/features.xml

Change-Id: Ie1aed6d47da540e3fd94c6a8cc3eedf7b4954989
Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
(cherry picked from commit 156124fda4f55fe7c1f34f1e4e8c0584441ad65f)

6 years agoRefactor alarm poms to match latest conventions 66/65666/2
Sam Hague [Fri, 17 Nov 2017 13:19:18 +0000 (08:19 -0500)]
Refactor alarm poms to match latest conventions

Change-Id: I11944df261393aa119c6081cc6e884ce2e29a6b7
Signed-off-by: Sam Hague <shague@redhat.com>
6 years agoConvert vpnmanager-impl to use JobCoordinator 61/65561/9
Tom Pantelis [Wed, 15 Nov 2017 17:22:43 +0000 (12:22 -0500)]
Convert vpnmanager-impl to use JobCoordinator

Change-Id: I9b1753e88c24ed5a533d925dc940fcfee04fc13f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix bad transaction leak in InterfaceStateChangeListener 27/65627/3
Michael Vorburger [Thu, 16 Nov 2017 17:05:16 +0000 (18:05 +0100)]
Fix bad transaction leak in InterfaceStateChangeListener

see https://jira.opendaylight.org/browse/NETVIRT-985

  555x transactions opened here, which are not closed:
    org.opendaylight.netvirt.vpnmanager.InterfaceStateChangeListener.lambda$remove$1

  31x transactions opened here, which are not closed:
    org.opendaylight.netvirt.vpnmanager.InterfaceStateChangeListener.lambda$add$0

  15x transactions opened here, which are not closed:
    org.opendaylight.netvirt.vpnmanager.InterfaceStateChangeListener.lambda$update$2

Change-Id: Id29be0fb48b3d97f84049d0e0d698d13757eb6a8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoElan Junit Testcases 94/62894/20
Riyazahmed D Talikoti [Fri, 8 Sep 2017 11:13:40 +0000 (16:43 +0530)]
Elan Junit Testcases

Test Cases below
1. Check for SMAC entry in DPN1 for port created in DPN1
2. Check for DMAC entry in DPN1 for port created in DPN1
3. Check for DMAC entry in DPN1 for port created in DPN2

InterfaceManager, ITM teststubs are moved to genius.

Expected object contains the flow details of SMAC and DMAC
where most of the values are parameterised.

Change-Id: I6fada494719b904465608cfc0e4a3cd5ec8a8911
Signed-off-by: Riyazahmed D Talikoti <riyazahmed.d.talikoti@ericsson.com>
6 years agoneutronvpn: send alarm upon extra route configuration fault using BGPVPN 81/60881/33
Philippe Guibert [Fri, 28 Jul 2017 14:58:37 +0000 (15:58 +0100)]
neutronvpn: send alarm upon extra route configuration fault using BGPVPN

When extra routes are configured, through a router, if the number of
nexthops is greater than the number of available RDs, then an alarm and
an error is generated.

Change-Id: Ib78b1ff82a9a2013ec2f81f28c0e0261ef971177
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Noel de Prandières <prandieres@6wind.com>
6 years agoUnbind and bind DHCP service as part of state. 40/65540/2
Kency Kurian [Wed, 15 Nov 2017 11:50:41 +0000 (17:20 +0530)]
Unbind and bind DHCP service as part of state.

In VM migration UC there were some stale entries observed since dhcp was
not calling unbind and bind in state listeners.
It is recommended by interface managaer module that all services must be
calling the bind/unbind in inerface state listeners.

Change-Id: I00f2e2f7d85b9c9d36fee54a43e6f1011ca94348
Depends-On: Ib1ca5cb4d74a9af5000f60e9d9e85ff9ea3efd9c
Signed-off-by: Kency Kurian <kency.kurian@ericsson.com>
6 years agoSupport for IPv4 subnet addition. 92/64192/7
Kency Kurian [Thu, 12 Oct 2017 11:25:32 +0000 (16:55 +0530)]
Support for IPv4 subnet addition.

If the IPv4 subnet is added after booting the VM then none of the DHCP
flows were programmed. After the new subnet is added in openstack a
neutron port update needs to be done for the neutron port to be updated
with the newly added subnet.

neutron port-update <port-id> --fixed-ip subnet_id=<subnet-id>

Changes made:
Whenever neutron port gets updated with a new fixed ip:
1. Check if the newly added subnet is an IPv4 subnet.
2. If it is an IPv4 subnet invoke the bind logic in a DJC
3. Also, if we know the DPN ID for the VM then install the DHCP flow in
another DJC.
4. Refactored the code a little.

Change-Id: Ib1ca5cb4d74a9af5000f60e9d9e85ff9ea3efd9c
Signed-off-by: Kency Kurian <kency.kurian@ericsson.com>
6 years agoNETVIRT-981 CSIT Sporadic failures - snat conntrack job failing 07/65407/3
Aswin Suryanarayanan [Fri, 10 Nov 2017 10:33:18 +0000 (16:03 +0530)]
NETVIRT-981 CSIT Sporadic failures - snat conntrack job failing
many tempest scenario tests

Changes are made to avoid stale entries when an external network is
deleted.

https://jira.opendaylight.org/browse/NETVIRT-981

Change-Id: I28b86a4233d397686c9e074ece5697eb0629ff3e
Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
6 years agoFix bad transaction leak in StatisticsImpl 64/65564/1
Michael Vorburger [Wed, 15 Nov 2017 17:32:02 +0000 (18:32 +0100)]
Fix bad transaction leak in StatisticsImpl

see https://jira.opendaylight.org/browse/NETVIRT-886

Change-Id: Ia72726f9eeae0bcb6273da5b50eb60a65dcd7358
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoFix FindBugs violations and enable enforcement in vpnmanager-impl 97/65497/5
Tom Pantelis [Tue, 14 Nov 2017 02:25:05 +0000 (21:25 -0500)]
Fix FindBugs violations and enable enforcement in vpnmanager-impl

See in-line comments

Change-Id: I7cbf722bd8ce7a7f965aacf9316def2d60bb9232
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRemove final DJC reference from neutronvpn-impl 28/65528/2
Tom Pantelis [Wed, 15 Nov 2017 04:50:39 +0000 (23:50 -0500)]
Remove final DJC reference from neutronvpn-impl

DJC was eradicated from neutronvpn-impl but it creeped back into
NeutronvpnUtils in a recent patch.

Change-Id: I7f950ff7e3f600642f2ae0b79082320047a635f5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRefactoring and cleanup in neutronvpn-api 79/64979/9
Tom Pantelis [Tue, 31 Oct 2017 20:40:21 +0000 (16:40 -0400)]
Refactoring and cleanup in neutronvpn-api

- Modified L2GatewayCacheUtils to use a ConcurrentMap instead of
  the deprecated Cache.

- Made L2GatewayDevice thread-safe and improved encapsualation

- Enabled FindBugs and fixed violatoions

Change-Id: I70d10e67a8fb800cda51f90e40286e60e2398a67
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix FindBugs violations and enable enforcement in neutronvpn-impl 61/64861/8
Tom Pantelis [Mon, 30 Oct 2017 02:22:03 +0000 (22:22 -0400)]
Fix FindBugs violations and enable enforcement in neutronvpn-impl

See in-line comments.

Change-Id: Ie0dce5f21dee80b9c02405b7636e55a4a8347887
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix warnings and remove statics in neutronvpn-impl 60/64860/5
Tom Pantelis [Sun, 29 Oct 2017 22:30:12 +0000 (18:30 -0400)]
Fix warnings and remove statics in neutronvpn-impl

See inline comments. The major changes were with the NeutronvpnUtils
class which had several public static Maps. The class was refactored
into a singleton class which required injection into many other classes.

Change-Id: Ib2badb6d01c55aab5851c9045d8bea8a911ad0a2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoBug 8889: Removed trailing comments 48/61148/4
Itohan [Fri, 4 Aug 2017 06:20:47 +0000 (23:20 -0700)]
Bug 8889: Removed trailing comments

Removed trailing comments, deleted
unnecessary ones and placed some before
the code they described. This change would
make the code more readable.

Change-Id: If852f1628d8f57a64c62a9ea09db416ed317e7a4
Signed-off-by: Itohan Ukponmwan <itohan.ukponmwan@intel.com>
6 years agoBug 8889: Defined Constants to remove duplication 28/61128/3
Itohan [Thu, 3 Aug 2017 23:16:12 +0000 (16:16 -0700)]
Bug 8889: Defined Constants to remove duplication

Defined contstants ERROR and IS_NEEDED to replace the string
literals "error: " and " is needed". These changes would
reduce string duplication and make code refactoring easier
and less error-prone.

Change-Id: I32ff8549ac3c5f8102ab15519c79e57bd63951e4
Signed-off-by: Itohan Ukponmwan <itohan.ukponmwan@intel.com>
6 years agoClean up QosNeutronUtils 00/64400/5
Stephen Kitt [Tue, 17 Oct 2017 13:41:56 +0000 (15:41 +0200)]
Clean up QosNeutronUtils

* Avoid returning null for collections and propagate the simplified
  null-handling.
* Use computeIfAbsent and putIfAbsent to simplify map-related code.
* Drop some local variables which are immediately returned to simplify
  declarations.
* Drop some unnecessary parentheses.

Change-Id: I701a032c1cdf1b7fc21d219476ceddc7cdc73ca5
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBug 9234: DPN programmed wrongly with TOR mac 05/65505/2
eaksahu [Tue, 14 Nov 2017 11:58:21 +0000 (17:28 +0530)]
Bug 9234: DPN programmed wrongly with TOR mac

Correcting mistake in code where cache was added instead of remove.

Change-Id: Ieae2221fa57897b31739358f0fbc900417632844
Signed-off-by: eaksahu <a.k.sahu@ericsson.com>
6 years agoFix warnings/cleanup in natservice-impl 75/64575/7
Tom Pantelis [Fri, 20 Oct 2017 17:22:09 +0000 (13:22 -0400)]
Fix warnings/cleanup in natservice-impl

See inline comments.

Change-Id: Ibb3708ccb05db84d8e41d241ace9c418de357c47
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix warnings/cleanup in dhcpservice-impl 83/64683/5
Tom Pantelis [Wed, 25 Oct 2017 00:24:04 +0000 (20:24 -0400)]
Fix warnings/cleanup in dhcpservice-impl

See inline comments.

Change-Id: I6a2c7500ee19af96c83a88ed9ae6e16a51423b28
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRemove unused parameters from Genius services 73/63173/14
Stephen Kitt [Fri, 15 Sep 2017 12:35:50 +0000 (14:35 +0200)]
Remove unused parameters from Genius services

Following the clean-up in Genius, remove unnecessary parameters on
cleaned-up methods.

Change-Id: I1a32116f5bd9956e76ee32289597b70e04e0b872
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoSplit QosNeutronUtils.syncFlow 06/64306/7
Stephen Kitt [Mon, 16 Oct 2017 15:24:06 +0000 (17:24 +0200)]
Split QosNeutronUtils.syncFlow

This needs Id882570c15f018ce751b3829fac4a446f4aecfc8

Change-Id: I9488c6c809e1567b6c2d3decc4c6c39d006a6150
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoSplit handleKnownL3DmacAddress 04/64304/6
Stephen Kitt [Mon, 16 Oct 2017 14:41:26 +0000 (16:41 +0200)]
Split handleKnownL3DmacAddress

Change-Id: I2210fcfbf7c7a60ab95a407716d92457997c4230
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoSplit setupArpResponderFlowsToExternalNetworkIps 40/64140/6
Stephen Kitt [Tue, 10 Oct 2017 23:57:48 +0000 (16:57 -0700)]
Split setupArpResponderFlowsToExternalNetworkIps

Change-Id: I3f23d128e2d4c9c90b0894e42bc44c5f4cd3002c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoSplit setupRouterGwMacFlow 38/64138/6
Stephen Kitt [Tue, 10 Oct 2017 23:11:59 +0000 (16:11 -0700)]
Split setupRouterGwMacFlow

Split setupRouterGwMacFlow into explicit add/remove variants.

Change-Id: I317acf74247e9674b0d4cc2a4578bc60d2b489aa
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoSplit setupSubnetMacIntoVpnInstance 32/64132/7
Stephen Kitt [Tue, 10 Oct 2017 21:46:57 +0000 (14:46 -0700)]
Split setupSubnetMacIntoVpnInstance

Split setupSubnetMacIntoVpnInstance into explicit add/remove
variants. The method used a number of static functions in VpnUtil
which were only used here, so this patch pulls these back into
VpnManagerImpl.

Change-Id: I6b9190dd9e0bec3dd1e0d79f5105d6001457ab66
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoRenamed class LockManager to LockManagerServiceImpl and moved package 92/65292/2
Michael Vorburger [Tue, 7 Nov 2017 23:52:35 +0000 (00:52 +0100)]
Renamed class LockManager to LockManagerServiceImpl and moved package

this change handles the impact of
I5fd1197718aaeda5662cc331957edc301db97029 done in genius for netvirt

Change-Id: I20529de417ccdebda30e07e716661d3585c46ab0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoFix warnings/cleanup/refactoring in bgpmanagr-impl 46/64846/7
Tom Pantelis [Sat, 28 Oct 2017 02:47:39 +0000 (22:47 -0400)]
Fix warnings/cleanup/refactoring in bgpmanagr-impl

Major hilites:

- In BgpConfigurationManager, modified the starting/stopping of
the BgpAlarms and BgpCounters instances to make it thread-safe
uaing AtomicReferences.

- Modified BgpAlarms to convert static fields to non-static and
change public fields to private. Also added init/close lifecycle
methods.

- Modified BgpCounters to convert static fields to non-static and
added close method to cleanup.

- Eliminated static BgpSyncHandle instance. The only user is
BgpConfigurationManager which now creates a local instance.

See inline comments for other minor changes.

Change-Id: Id179716d3e1cf2d21989ee7e62309aa33349ad66
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert to JobCoordinator in natservice-impl 20/64420/3
Tom Pantelis [Tue, 17 Oct 2017 18:52:56 +0000 (14:52 -0400)]
Convert to JobCoordinator in natservice-impl

DataStoreJobCoordinator is deprecated so convert to use JobCoordinator.

Change-Id: Ibffd141f7f5f12f418d90405de78e88371e30dfc
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agovpnmanager: misc fixes related to dual stack per neutron port. 51/63951/30
Philippe Guibert [Mon, 2 Oct 2017 17:33:10 +0000 (18:33 +0100)]
vpnmanager: misc fixes related to dual stack per neutron port.

- route interface state applies to more than one IP.
introduction of dual stack makes it possible to handle more than one
fixed IP, then more than one associated subnet. This change applied the
change of yang port-op-data-entry structure to support a list of
subnet-ids. This information is updated in
SubnetRouteInterfaceStateChangeListener, where the list of subnets is
extracted from the Neutron port.
- vpnmanager: remove and update prefixtointerface for dual stack addresses
Due to the possibility to have two primary IP addresses per port, some
VPN migration scenarios may not work with the other IP address. The code
is adapted to parse all the primary adjacencies of the VPN Interface.

Change-Id: I2936014f9aaa5b42b820466affd3ada31695860d
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agovpnservice: misc fixes mainly about BGPVPN configuration 49/62949/52
Philippe Guibert [Sun, 10 Sep 2017 17:44:02 +0000 (18:44 +0100)]
vpnservice: misc fixes mainly about BGPVPN configuration

- Bug-9134: avoid returning exception when checking for a non IPv4 prefix
In order to not having an exception returned, the Nwutils library is not
used to check for an IPv4 address.

- vpnmanager: for each vrf sub family deleted, partial FIB removed
Upon VRF sub family deletion, associate FIB entries are looked up and
removed.

- add generic vpn-config attribute in vpn-instance
This generic field contains BGPVPN information ( import / export rules,
RD), that will be used and synced with ipv4-family and ipv6-family in
the same structure. By default, vpn-config is present, and is used. If
an IPv4 subnet is found, then ipv4-family is created based on what
contains vpn-config.

- Bug 9168: multipath command supports vpnv6 address families
The multipath command changes:
o the addr-family is optional and takes as default value vpnv4
o it is possible to set multipath for vpnv6 , evpn, or lu address-family

- Bug-9167: in case of subnetmap update, the networkId is set correctly
There are cases where the subnetmap networkId field is flushed, and
never set back when an update occurs.

Change-Id: I3af7f6d5e700735450fd615d1b080229c2dfd771
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoNETVIRT-968 : Conntrack SNAT fails in a cluster setup. 95/64795/9
Aswin Suryanarayanan [Fri, 27 Oct 2017 08:45:40 +0000 (14:15 +0530)]
NETVIRT-968  : Conntrack SNAT fails in a cluster setup.

Made  the SNAT node event listener cluster aware using
AbstractClusteredAsyncDataTreeChangeListener(Only in Oxygen)

https://jira.opendaylight.org/browse/NETVIRT-968

Change-Id: If036fe679abe8ac5c5457b488325d2474f85820c
Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
6 years agoBug9298 : ModifiedNodeDoesNotExistException for FIP 30/64930/6
cgowdru [Tue, 31 Oct 2017 07:14:29 +0000 (12:44 +0530)]
Bug9298 : ModifiedNodeDoesNotExistException for FIP

Description:
1) This Exception is thrown which deleting the VM instances(using
command “openstack server delete VM“) as part of “External network test”
2) This VMs are booted directly using net-id
Ex: openstack server create --image cirros-0.3.5-x86_64-disk --flavor
m1.nano --nic net-id=193f740e-910f-4038-9a4a-7d8758e63756
VmInstanceFloating1 --security-group sg-connectivity --min 1 --max 1
3) And such Vms are associated with floating ip  using command
“openstack server add floating ip VmInstanceFloating1 10.10.10.12”
4) When such an VM is deleted using “openstack server delete”, I need
NeutronPortChangeListener.remove()(for VM Neutron port deletion) and
NeutronFloatingToFixedIpMappingChangeListener.update(for
floatingip-disassoicated from neutron port) getting triggered
concurrently.
5) NeutronPortChangeListener.remove() -> handleNeutronPortDeleted()
-> nvpnManager.dissociatefixedIPFromFloatingIP() ->
floatingIpMapListener.dissociatefixedIPFromFloatingIP() ->
removeRouterPortsOrPortsNode() -> MDSALUtil.syncDelete()
6) NeutronFloatingToFixedIpMappingChangeListener.update() ->
clearFromFloatingIpInfo() -> MDSALUtil.syncDelete()
7) Both step-5 and step-6 attempt to delete same DS instance
resulting in one in this exception.

Solution:
Change done to check if the internal-to-external-port-map fo the given
fixed-ip exists during Step-6 flow there-by preventing deletion on
non-existant DS instance.

Change-Id: Icc4973020ff73225a5b25a5e73d1ffcbf78f2609
Signed-off-by: cgowdru <chetan.arakere@altencalsoftlabs.com>
6 years agoBug 9297 : Adjacency doesn't exist exception fo FIP 18/65018/4
cgowdru [Thu, 2 Nov 2017 07:21:43 +0000 (12:51 +0530)]
Bug 9297 : Adjacency doesn't exist exception fo FIP

Description : When are ARP request for floating-ip(which is learnt
earlier) is received(with mac address change due to deletion and creation
of same FIP during tempest), query is done to delete the odl-adjacency
from vpn-interface which doesn't exists.

Instead of quering all adjacenies, change done for existance of specific
adjancency and delete it if only exists.

Change-Id: Id39f9f0830330bb84869c0d3a88c4787cd55df3c
Signed-off-by: cgowdru <chetan.arakere@altencalsoftlabs.com>
6 years agoneutronvpn: dual stack changes 17/62917/46
Valentina Krasnobaeva [Tue, 23 May 2017 09:08:42 +0000 (11:08 +0200)]
neutronvpn: dual stack changes

The vpn interface creation/deletion is decorrelated with the adjacencies
and fixed ips contexts port creation. This becomes necessary since each
neutron port will receive creation of ports, but also updates related to
update of new IPs ( which implies that it does not mean creation of VPN
interface).
Also if fixes in vpnmanager an issue upon some cases where networkId
field from subnetmap was null.

Change-Id: I664421f592ea7da9c34f5400100502593bfeea55
Signed-off-by: Valentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
Signed-off-by: Noel de Prandieres <prandieres@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgp-manager: update thrift model 80/57980/142
Philippe Guibert [Mon, 29 May 2017 13:00:22 +0000 (14:00 +0100)]
bgp-manager: update thrift model

addVrf() and delVrf() have 2 new parameters that are needed.
The modification consists in adapting the necessary thrift generated
files changes. On top of that, the call appropriate to BgpRoute.addVrf
and BgpRoute.delVrf is done with correct parameters.

Change-Id: Ie2a42923e804d30668c649434fa21fbb39f2ef1c
Signed-off-by: Noel de Prandieres <prandieres@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Valentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
6 years agoRemove un-used Dropwizard Metrics from bgpmanager 39/65339/2
Michael Vorburger [Wed, 8 Nov 2017 22:32:48 +0000 (23:32 +0100)]
Remove un-used Dropwizard Metrics from bgpmanager

Found during https://jira.opendaylight.org/browse/INFRAUTILS-19

If bgpmanager wants metrics in the future, then it should use the
upcoming infrautils.metrics instead of having a direct dependency on
io.dropwizard.metrics.

Change-Id: I54555c518f0b48f49f940021ba093a264f474e8d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoComment out LogCaptureRule in ElanServiceTest 42/65342/1
Michael Vorburger [Wed, 8 Nov 2017 23:42:30 +0000 (00:42 +0100)]
Comment out LogCaptureRule in ElanServiceTest

to avoid spurious test failures for now; when I get time I'm hoping to
follow up with work which makes this completely reliable by having tests
await the completion of JC background jobs (which is what's causing
this)

Change-Id: I2bcc19f01a0665a85ab155cfa616817fdb3c4854
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agovpnmanager: update vpn instance families based on subnetmap updates only 16/62916/48
Valentina Krasnobaeva [Tue, 5 Sep 2017 09:47:22 +0000 (11:47 +0200)]
vpnmanager: update vpn instance families based on subnetmap updates only

Upon a change in configuration, VPN instance from config DS is updated.
The change is due to a subnetmap moving to or from an other vpnid. If the old
VPN was a BGPVPN, then the list of subnetmaps will be parsed to check if
an IP family is missing or not. Reversely, the introduction of a new
subnet refreshes the IP families of the VPN instance.
According to the information, the VPN instance is updapted.
Consequently, if BGPVPN is configured, then the associated BGP VRFs are
updated accordingly.
Also, the vpnmanager shell command is modified accordingly with correct
AFConfig. Because a VPN instance can be either IPv4 or IPv6 or both,
then a check should be done against the good structure to parse.

Change-Id: I76b067eda44900d5c7bbf3f9792a55c32f711612
Signed-off-by: Valentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoConvert to JobCoordinator in aclservice-impl 22/64322/8
Tom Pantelis [Tue, 17 Oct 2017 00:40:19 +0000 (20:40 -0400)]
Convert to JobCoordinator in aclservice-impl

DataStoreJobCoordinator is deprecated so convert to use JobCoordinator.

Change-Id: Ibdeb83f2c147a1b0d651fca792f91f7674d3d802
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoBug 9299 - In conntrack SNAT Vpn to dpn maps fails to update when a 87/64387/13
Aswin Suryanarayanan [Tue, 17 Oct 2017 07:01:21 +0000 (12:31 +0530)]
Bug 9299 - In conntrack SNAT Vpn to dpn maps fails to update when a
subnet is added/removed

Added update method in centralized switch scheduler. This will update
the maps when a subnet is added/ removed from the router.

Change-Id: I7418cf0e3586fc643c14c86f807c542ed586305d
Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
6 years ago21->nat-group flow is not present on OVS after “upgrade” 83/64983/1
cgowdru [Mon, 30 Oct 2017 07:47:11 +0000 (13:17 +0530)]
21->nat-group flow is not present on OVS after “upgrade”

table=21, priority=10,ip,metadata=0x30d42/0xfffffe actions=group:225000
(checks the VRF id and forwards to a group
that outputs to the external interface)
The flow is in fact written by ODL but rejected by OVS because
group:225000 is not present at the time the flow is written.
Group:225000 is not written because at the time that is triggered
(twice, actually) there is no /elan-interfaces/elan-interface for the
external network (trunk) port because OVS has not yet connected.

Create a default NAT group(225000) before installing flow the
21->group:225000. If elan-interface(for external-interfaces) are missing
during this group creation, then create this group with an drop action.
Once elan-interfaces are available, this group will be updated with proper
action values.

Steps perfomed
--------------

1) Shutdown ODL (logout)
2) wipe data store (rm -rf $KARAF_HOME/journal/* &
$KARAF_HOME/snapshots/*)
3) disconnect OVS and clear groups/flows
sudo ovs-ofctl del-flows -O Openflow13 br-int
sudo ovs-ofctl del-groups -O Openflow13 br-int
sudo ovs-vsctl del-manager
sudo ovs-vsctl del-controller br-int
4) restart ODL (./karaf)
5) Wait for net-odl full sync from neutron
- waited until DS gets poulatedi
- (ex : GET http://192.168.56.1:8181/restconf/config/neutron:neutron/ports)
6) reconnect OVS
sudo ovs-vsctl set-manager "tcp:192.168.56.1:6640"
sudo ovs-vsctl set-controller br-int "tcp:192.168.56.1:6653"

Change-Id: Iad89b3ff7935846b0bf1a3b9b3a4690ff87fcd9c
Signed-off-by: cgowdru <chetan.arakere@altencalsoftlabs.com>
6 years agoConvert to JobCoordinator in qosservice-impl 77/64677/3
Tom Pantelis [Tue, 24 Oct 2017 18:49:19 +0000 (14:49 -0400)]
Convert to JobCoordinator in qosservice-impl

Change-Id: I3462bacddee1ad01803fdacec4f355e7c8a5bb7d
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert bgpmanager-impl to use mdsal EOS APIs 28/64828/2
Tom Pantelis [Thu, 12 Oct 2017 18:05:46 +0000 (14:05 -0400)]
Convert bgpmanager-impl to use mdsal EOS APIs

The controller EOS APIs are deprecated.

Change-Id: Ibb54eafc0561fa4ee1845498b5d17ef9b3b01363
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert to JobCoordinator in neutronvpn-impl 59/64859/2
Tom Pantelis [Sun, 29 Oct 2017 20:33:45 +0000 (16:33 -0400)]
Convert to JobCoordinator in neutronvpn-impl

Change-Id: I2f328995de40918bd3031d5754d91ffdf0c728cf
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert to JobCoordinator in dhcpservice-impl 21/64321/6
Tom Pantelis [Tue, 17 Oct 2017 00:12:25 +0000 (20:12 -0400)]
Convert to JobCoordinator in dhcpservice-impl

DataStoreJobCoordinator is deprecated so convert to use JobCoordinator.

Change-Id: Idb4057c125e41bf64dcba559caedfe8d046da28f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert to JobCoordinator in cloud-servicechain-impl 25/64325/3
Tom Pantelis [Tue, 17 Oct 2017 01:19:52 +0000 (21:19 -0400)]
Convert to JobCoordinator in cloud-servicechain-impl

DataStoreJobCoordinator is deprecated so convert to use JobCoordinator.

Change-Id: Icce0eb72bf61fbc703e79f246aa7e8dc796e83f9
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert to JobCoordinator in policyservice-impl 24/64324/2
Tom Pantelis [Tue, 17 Oct 2017 01:02:50 +0000 (21:02 -0400)]
Convert to JobCoordinator in policyservice-impl

DataStoreJobCoordinator is deprecated so convert to use JobCoordinator.

Change-Id: I4e12d77e8626a7638c3cd4ada700061ee5ae81ae
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert to JobCoordinator in fibmanager-impl 23/64323/2
Tom Pantelis [Tue, 17 Oct 2017 00:53:12 +0000 (20:53 -0400)]
Convert to JobCoordinator in fibmanager-impl

DataStoreJobCoordinator is deprecated so convert to use JobCoordinator.

Change-Id: I17094b2da363bd4a96cca06d5c53cc45da001642
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRemove deploy-site.xml 03/64903/2
Thanh Ha [Mon, 30 Oct 2017 21:14:37 +0000 (17:14 -0400)]
Remove deploy-site.xml

With the javadoc jobs now available to generate javadoc it is time to
remove the maven-sites and related files.

Change-Id: If19cda9d89fd6ad5c0cb1351885c59d501ffe6aa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
6 years agoFix ElanServiceTest by adding ElanServiceTest 15/64915/1
Michael Vorburger [Mon, 30 Oct 2017 23:34:53 +0000 (00:34 +0100)]
Fix ElanServiceTest by adding ElanServiceTest

ElanServiceTest broke on master following
I75a0edccef1b47ecf1c246c9e51e7717916f1da2 ... :-(

Change-Id: Ib63cf571901e23e9d3dc897781c779866c5f052c
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoRevert "INFRAUTILS-18: @Ignore AclServiceStatefulTest until JobCoordinator fixed" 27/64827/1
Michael Vorburger [Fri, 27 Oct 2017 20:29:38 +0000 (22:29 +0200)]
Revert "INFRAUTILS-18: @Ignore AclServiceStatefulTest until JobCoordinator fixed"

This reverts commit fbde3eaa72bb40528df7bb482feef8103b812e9b,
because https://jira.opendaylight.org/browse/INFRAUTILS-18 is fixed.

Change-Id: I849d7c6abf5d53cf0d1cba5f8349318f6f45f0e8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
6 years agoRefactor/cleanup BgpConfigurationManager 79/64179/4
Tom Pantelis [Wed, 11 Oct 2017 20:37:35 +0000 (16:37 -0400)]
Refactor/cleanup BgpConfigurationManager

- converted static fields to instance fields
- changed all instance fields to private
- removed unused fields/variables/code
- fix warnings

Change-Id: Ic6629f39558ec5280718c42d56a6af9c6a194e46
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoConvert dhcpservice to use mdsal EOS APIs 27/64127/8
Tom Pantelis [Tue, 10 Oct 2017 18:20:12 +0000 (14:20 -0400)]
Convert dhcpservice to use mdsal EOS APIs

The controller EOS APIs are deprecated.

Change-Id: I2670160dd459b4f3ff64aff2a877b2a6f0683988
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>