• Robert Konklewski's avatar
    i40e: Fixed race conditions in VF reset · beff3e9d
    Robert Konklewski authored
    First, this patch eliminates IOMMU DMAR Faults caused by VF hardware.
    This is done by enabling VF hardware only after VSI resources are
    freed. Otherwise, hardware could DMA into memory that is (or just has
    been) being freed.
    
    Then, the VF driver is activated only after VSI resources have been
    reallocated. That's because the VF driver can request resources
    immediately after it's activated. So they need to be ready at that
    point.
    
    The second race condition happens when the OS initiates a VF reset,
    and then before it's finished modifies VF's settings by changing its
    MAC, VLAN ID, bandwidth allocation, anti-spoof checking, etc. These
    functions needed to be blocked while VF is undergoing reset. Otherwise,
    they could operate on data structures that had just been freed or not
    yet fully initialized.
    
    Change-ID: I43ba5a7ae2c9a1cce3911611ffc4598ae33ae3ff
    Signed-off-by: default avatarRobert Konklewski <robertx.konklewski@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    beff3e9d
i40e_virtchnl_pf.c 85.6 KB