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 | |
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>
-rw-r--r-- | drivers/net/benet/be_main.c | 6 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 4 | ||||
-rw-r--r-- | drivers/net/jme.c | 16 | ||||
-rw-r--r-- | drivers/net/pch_gbe/pch_gbe_ethtool.c | 19 | ||||
-rw-r--r-- | drivers/net/pch_gbe/pch_gbe_main.c | 6 | ||||
-rw-r--r-- | drivers/net/sc92031.c | 3 | ||||
-rw-r--r-- | drivers/net/stmmac/stmmac_ethtool.c | 12 | ||||
-rw-r--r-- | drivers/net/stmmac/stmmac_main.c | 5 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 7 | ||||
-rw-r--r-- | net/core/ethtool.c | 4 |
12 files changed, 35 insertions, 51 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 102567ee68c2..275428032ce2 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -2583,10 +2583,12 @@ static void be_netdev_init(struct net_device *netdev) | |||
2583 | int i; | 2583 | int i; |
2584 | 2584 | ||
2585 | netdev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_RX | NETIF_F_TSO | | 2585 | netdev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_RX | NETIF_F_TSO | |
2586 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | NETIF_F_HW_CSUM | | 2586 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | |
2587 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | ||
2587 | NETIF_F_GRO | NETIF_F_TSO6; | 2588 | NETIF_F_GRO | NETIF_F_TSO6; |
2588 | 2589 | ||
2589 | netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_HW_CSUM; | 2590 | netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | |
2591 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
2590 | 2592 | ||
2591 | if (lancer_chip(adapter)) | 2593 | if (lancer_chip(adapter)) |
2592 | netdev->vlan_features |= NETIF_F_TSO6; | 2594 | netdev->vlan_features |= NETIF_F_TSO6; |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 1552fc3c1351..0068a1dbc064 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -8957,7 +8957,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, | |||
8957 | dev->netdev_ops = &bnx2x_netdev_ops; | 8957 | dev->netdev_ops = &bnx2x_netdev_ops; |
8958 | bnx2x_set_ethtool_ops(dev); | 8958 | bnx2x_set_ethtool_ops(dev); |
8959 | dev->features |= NETIF_F_SG; | 8959 | dev->features |= NETIF_F_SG; |
8960 | dev->features |= NETIF_F_HW_CSUM; | 8960 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
8961 | if (bp->flags & USING_DAC_FLAG) | 8961 | if (bp->flags & USING_DAC_FLAG) |
8962 | dev->features |= NETIF_F_HIGHDMA; | 8962 | dev->features |= NETIF_F_HIGHDMA; |
8963 | dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); | 8963 | dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); |
@@ -8965,7 +8965,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, | |||
8965 | dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); | 8965 | dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); |
8966 | 8966 | ||
8967 | dev->vlan_features |= NETIF_F_SG; | 8967 | dev->vlan_features |= NETIF_F_SG; |
8968 | dev->vlan_features |= NETIF_F_HW_CSUM; | 8968 | dev->vlan_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
8969 | if (bp->flags & USING_DAC_FLAG) | 8969 | if (bp->flags & USING_DAC_FLAG) |
8970 | dev->vlan_features |= NETIF_F_HIGHDMA; | 8970 | dev->vlan_features |= NETIF_F_HIGHDMA; |
8971 | dev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); | 8971 | dev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); |
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 | |
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; |
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c index 417adf372828..76290a8c3c14 100644 --- a/drivers/net/sc92031.c +++ b/drivers/net/sc92031.c | |||
@@ -1449,7 +1449,8 @@ static int __devinit sc92031_probe(struct pci_dev *pdev, | |||
1449 | dev->irq = pdev->irq; | 1449 | dev->irq = pdev->irq; |
1450 | 1450 | ||
1451 | /* faked with skb_copy_and_csum_dev */ | 1451 | /* faked with skb_copy_and_csum_dev */ |
1452 | dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; | 1452 | dev->features = NETIF_F_SG | NETIF_F_HIGHDMA | |
1453 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
1453 | 1454 | ||
1454 | dev->netdev_ops = &sc92031_netdev_ops; | 1455 | dev->netdev_ops = &sc92031_netdev_ops; |
1455 | dev->watchdog_timeo = TX_TIMEOUT; | 1456 | dev->watchdog_timeo = TX_TIMEOUT; |
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c index f2695fd180ca..fd719edc7f7c 100644 --- a/drivers/net/stmmac/stmmac_ethtool.c +++ b/drivers/net/stmmac/stmmac_ethtool.c | |||
@@ -197,16 +197,6 @@ static void stmmac_ethtool_gregs(struct net_device *dev, | |||
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | static int stmmac_ethtool_set_tx_csum(struct net_device *netdev, u32 data) | ||
201 | { | ||
202 | if (data) | ||
203 | netdev->features |= NETIF_F_HW_CSUM; | ||
204 | else | ||
205 | netdev->features &= ~NETIF_F_HW_CSUM; | ||
206 | |||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static u32 stmmac_ethtool_get_rx_csum(struct net_device *dev) | 200 | static u32 stmmac_ethtool_get_rx_csum(struct net_device *dev) |
211 | { | 201 | { |
212 | struct stmmac_priv *priv = netdev_priv(dev); | 202 | struct stmmac_priv *priv = netdev_priv(dev); |
@@ -370,7 +360,7 @@ static struct ethtool_ops stmmac_ethtool_ops = { | |||
370 | .get_link = ethtool_op_get_link, | 360 | .get_link = ethtool_op_get_link, |
371 | .get_rx_csum = stmmac_ethtool_get_rx_csum, | 361 | .get_rx_csum = stmmac_ethtool_get_rx_csum, |
372 | .get_tx_csum = ethtool_op_get_tx_csum, | 362 | .get_tx_csum = ethtool_op_get_tx_csum, |
373 | .set_tx_csum = stmmac_ethtool_set_tx_csum, | 363 | .set_tx_csum = ethtool_op_set_tx_ipv6_csum, |
374 | .get_sg = ethtool_op_get_sg, | 364 | .get_sg = ethtool_op_get_sg, |
375 | .set_sg = ethtool_op_set_sg, | 365 | .set_sg = ethtool_op_set_sg, |
376 | .get_pauseparam = stmmac_get_pauseparam, | 366 | .get_pauseparam = stmmac_get_pauseparam, |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 730a6fd79ee0..bfc2d1251502 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -1494,7 +1494,8 @@ static int stmmac_probe(struct net_device *dev) | |||
1494 | dev->netdev_ops = &stmmac_netdev_ops; | 1494 | dev->netdev_ops = &stmmac_netdev_ops; |
1495 | stmmac_set_ethtool_ops(dev); | 1495 | stmmac_set_ethtool_ops(dev); |
1496 | 1496 | ||
1497 | dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA); | 1497 | dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA | |
1498 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
1498 | dev->watchdog_timeo = msecs_to_jiffies(watchdog); | 1499 | dev->watchdog_timeo = msecs_to_jiffies(watchdog); |
1499 | #ifdef STMMAC_VLAN_TAG_USED | 1500 | #ifdef STMMAC_VLAN_TAG_USED |
1500 | /* Both mac100 and gmac support receive VLAN tag detection */ | 1501 | /* Both mac100 and gmac support receive VLAN tag detection */ |
@@ -1525,7 +1526,7 @@ static int stmmac_probe(struct net_device *dev) | |||
1525 | 1526 | ||
1526 | DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", | 1527 | DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", |
1527 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", | 1528 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", |
1528 | (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); | 1529 | (dev->features & NETIF_F_IP_CSUM) ? "on" : "off"); |
1529 | 1530 | ||
1530 | spin_lock_init(&priv->lock); | 1531 | spin_lock_init(&priv->lock); |
1531 | 1532 | ||
diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c index bc9bd1035706..1dd3a21b3a43 100644 --- a/drivers/net/vxge/vxge-ethtool.c +++ b/drivers/net/vxge/vxge-ethtool.c | |||
@@ -1177,7 +1177,7 @@ static const struct ethtool_ops vxge_ethtool_ops = { | |||
1177 | .get_rx_csum = vxge_get_rx_csum, | 1177 | .get_rx_csum = vxge_get_rx_csum, |
1178 | .set_rx_csum = vxge_set_rx_csum, | 1178 | .set_rx_csum = vxge_set_rx_csum, |
1179 | .get_tx_csum = ethtool_op_get_tx_csum, | 1179 | .get_tx_csum = ethtool_op_get_tx_csum, |
1180 | .set_tx_csum = ethtool_op_set_tx_hw_csum, | 1180 | .set_tx_csum = ethtool_op_set_tx_ipv6_csum, |
1181 | .get_sg = ethtool_op_get_sg, | 1181 | .get_sg = ethtool_op_get_sg, |
1182 | .set_sg = ethtool_op_set_sg, | 1182 | .set_sg = ethtool_op_set_sg, |
1183 | .get_tso = ethtool_op_get_tso, | 1183 | .get_tso = ethtool_op_get_tso, |
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 8a84152e320a..4877b3b8a29e 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -3368,7 +3368,7 @@ static int __devinit vxge_device_register(struct __vxge_hw_device *hldev, | |||
3368 | 3368 | ||
3369 | ndev->features |= NETIF_F_SG; | 3369 | ndev->features |= NETIF_F_SG; |
3370 | 3370 | ||
3371 | ndev->features |= NETIF_F_HW_CSUM; | 3371 | ndev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
3372 | vxge_debug_init(vxge_hw_device_trace_level_get(hldev), | 3372 | vxge_debug_init(vxge_hw_device_trace_level_get(hldev), |
3373 | "%s : checksuming enabled", __func__); | 3373 | "%s : checksuming enabled", __func__); |
3374 | 3374 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index cd2437495428..55ff66fabce4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5041,10 +5041,13 @@ unsigned long netdev_fix_features(unsigned long features, const char *name) | |||
5041 | } | 5041 | } |
5042 | 5042 | ||
5043 | if (features & NETIF_F_UFO) { | 5043 | if (features & NETIF_F_UFO) { |
5044 | if (!(features & NETIF_F_GEN_CSUM)) { | 5044 | /* maybe split UFO into V4 and V6? */ |
5045 | if (!((features & NETIF_F_GEN_CSUM) || | ||
5046 | (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) | ||
5047 | == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { | ||
5045 | if (name) | 5048 | if (name) |
5046 | printk(KERN_ERR "%s: Dropping NETIF_F_UFO " | 5049 | printk(KERN_ERR "%s: Dropping NETIF_F_UFO " |
5047 | "since no NETIF_F_HW_CSUM feature.\n", | 5050 | "since no checksum offload features.\n", |
5048 | name); | 5051 | name); |
5049 | features &= ~NETIF_F_UFO; | 5052 | features &= ~NETIF_F_UFO; |
5050 | } | 5053 | } |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 956a9f4971cb..d5bc28818883 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -1171,7 +1171,9 @@ static int ethtool_set_ufo(struct net_device *dev, char __user *useraddr) | |||
1171 | return -EFAULT; | 1171 | return -EFAULT; |
1172 | if (edata.data && !(dev->features & NETIF_F_SG)) | 1172 | if (edata.data && !(dev->features & NETIF_F_SG)) |
1173 | return -EINVAL; | 1173 | return -EINVAL; |
1174 | if (edata.data && !(dev->features & NETIF_F_HW_CSUM)) | 1174 | if (edata.data && !((dev->features & NETIF_F_GEN_CSUM) || |
1175 | (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) | ||
1176 | == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) | ||
1175 | return -EINVAL; | 1177 | return -EINVAL; |
1176 | return dev->ethtool_ops->set_ufo(dev, edata.data); | 1178 | return dev->ethtool_ops->set_ufo(dev, edata.data); |
1177 | } | 1179 | } |