Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3133908yba; Mon, 22 Apr 2019 20:56:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBx7GVCqIJBN4bLHMYHHZVcYZzFAO1DWQJ6SuEsmrPlO3+e41/JjgyRse0eXDlzkmegCll X-Received: by 2002:a62:474a:: with SMTP id u71mr23794581pfa.87.1555991797665; Mon, 22 Apr 2019 20:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555991797; cv=none; d=google.com; s=arc-20160816; b=0RX3fIxt3V6K/D2cEGX2qRRyof/VZ2AzukhUwxW03GJl1dtRaeur7AGHURYIDTPTMi YIWoNMa+PKWwE8XF6GPLmzA/oLBMr1Kpyr7f96GCdzkS9QzB5YrQS20W2GymIfioJtP+ L9ZXLc0QMPeTrCNgrBaT/kHE5gD3pZNcE+DSDKHYmLYjWOu6I11czHLcPCIGmJI6ZW7A pyUEas8HjLgw3uQmi70ZRJCWYfAWQca6YkcJGac0cZ3zDLvuWZKrxQSCwvRhC2yL8gdP 1MmHm62ZAHwDTMTQd2Lv1XqzXB5BW2V4IJ6bFeCIP3tCkGUni1H43nRUfZtQN3j9noWp H6DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7IzJQfMfcbJ3GY4q41cW4H36gtaA7o57eCLtAONQIoo=; b=mmejDyotnVCjJCm31cYr85Kag56nRVg2CBHEGBcdbvvHxeX2jchTRCrv0eZqPt1Smn VfdDMHtx7kbOsq8SXGl93b6/gG5IV8JBhj1eSsWuMhyswvHDYuSaQ75yKG9pq+C19yD2 eQdt0HbUxu6sgQ/5xMxNPe9ILrL1HKRImV03uNDS+luk3WrFa7wrzfhxNOCW4/opFTgZ 23zgpbGpaPWt9b/GQNr1jcoBimH6Ix9o24V0AkGK1cwNfcB4QYjqOTETZ4PP+bO9F5HJ niJ+CH7VO58RUPrusSMkTa8UHicMw7Na4azZojXiv+0TLg6aT6e8mG/Ma8iUITiPXMqd S9lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VVqjjPMd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si14876293plk.144.2019.04.22.20.56.22; Mon, 22 Apr 2019 20:56:37 -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=@gmail.com header.s=20161025 header.b=VVqjjPMd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbfDWAvC (ORCPT + 99 others); Mon, 22 Apr 2019 20:51:02 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:52726 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfDWAvB (ORCPT ); Mon, 22 Apr 2019 20:51:01 -0400 Received: by mail-it1-f195.google.com with SMTP id x132so20767624itf.2; Mon, 22 Apr 2019 17:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7IzJQfMfcbJ3GY4q41cW4H36gtaA7o57eCLtAONQIoo=; b=VVqjjPMdKnbgeQLMovAysdrXkhWjpHgXKdDlsTWs390ogm3LRe09lyC9yjyHG25JAN lvdhNOIaf+DWcL1dbYnmXT7ppgTZCXIRcT8d+oXonbrPeAwN81r4BJsZZUuRIy2VFaZO aEJ4KdK7BfcnCI78tg7XxbVPY41m/3Vtzphb9qqsa3WBDlqLB7zo2UBTbyq5bjbOLD8+ ZM5o2lGP7OqkqvyeLSfwzm+qm4AuAjNLtMSeggmoG9TimE5r8Paxux7qBtLheun5lwjL VnTPj6KoXNqJfQ/Ru+ntHEUQNq7tuFHQgmwouTVzXPaIfJVwmSqC/9a1YSWhj1+eczH2 5JTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7IzJQfMfcbJ3GY4q41cW4H36gtaA7o57eCLtAONQIoo=; b=bA9sUHHQoJ7vMChjCU4ak394oS92lF+5eALV1VGM443SMiHt+dD4Tx6+I7Vx5uWijF nmle2E1AXcO9UNc1tyY4DGiFuPzrBbTQq4tiHGflvwGd0u/wpYF6yjMN7/r1dLE7Pr18 7ssrdVJ1CrWX9yShS9sGT/7MmS7vgdx5aR29kVPB39Scyi5CyfAhSco3TLAV/Y/9qwwC /mV6Yl3qVAwogfJciU4JexWrhOz0+Zg+fu6U6vBLYNVxsDZPLmrv+aRLe04iMc/0oU1Y OIgBQLvpDeCLIPq8btHuEcQq42y1/8IsJgbyMBL+v35uHg+pfSCsLja+BFjJ/O1sBijI iDoA== X-Gm-Message-State: APjAAAUqBLGjYWW8Lk574rwJj/vCvO/5ApxB5UhfAS7VFcykKel66vSZ +tw7qp72Z2cY1pWyK+evwuNsEA+M/eg3NLClXDM= X-Received: by 2002:a24:9a03:: with SMTP id l3mr132470ite.3.1555980660537; Mon, 22 Apr 2019 17:51:00 -0700 (PDT) MIME-Version: 1.0 References: <155548879651.3454.13167784936351314661.stgit@buzz> <155548880068.3454.1621821881762819373.stgit@buzz> In-Reply-To: <155548880068.3454.1621821881762819373.stgit@buzz> From: Joseph Yasi Date: Mon, 22 Apr 2019 20:50:49 -0400 Message-ID: Subject: Re: [PATCH 2/2] e1000e: start network tx queue only when link is up To: Konstantin Khlebnikov Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, Jeff Kirsher , Sasha Levin , Aaron Brown , Alexander Duyck , e1000-devel@lists.sourceforge.net 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 On Wed, Apr 17, 2019 at 4:13 AM Konstantin Khlebnikov wrote: > > 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 > --- > drivers/net/ethernet/intel/e1000e/netdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c > index ba96e52aa8d1..fe643d66aa10 100644 > --- a/drivers/net/ethernet/intel/e1000e/netdev.c > +++ b/drivers/net/ethernet/intel/e1000e/netdev.c > @@ -4209,7 +4209,7 @@ void e1000e_up(struct e1000_adapter *adapter) > 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); > } > @@ -4607,6 +4607,7 @@ int e1000e_open(struct net_device *netdev) > 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); > @@ -4667,7 +4668,6 @@ int e1000e_open(struct net_device *netdev) > e1000_irq_enable(adapter); > > adapter->tx_hang_recheck = false; > - netif_start_queue(netdev); > > hw->mac.get_link_status = true; > pm_runtime_put(&pdev->dev); > @@ -5289,6 +5289,7 @@ static void e1000_watchdog_task(struct work_struct *work) > 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)) > @@ -5302,6 +5303,7 @@ static void e1000_watchdog_task(struct work_struct *work) > /* 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)); >