Commit 78fff83b authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Lennert Buytenhek

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: default avatarLennert Buytenhek <buytenh@marvell.com>
parent 45c5d3bc
...@@ -58,7 +58,6 @@ static char mv643xx_eth_driver_name[] = "mv643xx_eth"; ...@@ -58,7 +58,6 @@ static char mv643xx_eth_driver_name[] = "mv643xx_eth";
static char mv643xx_eth_driver_version[] = "1.3"; static char mv643xx_eth_driver_version[] = "1.3";
#define MV643XX_ETH_CHECKSUM_OFFLOAD_TX #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX
#define MV643XX_ETH_NAPI
#define MV643XX_ETH_TX_FAST_REFILL #define MV643XX_ETH_TX_FAST_REFILL
#ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX #ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX
...@@ -616,7 +615,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) ...@@ -616,7 +615,7 @@ static int rxq_process(struct rx_queue *rxq, int budget)
if (cmd_sts & ERROR_SUMMARY) if (cmd_sts & ERROR_SUMMARY)
stats->rx_errors++; stats->rx_errors++;
dev_kfree_skb_irq(skb); dev_kfree_skb(skb);
} else { } else {
/* /*
* The -4 is for the CRC in the trailer of the * 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,11 +629,7 @@ static int rxq_process(struct rx_queue *rxq, int budget)
(cmd_sts & 0x0007fff8) >> 3); (cmd_sts & 0x0007fff8) >> 3);
} }
skb->protocol = eth_type_trans(skb, mp->dev); skb->protocol = eth_type_trans(skb, mp->dev);
#ifdef MV643XX_ETH_NAPI
netif_receive_skb(skb); netif_receive_skb(skb);
#else
netif_rx(skb);
#endif
} }
mp->dev->last_rx = jiffies; mp->dev->last_rx = jiffies;
...@@ -645,7 +640,6 @@ static int rxq_process(struct rx_queue *rxq, int budget) ...@@ -645,7 +640,6 @@ static int rxq_process(struct rx_queue *rxq, int budget)
return rx; return rx;
} }
#ifdef MV643XX_ETH_NAPI
static int mv643xx_eth_poll(struct napi_struct *napi, int budget) static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
{ {
struct mv643xx_eth_private *mp; struct mv643xx_eth_private *mp;
...@@ -681,7 +675,6 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) ...@@ -681,7 +675,6 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
return rx; return rx;
} }
#endif
/* tx ***********************************************************************/ /* tx ***********************************************************************/
...@@ -1856,7 +1849,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) ...@@ -1856,7 +1849,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
/* /*
* RxBuffer or RxError set for any of the 8 queues? * RxBuffer or RxError set for any of the 8 queues?
*/ */
#ifdef MV643XX_ETH_NAPI
if (int_cause & INT_RX) { if (int_cause & INT_RX) {
wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_RX)); wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_RX));
wrl(mp, INT_MASK(mp->port_num), 0x00000000); wrl(mp, INT_MASK(mp->port_num), 0x00000000);
...@@ -1864,15 +1856,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) ...@@ -1864,15 +1856,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id)
netif_rx_schedule(dev, &mp->napi); netif_rx_schedule(dev, &mp->napi);
} }
#else
if (int_cause & INT_RX) {
int i;
for (i = 7; i >= 0; i--)
if (mp->rxq_mask & (1 << i))
rxq_process(mp->rxq + i, INT_MAX);
}
#endif
/* /*
* TxBuffer or TxError set for any of the 8 queues? * TxBuffer or TxError set for any of the 8 queues?
...@@ -2101,9 +2084,7 @@ static int mv643xx_eth_open(struct net_device *dev) ...@@ -2101,9 +2084,7 @@ static int mv643xx_eth_open(struct net_device *dev)
} }
} }
#ifdef MV643XX_ETH_NAPI
napi_enable(&mp->napi); napi_enable(&mp->napi);
#endif
netif_carrier_off(dev); netif_carrier_off(dev);
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -2167,9 +2148,8 @@ static int mv643xx_eth_stop(struct net_device *dev) ...@@ -2167,9 +2148,8 @@ static int mv643xx_eth_stop(struct net_device *dev)
wrl(mp, INT_MASK(mp->port_num), 0x00000000); wrl(mp, INT_MASK(mp->port_num), 0x00000000);
rdl(mp, INT_MASK(mp->port_num)); rdl(mp, INT_MASK(mp->port_num));
#ifdef MV643XX_ETH_NAPI
napi_disable(&mp->napi); napi_disable(&mp->napi);
#endif
netif_carrier_off(dev); netif_carrier_off(dev);
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -2632,9 +2612,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev) ...@@ -2632,9 +2612,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
mp->port_num = pd->port_number; mp->port_num = pd->port_number;
mp->dev = dev; mp->dev = dev;
#ifdef MV643XX_ETH_NAPI
netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, 64); netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, 64);
#endif
set_params(mp, pd); set_params(mp, pd);
...@@ -2700,10 +2679,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) ...@@ -2700,10 +2679,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
if (dev->features & NETIF_F_IP_CSUM) if (dev->features & NETIF_F_IP_CSUM)
dev_printk(KERN_NOTICE, &dev->dev, "tx checksum offload\n"); dev_printk(KERN_NOTICE, &dev->dev, "tx checksum offload\n");
#ifdef MV643XX_ETH_NAPI
dev_printk(KERN_NOTICE, &dev->dev, "napi enabled\n");
#endif
if (mp->tx_desc_sram_size > 0) if (mp->tx_desc_sram_size > 0)
dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n"); dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment