Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965995AbdDSUw0 (ORCPT ); Wed, 19 Apr 2017 16:52:26 -0400 Received: from mail-sn1nam01on0135.outbound.protection.outlook.com ([104.47.32.135]:51820 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965671AbdDSUwW (ORCPT ); Wed, 19 Apr 2017 16:52:22 -0400 From: KY Srinivasan To: KY Srinivasan , "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 Subject: RE: [PATCH 1/1] netvsc: Deal with rescinded channels correctly Thread-Topic: [PATCH 1/1] netvsc: Deal with rescinded channels correctly Thread-Index: AQHSuU6SfunGH7mCdUi63SV0lzdSZaHNKtXQ Date: Wed, 19 Apr 2017 20:52:14 +0000 Message-ID: References: <1492634959-28942-1-git-send-email-kys@exchange.microsoft.com> In-Reply-To: <1492634959-28942-1-git-send-email-kys@exchange.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: microsoft.com; dkim=none (message not signed) header.d=none;microsoft.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:4::444] x-microsoft-exchange-diagnostics: 1;CY4PR03MB2488;7:lbEgwklq4yqGG94qjR83QL+/CW8vpZV7RWbfybjed9ji3POMslG2UEwSwmaTDzrGl4evPbPzkniUOYmgZdwQIGeXD3up69nSifkWE95SuU4Y6rx4wXrQV7nhJUQZsVzHHXFseKwwycWuxKixihAa8Xt7tNm6o6Ox/KNY/hgHMdbJC5Gqun+co3QHCPvUUCjEypMKYjJWxhH2dXYv2vHvm56CEdSuLJlvRKt2IJ/DzBa6s11KOlt8h7E9f4Wk7BoknI4HTzNVfZHKeeCcPxW9DlosmI7pqFnZTacob9RiuDUnDhMGeczUy6diJPQwoma8/NbbLFQOHPeUSKUfHFjIaAomtWnr6yjzG0Lh/aRH/IM= x-ms-office365-filtering-correlation-id: 669e0109-5106-4721-8bd6-08d48765f5e2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:CY4PR03MB2488; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(140211028294663)(198206253151910); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:CY4PR03MB2488;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2488; x-forefront-prvs: 028256169F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(39450400003)(39840400002)(39410400002)(39400400002)(39850400002)(377454003)(13464003)(5005710100001)(966004)(1511001)(10090500001)(53936002)(9686003)(2501003)(6436002)(6306002)(99286003)(10290500002)(55016002)(8990500004)(2906002)(2421001)(50986999)(76176999)(6116002)(102836003)(77096006)(33656002)(6506006)(6246003)(54356999)(229853002)(3280700002)(81166006)(8676002)(7736002)(305945005)(2201001)(2950100002)(86362001)(86612001)(7696004)(6636002)(189998001)(8936002)(3660700001)(2900100001)(2561002)(25786009)(53376002)(53366004)(38730400002)(5660300001)(74316002)(122556002)(53546009)(921003)(1121003)(10090945008);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR03MB2488;H:CY4PR03MB2487.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2017 20:52:14.9941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2488 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3JKqVLN031243 Content-Length: 3041 Lines: 73 > -----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 > Cc: KY Srinivasan > 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 > > 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 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