From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937954AbdDSUyy (ORCPT ); Wed, 19 Apr 2017 16:54:54 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:44342 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762475AbdDSUyx (ORCPT ); Wed, 19 Apr 2017 16:54:53 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com 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, sthemmin@microsoft.com Cc: "K. Y. Srinivasan" Subject: [PATCH net-next 1/1] netvsc: Deal with rescinded channels correctly Date: Wed, 19 Apr 2017 13:53:49 -0700 Message-Id: <1492635229-29075-1-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfCnhm6mwotpp2SrzV6Uy6ZgkXKeWb7Xjr4Vyc6Zb6v7LUaGjWBdtmRyFN4MwNjW+VUvT94Wf3rnZYeoLCEQECuyK7zohUI6aAFUOQy/50x3IzSkk5Nur Vf4NryCj2hLlmLloSlG3cvUI2WM3l3RfRAHSs66QRlkk6r7GU6thKUyr2mOpTRywDAeQrbSJ3oT2l1sJPnVWVJMCGqjQIIMXGdQ59ZRIFJm6p31piKXJQ/Pi 49IIwuaWGPIqsBym1tOgEEPe1wnGX0DVf47IyfuBXp4vK2didEz2kbLr04qoeBK2MMzLMtoxld18tMQpxvws6G9el9FSiJcw+Li3NpHhPbG05JDz0TsnEza6 xvHmlDkxvs+DZFSHflvSaA0QJRmp/kAesVxDb2IRWzxapL4li+rv4y9CQlt/SnsqGVkWwMbwp+n31L5YlmyQ6awjncqph5evZ9gFO/Pvv5Fvq6bgv1gzY3Vh VRqVX7EXsoYL7WdMmSPCPVZRBciYScj5UMN1KQmEMXghwexF3xpdc14PibA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: K. Y. Srinivasan 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 --- 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