lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Mar 2021 19:26:13 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     netdev@...r.kernel.org
Cc:     jiri@...nulli.us, saeedm@...dia.com,
        andrew.gospodarek@...adcom.com, jacob.e.keller@...el.com,
        guglielmo.morandin@...adcom.com, eugenem@...com,
        eranbe@...lanox.com, Jakub Kicinski <kuba@...nel.org>
Subject: [RFC net-next v2 3/3] devlink: add more failure modes

>> Pending vendors adding the right reporters. <<

Extend the applicability of devlink health reporters
beyond what can be locally remedied. Add failure modes
which require re-flashing the NVM image or HW changes.

The expectation is that driver will call
devlink_health_reporter_state_update() to put hardware
health reporters into bad state.

Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
 include/uapi/linux/devlink.h | 7 +++++++
 net/core/devlink.c           | 3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 8cd1508b525b..f623bbc63489 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -617,10 +617,17 @@ enum devlink_port_fn_opstate {
  * @DL_HEALTH_STATE_ERROR: error state, running health reporter's recovery
  *			may fix the issue, otherwise user needs to try
  *			power cycling or other forms of reset
+ * @DL_HEALTH_STATE_BAD_IMAGE: device's non-volatile memory needs
+ *			to be re-written, usually due to block corruption
+ * @DL_HEALTH_STATE_BAD_HW: hardware errors detected, device, host
+ *			or the connection between the two may be at fault
  */
 enum devlink_health_state {
 	DL_HEALTH_STATE_HEALTHY,
 	DL_HEALTH_STATE_ERROR,
+
+	DL_HEALTH_STATE_BAD_IMAGE,
+	DL_HEALTH_STATE_BAD_HW,
 };
 
 /**
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 09d77d43ff63..4a9fa6288a4a 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6527,8 +6527,7 @@ void
 devlink_health_reporter_state_update(struct devlink_health_reporter *reporter,
 				     enum devlink_health_state state)
 {
-	if (WARN_ON(state != DL_HEALTH_STATE_HEALTHY &&
-		    state != DL_HEALTH_STATE_ERROR))
+	if (WARN_ON(state > DL_HEALTH_STATE_BAD_HW))
 		return;
 
 	if (reporter->health_state == state)
-- 
2.29.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