diff mbox series

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

Message ID 20210217215128.17904-2-jeffrey.lane@canonical.com
State New
Headers show
Series devlink: don't do reporter recovery if the state is healthy | expand

Commit Message

Jeff Lane Feb. 17, 2021, 9:51 p.m. UTC
From: Jiri Pirko <jiri@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@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 402818205c9ecdfd922fdfa58fb113f60fdda523)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
---
 net/core/devlink.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stefan Bader Feb. 18, 2021, 8:04 a.m. UTC | #1
On 17.02.21 22:51, Jeff Lane wrote:
> From: Jiri Pirko <jiri@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@mellanox.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit 402818205c9ecdfd922fdfa58fb113f60fdda523)
> Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Acked-by: Stefan Bader <stefan.bader@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;
>  
>
Colin Ian King Feb. 18, 2021, 9:23 a.m. UTC | #2
On 17/02/2021 21:51, Jeff Lane wrote:
> From: Jiri Pirko <jiri@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@mellanox.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit 402818205c9ecdfd922fdfa58fb113f60fdda523)
> Signed-off-by: Jeff Lane <jeffrey.lane@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;
>  
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

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;