diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2010-11-16 22:26:58 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2010-11-16 22:26:58 -0500 |
commit | b953799ee29075afd30afe4c0fb65f278b088f69 (patch) | |
tree | 9c229bddd9c00e4903128dc57a3f735bc09fa556 | |
parent | 80fba3f4341b1c98430bee620b507d3f5b7086cd (diff) |
ixgbe: reorder Tx cleanup so that if adapter will reset we don't rearm
The code as it existed could re-arm the queues when it was requesting a HW
reset due to a TX hang. Instead of doing that this change makes it so that
we will just exit if the hardware is believed to be hung.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 0128fe666f0b..1d78b554b0ea 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -735,8 +735,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
735 | struct ixgbe_adapter *adapter = q_vector->adapter; | 735 | struct ixgbe_adapter *adapter = q_vector->adapter; |
736 | union ixgbe_adv_tx_desc *tx_desc, *eop_desc; | 736 | union ixgbe_adv_tx_desc *tx_desc, *eop_desc; |
737 | struct ixgbe_tx_buffer *tx_buffer_info; | 737 | struct ixgbe_tx_buffer *tx_buffer_info; |
738 | unsigned int i, eop, count = 0; | ||
739 | unsigned int total_bytes = 0, total_packets = 0; | 738 | unsigned int total_bytes = 0, total_packets = 0; |
739 | u16 i, eop, count = 0; | ||
740 | 740 | ||
741 | i = tx_ring->next_to_clean; | 741 | i = tx_ring->next_to_clean; |
742 | eop = tx_ring->tx_buffer_info[i].next_to_watch; | 742 | eop = tx_ring->tx_buffer_info[i].next_to_watch; |
@@ -771,6 +771,23 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
771 | } | 771 | } |
772 | 772 | ||
773 | tx_ring->next_to_clean = i; | 773 | tx_ring->next_to_clean = i; |
774 | tx_ring->total_bytes += total_bytes; | ||
775 | tx_ring->total_packets += total_packets; | ||
776 | u64_stats_update_begin(&tx_ring->syncp); | ||
777 | tx_ring->stats.packets += total_packets; | ||
778 | tx_ring->stats.bytes += total_bytes; | ||
779 | u64_stats_update_end(&tx_ring->syncp); | ||
780 | |||
781 | if (check_for_tx_hang(tx_ring) && | ||
782 | ixgbe_check_tx_hang(adapter, tx_ring, i)) { | ||
783 | /* schedule immediate reset if we believe we hung */ | ||
784 | e_info(probe, "tx hang %d detected, resetting " | ||
785 | "adapter\n", adapter->tx_timeout_count + 1); | ||
786 | ixgbe_tx_timeout(adapter->netdev); | ||
787 | |||
788 | /* the adapter is about to reset, no point in enabling stuff */ | ||
789 | return true; | ||
790 | } | ||
774 | 791 | ||
775 | #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2) | 792 | #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2) |
776 | if (unlikely(count && netif_carrier_ok(tx_ring->netdev) && | 793 | if (unlikely(count && netif_carrier_ok(tx_ring->netdev) && |
@@ -786,24 +803,6 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
786 | } | 803 | } |
787 | } | 804 | } |
788 | 805 | ||
789 | if (check_for_tx_hang(tx_ring) && | ||
790 | ixgbe_check_tx_hang(adapter, tx_ring, i)) { | ||
791 | /* schedule immediate reset if we believe we hung */ | ||
792 | e_info(probe, "tx hang %d detected, resetting " | ||
793 | "adapter\n", adapter->tx_timeout_count + 1); | ||
794 | ixgbe_tx_timeout(adapter->netdev); | ||
795 | } | ||
796 | |||
797 | /* re-arm the interrupt */ | ||
798 | if (count >= tx_ring->work_limit) | ||
799 | ixgbe_irq_rearm_queues(adapter, ((u64)1 << q_vector->v_idx)); | ||
800 | |||
801 | tx_ring->total_bytes += total_bytes; | ||
802 | tx_ring->total_packets += total_packets; | ||
803 | u64_stats_update_begin(&tx_ring->syncp); | ||
804 | tx_ring->stats.packets += total_packets; | ||
805 | tx_ring->stats.bytes += total_bytes; | ||
806 | u64_stats_update_end(&tx_ring->syncp); | ||
807 | return count < tx_ring->work_limit; | 806 | return count < tx_ring->work_limit; |
808 | } | 807 | } |
809 | 808 | ||