Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1325831imm; Wed, 6 Jun 2018 14:13:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLzYzxJNszLaEKdogRScZZZXArefJifttJnyIDSwYKNxsz6v9nSVPhcwY5eRJgpkzNHqKJi X-Received: by 2002:a62:b509:: with SMTP id y9-v6mr3920756pfe.121.1528319609446; Wed, 06 Jun 2018 14:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528319609; cv=none; d=google.com; s=arc-20160816; b=Q9Cge/8HzzqSbKnQLJJSLC461p3ZHF6vEvr7QBMl9KcNsZxqwXyIozcO9ut7vithOl 1P+zDTaywsYuFhZOP8Dc0OpowZQMu81Gd3QLNPRDWBICUCFmg4SSIqtbrX/eqb7UWC0u F5z1zYvTM6g1sPTAyUQ76PQCUfupat/MpiWeSbDL7n0BDCWilAYXHDUjydl0p8V+JCgE d4ud/ADexn83OpkUiD/xMlJbPenpSXodNnFaEmg0+gP+c2feHV1OUPC/aUfp5AKwwK5d y3MzYhyJTW+Sr86wLRGSR+jUVPvEa6fPpb8tJf4+O8v/TThhWmtTYavxHqnzzLAj3vW1 YqjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:msip_labels :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ati5OK0PIsdhI/p8QXW5f8D4vKbHgkedqnBFSLwSMbQ=; b=JWZUsWQBv/YoZIGX9Lp9xmpguOSeGyc7HEo9uvbDRU6UaKmvLfGSoZklNN769Gxy0b hbHj/gBI9+65DHOQkcRP4aLQjxlFNAd37Hda+ObsSwSRRJv542Oi57wICqrSzk+8Bocd +L3iAS9FvC3ehcEQ3HDpKe8z7o/ri93bs3ZaybwA8FeMnW5RyRIbv/5z1FBJLMXXfqzz Wva5pT7TDrY5Q0swnLVLz3eXtwD2VaOH8ZTKBdyt0t9eY36FTnZFTQTMZFORxASLRsD2 dRbKXvyZfW8W6bGBRK601Qih6R9W51rynuWYXqBNpnfSVly0Cp3L7oTSUzGC54TwwDle ROXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MSdVJy4i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7-v6si52851702ple.585.2018.06.06.14.13.13; Wed, 06 Jun 2018 14:13:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MSdVJy4i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbeFFVCK (ORCPT + 99 others); Wed, 6 Jun 2018 17:02:10 -0400 Received: from mail-sg2apc01on0097.outbound.protection.outlook.com ([104.47.125.97]:28672 "EHLO APC01-SG2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752030AbeFFVCI (ORCPT ); Wed, 6 Jun 2018 17:02:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ati5OK0PIsdhI/p8QXW5f8D4vKbHgkedqnBFSLwSMbQ=; b=MSdVJy4ijaMCndNROB4L+6v/C+zhhxyg3aeoQ7iUIGm3TvV7Qla6PZV+BylDL54j+29Peqz3VmYQUWbOMsavUbC0uDLk+39Xzgnd1GiVoWOGNPKo3Q35BCHDGj557SoC9x4l6M3x8WO73cEGrXQrtlaBUGIG8zImbyJFw+Y0smM= Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0005.APCP153.PROD.OUTLOOK.COM (10.170.167.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.2; Wed, 6 Jun 2018 21:01:52 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) with mapi id 15.20.0863.004; Wed, 6 Jun 2018 21:01:52 +0000 From: Dexuan Cui To: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "David S. Miller" , "netdev@vger.kernel.org" CC: "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , "'olaf@aepfle.de'" , "'apw@canonical.com'" , "'jasowang@redhat.com'" , "'vkuznets@redhat.com'" , "'marcelo.cerri@canonical.com'" , Josh Poulson , Stephen Zarkos Subject: [PATCH] hv_netvsc: Fix a network regression after ifdown/ifup Thread-Topic: [PATCH] hv_netvsc: Fix a network regression after ifdown/ifup Thread-Index: AdP92N4EqgEj8nWJRA2EB/lO8D4XFg== Date: Wed, 6 Jun 2018 21:01:52 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-06-06T21:01:34.8727497Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General authentication-results: spf=none (sender IP is ) smtp.mailfrom=decui@microsoft.com; x-originating-ip: [2001:4898:80e8:0:512f:6303:d09e:a11f] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;KL1P15301MB0005;7:R5Xky5fUTyCSu9YObPRBywOx+B0faxVJu1yH6Y+NYwkapvyhy0SAzp9tKQcnMeuPObLASeITFq8nmiGAdI0OQf1JprNwCx0Lw+95+mf5IfO+0o3jQ/Li9dshNBD0ulH3jI69X5RK6WtGgAdjQMwcNozVJlVntrnsOMwicRRGkhF/ay7/LM0A0mPGZQIyV48CsimmC9D8lIVJuw/QMhkYseVQmdPSCDhR9weql9v7TYZ6DTZaTYrvNxxylvS5OXZY x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7193020);SRVR:KL1P15301MB0005; x-ms-traffictypediagnostic: KL1P15301MB0005: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(9452136761055); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:KL1P15301MB0005;BCL:0;PCL:0;RULEID:;SRVR:KL1P15301MB0005; x-forefront-prvs: 06952FC175 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(346002)(396003)(39850400004)(39380400002)(189003)(199004)(105586002)(106356001)(1857600001)(5890100001)(2501003)(99286004)(77096007)(59450400001)(6506007)(33656002)(102836004)(7696005)(8990500004)(81166006)(81156014)(4326008)(8676002)(8936002)(10090500001)(9686003)(25786009)(7736002)(305945005)(3280700002)(3660700001)(10290500003)(107886003)(478600001)(53936002)(74316002)(68736007)(6116002)(2906002)(14454004)(2900100001)(54906003)(110136005)(5660300001)(55016002)(6436002)(97736004)(316002)(486006)(476003)(46003)(86362001)(575784001)(22452003)(86612001)(1511001);DIR:OUT;SFP:1102;SCL:1;SRVR:KL1P15301MB0005;H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: lcJQoleexnfgGgK8m37hsgRbZ1FqUlcda0EGE5N1SRL83xEadKKHU1lJQLgRi9gpfpfh3IhFOY4LlkSoRsbT1PospIt9kY2hizGUuanLVFaX6hqC3H6y7DVn4//w+H4MQvgvimhaT9OYI+2R7lyKoJLbmPAn5TAfUF8DyQojxLqzu8FQcQ61a41J1KpKAKfr spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 47cb9da9-6a75-4042-b702-08d5cbf0ba94 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47cb9da9-6a75-4042-b702-08d5cbf0ba94 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jun 2018 21:01:52.0416 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0005 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently people reported the NIC stops working after "ifdown eth0; ifup eth0". It turns out in this case the TX queues are not enabled, after the refactoring of the common detach logic. The patch fixes the regression. Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic") Signed-off-by: Dexuan Cui Cc: stable@vger.kernel.org Cc: Stephen Hemminger Cc: K. Y. Srinivasan Cc: Haiyang Zhang --- drivers/net/hyperv/netvsc_drv.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_dr= v.c index da07ccd..4461e16 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -126,9 +126,20 @@ static int netvsc_open(struct net_device *net) } =20 rdev =3D nvdev->extension; - if (!rdev->link_state) + if (!rdev->link_state) { netif_carrier_on(net); =20 + /* When the NIC has sub-channels, usually we enable all the + * TX queues after all sub-channels are set up: see + * rndis_set_subchannel() -> netif_device_attach(), but in + * the case of "ifdown eth0; ifup eth0" where the number of + * channels doesn't change, we also must make sure the + * TX queues are enabled. + */ + if (atomic_read(&nvdev->open_chn) =3D=3D nvdev->num_chn) + netif_tx_wake_all_queues(net); + } + if (vf_netdev) { /* Setting synthetic device up transparently sets * slave as up. If open fails, then slave will be --=20 2.7.4