ECMP - MIP/learnt IPs pointing to groups 89/77989/3
authoreswanit <swati.udhavrao.niture@ericsson.com>
Tue, 20 Nov 2018 15:24:00 +0000 (20:54 +0530)
committerSam Hague <shague@redhat.com>
Sun, 9 Dec 2018 19:12:27 +0000 (19:12 +0000)
Issue:
MIP/learnt IPs (both local and remote) programmed in FIB
(table-21) were pointing to load balancing groups rather
than redirecting to table-220. Only extra routes
(in table 21) need to be pointed to the group.

Fix:
Adding a check to enter setupLoadBalancingNextHop if
it is a static route

Also, the logic for removeAdjacencyFromInternalVpn method
is changed for the deletion of extra-route and nexthop.

Change-Id: Ie2aa43fb3180c032a609cba4fa39ac20f3a5b003
Signed-off-by: eswanit <swati.udhavrao.niture@ericsson.com>
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/VrfEntryListener.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java

index 81b3c29a6945e026fb16c36cf6bc095d329422b3..e4c2c97997e5a1b764d12cbc8baac742008434f3 100755 (executable)
@@ -869,7 +869,8 @@ public class VrfEntryListener extends AsyncDataTreeChangeListenerBase<VrfEntry,
             String gwMacAddress = vrfEntry.getGatewayMacAddress();
             //The loadbalancing group is created only if the extra route has multiple nexthops
             //to avoid loadbalancing the discovered routes
-            if (vpnExtraRoutes != null && routes != null) {
+            if (RouteOrigin.STATIC.getValue().equals(vrfEntry.getOrigin()) && vpnExtraRoutes != null
+                    && routes != null) {
                 if (vpnExtraRoutes.size() > 1) {
                     groupId = nextHopManager.createNextHopGroups(vpnId, rd, dpnId, vrfEntry, routes, vpnExtraRoutes);
                     localGroupId = nextHopManager.getLocalSelectGroup(vpnId, vrfEntry.getDestPrefix());
index 1350a29be4fa542a7501c6beb34ad5afdde495c2..cebe58d3f6475eb86272c5daee5c04226444d589 100755 (executable)
@@ -1400,7 +1400,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                                     interfaceName, writeInvTxn);
                         }
                         if (!nhList.isEmpty()) {
-                            if (Objects.equals(rd, vpnName)) {
+                            if (Objects.equals(primaryRd, vpnName)) {
                                 //this is an internal vpn - the rd is assigned to the vpn instance name;
                                 //remove from FIB directly
                                 nhList.forEach(removeAdjacencyFromInternalVpn(nextHop, vpnName,
@@ -1906,7 +1906,7 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                 }
                 if (adj.getNextHopIpList() != null && !adj.getNextHopIpList().isEmpty()
                         && adj.getAdjacencyType() != AdjacencyType.PrimaryAdjacency) {
-                    RouteOrigin origin = adj.getAdjacencyType() == AdjacencyType.PrimaryAdjacency ? RouteOrigin.LOCAL
+                    RouteOrigin origin = adj.getAdjacencyType() == AdjacencyType.LearntIp ? RouteOrigin.DYNAMIC
                             : RouteOrigin.STATIC;
                     String nh = adj.getNextHopIpList().get(0);
                     String vpnPrefixKey = VpnUtil.getVpnNamePrefixKey(vpnName, prefix);