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/pch_gbe | |
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/pch_gbe')
-rw-r--r-- | drivers/net/pch_gbe/pch_gbe_ethtool.c | 19 | ||||
-rw-r--r-- | drivers/net/pch_gbe/pch_gbe_main.c | 6 |
2 files changed, 4 insertions, 21 deletions
diff --git a/drivers/net/pch_gbe/pch_gbe_ethtool.c b/drivers/net/pch_gbe/pch_gbe_ethtool.c index c8cc32c0edc9..c8c873b31a89 100644 --- a/drivers/net/pch_gbe/pch_gbe_ethtool.c +++ b/drivers/net/pch_gbe/pch_gbe_ethtool.c | |||
@@ -469,18 +469,6 @@ static int pch_gbe_set_rx_csum(struct net_device *netdev, u32 data) | |||
469 | } | 469 | } |
470 | 470 | ||
471 | /** | 471 | /** |
472 | * pch_gbe_get_tx_csum - Report whether transmit checksums are turned on or off | ||
473 | * @netdev: Network interface device structure | ||
474 | * Returns | ||
475 | * true(1): Checksum On | ||
476 | * false(0): Checksum Off | ||
477 | */ | ||
478 | static u32 pch_gbe_get_tx_csum(struct net_device *netdev) | ||
479 | { | ||
480 | return (netdev->features & NETIF_F_HW_CSUM) != 0; | ||
481 | } | ||
482 | |||
483 | /** | ||
484 | * pch_gbe_set_tx_csum - Turn transmit checksums on or off | 472 | * pch_gbe_set_tx_csum - Turn transmit checksums on or off |
485 | * @netdev: Network interface device structure | 473 | * @netdev: Network interface device structure |
486 | * @data: Checksum on[true] or off[false] | 474 | * @data: Checksum on[true] or off[false] |
@@ -493,11 +481,7 @@ static int pch_gbe_set_tx_csum(struct net_device *netdev, u32 data) | |||
493 | struct pch_gbe_adapter *adapter = netdev_priv(netdev); | 481 | struct pch_gbe_adapter *adapter = netdev_priv(netdev); |
494 | 482 | ||
495 | adapter->tx_csum = data; | 483 | adapter->tx_csum = data; |
496 | if (data) | 484 | return ethtool_op_set_tx_ipv6_csum(netdev, data); |
497 | netdev->features |= NETIF_F_HW_CSUM; | ||
498 | else | ||
499 | netdev->features &= ~NETIF_F_HW_CSUM; | ||
500 | return 0; | ||
501 | } | 485 | } |
502 | 486 | ||
503 | /** | 487 | /** |
@@ -572,7 +556,6 @@ static const struct ethtool_ops pch_gbe_ethtool_ops = { | |||
572 | .set_pauseparam = pch_gbe_set_pauseparam, | 556 | .set_pauseparam = pch_gbe_set_pauseparam, |
573 | .get_rx_csum = pch_gbe_get_rx_csum, | 557 | .get_rx_csum = pch_gbe_get_rx_csum, |
574 | .set_rx_csum = pch_gbe_set_rx_csum, | 558 | .set_rx_csum = pch_gbe_set_rx_csum, |
575 | .get_tx_csum = pch_gbe_get_tx_csum, | ||
576 | .set_tx_csum = pch_gbe_set_tx_csum, | 559 | .set_tx_csum = pch_gbe_set_tx_csum, |
577 | .get_strings = pch_gbe_get_strings, | 560 | .get_strings = pch_gbe_get_strings, |
578 | .get_ethtool_stats = pch_gbe_get_ethtool_stats, | 561 | .get_ethtool_stats = pch_gbe_get_ethtool_stats, |
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c index afb75066b14d..58e79033a8ee 100644 --- a/drivers/net/pch_gbe/pch_gbe_main.c +++ b/drivers/net/pch_gbe/pch_gbe_main.c | |||
@@ -2319,7 +2319,7 @@ static int pch_gbe_probe(struct pci_dev *pdev, | |||
2319 | netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD; | 2319 | netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD; |
2320 | netif_napi_add(netdev, &adapter->napi, | 2320 | netif_napi_add(netdev, &adapter->napi, |
2321 | pch_gbe_napi_poll, PCH_GBE_RX_WEIGHT); | 2321 | pch_gbe_napi_poll, PCH_GBE_RX_WEIGHT); |
2322 | netdev->features = NETIF_F_HW_CSUM | NETIF_F_GRO; | 2322 | netdev->features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_GRO; |
2323 | pch_gbe_set_ethtool_ops(netdev); | 2323 | pch_gbe_set_ethtool_ops(netdev); |
2324 | 2324 | ||
2325 | pch_gbe_mac_reset_hw(&adapter->hw); | 2325 | pch_gbe_mac_reset_hw(&adapter->hw); |
@@ -2358,9 +2358,9 @@ static int pch_gbe_probe(struct pci_dev *pdev, | |||
2358 | pch_gbe_check_options(adapter); | 2358 | pch_gbe_check_options(adapter); |
2359 | 2359 | ||
2360 | if (adapter->tx_csum) | 2360 | if (adapter->tx_csum) |
2361 | netdev->features |= NETIF_F_HW_CSUM; | 2361 | netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
2362 | else | 2362 | else |
2363 | netdev->features &= ~NETIF_F_HW_CSUM; | 2363 | netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); |
2364 | 2364 | ||
2365 | /* initialize the wol settings based on the eeprom settings */ | 2365 | /* initialize the wol settings based on the eeprom settings */ |
2366 | adapter->wake_up_evt = PCH_GBE_WL_INIT_SETTING; | 2366 | adapter->wake_up_evt = PCH_GBE_WL_INIT_SETTING; |