diff options
author | David S. Miller <davem@davemloft.net> | 2013-11-15 17:55:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-15 17:55:58 -0500 |
commit | 82c80e9d9de354333aa69368576df6a355791418 (patch) | |
tree | 6f19d2911b09276a4f69f13e99272321024417f6 | |
parent | f9de11a165943a55e0fbda714caf60eaeb276a42 (diff) | |
parent | 529d04895446f02449077a4ff49185b593283e19 (diff) |
Merge branch 'macvlan'
Michal Kubecek says:
====================
macvlan: disable LRO on lowerdev instead of a macvlan
A customer of ours encountered a problem with LRO on an ixgbe network
card. Analysis showed that it was a known conflict of forwarding and LRO
but the forwarding was enabled in an LXC container where only a macvlan
was, not the ethernet device itself.
I believe the solution is exactly the same as what we do for "normal"
(802.1q) VLAN devices: if dev_disable_lro() is called for such device,
LRO is disabled on the underlying "real" device instead.
v2: adapt to changes merged from net-next
v3: use BUG() in macvlan_dev_real_dev() if compiled without macvlan
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/if_macvlan.h | 17 | ||||
-rw-r--r-- | net/core/dev.c | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index c2702856295e..84ba5ac39e03 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -119,4 +119,21 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops); | |||
119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | 119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, |
120 | struct net_device *dev); | 120 | struct net_device *dev); |
121 | 121 | ||
122 | #if IS_ENABLED(CONFIG_MACVLAN) | ||
123 | static inline struct net_device * | ||
124 | macvlan_dev_real_dev(const struct net_device *dev) | ||
125 | { | ||
126 | struct macvlan_dev *macvlan = netdev_priv(dev); | ||
127 | |||
128 | return macvlan->lowerdev; | ||
129 | } | ||
130 | #else | ||
131 | static inline struct net_device * | ||
132 | macvlan_dev_real_dev(const struct net_device *dev) | ||
133 | { | ||
134 | BUG(); | ||
135 | return NULL; | ||
136 | } | ||
137 | #endif | ||
138 | |||
122 | #endif /* _LINUX_IF_MACVLAN_H */ | 139 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/net/core/dev.c b/net/core/dev.c index 974143d3e727..7e00a7342ee6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -131,6 +131,7 @@ | |||
131 | #include <linux/static_key.h> | 131 | #include <linux/static_key.h> |
132 | #include <linux/hashtable.h> | 132 | #include <linux/hashtable.h> |
133 | #include <linux/vmalloc.h> | 133 | #include <linux/vmalloc.h> |
134 | #include <linux/if_macvlan.h> | ||
134 | 135 | ||
135 | #include "net-sysfs.h" | 136 | #include "net-sysfs.h" |
136 | 137 | ||
@@ -1424,6 +1425,10 @@ void dev_disable_lro(struct net_device *dev) | |||
1424 | if (is_vlan_dev(dev)) | 1425 | if (is_vlan_dev(dev)) |
1425 | dev = vlan_dev_real_dev(dev); | 1426 | dev = vlan_dev_real_dev(dev); |
1426 | 1427 | ||
1428 | /* the same for macvlan devices */ | ||
1429 | if (netif_is_macvlan(dev)) | ||
1430 | dev = macvlan_dev_real_dev(dev); | ||
1431 | |||
1427 | dev->wanted_features &= ~NETIF_F_LRO; | 1432 | dev->wanted_features &= ~NETIF_F_LRO; |
1428 | netdev_update_features(dev); | 1433 | netdev_update_features(dev); |
1429 | 1434 | ||