Received: by 10.192.165.148 with SMTP id m20csp526674imm; Wed, 25 Apr 2018 03:41:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kJnGjMlGpYkEtTjb7z2ZH7al2WHZCSVbwJzZwrchRmadhFShuSD3UeWjsxZfGnBjm2u0l X-Received: by 2002:a17:902:7149:: with SMTP id u9-v6mr20286440plm.356.1524652900038; Wed, 25 Apr 2018 03:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652900; cv=none; d=google.com; s=arc-20160816; b=LmE+CsY7MknSXCbT0q6wwM/GkntXEEGqqE8D/jrgldf0nuX7HgpHdJ2r/ddxbrrCLx HmSqhHvc0Oq/tge1Eu8EtdqooZioSQNxzsDV/vAbBADvesDbNz7VP69FMqzkeHE5qjQh VIRc+hJq81rXrqG9adxqk+0+cRS2ULXEpmly3LQ771VtXPwdonQZeARrriXz5+jgcL9f vxC6mrGgumyKKH03zdbPm46fhywLacQsMsP2HCWLvSVFGnalw9wh43+kOljPylk9+sdb haebI1KTFepy/tA1MYw3bEQSWiGAut0PKeJ7tT11rNAl3Gx1SGMfW7FSFT940TGP0LaF kMuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PXgcM7/3zbNAo7QIsPl8WGCKQI32APG/WwO08T8jT00=; b=LsgENM6Fg2gnVioFhNebAdIJA2kPwQD0siBgniQyqcv7iNtaIeDoXGO3pnenc5xX7i 4w8bX7D+etAYOq9/+VKZpzsJoFo20UOfks3houuv7BiYGyqXmAdDV5feLujJbzlGPnsc ajvVp2HA2YZw5pXemBjsD3SsvoXin2xd0m8nj6pqVBLiTuowxCM7LxcBTBF7L5clwTgS lSGICWXfytZ61aTtPxtkvDgBFDK6xU/whn+pbZqGSKrMMvdFQS9STJvN4XKlyhwrl03T VH5Idx3KjbioAGQfd76ZziNMm8p9gqjrnO/rD9UK+Pioff+by76FyRSVNinLvWNeOee3 Ty7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14-v6si16157003pli.13.2018.04.25.03.41.26; Wed, 25 Apr 2018 03:41:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753816AbeDYKkY (ORCPT + 99 others); Wed, 25 Apr 2018 06:40:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52056 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753757AbeDYKkN (ORCPT ); Wed, 25 Apr 2018 06:40:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C8F70272; Wed, 25 Apr 2018 10:40:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Brady , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 079/183] i40evf: ignore link up if not running Date: Wed, 25 Apr 2018 12:34:59 +0200 Message-Id: <20180425103245.682181232@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 35 +++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) --- 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 i if (v_opcode == VIRTCHNL_OP_EVENT) { struct virtchnl_pf_event *vpe = (struct virtchnl_pf_event *)msg; + bool link_up = vpe->event_data.link_event.link_status; switch (vpe->event) { case VIRTCHNL_EVENT_LINK_CHANGE: adapter->link_speed = vpe->event_data.link_event.link_speed; - if (adapter->link_up != - vpe->event_data.link_event.link_status) { - adapter->link_up = - 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 == 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 != __I40EVF_RUNNING) + break; + + adapter->link_up = 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");