macvlan: disable LRO on lowerdev instead of a macvlan
Subsystems (2)
v3 cover 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
Michal Kubecek (2):
macvlan: introduce macvlan_dev_real_dev() helper function
macvlan: disable LRO on lower device instead of macvlan
include/linux/if_macvlan.h | 17 +++++++++++++++++ net/core/dev.c | 5 +++++ 2 files changed, 22 insertions(+)
Signature · 1 line
1.8.1.4
PATCH v3 1/2 macvlan: introduce macvlan_dev_real_dev() helper function
Introduce helper function macvlan_dev_real_dev which returns the underlying device of a macvlan device, similar to vlan_dev_real_dev() for 802.1q VLAN devices.
v2: IFF_MACVLAN flag and equivalent of is_macvlan_dev() were introduced in the meantime
v3: do BUG() if compiled without macvlan support
--- include/linux/if_macvlan.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
include/linux/if_macvlan.h +17 -0
@@ -119,4 +119,21 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops);extern netdev_tx_t macvlan_start_xmit (struct sk_buff *skb,struct net_device *dev); +#if IS_ENABLED (CONFIG_MACVLAN ) +static inline struct net_device * +macvlan_dev_real_dev (const struct net_device *dev) +{ +struct macvlan_dev *macvlan =netdev_priv (dev); + +return macvlan->lowerdev; +} +#else +static inline struct net_device * +macvlan_dev_real_dev (const struct net_device *dev) +{ +BUG (); +return NULL ; +} +#endif +#endif /* _LINUX_IF_MACVLAN_H */
Signature · 1 line
1.8.1.4
PATCH v3 2/2 macvlan: disable LRO on lower device instead of macvlan
In reply to Michal KubecekA macvlan device has always LRO disabled so that calling dev_disable_lro() on it does nothing. If we need to disable LRO e.g. because
- the macvlan device is inserted into a bridge
- IPv6 forwarding is enabled for it
- it is in a different namespace than lowerdev and IPv4 forwarding is enabled in it
we need to disable LRO on its underlying device instead (as we do for 802.1q VLAN devices).
v2: use newly introduced netif_is_macvlan()
--- net/core/dev.c | 5 +++++ 1 file changed, 5 insertions(+)
net/core/dev.c +5 -0
@@ -131,6 +131,7 @@#include <linux/static_key.h> #include <linux/hashtable.h> #include <linux/vmalloc.h> +#include <linux/if_macvlan.h> #include "net-sysfs.h"
@@ -1424,6 +1425,10 @@ void dev_disable_lro(struct net_device *dev)if (is_vlan_dev (dev)) dev =vlan_dev_real_dev (dev); +/* the same for macvlan devices */ +if (netif_is_macvlan (dev)) + dev =macvlan_dev_real_dev (dev); + dev->wanted_features &= ~NETIF_F_LRO ;netdev_update_features (dev);
Signature · 1 line
1.8.1.4
David Miller
maintainerFrom: Michal Kubecek <[email protected]>
Date: Fri, 15 Nov 2013 06:18:30 +0100 (CET)
Quoted 5 lines
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.
Quoted 7 lines
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()inmacvlan_dev_real_dev()if compiled without macvlan
Series applied, thanks Michal.