Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1000018yba; Thu, 4 Apr 2019 02:06:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPYbmNhWrxapDS2vbXaIu+0uV4dbgsswHptfo3l5693IFSeCdPDfQB7p7cCiPinmsPDzbR X-Received: by 2002:a63:408:: with SMTP id 8mr4650624pge.334.1554368818993; Thu, 04 Apr 2019 02:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368818; cv=none; d=google.com; s=arc-20160816; b=BY1ssDllGODkgpeQy6umd3jH+sRwQdN6yh+48phsHX+lBLcj5kQDL5J8gjog8B1yiC pPxxQEThQ6VkFAYVYomo078XhvnMsDm++yqY0VLZIkChShpwwNF7t67T6jL2wbfWsSjb FeKAnT5lbD7oStPU1E95+VESHm7pFQX8EfOzNb5Y5bXwJmLms/zCQFwLY8kPU18DaK0O oKig1G4EPSY441O+TazjL82NTtTfGdmSZfA5X8ylXaNy3peJcxWfH/7F+47jG1y26E3c 3cr6+1MuaO/f3Yl4vUy7wiv4aqW1mV74ntOcimUS5prxszpGXUF3TXY3Y8Wt/awgJu06 aDDg== 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=WlTAAVYSTBNL0cUo0L6a9ZM7myAGDpnqkab0rMtHpQ4=; b=TLmIYqo2BwwGGbWR6bRmQFvi4YRO6WzKDaTIUFe6CZJmEnepC9yy4RhMWsI+gwrvDD WsgcDhsFpyr/No6fjkCFwMO+pwcGd8Gn91gun7AWkm/rnB0jWNkWIrn61V2kyw8ivDh1 5CwqN5z3pkDyUdsTdesuDmL0Zg6kzGptltcKPe8Qig/b5feyQeC5cLZ2d0yHu5YeEMuY P2fuZHHi4YGonBfr6LiJlmdACjZ/2q+UE1pF617eH2Lw0S7wEWdjV/AA7vLYpJsgzpug wjxYUFxg/aKSqHch4oQXXy1i8DVXpVhKfWd+ns0wTvQ5k5VSCj+tm4pqNW/Tq7ddsiqO DQAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OghZDOET; 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 v5si14720852pfm.134.2019.04.04.02.06.43; Thu, 04 Apr 2019 02:06:58 -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=OghZDOET; 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 S1732056AbfDDJEz (ORCPT + 99 others); Thu, 4 Apr 2019 05:04:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:42778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732044AbfDDJEw (ORCPT ); Thu, 4 Apr 2019 05:04:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 6D93F2177E; Thu, 4 Apr 2019 09:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368690; bh=hshdS0V29yy41QA+0O0UPWYGFYONKJDqaQeR0WfM1XU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OghZDOETPhKD8Sx+6UF2bdg+RaruowQh/L5k5zMfrrbU0CVxymWtBwbyGsjHTngi4 gQm3hV8jLwWB2xkJQHMo8Wagtv9YZQnEdoWXXeA3dRYNt6PMUaJmSLqFsqeHKP1EH8 0KX2e5cDXwGYZwbVatTIg0CgrxwpjuesOeKN0H+4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Konstantin Khlebnikov , Aaron Brown , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.19 125/187] e1000e: fix cyclic resets at link up with active tx Date: Thu, 4 Apr 2019 10:47:42 +0200 Message-Id: <20190404084609.119621882@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 0f9e980bf5ee1a97e2e401c846b2af989eb21c61 ] I'm seeing series of e1000e resets (sometimes endless) at system boot if something generates tx traffic at this time. In my case this is netconsole who sends message "e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames" from e1000e itself. As result e1000_watchdog_task sees used tx buffer while carrier is off and start this reset cycle again. [ 17.794359] e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None [ 17.794714] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready [ 22.936455] e1000e 0000:02:00.0 eth1: changing MTU from 1500 to 9000 [ 23.033336] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 26.102364] e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None [ 27.174495] 8021q: 802.1Q VLAN Support v1.8 [ 27.174513] 8021q: adding VLAN 0 to HW filter on device eth1 [ 30.671724] cgroup: cgroup: disabling cgroup2 socket matching due to net_prio or net_cls activation [ 30.898564] netpoll: netconsole: local port 6666 [ 30.898566] netpoll: netconsole: local IPv6 address 2a02:6b8:0:80b:beae:c5ff:fe28:23f8 [ 30.898567] netpoll: netconsole: interface 'eth1' [ 30.898568] netpoll: netconsole: remote port 6666 [ 30.898568] netpoll: netconsole: remote IPv6 address 2a02:6b8:b000:605c:e61d:2dff:fe03:3790 [ 30.898569] netpoll: netconsole: remote ethernet address b0:a8:6e:f4:ff:c0 [ 30.917747] console [netcon0] enabled [ 30.917749] netconsole: network logging started [ 31.453353] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 34.185730] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 34.321840] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 34.465822] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 34.597423] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 34.745417] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 34.877356] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 35.005441] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 35.157376] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 35.289362] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 35.417441] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames [ 37.790342] e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None This patch flushes tx buffers only once when carrier is off rather than at each watchdog iteration. Signed-off-by: Konstantin Khlebnikov Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/e1000e/netdev.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index e3945469b5c8..23edc1364487 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5286,8 +5286,13 @@ static void e1000_watchdog_task(struct work_struct *work) /* 8000ES2LAN requires a Rx packet buffer work-around * on link down event; reset the controller to flush * the Rx packet buffer. + * + * If the link is lost the controller stops DMA, but + * if there is queued Tx work it cannot be done. So + * reset the controller to flush the Tx packet buffers. */ - if (adapter->flags & FLAG_RX_NEEDS_RESTART) + if ((adapter->flags & FLAG_RX_NEEDS_RESTART) || + e1000_desc_unused(tx_ring) + 1 < tx_ring->count) adapter->flags |= FLAG_RESTART_NOW; else pm_schedule_suspend(netdev->dev.parent, @@ -5310,14 +5315,6 @@ link_up: adapter->gotc_old = adapter->stats.gotc; spin_unlock(&adapter->stats64_lock); - /* If the link is lost the controller stops DMA, but - * if there is queued Tx work it cannot be done. So - * reset the controller to flush the Tx packet buffers. - */ - if (!netif_carrier_ok(netdev) && - (e1000_desc_unused(tx_ring) + 1 < tx_ring->count)) - adapter->flags |= FLAG_RESTART_NOW; - /* If reset is necessary, do it outside of interrupt context. */ if (adapter->flags & FLAG_RESTART_NOW) { schedule_work(&adapter->reset_task); -- 2.19.1