Fix e1000e Tx hang check (rhbz 785806)
This commit is contained in:
parent
c2a76c7eaf
commit
71aea6e1f7
|
@ -0,0 +1,95 @@
|
|||
From 09357b00255c233705b1cf6d76a8d147340545b8 Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
|
||||
Date: Fri, 18 Nov 2011 14:25:00 +0000
|
||||
Subject: [PATCH] e1000e: Avoid wrong check on TX hang
|
||||
|
||||
Based on the original patch submitted my Michael Wang
|
||||
<wangyun@linux.vnet.ibm.com>.
|
||||
Descriptors may not be write-back while checking TX hang with flag
|
||||
FLAG2_DMA_BURST on.
|
||||
So when we detect hang, we just flush the descriptor and detect
|
||||
again for once.
|
||||
|
||||
-v2 change 1 to true and 0 to false and remove extra ()
|
||||
|
||||
CC: Michael Wang <wangyun@linux.vnet.ibm.com>
|
||||
CC: Flavio Leitner <fbl@redhat.com>
|
||||
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
|
||||
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
|
||||
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
|
||||
---
|
||||
drivers/net/ethernet/intel/e1000e/e1000.h | 1 +
|
||||
drivers/net/ethernet/intel/e1000e/netdev.c | 23 ++++++++++++++++++++---
|
||||
2 files changed, 21 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
|
||||
index 9fe18d1..f478a22 100644
|
||||
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
|
||||
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
|
||||
@@ -309,6 +309,7 @@ struct e1000_adapter {
|
||||
u32 txd_cmd;
|
||||
|
||||
bool detect_tx_hung;
|
||||
+ bool tx_hang_recheck;
|
||||
u8 tx_timeout_factor;
|
||||
|
||||
u32 tx_int_delay;
|
||||
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
|
||||
index c6e9763..c12df69 100644
|
||||
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
|
||||
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
|
||||
@@ -1014,6 +1014,7 @@ static void e1000_print_hw_hang(struct work_struct *work)
|
||||
struct e1000_adapter *adapter = container_of(work,
|
||||
struct e1000_adapter,
|
||||
print_hang_task);
|
||||
+ struct net_device *netdev = adapter->netdev;
|
||||
struct e1000_ring *tx_ring = adapter->tx_ring;
|
||||
unsigned int i = tx_ring->next_to_clean;
|
||||
unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
|
||||
@@ -1025,6 +1026,21 @@ static void e1000_print_hw_hang(struct work_struct *work)
|
||||
if (test_bit(__E1000_DOWN, &adapter->state))
|
||||
return;
|
||||
|
||||
+ if (!adapter->tx_hang_recheck &&
|
||||
+ (adapter->flags2 & FLAG2_DMA_BURST)) {
|
||||
+ /* May be block on write-back, flush and detect again
|
||||
+ * flush pending descriptor writebacks to memory
|
||||
+ */
|
||||
+ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
|
||||
+ /* execute the writes immediately */
|
||||
+ e1e_flush();
|
||||
+ adapter->tx_hang_recheck = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ /* Real hang detected */
|
||||
+ adapter->tx_hang_recheck = false;
|
||||
+ netif_stop_queue(netdev);
|
||||
+
|
||||
e1e_rphy(hw, PHY_STATUS, &phy_status);
|
||||
e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
|
||||
e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
|
||||
@@ -1145,10 +1161,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
|
||||
if (tx_ring->buffer_info[i].time_stamp &&
|
||||
time_after(jiffies, tx_ring->buffer_info[i].time_stamp
|
||||
+ (adapter->tx_timeout_factor * HZ)) &&
|
||||
- !(er32(STATUS) & E1000_STATUS_TXOFF)) {
|
||||
+ !(er32(STATUS) & E1000_STATUS_TXOFF))
|
||||
schedule_work(&adapter->print_hang_task);
|
||||
- netif_stop_queue(netdev);
|
||||
- }
|
||||
+ else
|
||||
+ adapter->tx_hang_recheck = false;
|
||||
}
|
||||
adapter->total_tx_bytes += total_tx_bytes;
|
||||
adapter->total_tx_packets += total_tx_packets;
|
||||
@@ -3838,6 +3854,7 @@ static int e1000_open(struct net_device *netdev)
|
||||
|
||||
e1000_irq_enable(adapter);
|
||||
|
||||
+ adapter->tx_hang_recheck = false;
|
||||
netif_start_queue(netdev);
|
||||
|
||||
adapter->idle_check = true;
|
||||
--
|
||||
1.7.9
|
||||
|
|
@ -694,6 +694,9 @@ Patch21085: jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
|||
# Remove overlap between bcma/b43 and brcmsmac and reenable bcm4331
|
||||
Patch21091: bcma-brcmsmac-compat.patch
|
||||
|
||||
#rhbz 785806
|
||||
Patch21092: e1000e-Avoid-wrong-check-on-TX-hang.patch
|
||||
|
||||
#rhbz 771058
|
||||
Patch21100: msi-irq-sysfs-warning.patch
|
||||
|
||||
|
@ -1290,6 +1293,9 @@ ApplyPatch proc-fix-null-pointer-deref-in-proc_pid_permission.patch
|
|||
#rhbz 788260
|
||||
ApplyPatch jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
|
||||
|
||||
#rhbz 785806
|
||||
ApplyPatch e1000e-Avoid-wrong-check-on-TX-hang.patch
|
||||
|
||||
# Remove overlap between bcma/b43 and brcmsmac and reenable bcm4331
|
||||
ApplyPatch bcma-brcmsmac-compat.patch
|
||||
|
||||
|
@ -1944,6 +1950,7 @@ fi
|
|||
- CVE-2011-4086: jbd2: unmapped buffer with _Unwritten or _Delay flags
|
||||
set can lead to DoS (rhbz 788260)
|
||||
- Drop patch that was NAKd upstream (rhbz 783211)
|
||||
- Fix e1000e Tx hang check (rhbz 785806)
|
||||
|
||||
* Sun Feb 05 2012 Dave Jones <davej@redhat.com>
|
||||
- Remove unnecessary block-stray-block-put-after-teardown.patch
|
||||
|
|
Loading…
Reference in New Issue