]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: fix client notify of VF reset
authorAlan Brady <alan.brady@intel.com>
Tue, 22 Aug 2017 10:57:53 +0000 (06:57 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 2 Oct 2017 19:46:36 +0000 (12:46 -0700)
commit87c8e6062d41bb2c1cca6d5225520ee88e7498bc
tree7d5dfd9bda3cbc499156db0becf6d730dec98923
parent133e2011c7c79b5d68945b870cad5a9506a59a7d
i40e: fix client notify of VF reset

Currently there is a bug in which the PF driver fails to inform clients
of a VF reset which then causes clients to leak resources.  The bug
exists because we were incorrectly checking the I40E_VF_STATE_PRE_ENABLE
bit.

When a VF is first init we go through a reset to initialize variables
and allocate resources but we don't want to inform clients of this first
reset since the client isn't fully enabled yet so we set a state bit
signifying we're in a "pre-enabled" client state.  During the first
reset we should be clearing the bit, allowing all following resets to
notify the client of the reset when the bit is not set.  This patch
fixes the issue by negating the 'test_and_clear_bit' check to accurately
reflect the behavior we want.

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>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c