[net-next,v2,1/4] devlink: don't do reporter recovery if the state is healthy
diff mbox series

Message ID 20191010131851.21438-2-jiri@resnulli.us
State Accepted
Delegated to: David Miller
Headers show
Series
  • [net-next,v2,1/4] devlink: don't do reporter recovery if the state is healthy
Related show

Commit Message

Jiri Pirko Oct. 10, 2019, 1:18 p.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

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@mellanox.com>
---
 net/core/devlink.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/net/core/devlink.c b/net/core/devlink.c
index eb0a22f05887..95887462eecf 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4851,6 +4851,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;