]>
Commit | Line | Data |
---|---|---|
91b336e7 TL |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Alan Brady <alan.brady@intel.com> | |
3 | Date: Mon, 29 Oct 2018 11:27:21 -0700 | |
4 | Subject: [PATCH] i40e: prevent overlapping tx_timeout recover | |
5 | ||
6 | If a TX hang occurs, we attempt to recover by incrementally resetting. | |
7 | If we're starved for CPU time, it's possible the reset doesn't actually | |
8 | complete (or even fire) before another tx_timeout fires causing us to | |
9 | fly through the different resets without actually doing them. | |
10 | ||
11 | This adds a bit to set and check if a timeout recovery is already | |
12 | pending and, if so, bail out of tx_timeout. The bit will get cleared at | |
13 | the end of i40e_rebuild when reset is complete. | |
14 | ||
15 | Signed-off-by: Alan Brady <alan.brady@intel.com> | |
16 | Tested-by: Andrew Bowers <andrewx.bowers@intel.com> | |
17 | Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> | |
18 | Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> | |
19 | --- | |
20 | drivers/net/ethernet/intel/i40e/i40e.h | 1 + | |
21 | drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++ | |
22 | 2 files changed, 6 insertions(+) | |
23 | ||
24 | diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h | |
25 | index e019baa905c5..80114d6a910a 100644 | |
26 | --- a/drivers/net/ethernet/intel/i40e/i40e.h | |
27 | +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |
28 | @@ -145,6 +145,7 @@ enum i40e_state_t { | |
29 | __I40E_MDD_EVENT_PENDING, | |
30 | __I40E_VFLR_EVENT_PENDING, | |
31 | __I40E_RESET_RECOVERY_PENDING, | |
32 | + __I40E_TIMEOUT_RECOVERY_PENDING, | |
33 | __I40E_MISC_IRQ_REQUESTED, | |
34 | __I40E_RESET_INTR_RECEIVED, | |
35 | __I40E_REINIT_REQUESTED, | |
36 | diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c | |
37 | index 7895a0af37e6..874fd143c351 100644 | |
38 | --- a/drivers/net/ethernet/intel/i40e/i40e_main.c | |
39 | +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |
40 | @@ -365,6 +365,10 @@ static void i40e_tx_timeout(struct net_device *netdev) | |
41 | (pf->tx_timeout_last_recovery + netdev->watchdog_timeo))) | |
42 | return; /* don't do any new action before the next timeout */ | |
43 | ||
44 | + /* don't kick off another recovery if one is already pending */ | |
45 | + if (test_and_set_bit(__I40E_TIMEOUT_RECOVERY_PENDING, pf->state)) | |
46 | + return; | |
47 | + | |
48 | if (tx_ring) { | |
49 | head = i40e_get_head(tx_ring); | |
50 | /* Read interrupt register */ | |
51 | @@ -9478,6 +9482,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) | |
52 | clear_bit(__I40E_RESET_FAILED, pf->state); | |
53 | clear_recovery: | |
54 | clear_bit(__I40E_RESET_RECOVERY_PENDING, pf->state); | |
55 | + clear_bit(__I40E_TIMEOUT_RECOVERY_PENDING, pf->state); | |
56 | } | |
57 | ||
58 | /** |