Skip to content

Commit

Permalink
devlink: make health report on unregistered instance warn just once
Browse files Browse the repository at this point in the history
Devlink health is involved in error recovery. Machines in bad
state tend to be fairly unreliable, and occasionally get stuck
in error loops. Even with a reasonable grace period devlink health
may get a thousand reports in an hour.

In case of reporting on an unregistered devlink instance
the subsequent reports don't add much value. Switch to
WARN_ON_ONCE() to avoid flooding dmesg and fleet monitoring
dashboards.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20230531015523.48961-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jun 1, 2023
1 parent 6f7aee2 commit 6f4b981
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/devlink/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static void devlink_recover_notify(struct devlink_health_reporter *reporter,
int err;

WARN_ON(cmd != DEVLINK_CMD_HEALTH_REPORTER_RECOVER);
WARN_ON(!xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED));
ASSERT_DEVLINK_REGISTERED(devlink);

msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
Expand Down

0 comments on commit 6f4b981

Please sign in to comment.