[ovs-dev] [PATCH] dpif-netlink-rtnl: Fix ovs_geneve probing after restart

William Tu u9012063 at gmail.com
Tue Oct 24 21:43:31 UTC 2017

When using the out-of-tree (openvswitch compat) geneve module,
the first time oot tunnel probing returns true (correct).
Without unloading the geneve module, if the userspace ovs-vswitchd
restarts, because the 'geneve_sys_6081' still exists, the probing
incorrectly returns false and loads the in-tree (upstream kernel)
geneve module.

The patch fixes it by adding NLM_F_EXCL flags, so if geneve already
exists, the dpif_netlink_rtnl_create return EEXIST and the oot tunnel
probing returns true.  To reproduce the issue, start the ovs
> /etc/init.d/openvswitch-switch start
> creat a bridge and attach a geneve port using out-of-tree geneve
> /etc/init.d/openvswitch-switch restart

Fixes: 921c370a9df5 ("dpif-netlink: Probe for out-of-tree tunnels, decides used interface")
Signed-off-by: William Tu <u9012063 at gmail.com>
Cc: Eric Garver <e at erig.me>
Cc: Gurucharan Shetty <guru at ovn.org>
 lib/dpif-netlink-rtnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
index 0c32e7d8ccb4..ab9737b8cc4b 100644
--- a/lib/dpif-netlink-rtnl.c
+++ b/lib/dpif-netlink-rtnl.c
@@ -451,7 +451,7 @@ dpif_netlink_rtnl_probe_oot_tunnels(void)
         error = dpif_netlink_rtnl_create(tnl_cfg, name, OVS_VPORT_TYPE_GENEVE,
                                          (NLM_F_REQUEST | NLM_F_ACK
-                                          | NLM_F_CREATE));
+                                          | NLM_F_CREATE | NLM_F_EXCL));
         if (error != EOPNOTSUPP) {
             if (!error) {

More information about the dev mailing list