OSDN Git Service

i40e: Fixed race conditions in VF reset
authorRobert Konklewski <robertx.konklewski@intel.com>
Tue, 21 Feb 2017 23:55:42 +0000 (15:55 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 27 Mar 2017 23:45:14 +0000 (16:45 -0700)
commitbeff3e9d80138e332ca08d909e1648e82764dc0c
tree92b1b6731a9872c0e53824b2f4fe7f5d091bafd9
parent741b8b832a57402380be79d7d11a59eaf57fff3b
i40e: Fixed race conditions in VF reset

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: Robert Konklewski <robertx.konklewski@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