[ovs-dev] gre: Rename fallback devices to avoid udev's interference

Message ID 1536673955-2687-1-git-send-email-pkusunyifeng@gmail.com
State Superseded
Headers show
Series
  • [ovs-dev] gre: Rename fallback devices to avoid udev's interference
Related show

Commit Message

Yifeng Sun Sept. 11, 2018, 1:52 p.m.
Please backport this patch to upstream OVS down to 2.9.

On certain kernel versions, when openvswitch kernel module creates
a gre0 interface, the kernel’s gre module will jump out and compete
to control the gre0 interface. This will cause the failure of
openvswitch kernel module loading.

This fix renames fallback devices by adding a prefix "ovs-".

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Issue: #2162866
---
 datapath/linux/compat/ip6_gre.c    | 5 +++--
 datapath/linux/compat/ip6_tunnel.c | 6 +++---
 datapath/linux/compat/ip_gre.c     | 2 +-
 datapath/linux/compat/ip_tunnel.c  | 3 ++-
 4 files changed, 9 insertions(+), 7 deletions(-)

Comments

Gregory Rose Sept. 11, 2018, 10:23 p.m. | #1
On 9/11/2018 6:52 AM, Yifeng Sun wrote:
> Please backport this patch to upstream OVS down to 2.9.
>
> On certain kernel versions, when openvswitch kernel module creates
> a gre0 interface, the kernel’s gre module will jump out and compete
> to control the gre0 interface. This will cause the failure of
> openvswitch kernel module loading.
>
> This fix renames fallback devices by adding a prefix "ovs-".

Looks good.  I also tested it on a 4.17 kernel where we would use the 
upstream tunneling and the
names there are still the same as we would expect.  Also passes check-kmod:

  19: datapath - ping over erspan v1 tunnel by simulated packets ok
  20: datapath - ping over erspan v2 tunnel by simulated packets ok
  21: datapath - ping over ip6erspan v1 tunnel by simulated packets ok
  22: datapath - ping over ip6erspan v2 tunnel by simulated packets ok

And Travis:

https://travis-ci.org/gvrose8192/ovs-experimental/builds/427403391

Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>

> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> Issue: #2162866
> ---
>   datapath/linux/compat/ip6_gre.c    | 5 +++--
>   datapath/linux/compat/ip6_tunnel.c | 6 +++---
>   datapath/linux/compat/ip_gre.c     | 2 +-
>   datapath/linux/compat/ip_tunnel.c  | 3 ++-
>   4 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
> index 00dbefc..08b31da 100644
> --- a/datapath/linux/compat/ip6_gre.c
> +++ b/datapath/linux/compat/ip6_gre.c
> @@ -377,7 +377,7 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
>   	if (parms->name[0])
>   		strlcpy(name, parms->name, IFNAMSIZ);
>   	else
> -		strcpy(name, "ip6gre%d");
> +		strcpy(name, "ovs-ip6gre%d");
>   
>   	dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
>   			   ip6gre_tunnel_setup);
> @@ -1712,7 +1712,8 @@ static int __net_init ip6gre_init_net(struct net *net)
>   	struct ip6gre_net *ign = net_generic(net, ip6gre_net_id);
>   	int err;
>   
> -	ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0",
> +	ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl),
> +					  "ovs-ip6gre0",
>   					  NET_NAME_UNKNOWN,
>   					  ip6gre_tunnel_setup);
>   	if (!ign->fb_tunnel_dev) {
> diff --git a/datapath/linux/compat/ip6_tunnel.c b/datapath/linux/compat/ip6_tunnel.c
> index 56fd8b4..06cebda 100644
> --- a/datapath/linux/compat/ip6_tunnel.c
> +++ b/datapath/linux/compat/ip6_tunnel.c
> @@ -355,7 +355,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
>   	if (p->name[0])
>   		strlcpy(name, p->name, IFNAMSIZ);
>   	else
> -		sprintf(name, "ip6tnl%%d");
> +		sprintf(name, "ovs-ip6tnl%%d");
>   
>   	dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
>   			   ip6_tnl_dev_setup);
> @@ -1410,7 +1410,7 @@ ip6_tnl_parm_to_user(struct ip6_tnl_parm *u, const struct __ip6_tnl_parm *p)
>    *     %SIOCCHGTUNNEL: change tunnel parameters to those given
>    *     %SIOCDELTUNNEL: delete tunnel
>    *
> - *   The fallback device "ip6tnl0", created during module
> + *   The fallback device "ovs-ip6tnl0", created during module
>    *   initialization, can be used for creating other tunnel devices.
>    *
>    * Return:
> @@ -2093,7 +2093,7 @@ static int __net_init ip6_tnl_init_net(struct net *net)
>   	ip6n->tnls[1] = ip6n->tnls_r_l;
>   
>   	err = -ENOMEM;
> -	ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6tnl0",
> +	ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ovs-ip6tnl0",
>   					NET_NAME_UNKNOWN, ip6_tnl_dev_setup);
>   
>   	if (!ip6n->fb_tnl_dev)
> diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
> index 05132ba..b7322c5 100644
> --- a/datapath/linux/compat/ip_gre.c
> +++ b/datapath/linux/compat/ip_gre.c
> @@ -1463,7 +1463,7 @@ static struct pernet_operations erspan_net_ops = {
>   
>   static int __net_init ipgre_tap_init_net(struct net *net)
>   {
> -	return ip_tunnel_init_net(net, gre_tap_net_id, &ipgre_tap_ops, "gretap0");
> +	return ip_tunnel_init_net(net, gre_tap_net_id, &ipgre_tap_ops, "ovs-gretap0");
>   }
>   
>   static void __net_exit ipgre_tap_exit_net(struct net *net)
> diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
> index d16e60f..b85ada3 100644
> --- a/datapath/linux/compat/ip_tunnel.c
> +++ b/datapath/linux/compat/ip_tunnel.c
> @@ -134,7 +134,8 @@ static struct net_device *__ip_tunnel_create(struct net *net,
>   			err = -E2BIG;
>   			goto failed;
>   		}
> -		strlcpy(name, ops->kind, IFNAMSIZ);
> +		strlcpy(name, "ovs-", IFNAMSIZ);
> +		strlcat(name, ops->kind, IFNAMSIZ);
>   		strncat(name, "%d", 2);
>   	}
>
Justin Pettit Sept. 13, 2018, 10:19 p.m. | #2
> On Sep 11, 2018, at 6:52 AM, Yifeng Sun <pkusunyifeng@gmail.com> wrote:
> 
> Please backport this patch to upstream OVS down to 2.9.
> 
> On certain kernel versions, when openvswitch kernel module creates
> a gre0 interface, the kernel’s gre module will jump out and compete
> to control the gre0 interface. This will cause the failure of
> openvswitch kernel module loading.
> 
> This fix renames fallback devices by adding a prefix "ovs-".
> 
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> Issue: #2162866
> ---
> datapath/linux/compat/ip6_gre.c    | 5 +++--
> datapath/linux/compat/ip6_tunnel.c | 6 +++---
> datapath/linux/compat/ip_gre.c     | 2 +-
> datapath/linux/compat/ip_tunnel.c  | 3 ++-
> 4 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
> index 00dbefc..08b31da 100644
> --- a/datapath/linux/compat/ip6_gre.c
> +++ b/datapath/linux/compat/ip6_gre.c
> @@ -377,7 +377,7 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
> 	if (parms->name[0])
> 		strlcpy(name, parms->name, IFNAMSIZ);
> 	else
> -		strcpy(name, "ip6gre%d");
> +		strcpy(name, "ovs-ip6gre%d");

We're starting to make this device name pretty long.  Should we be doing any sort of sanity-check on the length, since we're generating the name?  I did a quick search through the kernel sources, and couldn't determine where that "%d" is actually replaced and whether there's a check.

> 
> diff --git a/datapath/linux/compat/ip6_tunnel.c b/datapath/linux/compat/ip6_tunnel.c
> index 56fd8b4..06cebda 100644
> --- a/datapath/linux/compat/ip6_tunnel.c
> +++ b/datapath/linux/compat/ip6_tunnel.c
> @@ -355,7 +355,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
> 	if (p->name[0])
> 		strlcpy(name, p->name, IFNAMSIZ);
> 	else
> -		sprintf(name, "ip6tnl%%d");
> +		sprintf(name, "ovs-ip6tnl%%d");

