|
@@ -592,8 +592,17 @@ void netvsc_device_remove(struct hv_device *device)
|
|
= rtnl_dereference(net_device_ctx->nvdev);
|
|
= rtnl_dereference(net_device_ctx->nvdev);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Revoke receive buffer. If host is pre-Win2016 then tear down
|
|
|
|
+ * receive buffer GPADL. Do the same for send buffer.
|
|
|
|
+ */
|
|
netvsc_revoke_recv_buf(device, net_device);
|
|
netvsc_revoke_recv_buf(device, net_device);
|
|
|
|
+ if (vmbus_proto_version < VERSION_WIN10)
|
|
|
|
+ netvsc_teardown_recv_gpadl(device, net_device);
|
|
|
|
+
|
|
netvsc_revoke_send_buf(device, net_device);
|
|
netvsc_revoke_send_buf(device, net_device);
|
|
|
|
+ if (vmbus_proto_version < VERSION_WIN10)
|
|
|
|
+ netvsc_teardown_send_gpadl(device, net_device);
|
|
|
|
|
|
RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
|
|
RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
|
|
|
|
|
|
@@ -607,15 +616,13 @@ void netvsc_device_remove(struct hv_device *device)
|
|
*/
|
|
*/
|
|
netdev_dbg(ndev, "net device safe to remove\n");
|
|
netdev_dbg(ndev, "net device safe to remove\n");
|
|
|
|
|
|
- /* older versions require that buffer be revoked before close */
|
|
|
|
- if (vmbus_proto_version < VERSION_WIN10) {
|
|
|
|
- netvsc_teardown_recv_gpadl(device, net_device);
|
|
|
|
- netvsc_teardown_send_gpadl(device, net_device);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/* Now, we can close the channel safely */
|
|
/* Now, we can close the channel safely */
|
|
vmbus_close(device->channel);
|
|
vmbus_close(device->channel);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If host is Win2016 or higher then we do the GPADL tear down
|
|
|
|
+ * here after VMBus is closed.
|
|
|
|
+ */
|
|
if (vmbus_proto_version >= VERSION_WIN10) {
|
|
if (vmbus_proto_version >= VERSION_WIN10) {
|
|
netvsc_teardown_recv_gpadl(device, net_device);
|
|
netvsc_teardown_recv_gpadl(device, net_device);
|
|
netvsc_teardown_send_gpadl(device, net_device);
|
|
netvsc_teardown_send_gpadl(device, net_device);
|