diff options
author | Michal Kubeček <mkubecek@suse.cz> | 2014-12-05 11:05:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-09 16:00:22 -0500 |
commit | 62dbe83015ed15b307eb22b89568dd41091dda76 (patch) | |
tree | 7529dd8e6790a5148aef58eddeacd88f9ce6a2a7 | |
parent | bd42b788607b850b84e7c754d351cbec93c681e1 (diff) |
macvlan: allow setting LRO independently of lower device
Since commit fbe168ba91f7 ("net: generic dev_disable_lro() stacked
device handling"), dev_disable_lro() zeroes NETIF_F_LRO feature flag
first for a macvlan device and then for its lower device. As an attempt
to set NETIF_F_LRO to zero is ignored, dev_disable_lro() issues a
warning and taints kernel.
Allowing NETIF_F_LRO to be set independently of the lower device
consists of three parts:
- add the flag to hw_features to allow toggling it
- allow setting it to 0 even if lower device has the flag set
- add the flag to MACVLAN_FEATURES to restore copying from lower
device on macvlan creation
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/macvlan.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 9538674587aa..10604db2a3a0 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -747,7 +747,7 @@ static struct lock_class_key macvlan_netdev_addr_lock_key; | |||
747 | 747 | ||
748 | #define MACVLAN_FEATURES \ | 748 | #define MACVLAN_FEATURES \ |
749 | (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ | 749 | (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ |
750 | NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | \ | 750 | NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_LRO | \ |
751 | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ | 751 | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ |
752 | NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) | 752 | NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) |
753 | 753 | ||
@@ -784,6 +784,7 @@ static int macvlan_init(struct net_device *dev) | |||
784 | (lowerdev->state & MACVLAN_STATE_MASK); | 784 | (lowerdev->state & MACVLAN_STATE_MASK); |
785 | dev->features = lowerdev->features & MACVLAN_FEATURES; | 785 | dev->features = lowerdev->features & MACVLAN_FEATURES; |
786 | dev->features |= ALWAYS_ON_FEATURES; | 786 | dev->features |= ALWAYS_ON_FEATURES; |
787 | dev->hw_features |= NETIF_F_LRO; | ||
787 | dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES; | 788 | dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES; |
788 | dev->gso_max_size = lowerdev->gso_max_size; | 789 | dev->gso_max_size = lowerdev->gso_max_size; |
789 | dev->iflink = lowerdev->ifindex; | 790 | dev->iflink = lowerdev->ifindex; |
@@ -936,15 +937,15 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev, | |||
936 | netdev_features_t features) | 937 | netdev_features_t features) |
937 | { | 938 | { |
938 | struct macvlan_dev *vlan = netdev_priv(dev); | 939 | struct macvlan_dev *vlan = netdev_priv(dev); |
940 | netdev_features_t lowerdev_features = vlan->lowerdev->features; | ||
939 | netdev_features_t mask; | 941 | netdev_features_t mask; |
940 | 942 | ||
941 | features |= NETIF_F_ALL_FOR_ALL; | 943 | features |= NETIF_F_ALL_FOR_ALL; |
942 | features &= (vlan->set_features | ~MACVLAN_FEATURES); | 944 | features &= (vlan->set_features | ~MACVLAN_FEATURES); |
943 | mask = features; | 945 | mask = features; |
944 | 946 | ||
945 | features = netdev_increment_features(vlan->lowerdev->features, | 947 | lowerdev_features &= (features | ~NETIF_F_LRO); |
946 | features, | 948 | features = netdev_increment_features(lowerdev_features, features, mask); |
947 | mask); | ||
948 | features |= ALWAYS_ON_FEATURES; | 949 | features |= ALWAYS_ON_FEATURES; |
949 | features &= ~NETIF_F_NETNS_LOCAL; | 950 | features &= ~NETIF_F_NETNS_LOCAL; |
950 | 951 | ||