diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2010-11-30 01:38:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-06 15:59:04 -0500 |
commit | 7903264402546f45f9bac8ad2bfdb00d00eb124a (patch) | |
tree | 32076a169b37ce9c98916ed2d702de5cab1aeb6c /drivers/net/jme.c | |
parent | 900d495a189dc3ff5952b98a77d18e3018f8286c (diff) |
net: Fix too optimistic NETIF_F_HW_CSUM features
NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM+NETIF_F_IPV6_CSUM, but
some drivers miss the difference. Fix this and also fix UFO dependency
on checksumming offload as it makes the same mistake in assumptions.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jme.c')
-rw-r--r-- | drivers/net/jme.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index c57d9a43ceca..2411e72ba572 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -2076,12 +2076,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu) | |||
2076 | } | 2076 | } |
2077 | 2077 | ||
2078 | if (new_mtu > 1900) { | 2078 | if (new_mtu > 1900) { |
2079 | netdev->features &= ~(NETIF_F_HW_CSUM | | 2079 | netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
2080 | NETIF_F_TSO | | 2080 | NETIF_F_TSO | NETIF_F_TSO6); |
2081 | NETIF_F_TSO6); | ||
2082 | } else { | 2081 | } else { |
2083 | if (test_bit(JME_FLAG_TXCSUM, &jme->flags)) | 2082 | if (test_bit(JME_FLAG_TXCSUM, &jme->flags)) |
2084 | netdev->features |= NETIF_F_HW_CSUM; | 2083 | netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
2085 | if (test_bit(JME_FLAG_TSO, &jme->flags)) | 2084 | if (test_bit(JME_FLAG_TSO, &jme->flags)) |
2086 | netdev->features |= NETIF_F_TSO | NETIF_F_TSO6; | 2085 | netdev->features |= NETIF_F_TSO | NETIF_F_TSO6; |
2087 | } | 2086 | } |
@@ -2514,10 +2513,12 @@ jme_set_tx_csum(struct net_device *netdev, u32 on) | |||
2514 | if (on) { | 2513 | if (on) { |
2515 | set_bit(JME_FLAG_TXCSUM, &jme->flags); | 2514 | set_bit(JME_FLAG_TXCSUM, &jme->flags); |
2516 | if (netdev->mtu <= 1900) | 2515 | if (netdev->mtu <= 1900) |
2517 | netdev->features |= NETIF_F_HW_CSUM; | 2516 | netdev->features |= |
2517 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
2518 | } else { | 2518 | } else { |
2519 | clear_bit(JME_FLAG_TXCSUM, &jme->flags); | 2519 | clear_bit(JME_FLAG_TXCSUM, &jme->flags); |
2520 | netdev->features &= ~NETIF_F_HW_CSUM; | 2520 | netdev->features &= |
2521 | ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); | ||
2521 | } | 2522 | } |
2522 | 2523 | ||
2523 | return 0; | 2524 | return 0; |
@@ -2797,7 +2798,8 @@ jme_init_one(struct pci_dev *pdev, | |||
2797 | netdev->netdev_ops = &jme_netdev_ops; | 2798 | netdev->netdev_ops = &jme_netdev_ops; |
2798 | netdev->ethtool_ops = &jme_ethtool_ops; | 2799 | netdev->ethtool_ops = &jme_ethtool_ops; |
2799 | netdev->watchdog_timeo = TX_TIMEOUT; | 2800 | netdev->watchdog_timeo = TX_TIMEOUT; |
2800 | netdev->features = NETIF_F_HW_CSUM | | 2801 | netdev->features = NETIF_F_IP_CSUM | |
2802 | NETIF_F_IPV6_CSUM | | ||
2801 | NETIF_F_SG | | 2803 | NETIF_F_SG | |
2802 | NETIF_F_TSO | | 2804 | NETIF_F_TSO | |
2803 | NETIF_F_TSO6 | | 2805 | NETIF_F_TSO6 | |