Received: by 10.213.65.68 with SMTP id h4csp2124639imn; Sun, 8 Apr 2018 20:19:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49TT6X02Xbn1oX127FKjd4IFLcbqMVobuPKcjExgF7IwIEAWfZQQWfaNAnvMd1avg8UekgD X-Received: by 2002:a17:902:b101:: with SMTP id q1-v6mr36428395plr.3.1523243942699; Sun, 08 Apr 2018 20:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243942; cv=none; d=google.com; s=arc-20160816; b=ni5q3NRi3IzcGRJ1UmKtvvkqaArpuajqMh6aEX4POVcTb+1r4VwZ1Ai1mPrlw02LlM BlhDwLpMdNmRnnM42CxyQStf1SLNN652EQVGEbshfZo0KT16XtIYaeB2fC0MndDuMahY BIb4DpgNMwwpDkuYRtwMWglj5w7ZK+QecV5tU0qJymF0Q8IVDnOOpg46XURgmk+wiePR lmE0z3+Mx5/BIGI5dYC4XSpKu8bZikN1oNEQgbe1u1T4rJkstttdPJKNcnGyAf1hOZGl xbiR7hBwTNSUG4vqodi2krMDSoGTC8puSqKqmY6QmzjdBY46//kdcUFo+zYKE81jLbUA sCmg== 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:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=m8ixNJUDnBoYqC3YLBR9gNmirw+Cja9hUhW1V+7YEII=; b=ty0OQVD8/vwqeOfmzV2RYlK/WGkfw1R5tYTnam2ufflfRDg81y92ZPoNkuJvZVt0pa Ot6KS7xThzaJgRJWHbecm/atA9K+CTWRHquV4KCShQjsAMm54DGGiL4+5j1a5f6ormN+ glP+3AP3ZQ+sj2aPoBaUVf9gWa1q00DINPEq4mf2kHSV0E99Tny6g4jLM0aJ+j5rPSMW hXPI9eyyqcigHQCWPYCfj2HyAIOMozsCEpVtPB2QFXeyJMAngeuwRHTq6PbX5IW7YhAC vFDmmOEPHCyTPD3ppA+kTW4rybjQVEfchO7y5BKvr+Q5SMQIwNlDK1NRgmSAkVbAPrFJ PSxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=LLD73u76; 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 h10si10567547pgs.538.2018.04.08.20.18.25; Sun, 08 Apr 2018 20:19:02 -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=LLD73u76; 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 S1752781AbeDIDPX (ORCPT + 99 others); Sun, 8 Apr 2018 23:15:23 -0400 Received: from mail-by2nam03on0115.outbound.protection.outlook.com ([104.47.42.115]:29467 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754921AbeDIAXq (ORCPT ); Sun, 8 Apr 2018 20:23:46 -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; bh=m8ixNJUDnBoYqC3YLBR9gNmirw+Cja9hUhW1V+7YEII=; b=LLD73u76Luv8iuv1mKs/D/XTQt8zLYzX5Kyb0DKyJ86dDtHAKPKHupDoPc3WdTFwhGGOG/Ot9xWQxcE7FOvHJxucz3wTSRt3p48QXveYRv/AQ8Wto9ilP2U688tOOE2s/SxQOM33Q+lyRmweAm+7NCId7+Ja2Jz2eXbuAyVK+U8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1080.namprd21.prod.outlook.com (52.132.130.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:23:44 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:23:44 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Alan Brady , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 067/161] i40evf: ignore link up if not running Thread-Topic: [PATCH AUTOSEL for 4.14 067/161] i40evf: ignore link up if not running Thread-Index: AQHTz5iXrmnecz5cd0yLxKpD9m9/LA== Date: Mon, 9 Apr 2018 00:20:40 +0000 Message-ID: <20180409001936.162706-67-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1080;7:0E+V/DkVH0pMT4xh2za3f3Nwj2PLjBxKCH1xuDxLl39ojLzjaL9Q7gn8Z3rJAxMJFWM/Xm4fp+qew1dzpOWtBF+u3pR7CwlBd3WnL6VIfikXtlfgnzLZvWflnm2cntnKZfgGU7zd6vHjIX4ELI/nxoF+zdjqmUleSnW+l8LahyokFB820SOP3QkaoCvd6cwuJYoyKhW5pN2LcFbb6pCKsmP1C2jlLMAyP8HPMqRnBDCXO+G21hgS84MPtX0uyLgH;20:LhUyEmzfPX53XPzASyeZWO2zN6uANxhczYkkhZecB51kFAQHg5Zmz2K6O36hjJwyiIu0KzrZxbFnnx0T1G6zdqx3W0EPVN7/NMSxIbd+h4YGQULSwoL82W26qoNzG7epx38QO6nWDwWCER9ZtfEiCT2eTK7eIfPOj8/XXkJ8e6Q= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 0ed5200b-8b36-4a6f-0231-08d59db02732 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1080; x-ms-traffictypediagnostic: DM5PR2101MB1080: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231221)(944501327)(52105095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1080;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1080; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(396003)(39380400002)(366004)(39860400002)(199004)(189003)(2501003)(5250100002)(8936002)(10090500001)(5660300001)(3660700001)(446003)(107886003)(14454004)(36756003)(6436002)(476003)(3280700002)(2616005)(11346002)(4326008)(6666003)(53936002)(6512007)(22452003)(305945005)(10290500003)(316002)(102836004)(2906002)(6116002)(66066001)(6506007)(3846002)(7736002)(486006)(54906003)(110136005)(186003)(72206003)(26005)(1076002)(105586002)(2900100001)(6486002)(97736004)(478600001)(81156014)(81166006)(86612001)(8676002)(106356001)(99286004)(86362001)(76176011)(59450400001)(68736007)(25786009)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1080;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: lnxP4tYvRck7IRkU8Ljh8bjslvRu/f7re5qUaqDByax9IJOxtUR6MFJ5noXDqLj4p4ERPrdBqxpTleuylfMQNp5CVVtPrhxzgCzccNJ6ldiwgbmEXd4/ZeDHJ/aCP9ov8fcc3VZcqg2S8G6Rna62dZyYz7cq5TbpNjYavuomSmbGP4PgeN81a/B1XH0UefShDEm3+5m5EwmFUapvzT2wGvYkE1Y1SEL8SUpbfyj/9aCAHHzvD3v2E0GocjeshxRX+6FhlIsBVH7YoyRJpphjk20apwHLceaN0IT+eNmnzFVLyQBSijayn3WlhipUu+sodvIzV1M3XKDrOzfUfq3mOZZ0TIWD1vtNJeUKP6+lizIt6hJ4YWJ9OhGlyZCTnP4ScG7lgfJYFkzKLwkCCj7TJV8i/iLkq2rEzdEuqr+pDJ8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ed5200b-8b36-4a6f-0231-08d59db02732 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:40.7222 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1080 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alan Brady [ Upstream commit e0346f9fcb6c636d2f870e6666de8781413f34ea ] If we receive the link status message from PF with link up before queues are actually enabled, it will trigger a TX hang. This fixes the issue by ignoring a link up message if the VF state is not yet in RUNNING state. Signed-off-by: Alan Brady Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 35 ++++++++++++++----= ---- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/= net/ethernet/intel/i40evf/i40evf_virtchnl.c index 85876f4fb1fb..46bf11afba08 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c @@ -937,23 +937,34 @@ void i40evf_virtchnl_completion(struct i40evf_adapter= *adapter, if (v_opcode =3D=3D VIRTCHNL_OP_EVENT) { struct virtchnl_pf_event *vpe =3D (struct virtchnl_pf_event *)msg; + bool link_up =3D vpe->event_data.link_event.link_status; switch (vpe->event) { case VIRTCHNL_EVENT_LINK_CHANGE: adapter->link_speed =3D vpe->event_data.link_event.link_speed; - if (adapter->link_up !=3D - vpe->event_data.link_event.link_status) { - adapter->link_up =3D - vpe->event_data.link_event.link_status; - if (adapter->link_up) { - netif_tx_start_all_queues(netdev); - netif_carrier_on(netdev); - } else { - netif_tx_stop_all_queues(netdev); - netif_carrier_off(netdev); - } - i40evf_print_link_message(adapter); + + /* we've already got the right link status, bail */ + if (adapter->link_up =3D=3D link_up) + break; + + /* If we get link up message and start queues before + * our queues are configured it will trigger a TX hang. + * In that case, just ignore the link status message, + * we'll get another one after we enable queues and + * actually prepared to send traffic. + */ + if (link_up && adapter->state !=3D __I40EVF_RUNNING) + break; + + adapter->link_up =3D link_up; + if (link_up) { + netif_tx_start_all_queues(netdev); + netif_carrier_on(netdev); + } else { + netif_tx_stop_all_queues(netdev); + netif_carrier_off(netdev); } + i40evf_print_link_message(adapter); break; case VIRTCHNL_EVENT_RESET_IMPENDING: dev_info(&adapter->pdev->dev, "PF reset warning received\n"); --=20 2.15.1