diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-08-23 19:03:57 -0400 |
---|---|---|
committer | Lennert Buytenhek <buytenh@marvell.com> | 2008-09-05 00:33:58 -0400 |
commit | 78fff83b0347d72e996cef883f09c3e5b8544f73 (patch) | |
tree | ccb9eb1b16af748e312ee7c168dbbc4adc3a24fe /drivers/net | |
parent | 45c5d3bc1eae7a1d91b12dbee6443109337ec8c3 (diff) |
mv643xx_eth: make napi unconditional
Make napi unconditional on the receive side, so that we can get rid
of all the locking and local interrupt disabling in the receive path.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index b41860dc5b5e..2b7e76d9ac0c 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -58,7 +58,6 @@ 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 | 60 | #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX |
61 | #define MV643XX_ETH_NAPI | ||
62 | #define MV643XX_ETH_TX_FAST_REFILL | 61 | #define MV643XX_ETH_TX_FAST_REFILL |
63 | 62 | ||
64 | #ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX | 63 | #ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX |
@@ -616,7 +615,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
616 | if (cmd_sts & ERROR_SUMMARY) | 615 | if (cmd_sts & ERROR_SUMMARY) |
617 | stats->rx_errors++; | 616 | stats->rx_errors++; |
618 | 617 | ||
619 | dev_kfree_skb_irq(skb); | 618 | dev_kfree_skb(skb); |
620 | } else { | 619 | } else { |
621 | /* | 620 | /* |
622 | * The -4 is for the CRC in the trailer of the | 621 | * The -4 is for the CRC in the trailer of the |
@@ -630,11 +629,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
630 | (cmd_sts & 0x0007fff8) >> 3); | 629 | (cmd_sts & 0x0007fff8) >> 3); |
631 | } | 630 | } |
632 | skb->protocol = eth_type_trans(skb, mp->dev); | 631 | skb->protocol = eth_type_trans(skb, mp->dev); |
633 | #ifdef MV643XX_ETH_NAPI | ||
634 | netif_receive_skb(skb); | 632 | netif_receive_skb(skb); |
635 | #else | ||
636 | netif_rx(skb); | ||
637 | #endif | ||
638 | } | 633 | } |
639 | 634 | ||
640 | mp->dev->last_rx = jiffies; | 635 | mp->dev->last_rx = jiffies; |
@@ -645,7 +640,6 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
645 | return rx; | 640 | return rx; |
646 | } | 641 | } |
647 | 642 | ||
648 | #ifdef MV643XX_ETH_NAPI | ||
649 | static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | 643 | static int mv643xx_eth_poll(struct napi_struct *napi, int budget) |
650 | { | 644 | { |
651 | struct mv643xx_eth_private *mp; | 645 | struct mv643xx_eth_private *mp; |
@@ -681,7 +675,6 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
681 | 675 | ||
682 | return rx; | 676 | return rx; |
683 | } | 677 | } |
684 | #endif | ||
685 | 678 | ||
686 | 679 | ||
687 | /* tx ***********************************************************************/ | 680 | /* tx ***********************************************************************/ |
@@ -1856,7 +1849,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1856 | /* | 1849 | /* |
1857 | * RxBuffer or RxError set for any of the 8 queues? | 1850 | * RxBuffer or RxError set for any of the 8 queues? |
1858 | */ | 1851 | */ |
1859 | #ifdef MV643XX_ETH_NAPI | ||
1860 | if (int_cause & INT_RX) { | 1852 | if (int_cause & INT_RX) { |
1861 | wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_RX)); | 1853 | wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_RX)); |
1862 | wrl(mp, INT_MASK(mp->port_num), 0x00000000); | 1854 | wrl(mp, INT_MASK(mp->port_num), 0x00000000); |
@@ -1864,15 +1856,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1864 | 1856 | ||
1865 | netif_rx_schedule(dev, &mp->napi); | 1857 | netif_rx_schedule(dev, &mp->napi); |
1866 | } | 1858 | } |
1867 | #else | ||
1868 | if (int_cause & INT_RX) { | ||
1869 | int i; | ||
1870 | |||
1871 | for (i = 7; i >= 0; i--) | ||
1872 | if (mp->rxq_mask & (1 << i)) | ||
1873 | rxq_process(mp->rxq + i, INT_MAX); | ||
1874 | } | ||
1875 | #endif | ||
1876 | 1859 | ||
1877 | /* | 1860 | /* |
1878 | * TxBuffer or TxError set for any of the 8 queues? | 1861 | * TxBuffer or TxError set for any of the 8 queues? |
@@ -2101,9 +2084,7 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
2101 | } | 2084 | } |
2102 | } | 2085 | } |
2103 | 2086 | ||
2104 | #ifdef MV643XX_ETH_NAPI | ||
2105 | napi_enable(&mp->napi); | 2087 | napi_enable(&mp->napi); |
2106 | #endif | ||
2107 | 2088 | ||
2108 | netif_carrier_off(dev); | 2089 | netif_carrier_off(dev); |
2109 | netif_stop_queue(dev); | 2090 | netif_stop_queue(dev); |
@@ -2167,9 +2148,8 @@ static int mv643xx_eth_stop(struct net_device *dev) | |||
2167 | wrl(mp, INT_MASK(mp->port_num), 0x00000000); | 2148 | wrl(mp, INT_MASK(mp->port_num), 0x00000000); |
2168 | rdl(mp, INT_MASK(mp->port_num)); | 2149 | rdl(mp, INT_MASK(mp->port_num)); |
2169 | 2150 | ||
2170 | #ifdef MV643XX_ETH_NAPI | ||
2171 | napi_disable(&mp->napi); | 2151 | napi_disable(&mp->napi); |
2172 | #endif | 2152 | |
2173 | netif_carrier_off(dev); | 2153 | netif_carrier_off(dev); |
2174 | netif_stop_queue(dev); | 2154 | netif_stop_queue(dev); |
2175 | 2155 | ||
@@ -2632,9 +2612,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2632 | mp->port_num = pd->port_number; | 2612 | mp->port_num = pd->port_number; |
2633 | 2613 | ||
2634 | mp->dev = dev; | 2614 | mp->dev = dev; |
2635 | #ifdef MV643XX_ETH_NAPI | 2615 | |
2636 | netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, 64); | 2616 | netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, 64); |
2637 | #endif | ||
2638 | 2617 | ||
2639 | set_params(mp, pd); | 2618 | set_params(mp, pd); |
2640 | 2619 | ||
@@ -2700,10 +2679,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2700 | if (dev->features & NETIF_F_IP_CSUM) | 2679 | if (dev->features & NETIF_F_IP_CSUM) |
2701 | dev_printk(KERN_NOTICE, &dev->dev, "tx checksum offload\n"); | 2680 | dev_printk(KERN_NOTICE, &dev->dev, "tx checksum offload\n"); |
2702 | 2681 | ||
2703 | #ifdef MV643XX_ETH_NAPI | ||
2704 | dev_printk(KERN_NOTICE, &dev->dev, "napi enabled\n"); | ||
2705 | #endif | ||
2706 | |||
2707 | if (mp->tx_desc_sram_size > 0) | 2682 | if (mp->tx_desc_sram_size > 0) |
2708 | dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n"); | 2683 | dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n"); |
2709 | 2684 | ||