All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch,
	mkubecek@suse.cz, pali@kernel.org, jacob.e.keller@intel.com,
	jiri@nvidia.com, vadimp@nvidia.com, mlxsw@nvidia.com,
	Ido Schimmel <idosch@nvidia.com>
Subject: [RFC PATCH ethtool-next v3 6/6] ethtool: Add transceiver module extended states
Date: Tue, 24 Aug 2021 16:05:15 +0300	[thread overview]
Message-ID: <20210824130515.1828270-7-idosch@idosch.org> (raw)
In-Reply-To: <20210824130515.1828270-1-idosch@idosch.org>

From: Ido Schimmel <idosch@nvidia.com>

Add support for an extended state and two extended sub-states to
describe link issues related to transceiver modules.

In case "CMIS transceiver module is not in ModuleReady state" and the
module is in ModuleFault state, it is possible to read the fault reason
from the EEPROM dump.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 netlink/settings.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/netlink/settings.c b/netlink/settings.c
index e47a38f3058f..515b9302c09d 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -593,6 +593,7 @@ static const char *const names_link_ext_state[] = {
 	[ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE]	= "Calibration failure",
 	[ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED]	= "Power budget exceeded",
 	[ETHTOOL_LINK_EXT_STATE_OVERHEAT]		= "Overheat",
+	[ETHTOOL_LINK_EXT_STATE_MODULE]			= "Module",
 };
 
 static const char *const names_autoneg_link_ext_substate[] = {
@@ -648,6 +649,13 @@ static const char *const names_cable_issue_link_ext_substate[] = {
 		"Cable test failure",
 };
 
+static const char *const names_module_link_ext_substate[] = {
+	[ETHTOOL_LINK_EXT_SUBSTATE_MODULE_LOW_POWER_MODE]	=
+		"Module is in low power mode",
+	[ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY]	=
+		"CMIS module is not in ModuleReady state",
+};
+
 static const char *link_ext_substate_get(uint8_t link_ext_state_val, uint8_t link_ext_substate_val)
 {
 	switch (link_ext_state_val) {
@@ -671,6 +679,10 @@ static const char *link_ext_substate_get(uint8_t link_ext_state_val, uint8_t lin
 		return get_enum_string(names_cable_issue_link_ext_substate,
 				       ARRAY_SIZE(names_cable_issue_link_ext_substate),
 				       link_ext_substate_val);
+	case ETHTOOL_LINK_EXT_STATE_MODULE:
+		return get_enum_string(names_module_link_ext_substate,
+				       ARRAY_SIZE(names_module_link_ext_substate),
+				       link_ext_substate_val);
 	default:
 		return NULL;
 	}
-- 
2.31.1


      parent reply	other threads:[~2021-08-24 13:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 13:05 [RFC PATCH ethtool-next v3 0/6] ethtool: Add ability to control transceiver modules' power mode Ido Schimmel
2021-08-24 13:05 ` [RFC PATCH ethtool-next v3 1/6] Update UAPI header copies Ido Schimmel
2021-08-24 13:05 ` [RFC PATCH ethtool-next v3 2/6] ethtool: Add ability to control transceiver modules' power mode Ido Schimmel
2021-08-24 13:05 ` [RFC PATCH ethtool-next v3 3/6] ethtool: Print CMIS Module State Ido Schimmel
2021-08-24 13:05 ` [RFC PATCH ethtool-next v3 4/6] ethtool: Print CMIS Module-Level Controls Ido Schimmel
2021-08-24 13:05 ` [RFC PATCH ethtool-next v3 5/6] ethtool: Print SFF-8636 Power set and Power override bits Ido Schimmel
2021-08-24 13:05 ` Ido Schimmel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210824130515.1828270-7-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=vadimp@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.