Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1685021ybi; Wed, 17 Jul 2019 20:06:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBVBYnTC7TimCxHjH5nG6D+wv/HygHliew05jS2GyyZmMB4xOO7U8/62nvijNGGx4dUHNR X-Received: by 2002:a63:31c1:: with SMTP id x184mr40009753pgx.128.1563419171073; Wed, 17 Jul 2019 20:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563419171; cv=none; d=google.com; s=arc-20160816; b=ys+VbWv1rR2sm/kaiKknjjDcfUI2HPVRti/+Y9eBGaKlO2XY/uGKfXXe8GLyhPFvmi KRpbj8FB8zDh2dn+h6MR6+yp9ZAvajBPc6up/Ii/vDRDeoAX7U1Yie+fHTX1FmGUSpFu 8qKey0PkN1CSWEuLD3zv+o+3FhBksAMLeCOda6XV6JfAwvx/OrYmRyXaW0EiAb6jkWEe NDFdkBNM4TKEC7+VTqZmpgXBZV7PmX86TKg13c53hRYhccEf8s8zH0e86TGeDn+hV/qX kteTiUVWLSTdwzmgJ1uKZXzD+muRAOmcNXasO77+eHHBOKmO7pNvFU4IARb4bu1tHZHa gsqQ== 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=odmyZaJ/xPib8MafUdDtvaRgxtgcupn2xgHsHuDwy7w=; b=vKSEe2iHN153u1rVnGsdDQK3bsS4MYbScnwXflD7QmTm/TMFxr7vdnb2tpxNVM3+CN QgY74tshCKClIpSAlZcx1z7Lr9ui6uaD/PMwAZOr22i1uFIT0IO0d+rjTPQLbN0luYHl bl7+m6BWU1y+Qj0NNgG1P4uOk/KPS0ko3F5VfbQBOwPd0EkiDaqagG9iNzChK9KltFXx ZKobXHNbfBAKPHdRYijaIiIX4MLbB9oL3xkxt42B4Uzh3uBbK83NB+8cjv/+ho/iqCKY 60BQekzc9xEAwNNyqQ+WdmX/YNE+8wLwOOeVJlGrbwcPLpgrRcGRSlcji9ZkclMm+XZO 7Tog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yMZGPNn6; 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 72si903403plc.415.2019.07.17.20.05.54; Wed, 17 Jul 2019 20:06:11 -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=yMZGPNn6; 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 S2389471AbfGRDDo (ORCPT + 99 others); Wed, 17 Jul 2019 23:03:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:34460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389432AbfGRDDm (ORCPT ); Wed, 17 Jul 2019 23:03:42 -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 7643D21849; Thu, 18 Jul 2019 03:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419021; bh=rNZMM3N9RKTRm0K8TpzstOUDkLj8uGcAApZZJGzJxd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yMZGPNn6kdLsU88mDLPuc9DoozE8m+vD3806rTCxN9U7/HMdzxoflITKshXffIE0K hei3rhMe2zAjtgLQ6L2xJ46gBy9h2D/ARmBQUdOttfDGGjyB9Y36nuff+mXqRLfhGE X8uvxFENLqjGXxxAEpSWzhTZNgzbRNSzJfLBLr7s= 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 5.2 02/21] e1000e: start network tx queue only when link is up Date: Thu, 18 Jul 2019 12:01:20 +0900 Message-Id: <20190718030030.975683114@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030030.456918453@linuxfoundation.org> References: <20190718030030.456918453@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); } @@ -4606,6 +4606,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); @@ -4666,7 +4667,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); @@ -5288,6 +5288,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)) @@ -5301,6 +5302,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));