]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/e1000e-fix-cyclic-resets-at-link-up-with-active-tx.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / queue-4.4 / e1000e-fix-cyclic-resets-at-link-up-with-active-tx.patch
1 From e360c5a03af43ed5858cee18981560df58e39204 Mon Sep 17 00:00:00 2001
2 From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
3 Date: Mon, 14 Jan 2019 16:29:30 +0300
4 Subject: e1000e: fix cyclic resets at link up with active tx
5
6 [ Upstream commit 0f9e980bf5ee1a97e2e401c846b2af989eb21c61 ]
7
8 I'm seeing series of e1000e resets (sometimes endless) at system boot
9 if something generates tx traffic at this time. In my case this is
10 netconsole who sends message "e1000e 0000:02:00.0: Some CPU C-states
11 have been disabled in order to enable jumbo frames" from e1000e itself.
12 As result e1000_watchdog_task sees used tx buffer while carrier is off
13 and start this reset cycle again.
14
15 [ 17.794359] e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
16 [ 17.794714] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
17 [ 22.936455] e1000e 0000:02:00.0 eth1: changing MTU from 1500 to 9000
18 [ 23.033336] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
19 [ 26.102364] e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
20 [ 27.174495] 8021q: 802.1Q VLAN Support v1.8
21 [ 27.174513] 8021q: adding VLAN 0 to HW filter on device eth1
22 [ 30.671724] cgroup: cgroup: disabling cgroup2 socket matching due to net_prio or net_cls activation
23 [ 30.898564] netpoll: netconsole: local port 6666
24 [ 30.898566] netpoll: netconsole: local IPv6 address 2a02:6b8:0:80b:beae:c5ff:fe28:23f8
25 [ 30.898567] netpoll: netconsole: interface 'eth1'
26 [ 30.898568] netpoll: netconsole: remote port 6666
27 [ 30.898568] netpoll: netconsole: remote IPv6 address 2a02:6b8:b000:605c:e61d:2dff:fe03:3790
28 [ 30.898569] netpoll: netconsole: remote ethernet address b0:a8:6e:f4:ff:c0
29 [ 30.917747] console [netcon0] enabled
30 [ 30.917749] netconsole: network logging started
31 [ 31.453353] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
32 [ 34.185730] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
33 [ 34.321840] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
34 [ 34.465822] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
35 [ 34.597423] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
36 [ 34.745417] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
37 [ 34.877356] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
38 [ 35.005441] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
39 [ 35.157376] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
40 [ 35.289362] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
41 [ 35.417441] e1000e 0000:02:00.0: Some CPU C-states have been disabled in order to enable jumbo frames
42 [ 37.790342] e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
43
44 This patch flushes tx buffers only once when carrier is off
45 rather than at each watchdog iteration.
46
47 Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
48 Tested-by: Aaron Brown <aaron.f.brown@intel.com>
49 Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
50 Signed-off-by: Sasha Levin <sashal@kernel.org>
51 ---
52 drivers/net/ethernet/intel/e1000e/netdev.c | 15 ++++++---------
53 1 file changed, 6 insertions(+), 9 deletions(-)
54
55 diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
56 index 6b1cacd86c6e..44312962b64e 100644
57 --- a/drivers/net/ethernet/intel/e1000e/netdev.c
58 +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
59 @@ -5246,8 +5246,13 @@ static void e1000_watchdog_task(struct work_struct *work)
60 /* 8000ES2LAN requires a Rx packet buffer work-around
61 * on link down event; reset the controller to flush
62 * the Rx packet buffer.
63 + *
64 + * If the link is lost the controller stops DMA, but
65 + * if there is queued Tx work it cannot be done. So
66 + * reset the controller to flush the Tx packet buffers.
67 */
68 - if (adapter->flags & FLAG_RX_NEEDS_RESTART)
69 + if ((adapter->flags & FLAG_RX_NEEDS_RESTART) ||
70 + e1000_desc_unused(tx_ring) + 1 < tx_ring->count)
71 adapter->flags |= FLAG_RESTART_NOW;
72 else
73 pm_schedule_suspend(netdev->dev.parent,
74 @@ -5270,14 +5275,6 @@ link_up:
75 adapter->gotc_old = adapter->stats.gotc;
76 spin_unlock(&adapter->stats64_lock);
77
78 - /* If the link is lost the controller stops DMA, but
79 - * if there is queued Tx work it cannot be done. So
80 - * reset the controller to flush the Tx packet buffers.
81 - */
82 - if (!netif_carrier_ok(netdev) &&
83 - (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
84 - adapter->flags |= FLAG_RESTART_NOW;
85 -
86 /* If reset is necessary, do it outside of interrupt context. */
87 if (adapter->flags & FLAG_RESTART_NOW) {
88 schedule_work(&adapter->reset_task);
89 --
90 2.19.1
91