OSDN Git Service

devlink: Add health report functionality
authorEran Ben Elisha <eranbe@mellanox.com>
Thu, 7 Feb 2019 09:36:34 +0000 (11:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Feb 2019 18:34:28 +0000 (10:34 -0800)
commitc8e1da0bf9238e460c73ebc5a07ce93697e5e207
treed9f9d31b9bbde877a437f9b7faf4252daf13141f
parenta0bdcc59d194d9d2ccb679015e66d8562b0b9e84
devlink: Add health report functionality

Upon error discover, every driver can report it to the devlink health
mechanism via devlink_health_report function, using the appropriate
reporter registered to it. Driver can pass error specific context which
will be delivered to it as part of the dump / recovery callbacks.

Once an error is reported, devlink health will do the following actions:
* A log is being send to the kernel trace events buffer
* Health status and statistics are being updated for the reporter instance
* Object dump is being taken and stored at the reporter instance (as long
  as there is no other dump which is already stored)
* Auto recovery attempt is being done. Depends on:
  - Auto Recovery configuration
  - Grace period vs. Time since last recover

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/devlink.h
include/trace/events/devlink.h
net/core/devlink.c