[Intel-wired-lan] [PATCH S40 05/15] ice: Fix removing driver while bare-metal VFs pass traffic

Bowers, AndrewX andrewx.bowers at intel.com
Tue Mar 3 19:05:41 UTC 2020


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Tony Nguyen
> Sent: Thursday, February 27, 2020 10:15 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S40 05/15] ice: Fix removing driver while
> bare-metal VFs pass traffic
> 
> From: Brett Creeley <brett.creeley at intel.com>
> 
> Currently, if there are bare-metal VFs passing traffic and the ice driver is
> removed, there is a possibility of VFs triggering a Tx timeout right before
> iavf_remove(). This is causing iavf_close() to not be called because there is a
> check in the beginning of iavf_remove() that bails out early if (adapter->state
> < IAVF_DOWN_PENDING). This makes it so some resources do not get
> cleaned up. Specifically, free_irq() is never called for data interrupts, which
> results in the following line of code to trigger:
> 
> pci_disable_msix()
> 	free_msi_irqs()
> 		...
> 		BUG_ON(irq_has_action(entry->irq + i));
> 		...
> 
> To prevent the Tx timeout from occurring on the VF during driver unload for
> ice and the iavf there are a few changes that are needed.
> 
> [1] Don't disable all active VF Tx/Rx queues prior to calling pci_disable_sriov.
> 
> [2] Call ice_free_vfs() before disabling the service task.
> 
> [3] Disable VF resets when the ice driver is being unloaded by setting the pf-
> >state flag __ICE_VF_RESETS_DISABLED.
> 
> Changing [1] and [2] allow each VF driver's remove flow to successfully send
> VIRTCHNL requests, which includes queue disable. This prevents unexpected
> Tx timeouts because the PF driver is no longer forcefully disabling queues.
> 
> Due to [1] and [2] there is a possibility that the PF driver will get a VFLR or
> reset request over VIRTCHNL from a VF during PF driver unload.
> Prevent that by doing [3].
> 
> Signed-off-by: Brett Creeley <brett.creeley at intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice.h          |  1 +
>  drivers/net/ethernet/intel/ice/ice_main.c     | 19 +++++++++++++++----
>  .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 19 +++++++++++++------
>  3 files changed, 29 insertions(+), 10 deletions(-)

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




More information about the Intel-wired-lan mailing list