diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2017-04-19 13:53:49 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-21 13:47:00 -0400 |
commit | 73e64fa4f417b22d8d5521999a631ced8e2d442e (patch) | |
tree | 6f41077a83362b0a2954d5c21e5372ce20999476 /drivers/net/hyperv | |
parent | 87e978edacf53b239add5a307c8db09164856437 (diff) | |
download | op-kernel-dev-73e64fa4f417b22d8d5521999a631ced8e2d442e.zip op-kernel-dev-73e64fa4f417b22d8d5521999a631ced8e2d442e.tar.gz |
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: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index fd21d5a..967843b 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -135,6 +135,13 @@ static void netvsc_destroy_buf(struct hv_device *device) sizeof(struct nvsp_message), (unsigned long)revoke_packet, 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 * have a leak rather than continue and a bugchk @@ -195,6 +202,15 @@ static void netvsc_destroy_buf(struct hv_device *device) sizeof(struct nvsp_message), (unsigned long)revoke_packet, 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 * have a leak rather than continue and a bugchk */ |