diff mbox

[ovs-dev] tnl-ports: Open tunnel type if device name has special prefix

Message ID 1501672649-32851-1-git-send-email-roid@mellanox.com
State Accepted
Headers show

Commit Message

Roi Dayan Aug. 2, 2017, 11:17 a.m. UTC
From: Paul Blakey <paulb@mellanox.com>

There is a race between listening on route changes from route-table
netlink which then calls ovs_router_insert() where it adds the involved
netdev to the tnl-ports map (tnl_port_map_insert_ipdev()),
and netdev_open from from normal opening of the port.

tnl-ports open the netdev as type system (type == NULL) when it doesn't
exists before it is opened normally, e.g from dumping the ports
in dpctl.

This solves 'ovs-dpctl show' EExists error on vxlan ports as both
(dpctl/tnl-ports) will open the ports as vxlan type.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
---
 lib/tnl-ports.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff Aug. 3, 2017, 8:15 p.m. UTC | #1
On Wed, Aug 02, 2017 at 02:17:29PM +0300, Roi Dayan wrote:
> From: Paul Blakey <paulb@mellanox.com>
> 
> There is a race between listening on route changes from route-table
> netlink which then calls ovs_router_insert() where it adds the involved
> netdev to the tnl-ports map (tnl_port_map_insert_ipdev()),
> and netdev_open from from normal opening of the port.
> 
> tnl-ports open the netdev as type system (type == NULL) when it doesn't
> exists before it is opened normally, e.g from dumping the ports
> in dpctl.
> 
> This solves 'ovs-dpctl show' EExists error on vxlan ports as both
> (dpctl/tnl-ports) will open the ports as vxlan type.
> 
> Signed-off-by: Paul Blakey <paulb@mellanox.com>
> Reviewed-by: Roi Dayan <roid@mellanox.com>

Applied to master, thanks!
diff mbox

Patch

diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c
index 70f6c3b..777ed4d 100644
--- a/lib/tnl-ports.c
+++ b/lib/tnl-ports.c
@@ -408,7 +408,7 @@  insert_ipdev(const char dev_name[])
     struct netdev *dev;
     int error, n_in6;
 
-    error = netdev_open(dev_name, NULL, &dev);
+    error = netdev_open(dev_name, netdev_get_type_from_name(dev_name), &dev);
     if (error) {
         return;
     }