[Intel-wired-lan] [next PATCH S81-V3 5/9] i40evf: hold the critical task bit lock while opening

Bowers, AndrewX andrewx.bowers at intel.com
Tue Oct 31 19:05:38 UTC 2017


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, October 27, 2017 8:07 AM
> To: Michael, Alice <alice.michael at intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S81-V3 5/9] i40evf: hold the critical
> task bit lock while opening
> 
> From: Jacob Keller <jacob.e.keller at intel.com>
> 
> If i40evf_open() is called quickly at the same time as a reset occurs (such as
> via ethtool) it is possible for the device to attempt to open while a reset is in
> progress. This occurs because the driver was not holding the critical task bit
> lock during i40evf_open, nor was it holding it around the call to
> i40evf_up_complete() in i40evf_reset_task().
> 
> We didn't hold the lock previously because calls to i40evf_down() would take
> the bit lock directly, and this would have caused a deadlock.
> 
> To avoid this, we'll move the bit lock handling out of i40evf_down() and into
> the callers of this function. Additionally, we'll now hold the bit lock over the
> entire set of steps when going up or down, to ensure that we remain
> consistent.
> 
> Ultimately this causes us to serialize the transitions between down and up
> properly, and avoid changing status while we're resetting.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 40
> +++++++++++++++++++------
>  1 file changed, 31 insertions(+), 9 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list