From 1b747d74b3e7306ea953513f1b3b5c463006aefc Mon Sep 17 00:00:00 2001 From: Petr Oros Date: Mon, 23 Nov 2020 17:16:47 +0100 Subject: [PATCH 35/78] net: ena: fix continuous keep-alive resets Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1861967 Conflicts: - merge conflict was resolved by upstream commit 9fb16955fb6619 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Upstream commit(s): commit dfdde1345bc124816f0fd42fa91b8748051e758e Author: Arthur Kiyanovski Date: Tue Mar 17 09:06:42 2020 +0200 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: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Noam Dagan Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller Signed-off-by: Petr Oros --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 + 1 file changed, 1 insertion(+) Index: src/drivers/net/ethernet/amazon/ena/ena_netdev.c =================================================================== --- src.orig/drivers/net/ethernet/amazon/ena/ena_netdev.c 2020-11-23 17:45:30.965102771 +0100 +++ src/drivers/net/ethernet/amazon/ena/ena_netdev.c 2020-11-23 17:46:06.715787979 +0100 @@ -3491,6 +3491,7 @@ dev_err(&pdev->dev, "Device reset completed successfully, Driver info: %s\n", version); + adapter->last_keep_alive_jiffies = jiffies; return rc; err_disable_msix: