Bug 7606: Fix for missing table 110 flow in OVS 2.4 after VM live migration
[netvirt.git] / openstack / net-virt / src / main / java / org / opendaylight / netvirt / openstack / netvirt / SouthboundHandler.java
index 971378839056bab44261e0197a9b6f9aab2e0e10..8fc9fbb314d8dfc29aa1f76936c6265206154780 100644 (file)
@@ -117,7 +117,7 @@ public class SouthboundHandler extends AbstractHandler
         if (action.equals(Action.UPDATE)) {
             distributedArpService.processInterfaceEvent(node, tp, network, false, action);
         }
-        neutronL3Adapter.handleInterfaceEvent(node, tp, network, Action.UPDATE);
+        neutronL3Adapter.handleInterfaceEvent(node, tp, network, action);
     }
     /**
      * Get dpid from node.
@@ -148,6 +148,8 @@ public class SouthboundHandler extends AbstractHandler
         if(dpIdNeutronPort != null && !dpIdNeutronPort.equals(dpId)) {
             isMigratedPort = true;
         }
+        LOG.trace("isMigratedPort {}, node {}, neutronPort {}, dpIdNeutronPort {} ", isMigratedPort, node.getNodeId(),
+                  neutronPort.getMacAddress(), dpIdNeutronPort);
         return isMigratedPort;
     }
 
@@ -381,14 +383,16 @@ public class SouthboundHandler extends AbstractHandler
     }
 
     private void processPortUpdate(Node node, OvsdbTerminationPointAugmentation port, Action action) {
-        LOG.debug("processPortUpdate : {} for the Node: {}", port, node);
+        LOG.debug("processPortUpdate : action {}, {} for the Node: {}", action, port, node);
         NeutronNetwork network = tenantNetworkManager.getTenantNetwork(port);
         if (network != null) {
             final NeutronPort neutronPort = tenantNetworkManager.getTenantPort(port);
-            if (!network.getRouterExternal()) {
-                handleInterfaceUpdate(node, port, action);
-            } else if (action != null && action.equals(Action.UPDATE)) {
-                programVLANNetworkFlowProvider(node, port, network, neutronPort, true);
+            if (!(Action.UPDATE.equals(action) && isMigratedPort(node, neutronPort))) {
+                if (!network.getRouterExternal()) {
+                    handleInterfaceUpdate(node, port, action);
+                } else if (Action.UPDATE.equals(action)) {
+                    programVLANNetworkFlowProvider(node, port, network, neutronPort, true);
+                }
             }
         } else if (null != port.getInterfaceType() && null != port.getOfport()) {
             // Filter Vxlan interface request and install table#110 unicast flow (Bug 7392).