From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754946AbcFHPDy (ORCPT ); Wed, 8 Jun 2016 11:03:54 -0400 Received: from mail-bn1bon0142.outbound.protection.outlook.com ([157.56.111.142]:40449 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751179AbcFHPDv convert rfc822-to-8bit (ORCPT ); Wed, 8 Jun 2016 11:03:51 -0400 X-Greylist: delayed 1076 seconds by postgrey-1.27 at vger.kernel.org; Wed, 08 Jun 2016 11:03:51 EDT From: Haiyang Zhang To: Vitaly Kuznetsov , "netdev@vger.kernel.org" CC: "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , KY Srinivasan Subject: RE: [PATCH RFC net-next] netvsc: get rid of completion timeouts Thread-Topic: [PATCH RFC net-next] netvsc: get rid of completion timeouts Thread-Index: AQHRwZC7ygrW52G+PUWMXuK/shK8YZ/foQ9Q Date: Wed, 8 Jun 2016 14:31:03 +0000 Message-ID: References: <1465395546-28272-1-git-send-email-vkuznets@redhat.com> In-Reply-To: <1465395546-28272-1-git-send-email-vkuznets@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=haiyangz@microsoft.com; x-originating-ip: [173.48.116.247] x-ms-office365-filtering-correlation-id: 72054d3f-2a0d-4a5b-d5f0-08d38fa9856d x-microsoft-exchange-diagnostics: 1;DM2PR0301MB0783;5:Zg+NCFSKRxV+/z6tMso4Ezj6RF5R4140uUNVOG/Wfat1P9lng1BoJe9iolu8iiA6zfgfwokivMjGsyZ5Bp2OCJI3QW2tkVbp6nb6Hf+Od6EFs7z9Jrjzj4P2TSIfLZcJJ6HcIZ4Oia+wCU0hzcxITQ==;24:nJJntxYIDzKQloZ+nll2vldKC7PAodE4onE85qT8CkDVsFwAwjTwqWzVlbOa/F0scK+794QGE8TWS9l09fwykPmT5/YhtitU/RnU8GlgvXY=;7:7TcmTmw0l5Dk0peLe5QHlB/dPcHAguZis31LHeL1PkI3wbze18bKje//vv4ob+M3VLCwYClaJe+sZ1QESi7G2OLwd9LK5VSlie5iLbj7ZS1jXwU3h3GTmTMnspVgdG+s9CxwRMtpqDaQG/8DxxhKnLckef2bc+VtrBMl16q8/JKx1JGIIr7wTutFFn7w62Vkib9W9NVxaQ+rP6z9Bh4Ez1rMDvF2FzJNbmvQuiwfn03n5PERatQrggI2A3SHPLir x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0783; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038);SRVR:DM2PR0301MB0783;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0783; x-forefront-prvs: 0967749BC1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(199003)(13464003)(189002)(101416001)(19580405001)(19580395003)(99286002)(86612001)(4001430100002)(106116001)(54356999)(66066001)(74316001)(3660700001)(105586002)(33656002)(5008740100001)(10090500001)(5004730100002)(76576001)(10290500002)(3280700002)(5005710100001)(76176999)(586003)(10400500002)(5003600100002)(102836003)(2950100001)(106356001)(189998001)(8676002)(8990500004)(81156014)(9686002)(2906002)(50986999)(2501003)(8936002)(77096005)(3846002)(68736007)(6116002)(2900100001)(5001770100001)(92566002)(81166006)(107886002)(5002640100001)(122556002)(97736004)(4326007)(87936001)(86362001)(26583001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB0783;H:CY1PR03MB2284.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2016 14:31:03.8033 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0783 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > Sent: Wednesday, June 8, 2016 10:19 AM > To: netdev@vger.kernel.org > Cc: devel@linuxdriverproject.org; linux-kernel@vger.kernel.org; KY > Srinivasan ; Haiyang Zhang > Subject: [PATCH RFC net-next] netvsc: get rid of completion timeouts > > I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting > RSS parameters for the device. When this happens we end up returning > -ETIMEDOUT from the function and rndis_filter_device_add() falls back to > setting > > net_device->max_chn = 1; > net_device->num_chn = 1; > net_device->num_sc_offered = 0; > > but after a moment the rndis request succeeds and subchannels start to > appear. netvsc_sc_open() does unconditional nvscdev->num_sc_offered-- > and > it becomes U32_MAX-1. Consequent rndis_filter_device_remove() will hang > while waiting for all U32_MAX-1 subchannels to appear and this is not > going to happen. > > The immediate issue could be solved by adding num_sc_offered > 0 check to > netvsc_sc_open() but we're getting out of sync with the host and it's not > easy to adjust things later, e.g. in this particular case we'll be creating > queues without a user request for it and races are expected. Same applies > to other parts of the driver which have the same completion timeout. > > Following the trend in drivers/hv/* code I suggest we remove all these > timeouts completely. As a guest we can always trust the host we're running > on and if the host screws things up there is no easy way to recover anyway. > > Signed-off-by: Vitaly Kuznetsov Thank you. Acked-by: Haiyang Zhang