diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2009-04-16 12:59:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-17 04:09:59 -0400 |
commit | 843f42678f6c47a2c8d1648e584cb57ebff3750f (patch) | |
tree | ffcef58a48baebe78f28104656638ad5d44c57ee /drivers/net/e1000 | |
parent | a86043c2ad92aa6312807039198d6ab6171164ef (diff) |
e1000: fix transmit routine exit bug
If the e1000 transmit cleanup inner loop exited early, then
cleaned might not be true. This could cause tx hangs or other
badness. Use count to track the total number of descriptors
cleaned instead of basing a tx queue restart off of a temporary
working state variable.
This code now makes the flow the same for e1000/e1000e/igb/ixgbe
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index ef12931d302a..6a46ceed9436 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3834,7 +3834,6 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
3834 | struct e1000_buffer *buffer_info; | 3834 | struct e1000_buffer *buffer_info; |
3835 | unsigned int i, eop; | 3835 | unsigned int i, eop; |
3836 | unsigned int count = 0; | 3836 | unsigned int count = 0; |
3837 | bool cleaned = false; | ||
3838 | unsigned int total_tx_bytes=0, total_tx_packets=0; | 3837 | unsigned int total_tx_bytes=0, total_tx_packets=0; |
3839 | 3838 | ||
3840 | i = tx_ring->next_to_clean; | 3839 | i = tx_ring->next_to_clean; |
@@ -3843,7 +3842,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
3843 | 3842 | ||
3844 | while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) && | 3843 | while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) && |
3845 | (count < tx_ring->count)) { | 3844 | (count < tx_ring->count)) { |
3846 | for (cleaned = false; !cleaned; count++) { | 3845 | bool cleaned = false; |
3846 | for ( ; !cleaned; count++) { | ||
3847 | tx_desc = E1000_TX_DESC(*tx_ring, i); | 3847 | tx_desc = E1000_TX_DESC(*tx_ring, i); |
3848 | buffer_info = &tx_ring->buffer_info[i]; | 3848 | buffer_info = &tx_ring->buffer_info[i]; |
3849 | cleaned = (i == eop); | 3849 | cleaned = (i == eop); |
@@ -3871,7 +3871,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
3871 | tx_ring->next_to_clean = i; | 3871 | tx_ring->next_to_clean = i; |
3872 | 3872 | ||
3873 | #define TX_WAKE_THRESHOLD 32 | 3873 | #define TX_WAKE_THRESHOLD 32 |
3874 | if (unlikely(cleaned && netif_carrier_ok(netdev) && | 3874 | if (unlikely(count && netif_carrier_ok(netdev) && |
3875 | E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) { | 3875 | E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) { |
3876 | /* Make sure that anybody stopping the queue after this | 3876 | /* Make sure that anybody stopping the queue after this |
3877 | * sees the new next_to_clean. | 3877 | * sees the new next_to_clean. |