Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626791 > unrolled thread

[PATCH 1/1] netvsc: Deal with rescinded channels correctly

Started bykys@exchange.microsoft.com
First post2017-04-19 23:00 +0200
Last post2017-04-19 23:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] netvsc: Deal with rescinded channels correctly kys@exchange.microsoft.com - 2017-04-19 23:00 +0200
    RE: [PATCH 1/1] netvsc: Deal with rescinded channels correctly KY Srinivasan <kys@microsoft.com> - 2017-04-19 23:00 +0200

#1626791 — [PATCH 1/1] netvsc: Deal with rescinded channels correctly

Fromkys@exchange.microsoft.com
Date2017-04-19 23:00 +0200
Subject[PATCH 1/1] netvsc: Deal with rescinded channels correctly
Message-ID<ty4RI-845-5@gated-at.bofh.it>
From: K. Y. Srinivasan <kys@microsoft.com>

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>
---
 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 7ab06b3..b5b10fc 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
 		 */
-- 
1.7.1

[toc] | [next] | [standalone]


#1626795

FromKY Srinivasan <kys@microsoft.com>
Date2017-04-19 23:00 +0200
Message-ID<ty4RI-845-17@gated-at.bofh.it>
In reply to#1626791

> -----Original Message-----
> From: kys@exchange.microsoft.com [mailto:kys@exchange.microsoft.com]
> Sent: Wednesday, April 19, 2017 1:49 PM
> To: davem@davemloft.net; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; jasowang@redhat.com;
> leann.ogasawara@canonical.comi; marcelo.cerri@canonical.com; Stephen
> Hemminger <sthemmin@microsoft.com>
> Cc: KY Srinivasan <kys@microsoft.com>
> Subject: [PATCH 1/1] netvsc: Deal with rescinded channels correctly
> 
> [This sender failed our fraud detection checks and may not be who they
> appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]
> 
> From: K. Y. Srinivasan <kys@microsoft.com>
> 
> 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>

Dave,

Please drop this path; I will resend.

K. Y
> ---
>  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 7ab06b3..b5b10fc 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
>                  */
> --
> 1.7.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web