]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
net: remove NETIF_F_NO_CSUM feature bit
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Tue, 15 Nov 2011 15:29:55 +0000 (15:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2011 22:43:12 +0000 (17:43 -0500)
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>
14 files changed:
drivers/ieee802154/fakehard.c
drivers/misc/sgi-xp/xpnet.c
drivers/net/bonding/bond_main.c
drivers/net/can/dev.c
drivers/net/can/slcan.c
drivers/net/dummy.c
drivers/net/ifb.c
drivers/net/loopback.c
drivers/net/veth.c
include/linux/netdev_features.h
include/linux/skbuff.h
net/bridge/br_device.c
net/core/dev.c
net/core/ethtool.c

index eb0e2ccc79ae6c3098cdb065511b047218b0c6a0..73d453159408d62725e81317001889071211f094 100644 (file)
@@ -343,7 +343,7 @@ static void ieee802154_fake_setup(struct net_device *dev)
 {
        dev->addr_len           = IEEE802154_ADDR_LEN;
        memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
-       dev->features           = NETIF_F_NO_CSUM;
+       dev->features           = NETIF_F_HW_CSUM;
        dev->needed_tailroom    = 2; /* FCS */
        dev->mtu                = 127;
        dev->tx_queue_len       = 10;
index 42f067347bc70fd8f24466ed4384408191812611..3fac67a5204cfa768717a00b6628079fd37f939d 100644 (file)
@@ -576,7 +576,7 @@ xpnet_init(void)
         * report an error if the data is not retrievable and the
         * packet will be dropped.
         */
-       xpnet_device->features = NETIF_F_NO_CSUM;
+       xpnet_device->features = NETIF_F_HW_CSUM;
 
        result = register_netdev(xpnet_device);
        if (result != 0) {
index ac5337a04639bdc2cf744cf3f58102af8b254231..25a44d94be172ec9a3c64cdcdd4efdc931f99682 100644 (file)
@@ -4361,7 +4361,7 @@ static void bond_setup(struct net_device *bond_dev)
                                NETIF_F_HW_VLAN_RX |
                                NETIF_F_HW_VLAN_FILTER;
 
-       bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_NO_CSUM);
+       bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
        bond_dev->features |= bond_dev->hw_features;
 }
 
index 25695bde0549138a572f2eeb414f686af869051f..120f1ab5a2ce0d945ba76878afcc0b2352a11f18 100644 (file)
@@ -454,7 +454,7 @@ static void can_setup(struct net_device *dev)
 
        /* New-style flags. */
        dev->flags = IFF_NOARP;
-       dev->features = NETIF_F_NO_CSUM;
+       dev->features = NETIF_F_HW_CSUM;
 }
 
 struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)
index a979b006f4591fe68773dbe5db84dcc160439792..3f1ebcc2cb831af2f09add75d793fd9b1d67f57b 100644 (file)
@@ -387,7 +387,7 @@ static void slc_setup(struct net_device *dev)
 
        /* New-style flags. */
        dev->flags              = IFF_NOARP;
