IPv6 table=45 unknown flows on subnet add 43/91743/2
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Mon, 27 Jul 2020 10:33:31 +0000 (16:03 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Fri, 18 Sep 2020 04:16:33 +0000 (04:16 +0000)
When we create router-> network->subnet->bring VM -> Add subnet, both VM
and subnet flows will be added at table 45. Removal of VM (Removes VM
flows) and removal of subnet (Both VM and subnet flows) should get
deleted.Addition of only subnet shall not add flows unless there is a VM
on it.

Signed-off-by: Karthikeyan Krishnan <karthikeyangceb007@gmail.com>
Change-Id: I3a6a44c8c661132c6119317e8dee7a5bd1166e97

ipv6service/impl/src/main/java/org/opendaylight/netvirt/ipv6service/IfMgr.java

index c8330fa76797e8c9ff47f5274972138112b7c935..fcc7850e8ebdc429d86c690f304d6d5552d467e9 100644 (file)
@@ -1180,13 +1180,24 @@ public class IfMgr implements ElementCache, AutoCloseable {
                 for (VirtualNetwork.DpnInterfaceInfo dpnIfaceInfo : dpnIfaceList) {
                     ndExecutorService.execute(() ->
                             checkVmBootBeforeSubnetAddRouter(dpnIfaceInfo, intf, networkElanTag, action));
-                }
-                /* Router interface case. Default NS punt flows per subnet
-                 * 1. flow for matching nd_target = <Subnet_GW_IP>
-                 * 2. flow for matching nd_target = <Subnet_GW_LLA>
-                 */
-                for (Ipv6Address ndTarget : intf.getIpv6Addresses()) {
-                    programIcmpv6NsDefaultPuntFlows(intf, ndTarget, action);
+                    /* Router interface case. Default NS punt flows per subnet
+                     * 1. flow for matching nd_target = <Subnet_GW_IP>
+                     * 2. flow for matching nd_target = <Subnet_GW_LLA>
+                     */
+                    for (Ipv6Address ndTarget : intf.getIpv6Addresses()) {
+                        if ((action == Ipv6ServiceConstants.ADD_FLOW)
+                                && (dpnIfaceInfo.ofPortMap.size() == Ipv6ServiceConstants.FIRST_OR_LAST_VM_ON_DPN)) {
+                            LOG.debug("checkIcmpv6NsMatchAndResponderFlow: Subnet {} on Interface {} specific flows to"
+                                            + " be installed for {}", intf.getNetworkID().getValue(),
+                                    intf.getIntfUUID(), ndTarget.getValue());
+                            programIcmpv6NsDefaultPuntFlows(intf, ndTarget, action);
+                        } else if (action == Ipv6ServiceConstants.DEL_FLOW) {
+                            LOG.debug("checkIcmpv6NsMatchAndResponderFlow: Subnet {} on Interface {} specific flows "
+                                            + "to be removed for {}", intf.getNetworkID().getValue(),
+                                    intf.getIntfUUID(), ndTarget.getValue());
+                            programIcmpv6NsDefaultPuntFlows(intf, ndTarget, action);
+                        }
+                    }
                 }
             }
         } else {