]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx4_core: Avoid command timeouts during VF driver device shutdown
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Mon, 30 Jan 2017 13:11:45 +0000 (15:11 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 26 Jun 2017 02:02:21 +0000 (22:02 -0400)
commit6d43352435ba022174d62c4a1b6252ec56ab0fbb
tree0b703778c4b695b812f52e8e624a7f967633a4e4
parent295a19f594e889d19bbcc0229c1cd0ef6b06863f
net/mlx4_core: Avoid command timeouts during VF driver device shutdown

[ Upstream commit d585df1c5ccf995fcee910705ad7a9cdd11d4152 ]

Some Hypervisors detach VFs from VMs by instantly causing an FLR event
to be generated for a VF.

In the mlx4 case, this will cause that VF's comm channel to be disabled
before the VM has an opportunity to invoke the VF device's "shutdown"
method.

The result is that the VF driver on the VM will experience a command
timeout during the shutdown process when the Hypervisor does not deliver
a command-completion event to the VM.

To avoid FW command timeouts on the VM when the driver's shutdown method
is invoked, we detect the absence of the VF's comm channel at the very
start of the shutdown process. If the comm-channel has already been
disabled, we cause all FW commands during the device shutdown process to
immediately return success (and thus avoid all command timeouts).

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/net/ethernet/mellanox/mlx4/catas.c
drivers/net/ethernet/mellanox/mlx4/intf.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h