diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-08-23 23:33:55 -0400 |
---|---|---|
committer | Lennert Buytenhek <buytenh@marvell.com> | 2008-09-05 00:33:58 -0400 |
commit | 17cd0a59f9c34164c4f3bfe404894f5285bac112 (patch) | |
tree | 6d35c01accd4218fb7858b55f326203fed05d571 | |
parent | 2257e05c170561bb1168ee50205ae920008c37fb (diff) |
mv643xx_eth: get rid of compile-time configurable transmit checksumming
Get rid of the mv643xx_eth-internal MV643XX_ETH_CHECKSUM_OFFLOAD_TX
compile-time option. Using transmit checksumming is the sane default,
and anyone wanting to disable it should use ethtool(8) instead of
recompiling their kernels.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
-rw-r--r-- | drivers/net/mv643xx_eth.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 3831a8bffbd6..53cfd01b405d 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -57,15 +57,8 @@ | |||
57 | static char mv643xx_eth_driver_name[] = "mv643xx_eth"; | 57 | static char mv643xx_eth_driver_name[] = "mv643xx_eth"; |
58 | static char mv643xx_eth_driver_version[] = "1.3"; | 58 | static char mv643xx_eth_driver_version[] = "1.3"; |
59 | 59 | ||
60 | #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX | ||
61 | #define MV643XX_ETH_TX_FAST_REFILL | 60 | #define MV643XX_ETH_TX_FAST_REFILL |
62 | 61 | ||
63 | #ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX | ||
64 | #define MAX_DESCS_PER_SKB (MAX_SKB_FRAGS + 1) | ||
65 | #else | ||
66 | #define MAX_DESCS_PER_SKB 1 | ||
67 | #endif | ||
68 | |||
69 | /* | 62 | /* |
70 | * Registers shared between all ports. | 63 | * Registers shared between all ports. |
71 | */ | 64 | */ |
@@ -464,7 +457,7 @@ static void __txq_maybe_wake(struct tx_queue *txq) | |||
464 | */ | 457 | */ |
465 | BUG_ON(txq->index != mp->txq_primary); | 458 | BUG_ON(txq->index != mp->txq_primary); |
466 | 459 | ||
467 | if (txq->tx_ring_size - txq->tx_desc_count >= MAX_DESCS_PER_SKB) | 460 | if (txq->tx_ring_size - txq->tx_desc_count >= MAX_SKB_FRAGS + 1) |
468 | netif_wake_queue(mp->dev); | 461 | netif_wake_queue(mp->dev); |
469 | } | 462 | } |
470 | 463 | ||
@@ -855,7 +848,7 @@ static int mv643xx_eth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
855 | 848 | ||
856 | txq = mp->txq + mp->txq_primary; | 849 | txq = mp->txq + mp->txq_primary; |
857 | 850 | ||
858 | if (txq->tx_ring_size - txq->tx_desc_count < MAX_DESCS_PER_SKB) { | 851 | if (txq->tx_ring_size - txq->tx_desc_count < MAX_SKB_FRAGS + 1) { |
859 | spin_unlock_irqrestore(&mp->lock, flags); | 852 | spin_unlock_irqrestore(&mp->lock, flags); |
860 | if (txq->index == mp->txq_primary && net_ratelimit()) | 853 | if (txq->index == mp->txq_primary && net_ratelimit()) |
861 | dev_printk(KERN_ERR, &dev->dev, | 854 | dev_printk(KERN_ERR, &dev->dev, |
@@ -873,7 +866,7 @@ static int mv643xx_eth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
873 | int entries_left; | 866 | int entries_left; |
874 | 867 | ||
875 | entries_left = txq->tx_ring_size - txq->tx_desc_count; | 868 | entries_left = txq->tx_ring_size - txq->tx_desc_count; |
876 | if (entries_left < MAX_DESCS_PER_SKB) | 869 | if (entries_left < MAX_SKB_FRAGS + 1) |
877 | netif_stop_queue(dev); | 870 | netif_stop_queue(dev); |
878 | } | 871 | } |
879 | 872 | ||
@@ -2656,14 +2649,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2656 | dev->watchdog_timeo = 2 * HZ; | 2649 | dev->watchdog_timeo = 2 * HZ; |
2657 | dev->base_addr = 0; | 2650 | dev->base_addr = 0; |
2658 | 2651 | ||
2659 | #ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX | ||
2660 | /* | ||
2661 | * Zero copy can only work if we use Discovery II memory. Else, we will | ||
2662 | * have to map the buffers to ISA memory which is only 16 MB | ||
2663 | */ | ||
2664 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; | 2652 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; |
2665 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM; | 2653 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM; |
2666 | #endif | ||
2667 | 2654 | ||
2668 | SET_NETDEV_DEV(dev, &pdev->dev); | 2655 | SET_NETDEV_DEV(dev, &pdev->dev); |
2669 | 2656 | ||
@@ -2677,12 +2664,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2677 | dev_printk(KERN_NOTICE, &dev->dev, "port %d with MAC address %s\n", | 2664 | dev_printk(KERN_NOTICE, &dev->dev, "port %d with MAC address %s\n", |
2678 | mp->port_num, print_mac(mac, dev->dev_addr)); | 2665 | mp->port_num, print_mac(mac, dev->dev_addr)); |
2679 | 2666 | ||
2680 | if (dev->features & NETIF_F_SG) | ||
2681 | dev_printk(KERN_NOTICE, &dev->dev, "scatter/gather enabled\n"); | ||
2682 | |||
2683 | if (dev->features & NETIF_F_IP_CSUM) | ||
2684 | dev_printk(KERN_NOTICE, &dev->dev, "tx checksum offload\n"); | ||
2685 | |||
2686 | if (mp->tx_desc_sram_size > 0) | 2667 | if (mp->tx_desc_sram_size > 0) |
2687 | dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n"); | 2668 | dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n"); |
2688 | 2669 | ||