aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-12-14 14:19:44 -0500
committerDavid S. Miller <davem@davemloft.net>2015-12-15 16:50:20 -0500
commitc8cd0989bd151fda87bbf10887b3df18021284bc (patch)
tree714a0169000dfa3c7456e69b58da887159b71586 /net/core/dev.c
parenta188222b6ed29404ac2d4232d35d1fe0e77af370 (diff)
net: Eliminate NETIF_F_GEN_CSUM and NETIF_F_V[46]_CSUM
These netif flags are unnecessary convolutions. It is more straightforward to just use NETIF_F_HW_CSUM, NETIF_F_IP_CSUM, and NETIF_F_IPV6_CSUM directly. This patch also: - Cleans up can_checksum_protocol - Simplifies netdev_intersect_features Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 5a3b5a404642..45b013f27625 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6467,9 +6467,9 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
6467 /* UFO needs SG and checksumming */ 6467 /* UFO needs SG and checksumming */
6468 if (features & NETIF_F_UFO) { 6468 if (features & NETIF_F_UFO) {
6469 /* maybe split UFO into V4 and V6? */ 6469 /* maybe split UFO into V4 and V6? */
6470 if (!((features & NETIF_F_GEN_CSUM) || 6470 if (!(features & NETIF_F_HW_CSUM) &&
6471 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) 6471 ((features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) !=
6472 == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 6472 (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))) {
6473 netdev_dbg(dev, 6473 netdev_dbg(dev,
6474 "Dropping NETIF_F_UFO since no checksum offload features.\n"); 6474 "Dropping NETIF_F_UFO since no checksum offload features.\n");
6475 features &= ~NETIF_F_UFO; 6475 features &= ~NETIF_F_UFO;
@@ -7571,7 +7571,7 @@ static int dev_cpu_callback(struct notifier_block *nfb,
7571netdev_features_t netdev_increment_features(netdev_features_t all, 7571netdev_features_t netdev_increment_features(netdev_features_t all,
7572 netdev_features_t one, netdev_features_t mask) 7572 netdev_features_t one, netdev_features_t mask)
7573{ 7573{
7574 if (mask & NETIF_F_GEN_CSUM) 7574 if (mask & NETIF_F_HW_CSUM)
7575 mask |= NETIF_F_CSUM_MASK; 7575 mask |= NETIF_F_CSUM_MASK;
7576 mask |= NETIF_F_VLAN_CHALLENGED; 7576 mask |= NETIF_F_VLAN_CHALLENGED;
7577 7577
@@ -7579,8 +7579,8 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
7579 all &= one | ~NETIF_F_ALL_FOR_ALL; 7579 all &= one | ~NETIF_F_ALL_FOR_ALL;
7580 7580
7581 /* If one device supports hw checksumming, set for all. */ 7581 /* If one device supports hw checksumming, set for all. */
7582 if (all & NETIF_F_GEN_CSUM) 7582 if (all & NETIF_F_HW_CSUM)
7583 all &= ~(NETIF_F_CSUM_MASK & ~NETIF_F_GEN_CSUM); 7583 all &= ~(NETIF_F_CSUM_MASK & ~NETIF_F_HW_CSUM);
7584 7584
7585 return all; 7585 return all;
7586} 7586}