Skip to content

Commit

Permalink
hv_netvsc: change GPAD teardown order on older versions
Browse files Browse the repository at this point in the history
On older versions of Windows, the host ignores messages after
vmbus channel is closed.

Workaround this by doing what Windows does and send the teardown
before close on older versions of NVSP protocol.

Reported-by: Mohammed Gamal <mgamal@redhat.com>
Fixes: 0cf7378 ("hv_netvsc: netvsc_teardown_gpadl() split")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
shemminger authored and davem330 committed Mar 22, 2018
1 parent 02400fc commit 0ef58b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,15 @@ void netvsc_device_remove(struct hv_device *device)
*/
netdev_dbg(ndev, "net device safe to remove\n");

/* older versions require that buffer be revoked before close */
if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_4)
netvsc_teardown_gpadl(device, net_device);

/* Now, we can close the channel safely */
vmbus_close(device->channel);

netvsc_teardown_gpadl(device, net_device);
if (net_device->nvsp_version >= NVSP_PROTOCOL_VERSION_4)
netvsc_teardown_gpadl(device, net_device);

/* Release all resources */
free_netvsc_device_rcu(net_device);
Expand Down

0 comments on commit 0ef58b0

Please sign in to comment.