[PATCH 1/1] devlink: don't do reporter recovery if the state is healthy

Jeff Lane jeffrey.lane at canonical.com
Wed Feb 17 21:51:28 UTC 2021


From: Jiri Pirko <jiri at mellanox.com>

BugLink: https://bugs.launchpad.net/bugs/1915403

If reporter state is healthy, don't call into a driver for recover and
don't increase recovery count.

Signed-off-by: Jiri Pirko <jiri at mellanox.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 402818205c9ecdfd922fdfa58fb113f60fdda523)
Signed-off-by: Jeff Lane <jeffrey.lane at canonical.com>
---
 net/core/devlink.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index e422971b7874..09eb3e69a350 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4766,6 +4766,9 @@ devlink_health_reporter_recover(struct devlink_health_reporter *reporter,
 {
 	int err;
 
+	if (reporter->health_state == DEVLINK_HEALTH_REPORTER_STATE_HEALTHY)
+		return 0;
+
 	if (!reporter->ops->recover)
 		return -EOPNOTSUPP;
 
-- 
2.17.1




More information about the kernel-team mailing list