Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-07-21 10:23:21 +0200
committerJiri Slaby <jslaby@suse.cz>2019-07-21 10:23:22 +0200
commite1b4273cd5fc72eed48a7a51b7182235d6673384 (patch)
tree4cf48d962fe581c5364f0be70dc5d17985ed24f9
parent8bc7fe24e2b86addfcf20fe88d967e48abb27f30 (diff)
e1000e: start network tx queue only when link is up
-rw-r--r--patches.kernel.org/5.2.2-002-e1000e-start-network-tx-queue-only-when-link-is.patch79
-rw-r--r--series.conf1
2 files changed, 80 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.2-002-e1000e-start-network-tx-queue-only-when-link-is.patch b/patches.kernel.org/5.2.2-002-e1000e-start-network-tx-queue-only-when-link-is.patch
new file mode 100644
index 0000000000..67de281a59
--- /dev/null
+++ b/patches.kernel.org/5.2.2-002-e1000e-start-network-tx-queue-only-when-link-is.patch
@@ -0,0 +1,79 @@
+From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
+Date: Wed, 17 Apr 2019 11:13:20 +0300
+Subject: [PATCH] e1000e: start network tx queue only when link is up
+References: bnc#1012628
+Patch-mainline: 5.2.2
+Git-commit: d17ba0f616a08f597d9348c372d89b8c0405ccf3
+
+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 <khlebnikov@yandex-team.ru>
+Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
+Tested-by: Joseph Yasi <joe.yasi@gmail.com>
+Tested-by: Aaron Brown <aaron.f.brown@intel.com>
+Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ 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 e21b2ffd1e92..b081a1ef6859 100644
+--- 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 *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);
+ }
+@@ -4606,6 +4606,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);
+@@ -4666,7 +4667,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);
+@@ -5288,6 +5288,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))
+@@ -5301,6 +5302,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));
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index fa4f1544a8..dfe8184eed 100644
--- a/series.conf
+++ b/series.conf
@@ -89,6 +89,7 @@
patches.kernel.org/5.2.1-060-staging-rtl8712-reduce-stack-usage-again.patch
patches.kernel.org/5.2.1-061-Linux-5.2.1.patch
patches.kernel.org/5.2.2-001-Revert-e1000e-fix-cyclic-resets-at-link-up-with.patch
+ patches.kernel.org/5.2.2-002-e1000e-start-network-tx-queue-only-when-link-is.patch
########################################################
# Build fixes that apply to the vanilla kernel too.