Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1687736ybi; Wed, 17 Jul 2019 20:08:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwW4khSYfWw5GACxnTcIQq28WWR86obUOn/0/nxUKblCUcd4LeqnXCUd4CAg+L0/lDrXQlT X-Received: by 2002:a63:e306:: with SMTP id f6mr44375551pgh.39.1563419337664; Wed, 17 Jul 2019 20:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563419337; cv=none; d=google.com; s=arc-20160816; b=Y2wPvdNL8mjn6odtdCKD/LpwMR5KjH97BaXIA7zxSuEfyFNGwQRWrAlPwT3aTKQ1Zi OCGPa2eS923Wlr5qP4vqz5zp8jlXufdWsUYCbtyFU8RyWf8A4dMwx/H5Qd6G/qWdY3w6 nlg9MO3tSJLmRxHI6b0kpp6phq1KyilxpCnTUK0pbf2NMKLHtyFkhBP/MDvH711dfKAk X+0VMdA9e6TVPrmHnistXb6uIg5wlLd2uZotdt0c6ejH644VKNdwUkT2jXya+sb5Ppl+ c+AvimPAMmwUCPV7rcxBlaQohwRDbFDKMIsRI8828n+RS/aQUA1euJfw/He0euSNpKK/ d1XA== 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=GZi2sPRmLNuZOct+JnA0mbYABCnCvxrHz5kSWZHPdRM=; b=uIa5Y1DqWRtzJ9mkjIz8jh/nSiWplwMp1hn6Tn8T5wgBBQvarv8+hIYMSbdk/oyg7i QP8CjKkXMztrJec1MlhAnHu4vT0Y0c0+fJOYCpHZOJaz8uLl8NpW0OMN+Xz7UKeBT0/e IpDd+cGeImR6dsW3O625bG/CB7TAq6j2Zh++57xMRpfocVRiVJCpFbIl5m12kX+dHfkG GJ3jy4rmcKqe6m8TLETOn5aJNtAuxulvI19RJdoTHWhlHag6bXKC/hZS7AGn/QsGZG1z pokx7BnU6LpAo5vpBl8CboXTCvno7tsMSo3ZB7LiBxJL7+LsXzl97tNvJkDQSjui68mR NHeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Yqypyu/i"; 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 69si19036816pge.101.2019.07.17.20.08.41; Wed, 17 Jul 2019 20:08:57 -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="Yqypyu/i"; 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 S2390251AbfGRDGh (ORCPT + 99 others); Wed, 17 Jul 2019 23:06:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:37826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390224AbfGRDGe (ORCPT ); Wed, 17 Jul 2019 23:06:34 -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 19C1A2053B; Thu, 18 Jul 2019 03:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419193; bh=JFTBxaKMojFpgikaKkfjlhcOl+A8lazwN8wO3Sr7K8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yqypyu/iUEC1pZDiYt3+KR96Y1y+3RMzqv3Ywqmj8q/zYe4dEXkt3nFVb9RXUSuib GjSWrChfaitPDcaWPgcHOvBsLs+Ga9XX6/9O/jA7b9lF8GYsU4qaMDPYcExrFAioUX 5B6jrGeUwCI1w3LYoYKVZbsLbzud3NuJKkSEhnGs= 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.19 02/47] e1000e: start network tx queue only when link is up Date: Thu, 18 Jul 2019 12:01:16 +0900 Message-Id: <20190718030047.017203434@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030045.780672747@linuxfoundation.org> References: <20190718030045.780672747@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 @@ -4208,7 +4208,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); } @@ -4584,6 +4584,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); @@ -4644,7 +4645,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); @@ -5266,6 +5266,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)) @@ -5279,6 +5280,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));