Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a188222b authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK



The name NETIF_F_ALL_CSUM is a misnomer. This does not correspond to the
set of features for offloading all checksums. This is a mask of the
checksum offload related features bits. It is incorrect to set both
NETIF_F_HW_CSUM and NETIF_F_IP_CSUM or NETIF_F_IPV6 at the same time for
features of a device.

This patch:
  - Changes instances of NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK (where
    NETIF_F_ALL_CSUM is being used as a mask).
  - Changes bonding, sfc/efx, ipvlan, macvlan, vlan, and team drivers to
    use NEITF_F_HW_CSUM in features list instead of NETIF_F_ALL_CSUM.

Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 253aab05
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1067,12 +1067,12 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
	return features;
}

#define BOND_VLAN_FEATURES	(NETIF_F_ALL_CSUM | NETIF_F_SG | \
#define BOND_VLAN_FEATURES	(NETIF_F_HW_CSUM | NETIF_F_SG | \
				 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
				 NETIF_F_HIGHDMA | NETIF_F_LRO)

#define BOND_ENC_FEATURES	(NETIF_F_ALL_CSUM | NETIF_F_SG | NETIF_F_RXCSUM |\
				 NETIF_F_ALL_TSO)
#define BOND_ENC_FEATURES	(NETIF_F_HW_CSUM | NETIF_F_SG | \
				 NETIF_F_RXCSUM | NETIF_F_ALL_TSO)

static void bond_compute_features(struct bonding *bond)
{
@@ -4182,7 +4182,6 @@ void bond_setup(struct net_device *bond_dev)
				NETIF_F_HW_VLAN_CTAG_RX |
				NETIF_F_HW_VLAN_CTAG_FILTER;

	bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
	bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
	bond_dev->features |= bond_dev->hw_features;
}
+1 −1
Original line number Diff line number Diff line
@@ -5289,7 +5289,7 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
	    skb->inner_protocol != htons(ETH_P_TEB) ||
	    skb_inner_mac_header(skb) - skb_transport_header(skb) !=
	    sizeof(struct udphdr) + sizeof(struct vxlanhdr))
		return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);

	return features;
}
+3 −2
Original line number Diff line number Diff line
@@ -763,7 +763,7 @@ static netdev_features_t ibmveth_fix_features(struct net_device *dev,
	 */

	if (!(features & NETIF_F_RXCSUM))
		features &= ~NETIF_F_ALL_CSUM;
		features &= ~NETIF_F_CSUM_MASK;

	return features;
}
@@ -928,7 +928,8 @@ static int ibmveth_set_features(struct net_device *dev,
		rc1 = ibmveth_set_csum_offload(dev, rx_csum);
		if (rc1 && !adapter->rx_csum)
			dev->features =
				features & ~(NETIF_F_ALL_CSUM | NETIF_F_RXCSUM);
				features & ~(NETIF_F_CSUM_MASK |
					     NETIF_F_RXCSUM);
	}

	if (large_send != adapter->large_send) {
+1 −1
Original line number Diff line number Diff line
@@ -1357,7 +1357,7 @@ static netdev_features_t fm10k_features_check(struct sk_buff *skb,
	if (!skb->encapsulation || fm10k_tx_encap_offload(skb))
		return features;

	return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
	return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
}

static const struct net_device_ops fm10k_netdev_ops = {
+1 −1
Original line number Diff line number Diff line
@@ -8766,7 +8766,7 @@ static netdev_features_t i40e_features_check(struct sk_buff *skb,
	if (skb->encapsulation &&
	    (skb_inner_mac_header(skb) - skb_transport_header(skb) >
	     I40E_MAX_TUNNEL_HDR_LEN))
		return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);

	return features;
}
Loading