Same question here.

> static void __net_exit ipgre_tap_exit_net(struct net *net)
> diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
> index d16e60f..b85ada3 100644
> --- a/datapath/linux/compat/ip_tunnel.c
> +++ b/datapath/linux/compat/ip_tunnel.c
> @@ -134,7 +134,8 @@ static struct net_device *__ip_tunnel_create(struct net *net,
> 			err = -E2BIG;
> 			goto failed;
> 		}
> -		strlcpy(name, ops->kind, IFNAMSIZ);
> +		strlcpy(name, "ovs-", IFNAMSIZ);
> +		strlcat(name, ops->kind, IFNAMSIZ);
> 		strncat(name, "%d", 2);
> 	}

A little earlier in this function, there's a length check:

        if (strlen(ops->kind) > (IFNAMSIZ - 3)) {
            err = -E2BIG;
            goto failed;
        }

Should we be bumping that by four to account for the "ovs-" that was added?

--Justin
Yifeng Sun Sept. 13, 2018, 10:52 p.m. | #3
Thanks Justin for the review, I will look at it and create v2.

Yifeng

On Thu, Sep 13, 2018 at 3:19 PM Justin Pettit <jpettit@ovn.org> wrote:

>
>
> > On Sep 11, 2018, at 6:52 AM, Yifeng Sun <pkusunyifeng@gmail.com> wrote:
> >
> > Please backport this patch to upstream OVS down to 2.9.
> >
> > On certain kernel versions, when openvswitch kernel module creates
> > a gre0 interface, the kernel’s gre module will jump out and compete
> > to control the gre0 interface. This will cause the failure of
> > openvswitch kernel module loading.
> >
> > This fix renames fallback devices by adding a prefix "ovs-".
> >
> > Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> > Issue: #2162866
> > ---
> > datapath/linux/compat/ip6_gre.c    | 5 +++--
> > datapath/linux/compat/ip6_tunnel.c | 6 +++---
> > datapath/linux/compat/ip_gre.c     | 2 +-
> > datapath/linux/compat/ip_tunnel.c  | 3 ++-
> > 4 files changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/datapath/linux/compat/ip6_gre.c
> b/datapath/linux/compat/ip6_gre.c
> > index 00dbefc..08b31da 100644
> > --- a/datapath/linux/compat/ip6_gre.c
> > +++ b/datapath/linux/compat/ip6_gre.c
> > @@ -377,7 +377,7 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct
> net *net,
> >       if (parms->name[0])
> >               strlcpy(name, parms->name, IFNAMSIZ);
> >       else
> > -             strcpy(name, "ip6gre%d");
> > +             strcpy(name, "ovs-ip6gre%d");
>
> We're starting to make this device name pretty long.  Should we be doing
> any sort of sanity-check on the length, since we're generating the name?  I
> did a quick search through the kernel sources, and couldn't determine where
> that "%d" is actually replaced and whether there's a check.
>
> >
> > diff --git a/datapath/linux/compat/ip6_tunnel.c
> b/datapath/linux/compat/ip6_tunnel.c
> > index 56fd8b4..06cebda 100644
> > --- a/datapath/linux/compat/ip6_tunnel.c
> > +++ b/datapath/linux/compat/ip6_tunnel.c
> > @@ -355,7 +355,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net
> *net, struct __ip6_tnl_parm *p)
> >       if (p->name[0])
> >               strlcpy(name, p->name, IFNAMSIZ);
> >       else
> > -             sprintf(name, "ip6tnl%%d");
> > +             sprintf(name, "ovs-ip6tnl%%d");
>
> Same question here.
>
> > static void __net_exit ipgre_tap_exit_net(struct net *net)
> > diff --git a/datapath/linux/compat/ip_tunnel.c
> b/datapath/linux/compat/ip_tunnel.c
> > index d16e60f..b85ada3 100644
> > --- a/datapath/linux/compat/ip_tunnel.c
> > +++ b/datapath/linux/compat/ip_tunnel.c
> > @@ -134,7 +134,8 @@ static struct net_device *__ip_tunnel_create(struct
> net *net,
> >                       err = -E2BIG;
> >                       goto failed;
> >               }
> > -             strlcpy(name, ops->kind, IFNAMSIZ);
> > +             strlcpy(name, "ovs-", IFNAMSIZ);
> > +             strlcat(name, ops->kind, IFNAMSIZ);
> >               strncat(name, "%d", 2);
> >       }
>
> A little earlier in this function, there's a length check:
>
>         if (strlen(ops->kind) > (IFNAMSIZ - 3)) {
>             err = -E2BIG;
>             goto failed;
>         }
>
> Should we be bumping that by four to account for the "ovs-" that was added?
>
> --Justin
>
>
>
Justin Pettit Sept. 13, 2018, 11:05 p.m. | #4
Great. By the way, the indication of how far back it should be backported is very helpful. However, can you please add it after the “---“ so that it’s not part of the commit message. 

