[ovs-dev,1/3] Revert "dpif-netlink: Don't destroy and recreate port if it exists"

Message ID 20181213142448.8504-2-fbl@redhat.com
State New
Headers show
Series
  • revert port duplicate checking optimization
Related show

Commit Message

Flavio Leitner Dec. 13, 2018, 2:24 p.m.
This reverts commit  a38dccb3ee80a1d0b8973191c9e94f045441f8cc.

The original commit 7521e0cf9e88 ("ofproto-dpif: Let the dpif report
when a port is a duplicate.") relies on the kernel to check if the
port exists or not. However, the current kernel code doesn't handle
when the port is moved to another network namespace.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 lib/dpif-netlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index 03470603f..dfa9d9199 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -900,7 +900,7 @@  dpif_netlink_rtnl_port_create_and_add(struct dpif_netlink *dpif,
     name = netdev_vport_get_dpif_port(netdev, namebuf, sizeof namebuf);
     error = dpif_netlink_port_add__(dpif, name, OVS_VPORT_TYPE_NETDEV, NULL,
                                     port_nop);
-    if (error && error != EEXIST) {
+    if (error) {
         dpif_netlink_rtnl_port_destroy(name, netdev_get_type(netdev));
     }
     return error;
@@ -917,7 +917,7 @@  dpif_netlink_port_add(struct dpif *dpif_, struct netdev *netdev,
     if (!ovs_tunnels_out_of_tree) {
         error = dpif_netlink_rtnl_port_create_and_add(dpif, netdev, port_nop);
     }
-    if (error && error != EEXIST) {
+    if (error) {
         error = dpif_netlink_port_add_compat(dpif, netdev, port_nop);
     }
     fat_rwlock_unlock(&dpif->upcall_lock);