[Intel-wired-lan] [net PATCH v2] i40e/i40evf: avoid mutex re-init

Bowers, AndrewX andrewx.bowers at intel.com
Thu Dec 3 15:30:10 UTC 2015


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Jesse Brandeburg
> Sent: Wednesday, November 18, 2015 3:47 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [net PATCH v2] i40e/i40evf: avoid mutex re-init
> 
> If the driver were to happen to have a mutex held while the
> i40e_init_adminq call was called, the init_adminq might inadvertently call
> mutex_init on a lock that was held which is a violation of the calling
> semantics.
> 
> Fix this by avoiding adminq.c code allocating/freeing this memory, and then
> do the same work only once in probe/remove.
> 
> Testing Hints (Required if no HSD): for VF, load i40evf in bare metal and echo
> 32 > sriov_numvfs; echo 0 > sriov_numvfs in a loop.  Yes this is a horrible
> thing to do.
> 
> Reported-by: Stefan Assmann <sassmann at redhat.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
> Change-ID: Ida263c51b34e195252179e7e5e400d73a99be7a2
> 
> ---
> 
> v2: removed old calls to mutex_init that are no longer necessary
> ---
>  drivers/net/ethernet/intel/i40e/i40e_adminq.c   |  6 ------
>  drivers/net/ethernet/intel/i40e/i40e_main.c     | 11 ++++++++++-
>  drivers/net/ethernet/intel/i40evf/i40e_adminq.c |  6 ------
> drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 ++++++++++
>  4 files changed, 20 insertions(+), 13 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>
Patch code changes correctly applied, echoing 0, 32, repeat in a loop does not crash driver/cause unexpected behavior


More information about the Intel-wired-lan mailing list