Received: by 10.213.65.68 with SMTP id h4csp2151310imn; Sun, 8 Apr 2018 21:02:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4//760CdJ3xM2eL2JU3vJYkrYwDQ9HvtqhSIC2oKh0E6a2rrgH6lhUoeR6P5jIQSviVSH7H X-Received: by 2002:a17:902:6a10:: with SMTP id m16-v6mr3618106plk.370.1523246538342; Sun, 08 Apr 2018 21:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523246538; cv=none; d=google.com; s=arc-20160816; b=nQAbp7ETqy8EX3P+Y/h2PyiyEE6auE+sKTvBZ6asD8sJ4Dm9jk8rhS5kceFhGFRfaq QbAGLY7aWb0CghcujFPP+b1SYk59lbRk4py1WrIDDv6FDKlvi0TlcMtmYnmZxpGZJcKA jsP2fiKkLsbazALyhjuPC9rCPgP9CsHKXBiTr75ls8ApH2jU65mdRJs9aRZDdChoyiH6 NueBGnMHH8y2wsDMZQIk0gR8JVwIPLU8J3TYSgnyrJlAnKcewCzL1/vbaGlTa1ksmiPD sZzpTAH270Jnt1MLo62c1UtztZ6DMnYmPpH3OcrLDZoUMNzxUpBJBKk1FEcjRa3GzcIx Ai/g== 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=mcBQ2gCj89DBBquLT+hsRqR1RNwnzb3S+pGoWuSaBo4=; b=FgdDRAVJwN0G8meWYjG2LxWmjM1chrOalosTT9aMaBqZpak9BYwTrt1su7E9oq7q0u 5fi3cwzEdSW3JUjAbxYltQU/OUz5QaHwISPxeLcyAGwvYl7weRyTIjzpPR9tkIIMDKQD aip4uEmFY2XNXSZwXFLylTr+ZtAu2aPVL68EePxZJA0X4LJT90C159j+FdSQbNYRu5/Z Pfe11LxZsM0AscI2huqnJ9BhiUrOZ/mvCRcCbPqy7IL73Slbl3lPBx/es4FiZja2s/i/ vvqqZeB9Q/Md0l6g9CDgOI5tXl93pYkGsRv/MLx39JUuDLiNjL8MbG823DT82deB7WAE tCew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=SB1faA0U; 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 f7si10332808pgs.556.2018.04.08.21.01.40; Sun, 08 Apr 2018 21:02:18 -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=SB1faA0U; 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 S1754539AbeDID4v (ORCPT + 99 others); Sun, 8 Apr 2018 23:56:51 -0400 Received: from mail-by2nam01on0126.outbound.protection.outlook.com ([104.47.34.126]:59343 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753738AbeDIASo (ORCPT ); Sun, 8 Apr 2018 20:18:44 -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=mcBQ2gCj89DBBquLT+hsRqR1RNwnzb3S+pGoWuSaBo4=; b=SB1faA0UE7tv7pA7dGBefiEztb6qDMRAQvNtNcpRBhPZMuarQzHFI5t3u7ZSLoZQGHitKh6q1yzpKAC+A9ioYBpmfHobrgWZK3V1KZGyE+8b+hHZTWbb4NxjBsyt0rV8etmWVAzIGPmN6TKI6rXOv0Ci6pwJpDnw/RM5iGj82aA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) 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:18:37 +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:18:37 +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.15 079/189] i40evf: ignore link up if not running Thread-Topic: [PATCH AUTOSEL for 4.15 079/189] i40evf: ignore link up if not running Thread-Index: AQHTz5gwo09usvWbtk2p0S/mcjsUFg== Date: Mon, 9 Apr 2018 00:17:47 +0000 Message-ID: <20180409001637.162453-79-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1128;7:OIjk1fOd+VvNp+8cNthBtKb4C2DX+2AVPPzleWXwl3SJWnf778FrHk2QhhE/YT+dLZT+v14SNICGvXNd5tN5w7B32wYLJYz8O6sxIsUscZQITg7OQQ5apRejlckrh6Ucr9TPP9AI5m1Bzsf57iuVrcy7/jfsSc0JNXIQ/BjIUNRstsm61L3Tfabj3DBu3xBbq0uiQyJL1yIkUub9ePTQsi7KeudeyILRvIfnRc9jv6TFQ0zVsWNZMgrgsyrtWipz;20:n3t+B/3wJwM9073EmaHwxj5LZtA1Jmz4uNEohOUW413Jn7AeGbcy/R9pe2geeeA9LK1t8novdDNBfsbB1yY03X60bDHXUSHJaXIko9209DUdJmnBuOKFhUjMp3/pfkTiDhC/ggo256gym3e5CDtJpZJGuYFfcwA4wIO3sFN5GGk= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 3c0d66ee-31aa-4e69-de74-08d59daf70bf x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1128; x-ms-traffictypediagnostic: DM5PR2101MB1128: 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)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1128;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1128; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(396003)(376002)(366004)(39380400002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(2900100001)(25786009)(36756003)(6506007)(76176011)(2906002)(6486002)(86612001)(99286004)(102836004)(1076002)(7736002)(97736004)(2616005)(446003)(486006)(11346002)(476003)(26005)(305945005)(6666003)(6512007)(4326008)(107886003)(478600001)(6436002)(5660300001)(10290500003)(5250100002)(22452003)(316002)(105586002)(186003)(8676002)(110136005)(54906003)(72206003)(53936002)(2501003)(68736007)(14454004)(6116002)(8936002)(3846002)(81156014)(10090500001)(106356001)(81166006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1128;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: yDYHzaQ2Kuqp8fKpfJ01fjo6lWApsTDUahZOzCXiBeFk31ptV93HH5tW7Brk5J/in90whCkY6LrwIA+8s/BNdWn5J47ZJWsaD0BsTbNZqDBkYzr18+M8oVn8hK1Oyt+S1dDw0lFydk58M1VUb5uJJ7paNiIAy9Ex1PGxT5RE9NZmvZuA6+WXCerMGUNqvKBPLwEziJTs9U79Em0LJ1Lqvyi1Ac3zfO1FWPVkBd7Snfujdr8OamjBYxpv5f/yRXLxM2hVWkZnqvlXFhY5GsVnmcSkmnTHOMGRe07UYtfVwmlnK+xrlRBYOPhzE5052yS+wu4ZZ3g3CtJpj5c/Uu04X1MHNCmX/0QZ0kFHNGtpGYP8/ZOHMa1eSNMByfr1zEXBHcMHndjurHh0e/Wkrkhd6b4EEYv/WBkCYrRs7CkG8P8= 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: 3c0d66ee-31aa-4e69-de74-08d59daf70bf X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:47.2579 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1128 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 46c8b8a3907c..23635f5a2388 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c @@ -965,23 +965,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