diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2006-04-15 04:05:25 +0200 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2006-04-15 04:05:25 +0200 |
commit | 77b2aad5b4fcb6e050b64bbda158ce528f933023 (patch) | |
tree | 7d60229345056e9c4e4fe39e79801376bb61dc69 /drivers/net/e1000 | |
parent | e1000: Buffer optimizations for small MTU (diff) | |
download | linux-77b2aad5b4fcb6e050b64bbda158ce528f933023.tar.xz linux-77b2aad5b4fcb6e050b64bbda158ce528f933023.zip |
e1000: implement more efficient tx queue locking
Implement more efficient locking (avoid the lock) when checking for
a stopped queue. Also don't wake the queue unless the threshold is
reached to avoid queue on/off thrash.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index f604a1dea399..3c37c40339fb 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -3400,13 +3400,15 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, tx_ring->next_to_clean = i; - spin_lock(&tx_ring->tx_lock); - +#define TX_WAKE_THRESHOLD 32 if (unlikely(cleaned && netif_queue_stopped(netdev) && - netif_carrier_ok(netdev))) - netif_wake_queue(netdev); - - spin_unlock(&tx_ring->tx_lock); + netif_carrier_ok(netdev))) { + spin_lock(&tx_ring->tx_lock); + if (netif_queue_stopped(netdev) && + (E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) + netif_wake_queue(netdev); + spin_unlock(&tx_ring->tx_lock); + } if (adapter->detect_tx_hung) { /* Detect a transmit hang in hardware, this serializes the |