fix delete Direct with switchdev port 52/68452/7
authorMoshe Levi <moshele@mellanox.com>
Wed, 21 Feb 2018 08:25:22 +0000 (10:25 +0200)
committerSam Hague <shague@redhat.com>
Fri, 2 Mar 2018 21:39:03 +0000 (21:39 +0000)
Change-Id: I3165d5341770296052ded02751aabc3bee654cf3
Signed-off-by: Moshe Levi <moshele@mellanox.com>
Co-authored-by: Hamdy Khader <hamdyk@mellanox.com>
neutronvpn/impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronPortChangeListener.java

index 7de7a8b1bef39752d8ee6e2c6c69dbb5404ae217..fe5bfb1a76d14a222add70f768b5c9fd88b5f0fc 100644 (file)
@@ -577,7 +577,8 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
                 for (FixedIps ip: portIpAddrsList) {
                     nvpnManager.updateSubnetmapNodeWithPorts(ip.getSubnetId(), null, portId);
                 }
-                LOG.info("Port {} is not a NORMAL VNIC Type port; OF Port interfaces are not created", portName);
+                LOG.info("Port {} is not a normal and not a direct with switchdev VNIC type ;"
+                         + "OF Port interfaces are not created", portName);
                 return Collections.emptyList();
             }
             return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
@@ -629,12 +630,13 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         jobCoordinator.enqueueJob("PORT- " + portName, () -> {
             WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
             List<ListenableFuture<Void>> futures = new ArrayList<>();
-            if (!NeutronUtils.isPortVnicTypeNormal(port)) {
+            if (!(NeutronUtils.isPortVnicTypeNormal(port) || isPortTypeSwitchdev(port))) {
                 for (FixedIps ip: portIpsList) {
                     // remove direct port from subnetMaps config DS
                     nvpnManager.removePortsFromSubnetmapNode(ip.getSubnetId(), null, portId);
                 }
-                LOG.info("Port {} is not a NORMAL VNIC Type port; OF Port interfaces are not created", portName);
+                LOG.info("Port {} is not a normal and not a direct with switchdev VNIC type ;"
+                         + "Skipping OF Port interfaces removal", portName);
                 return futures;
             }
             Uuid vpnId = null;