-       dev->features           = NETIF_F_NO_CSUM;
+       dev->features           = NETIF_F_HW_CSUM;
 }
 
 /******************************************
index a7c5e8831e8c0f3a5a01e5adc53b29b2bc85129d..087648ea1edb0ff015ce8abce33ef7ea7a71e0d2 100644 (file)
@@ -134,7 +134,7 @@ static void dummy_setup(struct net_device *dev)
        dev->flags |= IFF_NOARP;
        dev->flags &= ~IFF_MULTICAST;
        dev->features   |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO;
-       dev->features   |= NETIF_F_NO_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
+       dev->features   |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
        random_ether_addr(dev->dev_addr);
 }
 
index 46b5f5fd686bab98b98aff86fbf3e43b0702ddb8..e05b645bbc323559b39e6d42c69744159774767d 100644 (file)
@@ -164,7 +164,7 @@ static const struct net_device_ops ifb_netdev_ops = {
        .ndo_validate_addr = eth_validate_addr,
 };
 
-#define IFB_FEATURES (NETIF_F_NO_CSUM | NETIF_F_SG  | NETIF_F_FRAGLIST | \
+#define IFB_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG  | NETIF_F_FRAGLIST | \
                      NETIF_F_TSO_ECN | NETIF_F_TSO | NETIF_F_TSO6      | \
                      NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_TX)
 
index 4ce9e5f2c069876a0fd4ec6d1446c25408411a33..b71998d0b5b495132b4e07e80f7fae6a93f634ef 100644 (file)
@@ -169,7 +169,7 @@ static void loopback_setup(struct net_device *dev)
        dev->features           = NETIF_F_SG | NETIF_F_FRAGLIST
                | NETIF_F_ALL_TSO
                | NETIF_F_UFO
-               | NETIF_F_NO_CSUM
+               | NETIF_F_HW_CSUM
                | NETIF_F_RXCSUM
                | NETIF_F_HIGHDMA
                | NETIF_F_LLTX
index d32a75fb6d21a24b77c5bcc7c0f616bdaf457e37..b576812bdc5931d7852d2bc1629d65c1bdee7c6c 100644 (file)
@@ -271,7 +271,7 @@ static void veth_setup(struct net_device *dev)
        dev->features |= NETIF_F_LLTX;
        dev->destructor = veth_dev_free;
 
-       dev->hw_features = NETIF_F_NO_CSUM | NETIF_F_SG | NETIF_F_RXCSUM;
+       dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_RXCSUM;
 }
 
 /*
index 20e3a1f9892dd1e71de121c29b7ceba8cd273e65..77f5202977ceb6ced9785142189bd2d5e702539e 100644 (file)
@@ -17,7 +17,7 @@ typedef u64 netdev_features_t;
 enum {
        NETIF_F_SG_BIT,                 /* Scatter/gather IO. */
        NETIF_F_IP_CSUM_BIT,            /* Can checksum TCP/UDP over IPv4. */
-       NETIF_F_NO_CSUM_BIT,            /* Does not require checksum. F.e. loopack. */
+       __UNUSED_NETIF_F_1,
        NETIF_F_HW_CSUM_BIT,            /* Can checksum all the packets. */
        NETIF_F_IPV6_CSUM_BIT,          /* Can checksum TCP/UDP over IPV6 */
        NETIF_F_HIGHDMA_BIT,            /* Can DMA to high memory. */
@@ -88,7 +88,6 @@ enum {
 #define NETIF_F_LRO            __NETIF_F(LRO)
 #define NETIF_F_NETNS_LOCAL    __NETIF_F(NETNS_LOCAL)
 #define NETIF_F_NOCACHE_COPY   __NETIF_F(NOCACHE_COPY)
-#define NETIF_F_NO_CSUM                __NETIF_F(NO_CSUM)
 #define NETIF_F_NTUPLE         __NETIF_F(NTUPLE)
 #define NETIF_F_RXCSUM         __NETIF_F(RXCSUM)
 #define NETIF_F_RXHASH         __NETIF_F(RXHASH)
@@ -118,7 +117,7 @@ enum {
 #define NETIF_F_GSO_SOFTWARE   (NETIF_F_TSO | NETIF_F_TSO_ECN | \
                                 NETIF_F_TSO6 | NETIF_F_UFO)
 
-#define NETIF_F_GEN_CSUM       (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)
+#define NETIF_F_GEN_CSUM       NETIF_F_HW_CSUM
 #define NETIF_F_V4_CSUM                (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
 #define NETIF_F_V6_CSUM                (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
 #define NETIF_F_ALL_CSUM       (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
index a10e487c0864eeefc0b200048f070b3de3d1fb1f..b93117389cfe6f7fc0ffc6cc6ee36d3fcc4b06ea 100644 (file)
@@ -88,7 +88,6 @@
  *     at device setup time.
  *     NETIF_F_HW_CSUM - it is clever device, it is able to checksum
  *                       everything.
- *     NETIF_F_NO_CSUM - loopback or reliable single hop media.
  *     NETIF_F_IP_CSUM - device is dumb. It is able to csum only
  *                       TCP/UDP over IPv4. Sigh. Vendors like this
  *                       way by an unknown reason. Though, see comment above
index 772bad34794cbc3133a3f160fc2e44171da1b332..a3754ac262c3158509e2ab985583d56b06e8d62b 100644 (file)
@@ -342,10 +342,10 @@ void br_dev_setup(struct net_device *dev)
        dev->priv_flags = IFF_EBRIDGE;
 
        dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
-                       NETIF_F_GSO_MASK | NETIF_F_NO_CSUM | NETIF_F_LLTX |
+                       NETIF_F_GSO_MASK | NETIF_F_HW_CSUM | NETIF_F_LLTX |
                        NETIF_F_NETNS_LOCAL | NETIF_F_HW_VLAN_TX;
        dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
-                          NETIF_F_GSO_MASK | NETIF_F_NO_CSUM |
+                          NETIF_F_GSO_MASK | NETIF_F_HW_CSUM |
                           NETIF_F_HW_VLAN_TX;
 
        br->dev = dev;
index f1cca59c46380f7d3f0f7a98d69aed8b0c1a241c..26c49d55e79d83d14d99b12288bf1c32aaad61b2 100644 (file)
@@ -5362,12 +5362,6 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
                features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM);
        }
 
-       if ((features & NETIF_F_NO_CSUM) &&
-           (features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
-               netdev_warn(dev, "mixed no checksumming and other settings.\n");
-               features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM);
-       }
-
        /* Fix illegal SG+CSUM combinations. */
        if ((features & NETIF_F_SG) &&
            !(features & NETIF_F_ALL_CSUM)) {
@@ -5624,11 +5618,12 @@ int register_netdevice(struct net_device *dev)
        dev->wanted_features = dev->features & dev->hw_features;
 
        /* Turn on no cache copy if HW is doing checksum */
-       dev->hw_features |= NETIF_F_NOCACHE_COPY;
-       if ((dev->features & NETIF_F_ALL_CSUM) &&
-           !(dev->features & NETIF_F_NO_CSUM)) {
-               dev->wanted_features |= NETIF_F_NOCACHE_COPY;
-               dev->features |= NETIF_F_NOCACHE_COPY;
+       if (!(dev->flags & IFF_LOOPBACK)) {
+               dev->hw_features |= NETIF_F_NOCACHE_COPY;
+               if (dev->features & NETIF_F_ALL_CSUM) {
+                       dev->wanted_features |= NETIF_F_NOCACHE_COPY;
+                       dev->features |= NETIF_F_NOCACHE_COPY;
+               }
        }
 
        /* Make NETIF_F_HIGHDMA inheritable to VLAN devices.
@@ -6374,10 +6369,6 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
        all |= one & (NETIF_F_ONE_FOR_ALL|NETIF_F_ALL_CSUM) & mask;
        all &= one | ~NETIF_F_ALL_FOR_ALL;
 
-       /* If device needs checksumming, downgrade to it. */
-       if (all & (NETIF_F_ALL_CSUM & ~NETIF_F_NO_CSUM))
-               all &= ~NETIF_F_NO_CSUM;
-
        /* If one device supports hw checksumming, set for all. */
        if (all & NETIF_F_GEN_CSUM)
                all &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
index bbf84fe0096e1453e6d39fcb8f84250b8ba13359..d2eff9ec88be7d548dab0a13be6ad070c105828f 100644 (file)
@@ -43,7 +43,6 @@ EXPORT_SYMBOL(ethtool_op_get_link);
 static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
        [NETIF_F_SG_BIT] =               "tx-scatter-gather",
        [NETIF_F_IP_CSUM_BIT] =          "tx-checksum-ipv4",
-       [NETIF_F_NO_CSUM_BIT] =          "tx-checksum-unneeded",
        [NETIF_F_HW_CSUM_BIT] =          "tx-checksum-ip-generic",
        [NETIF_F_IPV6_CSUM_BIT] =        "tx-checksum-ipv6",
        [NETIF_F_HIGHDMA_BIT] =          "highdma",