diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-09-22 20:46:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-26 21:27:15 -0400 |
commit | c5256c51232d8312755e8de2b514c426b19b101a (patch) | |
tree | 95312aa92634472fc2329032890203dfddd0b776 /net/core/dev.c | |
parent | bba50b99b2410e863b38afdcd0280eb37f8a8bcc (diff) |
net: propagate NETIF_F_HIGHDMA to vlans
Automatically allows vlans to get NETIF_F_HIGHDMA if underlying device
supports it.
On 32bit arches (and more precisely if CONFIG_HIGHMEM is enabled), it
can help to reduce cost of illegal_highdma() and __skb_linearize()
calls.
Tested on tg3 , bnx2, bonding, this worked very well.
This is a generalization of a patch provided by Yi Zou & Jeff Kirsher.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 2c7934f8cf3e..e0c0b86f57a1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5058,10 +5058,11 @@ int register_netdevice(struct net_device *dev) | |||
5058 | if (dev->features & NETIF_F_SG) | 5058 | if (dev->features & NETIF_F_SG) |
5059 | dev->features |= NETIF_F_GSO; | 5059 | dev->features |= NETIF_F_GSO; |
5060 | 5060 | ||
5061 | /* Enable GRO for vlans by default if dev->features has GRO also. | 5061 | /* Enable GRO and NETIF_F_HIGHDMA for vlans by default, |
5062 | * vlan_dev_init() will do the dev->features check. | 5062 | * vlan_dev_init() will do the dev->features check, so these features |
5063 | * are enabled only if supported by underlying device. | ||
5063 | */ | 5064 | */ |
5064 | dev->vlan_features |= NETIF_F_GRO; | 5065 | dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA); |
5065 | 5066 | ||
5066 | ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev); | 5067 | ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev); |
5067 | ret = notifier_to_errno(ret); | 5068 | ret = notifier_to_errno(ret); |