Skip to content

Commit 0ef58b0

Browse files
shemmingerdavem330
authored andcommitted
hv_netvsc: change GPAD teardown order on older versions
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 <[email protected]> Fixes: 0cf7378 ("hv_netvsc: netvsc_teardown_gpadl() split") Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 02400fc commit 0ef58b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/hyperv/netvsc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,15 @@ void netvsc_device_remove(struct hv_device *device)
571571
*/
572572
netdev_dbg(ndev, "net device safe to remove\n");
573573

574+
/* older versions require that buffer be revoked before close */
575+
if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_4)
576+
netvsc_teardown_gpadl(device, net_device);
577+
574578
/* Now, we can close the channel safely */
575579
vmbus_close(device->channel);
576580

577-
netvsc_teardown_gpadl(device, net_device);
581+
if (net_device->nvsp_version >= NVSP_PROTOCOL_VERSION_4)
582+
netvsc_teardown_gpadl(device, net_device);
578583

579584
/* Release all resources */
580585
free_netvsc_device_rcu(net_device);

0 commit comments

Comments
 (0)