Commit 73e64fa4 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by David S. Miller

netvsc: Deal with rescinded channels correctly

We will not be able to send packets over a channel that has been
rescinded. Make necessary adjustments so we can properly cleanup
even when the channel is rescinded. This issue can be trigerred
in the NIC hot-remove path.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87e978ed
...@@ -135,6 +135,13 @@ static void netvsc_destroy_buf(struct hv_device *device) ...@@ -135,6 +135,13 @@ static void netvsc_destroy_buf(struct hv_device *device)
sizeof(struct nvsp_message), sizeof(struct nvsp_message),
(unsigned long)revoke_packet, (unsigned long)revoke_packet,
VM_PKT_DATA_INBAND, 0); VM_PKT_DATA_INBAND, 0);
/* If the failure is because the channel is rescinded;
* ignore the failure since we cannot send on a rescinded
* channel. This would allow us to properly cleanup
* even when the channel is rescinded.
*/
if (device->channel->rescind)
ret = 0;
/* /*
* If we failed here, we might as well return and * If we failed here, we might as well return and
* have a leak rather than continue and a bugchk * have a leak rather than continue and a bugchk
...@@ -195,6 +202,15 @@ static void netvsc_destroy_buf(struct hv_device *device) ...@@ -195,6 +202,15 @@ static void netvsc_destroy_buf(struct hv_device *device)
sizeof(struct nvsp_message), sizeof(struct nvsp_message),
(unsigned long)revoke_packet, (unsigned long)revoke_packet,
VM_PKT_DATA_INBAND, 0); VM_PKT_DATA_INBAND, 0);
/* If the failure is because the channel is rescinded;
* ignore the failure since we cannot send on a rescinded
* channel. This would allow us to properly cleanup
* even when the channel is rescinded.
*/
if (device->channel->rescind)
ret = 0;
/* If we failed here, we might as well return and /* If we failed here, we might as well return and
* have a leak rather than continue and a bugchk * have a leak rather than continue and a bugchk
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment