diff options
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 4f37506ad374..76c0fa690cc6 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -632,6 +632,7 @@ e1000_down(struct e1000_adapter *adapter) | |||
632 | 632 | ||
633 | #ifdef CONFIG_E1000_NAPI | 633 | #ifdef CONFIG_E1000_NAPI |
634 | napi_disable(&adapter->napi); | 634 | napi_disable(&adapter->napi); |
635 | atomic_set(&adapter->irq_sem, 0); | ||
635 | #endif | 636 | #endif |
636 | e1000_irq_disable(adapter); | 637 | e1000_irq_disable(adapter); |
637 | 638 | ||
@@ -3924,27 +3925,24 @@ e1000_clean(struct napi_struct *napi, int budget) | |||
3924 | /* Must NOT use netdev_priv macro here. */ | 3925 | /* Must NOT use netdev_priv macro here. */ |
3925 | adapter = poll_dev->priv; | 3926 | adapter = poll_dev->priv; |
3926 | 3927 | ||
3927 | /* Keep link state information with original netdev */ | ||
3928 | if (!netif_carrier_ok(poll_dev)) | ||
3929 | goto quit_polling; | ||
3930 | |||
3931 | /* e1000_clean is called per-cpu. This lock protects | 3928 | /* e1000_clean is called per-cpu. This lock protects |
3932 | * tx_ring[0] from being cleaned by multiple cpus | 3929 | * tx_ring[0] from being cleaned by multiple cpus |
3933 | * simultaneously. A failure obtaining the lock means | 3930 | * simultaneously. A failure obtaining the lock means |
3934 | * tx_ring[0] is currently being cleaned anyway. */ | 3931 | * tx_ring[0] is currently being cleaned anyway. */ |
3935 | if (spin_trylock(&adapter->tx_queue_lock)) { | 3932 | if (spin_trylock(&adapter->tx_queue_lock)) { |
3936 | tx_cleaned = e1000_clean_tx_irq(adapter, | 3933 | tx_cleaned = e1000_clean_tx_irq(adapter, |
3937 | &adapter->tx_ring[0]); | 3934 | &adapter->tx_ring[0]); |
3938 | spin_unlock(&adapter->tx_queue_lock); | 3935 | spin_unlock(&adapter->tx_queue_lock); |
3939 | } | 3936 | } |
3940 | 3937 | ||
3941 | adapter->clean_rx(adapter, &adapter->rx_ring[0], | 3938 | adapter->clean_rx(adapter, &adapter->rx_ring[0], |
3942 | &work_done, budget); | 3939 | &work_done, budget); |
3943 | 3940 | ||
3944 | /* If no Tx and not enough Rx work done, exit the polling mode */ | 3941 | if (tx_cleaned) |
3945 | if ((!tx_cleaned && (work_done == 0)) || | 3942 | work_done = budget; |
3946 | !netif_running(poll_dev)) { | 3943 | |
3947 | quit_polling: | 3944 | /* If budget not fully consumed, exit the polling mode */ |
3945 | if (work_done < budget) { | ||
3948 | if (likely(adapter->itr_setting & 3)) | 3946 | if (likely(adapter->itr_setting & 3)) |
3949 | e1000_set_itr(adapter); | 3947 | e1000_set_itr(adapter); |
3950 | netif_rx_complete(poll_dev, napi); | 3948 | netif_rx_complete(poll_dev, napi); |