i40e: prevent overlapping tx_timeout recover
authorAlan Brady <alan.brady@intel.com>
Mon, 29 Oct 2018 18:27:21 +0000 (11:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:00 +0000 (19:47 +0100)
commitaa422af6d3dd57d838d59d80acf6835157844526
treef2eb23850dd5ec789f3e19e222104c11dd3ac1dd
parent5a6b7e1b19ca7fc42345ac97ae31b4618fc3022e
i40e: prevent overlapping tx_timeout recover

[ Upstream commit d5585b7b6846a6d0f9517afe57be3843150719da ]

If a TX hang occurs, we attempt to recover by incrementally resetting.
If we're starved for CPU time, it's possible the reset doesn't actually
complete (or even fire) before another tx_timeout fires causing us to
fly through the different resets without actually doing them.

This adds a bit to set and check if a timeout recovery is already
pending and, if so, bail out of tx_timeout.  The bit will get cleared at
the end of i40e_rebuild when reset is complete.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c