]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: Do not check netif_running() and carrier state in ->poll()
authorDavid S. Miller <davem@davemloft.net>
Tue, 8 Jan 2008 04:48:21 +0000 (20:48 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jan 2008 07:30:09 +0000 (23:30 -0800)
Drivers do this to try to break out of the ->poll()'ing loop
when the device is being brought administratively down.

Now that we have a napi_disable() "pending" state we are going
to solve that problem generically.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
drivers/net/e100.c
drivers/net/e1000/e1000_main.c
drivers/net/e1000e/netdev.c
drivers/net/epic100.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/ixgb/ixgb_main.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/ixp2000/ixpdev.c
drivers/net/myri10ge/myri10ge.c
drivers/net/natsemi.c
drivers/net/qla3xxx.c
drivers/net/s2io.c
drivers/net/tulip/interrupt.c
drivers/net/xen-netfront.c

index 2b06e4b4dabc1342fa66101c7a4f0628da5b3bf7..68316f15a7cb5834bd650e58919210a841d671c5 100644 (file)
@@ -1997,7 +1997,7 @@ static int e100_poll(struct napi_struct *napi, int budget)
        tx_cleaned = e100_tx_clean(nic);
 
        /* If no Rx and Tx cleanup work was done, exit polling mode. */
-       if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
+       if((!tx_cleaned && (work_done == 0))) {
                netif_rx_complete(netdev, napi);
                e100_enable_irq(nic);
        }
index 4f37506ad3744656c86d102f63fb66aac2185876..9de71443ef891a5de6e6ae5c6c617ad4c6336250 100644 (file)
@@ -3924,10 +3924,6 @@ e1000_clean(struct napi_struct *napi, int budget)
        /* Must NOT use netdev_priv macro here. */
        adapter = poll_dev->priv;
 
-       /* Keep link state information with original netdev */
-       if (!netif_carrier_ok(poll_dev))
-               goto quit_polling;
-
        /* e1000_clean is called per-cpu.  This lock protects
         * tx_ring[0] from being cleaned by multiple cpus
         * simultaneously.  A failure obtaining the lock means
@@ -3942,9 +3938,7 @@ e1000_clean(struct napi_struct *napi, int budget)
                          &work_done, budget);
 
        /* If no Tx and not enough Rx work done, exit the polling mode */
-       if ((!tx_cleaned && (work_done == 0)) ||
-          !netif_running(poll_dev)) {
-quit_polling:
+       if ((!tx_cleaned && (work_done == 0))) {
                if (likely(adapter->itr_setting & 3))
                        e1000_set_itr(adapter);
                netif_rx_complete(poll_dev, napi);
index 4fd2e23720b69f080569b9c9a789ba2b8fcb7964..dd9698cfbb9d92d7b8229ed95c0b15959c3782ce 100644 (file)
@@ -1389,10 +1389,6 @@ static int e1000_clean(struct napi_struct *napi, int budget)
        /* Must NOT use netdev_priv macro here. */
        adapter = poll_dev->priv;
 
-       /* Keep link state information with original netdev */
-       if (!netif_carrier_ok(poll_dev))
-               goto quit_polling;
-
        /* e1000_clean is called per-cpu.  This lock protects
         * tx_ring from being cleaned by multiple cpus
         * simultaneously.  A failure obtaining the lock means
@@ -1405,9 +1401,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
        adapter->clean_rx(adapter, &work_done, budget);
 
        /* If no Tx and not enough Rx work done, exit the polling mode */
-       if ((!tx_cleaned && (work_done < budget)) ||
-          !netif_running(poll_dev)) {
-quit_polling:
+       if ((!tx_cleaned && (work_done < budget))) {
                if (adapter->itr_setting & 3)
                        e1000_set_itr(adapter);
                netif_rx_complete(poll_dev, napi);
index ecdd3fc8d70ca8af89dc4fbd2f3033139a1fbeb0..0b365b8d947ba8dabd1dd28e94f1710d823cca77 100644 (file)
@@ -1273,7 +1273,7 @@ rx_action:
 
        epic_rx_err(dev, ep);
 
-       if (netif_running(dev) && (work_done < budget)) {
+       if (work_done < budget) {
                unsigned long flags;
                int more;
 
index 8d2904fa57896d33db21f274ca9181fb6f2f828a..ab9637ab3a8d9ccf9ff26e7356a70a559227139d 100644 (file)
@@ -476,11 +476,6 @@ static int fec_enet_rx_common(struct fec_enet_private *ep,
        __u16 pkt_len, sc;
        int curidx;
 
-       if (fpi->use_napi) {
-               if (!netif_running(dev))
-                       return 0;
-       }
-
        /*
         * First, grab all of the stats for the incoming packet.
         * These get messed up if we get called due to a busy condition.
index f2a4d399a6e5137f63fab69a52677317d6d7c9c9..3e1a57a42f110e3ed1ad2a51cb4a90ae8ae1e23c 100644 (file)
@@ -96,9 +96,6 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
        u16 pkt_len, sc;
        int curidx;
 
-       if (!netif_running(dev))
-               return 0;
-
        /*
         * First, grab all of the stats for the incoming packet.
         * These get messed up if we get called due to a busy condition.
index bf9085fe035aa6d4c6476c7fdf4540704494f9e0..a8bef52870fdc14487288f3a2ffb8b93123e337d 100644 (file)
@@ -1794,7 +1794,7 @@ ixgb_clean(struct napi_struct *napi, int budget)
        ixgb_clean_rx_irq(adapter, &work_done, budget);
 
        /* if no Tx and not enough Rx work done, exit the polling mode */
-       if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
+       if((!tx_cleaned && (work_done == 0))) {
                netif_rx_complete(netdev, napi);
                ixgb_irq_enable(adapter);
        }
index 00bc525c656071aebb25b8c4151eba246ce72686..7c319303f0f83d5c6921f04df2e9ab24ed25e770 100644 (file)
@@ -1470,19 +1470,13 @@ static int ixgbe_clean(struct napi_struct *napi, int budget)
        struct net_device *netdev = adapter->netdev;
        int tx_cleaned = 0, work_done = 0;
 
-       /* Keep link state information with original netdev */
-       if (!netif_carrier_ok(adapter->netdev))
-               goto quit_polling;
-
        /* In non-MSIX case, there is no multi-Tx/Rx queue */
        tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
        ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done,
                           budget);
 
        /* If no Tx and not enough Rx work done, exit the polling mode */
-       if ((!tx_cleaned && (work_done < budget)) ||
-           !netif_running(adapter->netdev)) {
-quit_polling:
+       if ((!tx_cleaned && (work_done < budget))) {
                netif_rx_complete(netdev, napi);
                ixgbe_irq_enable(adapter);
        }
index 6c0dd49149d0d3047d55059fd2c54889a3e7786b..484cb2ba717f97d1df4f84b43701a9b7cf7b4bca 100644 (file)
@@ -135,8 +135,6 @@ static int ixpdev_poll(struct napi_struct *napi, int budget)
        struct net_device *dev = ip->dev;
        int rx;
 
-       /* @@@ Have to stop polling when nds[0] is administratively
-        * downed while we are polling.  */
        rx = 0;
        do {
                ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff);
index 8def8657251f19435fa50960cc9a0f69459f417e..c90958f6d3fe8a807976c79a8a1734b186969f1d 100644 (file)
@@ -1239,7 +1239,7 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
        /* process as many rx events as NAPI will allow */
        work_done = myri10ge_clean_rx_done(mgp, budget);
 
-       if (work_done < budget || !netif_running(netdev)) {
+       if (work_done < budget) {
                netif_rx_complete(netdev, napi);
                put_be32(htonl(3), mgp->irq_claim);
        }
index 87cde062fd63d3a58caa6cb7175e8c0bd56b68d3..c329a4f5840c7c22ee80a2882343888ea13ffbde 100644 (file)
@@ -2266,7 +2266,7 @@ static int natsemi_poll(struct napi_struct *napi, int budget)
        /* Reenable interrupts providing nothing is trying to shut
         * the chip down. */
        spin_lock(&np->lock);
-       if (!np->hands_off && netif_running(dev))
+       if (!np->hands_off)
                natsemi_irq_enable(dev);
        spin_unlock(&np->lock);
 
index a5791114b7bde59eddd6aed9c0dc79c590a8d688..cf0774de6c4154fbf46956deaa0fc420a22358f9 100644 (file)
@@ -2320,14 +2320,9 @@ static int ql_poll(struct napi_struct *napi, int budget)
        unsigned long hw_flags;
        struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
 
-       if (!netif_carrier_ok(ndev))
-               goto quit_polling;
-
        ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget);
 
-       if (tx_cleaned + rx_cleaned != budget ||
-           !netif_running(ndev)) {
-quit_polling:
+       if (tx_cleaned + rx_cleaned != budget) {
                spin_lock_irqsave(&qdev->hw_lock, hw_flags);
                __netif_rx_complete(ndev, napi);
                ql_update_small_bufq_prod_index(qdev);
index 9d80f1cf73acbbe70a9eb8df62ef6a9c2f6be871..fa57c49c0c51fad86de064e98e96a36249efb829 100644 (file)
@@ -2704,9 +2704,6 @@ static int s2io_poll(struct napi_struct *napi, int budget)
        struct XENA_dev_config __iomem *bar0 = nic->bar0;
        int i;
 
-       if (!is_s2io_card_up(nic))
-               return 0;
-
        mac_control = &nic->mac_control;
        config = &nic->config;
 
index 0461956d3b50c723c8f92426153a47567e2ad74d..6284afd14bbb5fe42789b0a6f9531172ef9adf12 100644 (file)
@@ -117,9 +117,6 @@ int tulip_poll(struct napi_struct *napi, int budget)
        int received = 0;
 #endif
 
-       if (!netif_running(dev))
-               goto done;
-
 #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
 
 /* that one buffer is needed for mit activation; or might be a
@@ -261,8 +258,6 @@ int tulip_poll(struct napi_struct *napi, int budget)
                 * finally: amount of IO did not increase at all. */
        } while ((ioread32(tp->base_addr + CSR5) & RxIntr));
 
-done:
-
  #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
 
           /* We use this simplistic scheme for IM. It's proven by
index 2a8fc431099f6e1fcd5a652edd043a774629d002..bca37bf0f5455812913e448272749b5d55e7c1a6 100644 (file)
@@ -852,11 +852,6 @@ static int xennet_poll(struct napi_struct *napi, int budget)
 
        spin_lock(&np->rx_lock);
 
-       if (unlikely(!netif_carrier_ok(dev))) {
-               spin_unlock(&np->rx_lock);
-               return 0;
-       }
-
        skb_queue_head_init(&rxq);
        skb_queue_head_init(&errq);
        skb_queue_head_init(&tmpq);