Skip to content

Commit 34324dc

Browse files
osctobedavem330
authored andcommitted
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>
1 parent a861a8b commit 34324dc

14 files changed

Lines changed: 19 additions & 31 deletions

File tree

‎drivers/ieee802154/fakehard.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static void ieee802154_fake_setup(struct net_device *dev)
343343
{
344344
dev->addr_len = IEEE802154_ADDR_LEN;
345345
memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
346-
dev->features = NETIF_F_NO_CSUM;
346+
dev->features = NETIF_F_HW_CSUM;
347347
dev->needed_tailroom = 2; /* FCS */
348348
dev->mtu = 127;
349349
dev->tx_queue_len = 10;

‎drivers/misc/sgi-xp/xpnet.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ xpnet_init(void)
576576
* report an error if the data is not retrievable and the
577577
* packet will be dropped.
578578
*/
579-
xpnet_device->features = NETIF_F_NO_CSUM;
579+
xpnet_device->features = NETIF_F_HW_CSUM;
580580

581581
result = register_netdev(xpnet_device);
582582
if (result != 0) {

‎drivers/net/bonding/bond_main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4361,7 +4361,7 @@ static void bond_setup(struct net_device *bond_dev)
43614361
NETIF_F_HW_VLAN_RX |
43624362
NETIF_F_HW_VLAN_FILTER;
43634363

4364-
bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_NO_CSUM);
4364+
bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
43654365
bond_dev->features |= bond_dev->hw_features;
43664366
}
43674367

‎drivers/net/can/dev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static void can_setup(struct net_device *dev)
454454

455455
/* New-style flags. */
456456
dev->flags = IFF_NOARP;
457-
dev->features = NETIF_F_NO_CSUM;
457+
dev->features = NETIF_F_HW_CSUM;
458458
}
459459

460460
struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)

‎drivers/net/can/slcan.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static void slc_setup(struct net_device *dev)
387387

388388
/* New-style flags. */
389389
dev->flags = IFF_NOARP;
390-
dev->features = NETIF_F_NO_CSUM;
390+
dev->features = NETIF_F_HW_CSUM;
391391
}
392392

393393
/******************************************

‎drivers/net/dummy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void dummy_setup(struct net_device *dev)
134134
dev->flags |= IFF_NOARP;
135135
dev->flags &= ~IFF_MULTICAST;
136136
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO;
137-
dev->features |= NETIF_F_NO_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
137+
dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
138138
random_ether_addr(dev->dev_addr);
139139
}
140140

‎drivers/net/ifb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static const struct net_device_ops ifb_netdev_ops = {
164164
.ndo_validate_addr = eth_validate_addr,
165165
};
166166

167-
#define IFB_FEATURES (NETIF_F_NO_CSUM | NETIF_F_SG | NETIF_F_FRAGLIST | \
167+
#define IFB_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_FRAGLIST | \
168168
NETIF_F_TSO_ECN | NETIF_F_TSO | NETIF_F_TSO6 | \
169169
NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_TX)
170170

‎drivers/net/loopback.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void loopback_setup(struct net_device *dev)
169169
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
170170
| NETIF_F_ALL_TSO
171171
| NETIF_F_UFO
172-
| NETIF_F_NO_CSUM
172+
| NETIF_F_HW_CSUM
173173
| NETIF_F_RXCSUM
174174
| NETIF_F_HIGHDMA
175175
| NETIF_F_LLTX

‎drivers/net/veth.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static void veth_setup(struct net_device *dev)
271271
dev->features |= NETIF_F_LLTX;
272272
dev->destructor = veth_dev_free;
273273

274-
dev->hw_features = NETIF_F_NO_CSUM | NETIF_F_SG | NETIF_F_RXCSUM;
274+
dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_RXCSUM;
275275
}
276276

277277
/*

‎include/linux/netdev_features.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ typedef u64 netdev_features_t;
1717
enum {
1818
NETIF_F_SG_BIT, /* Scatter/gather IO. */
1919
NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */
20-
NETIF_F_NO_CSUM_BIT, /* Does not require checksum. F.e. loopack. */
20+
__UNUSED_NETIF_F_1,
2121
NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */
2222
NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */
2323
NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */
@@ -88,7 +88,6 @@ enum {
8888
#define NETIF_F_LRO __NETIF_F(LRO)
8989
#define NETIF_F_NETNS_LOCAL __NETIF_F(NETNS_LOCAL)
9090
#define NETIF_F_NOCACHE_COPY __NETIF_F(NOCACHE_COPY)
91-
#define NETIF_F_NO_CSUM __NETIF_F(NO_CSUM)
9291
#define NETIF_F_NTUPLE __NETIF_F(NTUPLE)
9392
#define NETIF_F_RXCSUM __NETIF_F(RXCSUM)
9493
#define NETIF_F_RXHASH __NETIF_F(RXHASH)
@@ -118,7 +117,7 @@ enum {
118117
#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \
119118
NETIF_F_TSO6 | NETIF_F_UFO)
120119

121-
#define NETIF_F_GEN_CSUM (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)
120+
#define NETIF_F_GEN_CSUM NETIF_F_HW_CSUM
122121
#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
123122
#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
124123
#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)

0 commit comments

Comments
 (0)