]> git.baikalelectronics.ru Git - kernel.git/commit
macvlan: fix netdev feature propagation from lower device
authorFlorian Westphal <fw@strlen.de>
Thu, 26 Dec 2013 11:17:00 +0000 (12:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Dec 2013 18:41:00 +0000 (13:41 -0500)
commitc6a6465a0b309c935055b3cfc4b555245d7da4f7
tree3ccec3d1c8085f47cb064e0e47490e459c4248bc
parent8589964d54143ecb727ac08df660e3bf9aeea384
macvlan: fix netdev feature propagation from lower device

There are inconsistencies wrt. feature propagation/inheritance between
macvlan and the underlying interface.

When a feature is turned off on the real device before a macvlan is
created on top, these will remain enabled on the macvlan device, whereas
turning off the feature on the lower device after macvlan creation the
kernel will propagate the changes to the macvlan.

The second issue is that, when propagating changes from underlying device
to the macvlan interface, macvlan can erronously lose its NETIF_F_LLTX flag,
as features are anded with the underlying device.

However, LLTX should be kept since it has no dependencies on physical
hardware (LLTX is set on macvlan creation regardless of the lower
device properties, see d45627f6f3681d48db5c95efb9c6c7e703554f0c
(macvlan: lockless tx path).

The LLTX flag is now forced regardless of user settings in absence of
layer2 hw acceleration (96f8e08a0ae7501357db8fd2e86,
net: Add layer 2 hardware acceleration operations for macvlan devices).

Use netdev_increment_features to rebuild the feature set on capability
changes on either the lower device or on the macvlan interface.

As pointed out by Ben Hutchings, use netdev_update_features on
NETDEV_FEAT_CHANGE event (it calls macvlan_fix_features/netdev_features_change
if needed).

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c