Thanks!

--Justin


> On Sep 13, 2018, at 3:52 PM, Yifeng Sun <pkusunyifeng@gmail.com> wrote:
> 
> Thanks Justin for the review, I will look at it and create v2.
> 
> Yifeng
> 
>> On Thu, Sep 13, 2018 at 3:19 PM Justin Pettit <jpettit@ovn.org> wrote:
>> 
>> 
>> > On Sep 11, 2018, at 6:52 AM, Yifeng Sun <pkusunyifeng@gmail.com> wrote:
>> > 
>> > Please backport this patch to upstream OVS down to 2.9.
>> > 
>> > On certain kernel versions, when openvswitch kernel module creates
>> > a gre0 interface, the kernel’s gre module will jump out and compete
>> > to control the gre0 interface. This will cause the failure of
>> > openvswitch kernel module loading.
>> > 
>> > This fix renames fallback devices by adding a prefix "ovs-".
>> > 
>> > Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
>> > Issue: #2162866
>> > ---
>> > datapath/linux/compat/ip6_gre.c    | 5 +++--
>> > datapath/linux/compat/ip6_tunnel.c | 6 +++---
>> > datapath/linux/compat/ip_gre.c     | 2 +-
>> > datapath/linux/compat/ip_tunnel.c  | 3 ++-
>> > 4 files changed, 9 insertions(+), 7 deletions(-)
>> > 
>> > diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
>> > index 00dbefc..08b31da 100644
>> > --- a/datapath/linux/compat/ip6_gre.c
>> > +++ b/datapath/linux/compat/ip6_gre.c
>> > @@ -377,7 +377,7 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
>> >       if (parms->name[0])
>> >               strlcpy(name, parms->name, IFNAMSIZ);
>> >       else
>> > -             strcpy(name, "ip6gre%d");
>> > +             strcpy(name, "ovs-ip6gre%d");
>> 
>> We're starting to make this device name pretty long.  Should we be doing any sort of sanity-check on the length, since we're generating the name?  I did a quick search through the kernel sources, and couldn't determine where that "%d" is actually replaced and whether there's a check.
>> 
>> > 
>> > diff --git a/datapath/linux/compat/ip6_tunnel.c b/datapath/linux/compat/ip6_tunnel.c
>> > index 56fd8b4..06cebda 100644
>> > --- a/datapath/linux/compat/ip6_tunnel.c
>> > +++ b/datapath/linux/compat/ip6_tunnel.c
>> > @@ -355,7 +355,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
>> >       if (p->name[0])
>> >               strlcpy(name, p->name, IFNAMSIZ);
>> >       else
>> > -             sprintf(name, "ip6tnl%%d");
>> > +             sprintf(name, "ovs-ip6tnl%%d");
>> 
>> Same question here.
>> 
>> > static void __net_exit ipgre_tap_exit_net(struct net *net)
>> > diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
>> > index d16e60f..b85ada3 100644
>> > --- a/datapath/linux/compat/ip_tunnel.c
>> > +++ b/datapath/linux/compat/ip_tunnel.c
>> > @@ -134,7 +134,8 @@ static struct net_device *__ip_tunnel_create(struct net *net,
>> >                       err = -E2BIG;
>> >                       goto failed;
>> >               }
>> > -             strlcpy(name, ops->kind, IFNAMSIZ);
>> > +             strlcpy(name, "ovs-", IFNAMSIZ);
>> > +             strlcat(name, ops->kind, IFNAMSIZ);
>> >               strncat(name, "%d", 2);
>> >       }
>> 
>> A little earlier in this function, there's a length check:
>> 
>>         if (strlen(ops->kind) > (IFNAMSIZ - 3)) {
>>             err = -E2BIG;
>>             goto failed;
>>         }
>> 
>> Should we be bumping that by four to account for the "ovs-" that was added?
>> 
>> --Justin
>> 
>>
Yifeng Sun Sept. 13, 2018, 11:28 p.m. | #5
Sure, will do.

