IPv6 table=45 unknown flows on subnet add 80/91680/10
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Mon, 27 Jul 2020 10:33:31 +0000 (16:03 +0530)
committerKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Tue, 15 Sep 2020 03:23:42 +0000 (03:23 +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 23791f3b3c02514224b2196bce07bece1ce7fd8b..6dbcb2a3ca7c417badc36beea4a08a567e0a1d81 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 {