diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-11-15 10:29:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-16 17:43:12 -0500 |
commit | 34324dc2bf27c1773045fea63cb11f7e2a6ad2b9 (patch) | |
tree | 47cd1f4ea5590c405dc60aee70b49fb14f56859b /net/core/dev.c | |
parent | a861a8b233e9024303fb8e73e465e81ad7119d5a (diff) |
net: remove NETIF_F_NO_CSUM feature bit
Only distinct use is checking if NETIF_F_NOCACHE_COPY should be
enabled by default. The check heuristics is altered a bit here,
so it hits other people than before. The default shouldn't be
trusted for performance-critical cases anyway.
For all other uses NETIF_F_NO_CSUM is equivalent to NETIF_F_HW_CSUM.
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.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index f1cca59c4638..26c49d55e79d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5362,12 +5362,6 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, | |||
5362 | features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM); | 5362 | features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM); |
5363 | } | 5363 | } |
5364 | 5364 | ||
5365 | if ((features & NETIF_F_NO_CSUM) && | ||
5366 | (features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { | ||
5367 | netdev_warn(dev, "mixed no checksumming and other settings.\n"); | ||
5368 | features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM); | ||
5369 | } | ||
5370 | |||
5371 | /* Fix illegal SG+CSUM combinations. */ | 5365 | /* Fix illegal SG+CSUM combinations. */ |
5372 | if ((features & NETIF_F_SG) && | 5366 | if ((features & NETIF_F_SG) && |
5373 | !(features & NETIF_F_ALL_CSUM)) { | 5367 | !(features & NETIF_F_ALL_CSUM)) { |
@@ -5624,11 +5618,12 @@ int register_netdevice(struct net_device *dev) | |||
5624 | dev->wanted_features = dev->features & dev->hw_features; | 5618 | dev->wanted_features = dev->features & dev->hw_features; |
5625 | 5619 | ||
5626 | /* Turn on no cache copy if HW is doing checksum */ | 5620 | /* Turn on no cache copy if HW is doing checksum */ |
5627 | dev->hw_features |= NETIF_F_NOCACHE_COPY; | 5621 | if (!(dev->flags & IFF_LOOPBACK)) { |
5628 | if ((dev->features & NETIF_F_ALL_CSUM) && | 5622 | dev->hw_features |= NETIF_F_NOCACHE_COPY; |
5629 | !(dev->features & NETIF_F_NO_CSUM)) { | 5623 | if (dev->features & NETIF_F_ALL_CSUM) { |
5630 | dev->wanted_features |= NETIF_F_NOCACHE_COPY; | 5624 | dev->wanted_features |= NETIF_F_NOCACHE_COPY; |
5631 | dev->features |= NETIF_F_NOCACHE_COPY; | 5625 | dev->features |= NETIF_F_NOCACHE_COPY; |
5626 | } | ||
5632 | } | 5627 | } |
5633 | 5628 | ||
5634 | /* Make NETIF_F_HIGHDMA inheritable to VLAN devices. | 5629 | /* Make NETIF_F_HIGHDMA inheritable to VLAN devices. |
@@ -6374,10 +6369,6 @@ netdev_features_t netdev_increment_features(netdev_features_t all, | |||
6374 | all |= one & (NETIF_F_ONE_FOR_ALL|NETIF_F_ALL_CSUM) & mask; | 6369 | all |= one & (NETIF_F_ONE_FOR_ALL|NETIF_F_ALL_CSUM) & mask; |
6375 | all &= one | ~NETIF_F_ALL_FOR_ALL; | 6370 | all &= one | ~NETIF_F_ALL_FOR_ALL; |
6376 | 6371 | ||
6377 | /* If device needs checksumming, downgrade to it. */ | ||
6378 | if (all & (NETIF_F_ALL_CSUM & ~NETIF_F_NO_CSUM)) | ||
6379 | all &= ~NETIF_F_NO_CSUM; | ||
6380 | |||
6381 | /* If one device supports hw checksumming, set for all. */ | 6372 | /* If one device supports hw checksumming, set for all. */ |
6382 | if (all & NETIF_F_GEN_CSUM) | 6373 | if (all & NETIF_F_GEN_CSUM) |
6383 | all &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM); | 6374 | all &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM); |