Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1702406ybi; Wed, 17 Jul 2019 20:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgHfItghjeZIYdGoJPuqw2ZaLMc4l9VxT4oZpBDSp4LfFmswtFgEXH/9B2d2P/+MrpNA+7 X-Received: by 2002:a63:f04:: with SMTP id e4mr43950375pgl.38.1563420284133; Wed, 17 Jul 2019 20:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563420284; cv=none; d=google.com; s=arc-20160816; b=tlH/8w+CcndEaKfFWuP2+g9q4CJIF8r2fp1JmC3GIEIwIGz6TRwvWwjT66R1LukGmy wsiww21z4VKbrPn499AVCkRBxLxBODHUS7kcjOe+uqPVPKRz4nFJzdpp/oGq9M6gKcF0 10Ao8/1GrUbKSD4lPmDX8nzqwegWDrbRteduQiwSSoCicIMY54ud36dz8/cPiz8crC+B eyNqeTpNTWClnPdynT8lkf+H7f5kFA5MBRF3L4pqxmvAoENs4x5FO1DUMWaEvfbB/Ksl 3Q1Kqn1EziRiUUsNydgXgTBnBiG7WLbx4B8rl1SPldnTTzfYi6w7rXttHPSFVuZK5qmn ipiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2oX21ch28xhBpg3xSNaDsSHVwkZBuy6FzD+/dL6yO90=; b=OIkaE4JrNw+Yq4g3enkHhdZvPLQChGU0TePRfT2iLr9Tzl5T4lMR/2Iq3EqBc1U8dA 2gxHRvEsQz3/kk7O4NNJBVqa3b173oBH3tWBlJyyTe8SVQ6gmuOU9TxMvkWmfnsfr8fc KZgbPGiypfMWMCth417CP8610UgMjXedK/7psLwHpNwTASVHbre1dvGKaRittd+I93bc 4+JlkzKihOLw0Vvxcy5tvfiLWaSHoMkZAG2Dcfu8DIGA+l968nB9thpeTxxqBxubJdqF FlKfjWbzRMEQ70/gthCUOWdoxy50bxlxfSj723MFwDnHI7critG6IcMp/lJse6ANTC8U OCXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rIw415ye; 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 y82si1427223pfb.58.2019.07.17.20.24.28; Wed, 17 Jul 2019 20:24:44 -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=@kernel.org header.s=default header.b=rIw415ye; 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 S2390880AbfGRDIv (ORCPT + 99 others); Wed, 17 Jul 2019 23:08:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:40972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390864AbfGRDIs (ORCPT ); Wed, 17 Jul 2019 23:08:48 -0400 Received: from localhost (115.42.148.210.bf.2iij.net [210.148.42.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5278205F4; Thu, 18 Jul 2019 03:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419327; bh=Shp4REY26jTKijwg6f6zgPTs3rXQ4FboKvg3as5AnNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIw415yeSPqCHusa8uY4oS5jZVd6nsU0xDur8y+AhaLrAk77DpW0I1SaplG4grG5Q j/YotmvLoetw6Qp9aYdSdANHYpkpVKb3YKGVyJQOF1e4d2xhB/30t/8uWOwHsqVxxt aPvHg4kg+BD2uo+EDbl+2lhA3EjLuhFcUwh1nbUM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konstantin Khlebnikov , Alexander Duyck , Joseph Yasi , Aaron Brown , Oleksandr Natalenko , Jeff Kirsher Subject: [PATCH 4.14 02/80] e1000e: start network tx queue only when link is up Date: Thu, 18 Jul 2019 12:00:53 +0900 Message-Id: <20190718030058.799580364@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030058.615992480@linuxfoundation.org> References: <20190718030058.615992480@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Konstantin Khlebnikov commit d17ba0f616a08f597d9348c372d89b8c0405ccf3 upstream. Driver does not want to keep packets in Tx queue when link is lost. But present code only reset NIC to flush them, but does not prevent queuing new packets. Moreover reset sequence itself could generate new packets via netconsole and NIC falls into endless reset loop. This patch wakes Tx queue only when NIC is ready to send packets. This is proper fix for problem addressed by commit 0f9e980bf5ee ("e1000e: fix cyclic resets at link up with active tx"). Signed-off-by: Konstantin Khlebnikov Suggested-by: Alexander Duyck Tested-by: Joseph Yasi Tested-by: Aaron Brown Tested-by: Oleksandr Natalenko Signed-off-by: Jeff Kirsher Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/e1000e/netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -4228,7 +4228,7 @@ void e1000e_up(struct e1000_adapter *ada e1000_configure_msix(adapter); e1000_irq_enable(adapter); - netif_start_queue(adapter->netdev); + /* Tx queue started by watchdog timer when link is up */ e1000e_trigger_lsc(adapter); } @@ -4604,6 +4604,7 @@ int e1000e_open(struct net_device *netde pm_runtime_get_sync(&pdev->dev); netif_carrier_off(netdev); + netif_stop_queue(netdev); /* allocate transmit descriptors */ err = e1000e_setup_tx_resources(adapter->tx_ring); @@ -4664,7 +4665,6 @@ int e1000e_open(struct net_device *netde e1000_irq_enable(adapter); adapter->tx_hang_recheck = false; - netif_start_queue(netdev); hw->mac.get_link_status = true; pm_runtime_put(&pdev->dev); @@ -5286,6 +5286,7 @@ static void e1000_watchdog_task(struct w if (phy->ops.cfg_on_link_up) phy->ops.cfg_on_link_up(hw); + netif_wake_queue(netdev); netif_carrier_on(netdev); if (!test_bit(__E1000_DOWN, &adapter->state)) @@ -5299,6 +5300,7 @@ static void e1000_watchdog_task(struct w /* Link status message must follow this format */ pr_info("%s NIC Link is Down\n", adapter->netdev->name); netif_carrier_off(netdev); + netif_stop_queue(netdev); if (!test_bit(__E1000_DOWN, &adapter->state)) mod_timer(&adapter->phy_info_timer, round_jiffies(jiffies + 2 * HZ));