* [PATCH 1/1] net: allow macvlans to move to net namespace
@ 2014-09-17 18:12 Francesco Ruggeri
2014-09-17 20:55 ` Cong Wang
2014-09-19 21:07 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Francesco Ruggeri @ 2014-09-17 18:12 UTC (permalink / raw)
To: netdev; +Cc: fruggeri, fw, chenweilong, davem
>From 6dad8398aee7fec77838ad591871745508ed481d Mon Sep 17 00:00:00 2001
From: Francesco Ruggeri <fruggeri@arista.com>
Date: Wed, 17 Sep 2014 10:40:44 -0700
Subject: [PATCH 1/1] net: allow macvlans to move to net namespace
I cannot move a macvlan interface created on top of a bonding interface
to a different namespace:
% ip netns add dummy0
% ip link add link bond0 mac0 type macvlan
% ip link set mac0 netns dummy0
RTNETLINK answers: Invalid argument
%
The problem seems to be that commit f9399814927a ("bonding: Don't allow
bond devices to change network namespaces.") sets NETIF_F_NETNS_LOCAL
on bonding interfaces, and commit 797f87f83b60 ("macvlan: fix netdev
feature propagation from lower device") causes macvlan interfaces
to inherit its features from the lower device.
NETIF_F_NETNS_LOCAL should not be inherited from the lower device
by a macvlan.
Patch tested on 3.16.
Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
---
drivers/net/macvlan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index a969555..7652fd1 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -806,6 +806,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
features,
mask);
features |= ALWAYS_ON_FEATURES;
+ features &= ~NETIF_F_NETNS_LOCAL;
return features;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] net: allow macvlans to move to net namespace
2014-09-17 18:12 [PATCH 1/1] net: allow macvlans to move to net namespace Francesco Ruggeri
@ 2014-09-17 20:55 ` Cong Wang
2014-09-19 21:07 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Cong Wang @ 2014-09-17 20:55 UTC (permalink / raw)
To: Francesco Ruggeri
Cc: netdev, Francesco Ruggeri, Florian Westphal, chenweilong, David Miller
On Wed, Sep 17, 2014 at 11:12 AM, Francesco Ruggeri
<fruggeri@aristanetworks.com> wrote:
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index a969555..7652fd1 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -806,6 +806,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
> features,
> mask);
> features |= ALWAYS_ON_FEATURES;
> + features &= ~NETIF_F_NETNS_LOCAL;
>
> return features;
> }
Even if we have some other way to clear this flag (maybe clearing it
in mask etc.),
explicitly clearing it is more readable, I don't want to spin my head to
read netdev_increment_features(), so,
Acked-by: Cong Wang <cwang@twopensource.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] net: allow macvlans to move to net namespace
2014-09-17 18:12 [PATCH 1/1] net: allow macvlans to move to net namespace Francesco Ruggeri
2014-09-17 20:55 ` Cong Wang
@ 2014-09-19 21:07 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-09-19 21:07 UTC (permalink / raw)
To: fruggeri; +Cc: netdev, fruggeri, fw, chenweilong
From: fruggeri@aristanetworks.com (Francesco Ruggeri)
Date: Wed, 17 Sep 2014 11:12:27 -0700
> From 6dad8398aee7fec77838ad591871745508ed481d Mon Sep 17 00:00:00 2001
> From: Francesco Ruggeri <fruggeri@arista.com>
> Date: Wed, 17 Sep 2014 10:40:44 -0700
> Subject: [PATCH 1/1] net: allow macvlans to move to net namespace
>
> I cannot move a macvlan interface created on top of a bonding interface
> to a different namespace:
>
> % ip netns add dummy0
> % ip link add link bond0 mac0 type macvlan
> % ip link set mac0 netns dummy0
> RTNETLINK answers: Invalid argument
> %
>
> The problem seems to be that commit f9399814927a ("bonding: Don't allow
> bond devices to change network namespaces.") sets NETIF_F_NETNS_LOCAL
> on bonding interfaces, and commit 797f87f83b60 ("macvlan: fix netdev
> feature propagation from lower device") causes macvlan interfaces
> to inherit its features from the lower device.
>
> NETIF_F_NETNS_LOCAL should not be inherited from the lower device
> by a macvlan.
> Patch tested on 3.16.
>
> Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-19 21:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-17 18:12 [PATCH 1/1] net: allow macvlans to move to net namespace Francesco Ruggeri
2014-09-17 20:55 ` Cong Wang
2014-09-19 21:07 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.