From 3167b27a7ded84623f50e4fb4cab846e75c4a210 Mon Sep 17 00:00:00 2001 From: Eran Ben Elisha Date: Sun, 3 Mar 2019 10:57:30 +0200 Subject: devlink: Add support for direct reporter health state update It is possible that a reporter state will be updated due to a recover flow which is not triggered by a devlink health related operation, but as a side effect of some other operation in the system. Expose devlink health API for a direct update of a reporter status. Move devlink_health_reporter_state enum definition to devlink.h so it could be used from drivers as a parameter of devlink_health_reporter_state_update. In addition, add trace_devlink_health_reporter_state_update to provide user notification for reporter state change. Signed-off-by: Eran Ben Elisha Acked-by: Jiri Pirko Signed-off-by: David S. Miller --- include/net/devlink.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/net') diff --git a/include/net/devlink.h b/include/net/devlink.h index 7f5a0bdca228..63de99e09f04 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -447,6 +447,11 @@ typedef void devlink_snapshot_data_dest_t(const void *data); struct devlink_fmsg; struct devlink_health_reporter; +enum devlink_health_reporter_state { + DEVLINK_HEALTH_REPORTER_STATE_HEALTHY, + DEVLINK_HEALTH_REPORTER_STATE_ERROR, +}; + /** * struct devlink_health_reporter_ops - Reporter operations * @name: reporter name @@ -715,6 +720,9 @@ void * devlink_health_reporter_priv(struct devlink_health_reporter *reporter); int devlink_health_report(struct devlink_health_reporter *reporter, const char *msg, void *priv_ctx); +void +devlink_health_reporter_state_update(struct devlink_health_reporter *reporter, + enum devlink_health_reporter_state state); void devlink_compat_running_version(struct net_device *dev, char *buf, size_t len); @@ -1204,6 +1212,12 @@ devlink_health_report(struct devlink_health_reporter *reporter, return 0; } +static inline void +devlink_health_reporter_state_update(struct devlink_health_reporter *reporter, + enum devlink_health_reporter_state state) +{ +} + static inline void devlink_compat_running_version(struct net_device *dev, char *buf, size_t len) { -- cgit v1.2.3