On Thu, Sep 13, 2018 at 4:05 PM Justin Pettit <jpettit@ovn.org> wrote:

> Great. By the way, the indication of how far back it should be backported
> is very helpful. However, can you please add it after the “---“ so that
> it’s not part of the commit message.
>
> Thanks!
>
> --Justin
>
>
> On Sep 13, 2018, at 3:52 PM, Yifeng Sun <pkusunyifeng@gmail.com> wrote:
>
> Thanks Justin for the review, I will look at it and create v2.
>
> Yifeng
>
> On Thu, Sep 13, 2018 at 3:19 PM Justin Pettit <jpettit@ovn.org> wrote:
>
>>
>>
>> > On Sep 11, 2018, at 6:52 AM, Yifeng Sun <pkusunyifeng@gmail.com> wrote:
>> >
>> > Please backport this patch to upstream OVS down to 2.9.
>> >
>> > On certain kernel versions, when openvswitch kernel module creates
>> > a gre0 interface, the kernel’s gre module will jump out and compete
>> > to control the gre0 interface. This will cause the failure of
>> > openvswitch kernel module loading.
>> >
>> > This fix renames fallback devices by adding a prefix "ovs-".
>> >
>> > Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
>> > Issue: #2162866
>> > ---
>> > datapath/linux/compat/ip6_gre.c    | 5 +++--
>> > datapath/linux/compat/ip6_tunnel.c | 6 +++---
>> > datapath/linux/compat/ip_gre.c     | 2 +-
>> > datapath/linux/compat/ip_tunnel.c  | 3 ++-
>> > 4 files changed, 9 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/datapath/linux/compat/ip6_gre.c
>> b/datapath/linux/compat/ip6_gre.c
>> > index 00dbefc..08b31da 100644
>> > --- a/datapath/linux/compat/ip6_gre.c
>> > +++ b/datapath/linux/compat/ip6_gre.c
>> > @@ -377,7 +377,7 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct
>> net *net,
>> >       if (parms->name[0])
>> >               strlcpy(name, parms->name, IFNAMSIZ);
>> >       else
>> > -             strcpy(name, "ip6gre%d");
>> > +             strcpy(name, "ovs-ip6gre%d");
>>
>> We're starting to make this device name pretty long.  Should we be doing
>> any sort of sanity-check on the length, since we're generating the name?  I
>> did a quick search through the kernel sources, and couldn't determine where
>> that "%d" is actually replaced and whether there's a check.
>>
>> >
>> > diff --git a/datapath/linux/compat/ip6_tunnel.c
>> b/datapath/linux/compat/ip6_tunnel.c
>> > index 56fd8b4..06cebda 100644
>> > --- a/datapath/linux/compat/ip6_tunnel.c
>> > +++ b/datapath/linux/compat/ip6_tunnel.c
>> > @@ -355,7 +355,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net
>> *net, struct __ip6_tnl_parm *p)
>> >       if (p->name[0])
>> >               strlcpy(name, p->name, IFNAMSIZ);
>> >       else
>> > -             sprintf(name, "ip6tnl%%d");
>> > +             sprintf(name, "ovs-ip6tnl%%d");
>>
>> Same question here.
>>
>> > static void __net_exit ipgre_tap_exit_net(struct net *net)
>> > diff --git a/datapath/linux/compat/ip_tunnel.c
>> b/datapath/linux/compat/ip_tunnel.c
>> > index d16e60f..b85ada3 100644
>> > --- a/datapath/linux/compat/ip_tunnel.c
>> > +++ b/datapath/linux/compat/ip_tunnel.c
>> > @@ -134,7 +134,8 @@ static struct net_device *__ip_tunnel_create(struct
>> net *net,
>> >                       err = -E2BIG;
>> >                       goto failed;
>> >               }
>> > -             strlcpy(name, ops->kind, IFNAMSIZ);
>> > +             strlcpy(name, "ovs-", IFNAMSIZ);
>> > +             strlcat(name, ops->kind, IFNAMSIZ);
>> >               strncat(name, "%d", 2);
>> >       }
>>
>> A little earlier in this function, there's a length check:
>>
>>         if (strlen(ops->kind) > (IFNAMSIZ - 3)) {
>>             err = -E2BIG;
>>             goto failed;
>>         }
>>
>> Should we be bumping that by four to account for the "ovs-" that was
>> added?
>>
>> --Justin
>>
>>
>>

