aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-02-15 16:59:16 +0000
committerDavid S. Miller <davem@davemloft.net>2011-02-17 14:16:32 -0800
commit212b573f5552c60265da721ff9ce32e3462a2cdd (patch)
treeb930a91d4d9c84414eca6e13d67bd5dba7c3c1e0 /net/core/dev.c
parentethtool: move EXPORT_SYMBOL(ethtool_op_set_tx_csum) to correct place (diff)
downloadlinux-dev-212b573f5552c60265da721ff9ce32e3462a2cdd.tar.xz
linux-dev-212b573f5552c60265da721ff9ce32e3462a2cdd.zip
ethtool: enable GSO and GRO by default
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 4580460ebecd..8686f6ffe7f0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5274,6 +5274,12 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
features &= ~NETIF_F_TSO;
}
+ /* Software GSO depends on SG. */
+ if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) {
+ netdev_info(dev, "Dropping NETIF_F_GSO since no SG feature.\n");
+ features &= ~NETIF_F_GSO;
+ }
+
/* UFO needs SG and checksumming */
if (features & NETIF_F_UFO) {
/* maybe split UFO into V4 and V6? */
@@ -5430,11 +5436,15 @@ int register_netdevice(struct net_device *dev)
if (dev->iflink == -1)
dev->iflink = dev->ifindex;
- dev->features = netdev_fix_features(dev, dev->features);
+ /* Enable software offloads by default - will be stripped in
+ * netdev_fix_features() if not supported. */
+ dev->features |= NETIF_F_SOFT_FEATURES;
- /* Enable software GSO if SG is supported. */
- if (dev->features & NETIF_F_SG)
- dev->features |= NETIF_F_GSO;
+ /* Avoid warning from netdev_fix_features() for GSO without SG */
+ if (!(dev->features & NETIF_F_SG))
+ dev->features &= ~NETIF_F_GSO;
+
+ dev->features = netdev_fix_features(dev, dev->features);
/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
* vlan_dev_init() will do the dev->features check, so these features