aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Gupta <vikas.gupta@broadcom.com>2020-01-02 21:18:09 +0530
committerDavid S. Miller <davem@davemloft.net>2020-01-08 15:47:50 -0800
commit6181e5cb752e5de9f56fbcee3f0206a2c51f1478 (patch)
tree3e03585cd26d71c32b796b98af76dc18406ee7f6
parentMerge branch 'reduce-open-coded-skb-next-access-for-gso-segment-walking' (diff)
downloadlinux-dev-6181e5cb752e5de9f56fbcee3f0206a2c51f1478.tar.xz
linux-dev-6181e5cb752e5de9f56fbcee3f0206a2c51f1478.zip
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: Vikas Gupta <vikas.gupta@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/devlink.h2
-rw-r--r--net/core/devlink.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 47f87b2fcf63..453f45cc1519 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -1000,6 +1000,8 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
void
devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
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);
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 4c63c9a4c09e..e686ae67cd96 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4860,6 +4860,14 @@ devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
}
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
devlink_health_reporter_recover(struct devlink_health_reporter *reporter,
void *priv_ctx, struct netlink_ext_ack *extack)
@@ -4876,9 +4884,8 @@ devlink_health_reporter_recover(struct devlink_health_reporter *reporter,
if (err)
return err;
- reporter->recovery_count++;
+ devlink_health_reporter_recovery_done(reporter);
reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_HEALTHY;
- reporter->last_recovery_ts = jiffies;
return 0;
}