ixgbe: Fix race when the VF driver does a reset
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 5 Dec 2018 13:54:26 +0000 (13:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:50:59 +0000 (09:50 +0100)
commit27f59f342f7c04a1f96f4b586d67e73b620f4f71
tree2e0d805211f615d02c1c85af2a9f87bbec01df0f
parent3bfed541c3ee07d8acaad08f6f23fd3ce69dd705
ixgbe: Fix race when the VF driver does a reset

[ Upstream commit 96d1a731611f711f0cb82cea93363ae2ea8cb028 ]

When the VF driver does a reset, it (at least the Linux one) writes to
the VFCTRL register to issue a reset and then immediately sends a reset
message using the mailbox API. This is racy because when the PF driver
detects that the VFCTRL register reset pin has been asserted, it clears
the mailbox memory. Depending on ordering, the reset message sent by
the VF could be cleared by the PF driver. It then responds to the
cleared message with a NACK which causes the VF driver to malfunction.
Fix this by deferring clearing the mailbox memory until the reset
message is received.

Fixes: 939b701ad633 ("ixgbe: fix driver behaviour after issuing VFLR")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c