Commit 6181e5cb authored by Vikas Gupta's avatar Vikas Gupta Committed by David S. Miller

devlink: add support for reporter recovery completion

It is possible that a reporter recovery completion do not finish
successfully when recovery is triggered via
devlink_health_reporter_recover as recovery could be processed in
different context. In such scenario an error is returned by driver when
recover hook is invoked and successful recovery completion is
intimated later.
Expose devlink recover done API to update recovery stats.
Signed-off-by: default avatarVikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6ea0032f
...@@ -1000,6 +1000,8 @@ int devlink_health_report(struct devlink_health_reporter *reporter, ...@@ -1000,6 +1000,8 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
void void
devlink_health_reporter_state_update(struct devlink_health_reporter *reporter, devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
enum devlink_health_reporter_state state); enum devlink_health_reporter_state state);
void
devlink_health_reporter_recovery_done(struct devlink_health_reporter *reporter);
bool devlink_is_reload_failed(const struct devlink *devlink); bool devlink_is_reload_failed(const struct devlink *devlink);
......
...@@ -4860,6 +4860,14 @@ devlink_health_reporter_state_update(struct devlink_health_reporter *reporter, ...@@ -4860,6 +4860,14 @@ devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
} }
EXPORT_SYMBOL_GPL(devlink_health_reporter_state_update); EXPORT_SYMBOL_GPL(devlink_health_reporter_state_update);
void
devlink_health_reporter_recovery_done(struct devlink_health_reporter *reporter)
{
reporter->recovery_count++;
reporter->last_recovery_ts = jiffies;
}
EXPORT_SYMBOL_GPL(devlink_health_reporter_recovery_done);
static int static int
devlink_health_reporter_recover(struct devlink_health_reporter *reporter, devlink_health_reporter_recover(struct devlink_health_reporter *reporter,
void *priv_ctx, struct netlink_ext_ack *extack) void *priv_ctx, struct netlink_ext_ack *extack)
...@@ -4876,9 +4884,8 @@ devlink_health_reporter_recover(struct devlink_health_reporter *reporter, ...@@ -4876,9 +4884,8 @@ devlink_health_reporter_recover(struct devlink_health_reporter *reporter,
if (err) if (err)
return err; return err;
reporter->recovery_count++; devlink_health_reporter_recovery_done(reporter);
reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_HEALTHY; reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_HEALTHY;
reporter->last_recovery_ts = jiffies;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment