Subject: Re: Cannot move macvlan interface on top of bonding device

From: Florian Westphal <[email-masked]>
Date: Wed, 17 Sep 2014 23:28:49 +0200

Vlad Yasevich <[email-masked]> wrote:
> On 09/17/2014 03:06 PM, Florian Westphal wrote:
> > Cong Wang <[email-masked]> wrote:
> >> On Wed, Sep 17, 2014 at 8:56 AM, Francesco Ruggeri <[email-masked]> wrote:
> >>> This used to work in older releases.
> >>> The problem seems to be that commit f939981492 sets NETIF_F_NETNS_LOCAL
> >>> on bonding interfaces, and commit 797f87f83 causes macvlan interfaces
> >>> to inherit its features from the lower device.
> >>>
> >>> Is there a reason why NETIF_F_NETNS_LOCAL should be inherited from the
> >>> lower device
> >>> by macvlan interfaces?
> >>
> >> commit 797f87f83 looks wrong, it should not inherit NETIF_F_NETNS_LOCAL,
> >> so just clear this flag. Please submit a patch.
> > 
> > Under which conditions would NETIF_F_NETNS_LOCAL have to be inherited?
> > (i.e., why is it inheritable in the first place?)

To answer my own question:  Its inherited since lowerdev->features is
passed as 'all' flag, so we would 'decrement' feature set if we'd remove
it in _increment_features().

> macvlan code calls
>         features = netdev_increment_features(vlan->lowerdev->features,
>                                              features,
>                                              mask);
> 
> where lowerdev->features contains the NETIF_F_NETNS_LOCAL bit.  That

[..]

> May be a better solution is:
> 
>         features = netdev_increment_features(vlan->lowerdev->features & MACVLAN_FEATURS,
>                                              features,
>                                              mask);
> 
> This way we start with only the feature MACVLAN is interested in.

Seems correct, since it will also prevent other non-macvlan features from
appearing.

Thanks Vlad.