Patch

diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
index 00dbefc..08b31da 100644
--- a/datapath/linux/compat/ip6_gre.c
+++ b/datapath/linux/compat/ip6_gre.c
@@ -377,7 +377,7 @@  static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
 	if (parms->name[0])
 		strlcpy(name, parms->name, IFNAMSIZ);
 	else
-		strcpy(name, "ip6gre%d");
+		strcpy(name, "ovs-ip6gre%d");
 
 	dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
 			   ip6gre_tunnel_setup);
@@ -1712,7 +1712,8 @@  static int __net_init ip6gre_init_net(struct net *net)
 	struct ip6gre_net *ign = net_generic(net, ip6gre_net_id);
 	int err;
 
-	ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0",
+	ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl),
+					  "ovs-ip6gre0",
 					  NET_NAME_UNKNOWN,
 					  ip6gre_tunnel_setup);
 	if (!ign->fb_tunnel_dev) {
diff --git a/datapath/linux/compat/ip6_tunnel.c b/datapath/linux/compat/ip6_tunnel.c
index 56fd8b4..06cebda 100644
--- a/datapath/linux/compat/ip6_tunnel.c
+++ b/datapath/linux/compat/ip6_tunnel.c
@@ -355,7 +355,7 @@  static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
 	if (p->name[0])
 		strlcpy(name, p->name, IFNAMSIZ);
 	else
-		sprintf(name, "ip6tnl%%d");
+		sprintf(name, "ovs-ip6tnl%%d");
 
 	dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
 			   ip6_tnl_dev_setup);
@@ -1410,7 +1410,7 @@  ip6_tnl_parm_to_user(struct ip6_tnl_parm *u, const struct __ip6_tnl_parm *p)
  *     %SIOCCHGTUNNEL: change tunnel parameters to those given
  *     %SIOCDELTUNNEL: delete tunnel
  *
- *   The fallback device "ip6tnl0", created during module
+ *   The fallback device "ovs-ip6tnl0", created during module
  *   initialization, can be used for creating other tunnel devices.
  *
  * Return:
@@ -2093,7 +2093,7 @@  static int __net_init ip6_tnl_init_net(struct net *net)
 	ip6n->tnls[1] = ip6n->tnls_r_l;
 
 	err = -ENOMEM;
-	ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6tnl0",
+	ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ovs-ip6tnl0",
 					NET_NAME_UNKNOWN, ip6_tnl_dev_setup);
 
 	if (!ip6n->fb_tnl_dev)
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 05132ba..b7322c5 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -1463,7 +1463,7 @@  static struct pernet_operations erspan_net_ops = {
 
 static int __net_init ipgre_tap_init_net(struct net *net)
 {
-	return ip_tunnel_init_net(net, gre_tap_net_id, &ipgre_tap_ops, "gretap0");
+	return ip_tunnel_init_net(net, gre_tap_net_id, &ipgre_tap_ops, "ovs-gretap0");
 }
 
 static void __net_exit ipgre_tap_exit_net(struct net *net)
diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
index d16e60f..b85ada3 100644
--- a/datapath/linux/compat/ip_tunnel.c
+++ b/datapath/linux/compat/ip_tunnel.c
@@ -134,7 +134,8 @@  static struct net_device *__ip_tunnel_create(struct net *net,
 			err = -E2BIG;
 			goto failed;
 		}
-		strlcpy(name, ops->kind, IFNAMSIZ);
+		strlcpy(name, "ovs-", IFNAMSIZ);
+		strlcat(name, ops->kind, IFNAMSIZ);
 		strncat(name, "%d", 2);
 	}