]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: fix continuous keep-alive resets
authorArthur Kiyanovski <akiyano@amazon.com>
Tue, 17 Mar 2020 07:06:42 +0000 (09:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Mar 2020 04:24:23 +0000 (21:24 -0700)
commiteb7736202d16930b3fb0334441f161bc389e8cfa
treeae6294cc7ffa878fd6170cbe2c1a22684d719468
parent94be4a7e88e2596656323c0d826af7c4a727b625
net: ena: fix continuous keep-alive resets

last_keep_alive_jiffies is updated in probe and when a keep-alive
event is received.  In case the driver times-out on a keep-alive event,
it has high chances of continuously timing-out on keep-alive events.
This is because when the driver recovers from the keep-alive-timeout reset
the value of last_keep_alive_jiffies is very old, and if a keep-alive
event is not received before the next timer expires, the value of
last_keep_alive_jiffies will cause another keep-alive-timeout reset
and so forth in a loop.

Solution:
Update last_keep_alive_jiffies whenever the device is restored after
reset.

Fixes: 42904aea461f ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Noam Dagan <ndagan@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_netdev.c