All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Cohen <amitc@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, corbet@lwn.net,
	jiri@mellanox.com, idosch@mellanox.com, shuah@kernel.org,
	mkubecek@suse.cz, gustavo@embeddedor.com, amitc@mellanox.com,
	cforno12@linux.vnet.ibm.com, andrew@lunn.ch,
	f.fainelli@gmail.com, linux@rempel-privat.de,
	alexandru.ardelean@analog.com, ayal@mellanox.com,
	petrm@mellanox.com, mlxsw@mellanox.com, liuhangbin@gmail.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: [RFC PATCH net-next 05/10] Documentation: networking: ethtool-netlink: Add link extended state
Date: Sun,  7 Jun 2020 17:59:40 +0300	[thread overview]
Message-ID: <20200607145945.30559-6-amitc@mellanox.com> (raw)
In-Reply-To: <20200607145945.30559-1-amitc@mellanox.com>

Add link extended state attributes.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
---
 Documentation/networking/ethtool-netlink.rst | 56 ++++++++++++++++++--
 1 file changed, 52 insertions(+), 4 deletions(-)

diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst
index 7e651ea33eab..4e4570ebbc4d 100644
--- a/Documentation/networking/ethtool-netlink.rst
+++ b/Documentation/networking/ethtool-netlink.rst
@@ -441,10 +441,11 @@ supports.
 LINKSTATE_GET
 =============
 
-Requests link state information. At the moment, only link up/down flag (as
-provided by ``ETHTOOL_GLINK`` ioctl command) is provided but some future
-extensions are planned (e.g. link down reason). This request does not have any
-attributes.
+Requests link state information. Link up/down flag (as provided by
+``ETHTOOL_GLINK`` ioctl command) is provided. Optionally, extended state might
+be provided as well. In general, extended state describes reasons for why a port
+is down, or why it operates in some non-obvious mode. This request does not have
+any attributes.
 
 Request contents:
 
@@ -459,16 +460,63 @@ Kernel response contents:
   ``ETHTOOL_A_LINKSTATE_LINK``          bool    link state (up/down)
   ``ETHTOOL_A_LINKSTATE_SQI``           u32     Current Signal Quality Index
   ``ETHTOOL_A_LINKSTATE_SQI_MAX``       u32     Max support SQI value
+  ``ETHTOOL_A_LINKSTATE_EXT_STATE``     u8      link extended state
+  ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE``  u8      link extended substate
   ====================================  ======  ============================
 
 For most NIC drivers, the value of ``ETHTOOL_A_LINKSTATE_LINK`` returns
 carrier flag provided by ``netif_carrier_ok()`` but there are drivers which
 define their own handler.
 
+``ETHTOOL_A_LINKSTATE_EXT_STATE`` and ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE`` are
+optional values. ethtool core can provide either both
+``ETHTOOL_A_LINKSTATE_EXT_STATE`` and ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE``,
+or only ``ETHTOOL_A_LINKSTATE_EXT_STATE``, or none of them.
+
 ``LINKSTATE_GET`` allows dump requests (kernel returns reply messages for all
 devices supporting the request).
 
 
+Link extended states:
+
+  ============================    =============================================
+  ``Autoneg failure``             Failure during auto negotiation mechanism
+
+  ``Link training failure``       Failure during link training
+
+  ``Link logical mismatch``       Logical mismatch in physical coding sublayer
+                                  or forward error correction sublayer
+
+  ``Bad signal integrity``        Signal integrity issues
+
+  ``No cable``                    No cable connected
+
+  ``Cable issue``                 Failure is related to cable,
+                                  e.g., unsupported cable
+
+  ``EEPROM issue``                Failure is related to EEPROM, e.g., failure
+                                  during reading or parsing the data
+
+  ``Calibration failure``         Failure during calibration algorithm
+
+  ``Power budget exceeded``       The hardware is not able to provide the
+                                  power required from cable or module
+
+  ``Overheat``                    The module is overheated
+  ============================    =============================================
+
+Many of the substates are obvious, or terms that someone working in the
+particular area will be familiar with. The following table summarizes some
+that are not:
+
+Link extended substates:
+
+  ============================    =============================================
+  ``Unsupported rate``            The system attempted to operate the cable at
+                                  a rate that is not formally supported, which
+                                  led to signal integrity issues
+  ============================    =============================================
+
 DEBUG_GET
 =========
 
-- 
2.20.1


  parent reply	other threads:[~2020-06-07 15:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-07 14:59 [RFC PATCH net-next 00/10] Add extended state Amit Cohen
2020-06-07 14:59 ` [RFC PATCH net-next 01/10] mlxsw: spectrum_dcb: Rename mlxsw_sp_port_headroom_set() Amit Cohen
2020-06-07 19:13   ` Florian Fainelli
2020-06-07 14:59 ` [RFC PATCH net-next 02/10] mlxsw: Move ethtool_ops to spectrum_ethtool.c Amit Cohen
2020-06-07 19:14   ` Florian Fainelli
2020-06-07 14:59 ` [RFC PATCH net-next 03/10] mlxsw: spectrum_ethtool: Move mlxsw_sp_port_type_speed_ops structs Amit Cohen
2020-06-07 19:14   ` Florian Fainelli
2020-06-07 14:59 ` [RFC PATCH net-next 04/10] ethtool: Add link extended state Amit Cohen
2020-06-07 15:30   ` Andrew Lunn
2020-06-08 10:03     ` Amit Cohen
2020-06-07 16:02   ` Andrew Lunn
2020-06-07 16:12   ` Andrew Lunn
2020-06-07 16:27   ` Andrew Lunn
2020-06-07 18:17   ` Florian Fainelli
2020-06-09 10:24     ` Amit Cohen
2020-06-07 14:59 ` Amit Cohen [this message]
2020-06-07 16:47   ` [RFC PATCH net-next 05/10] Documentation: networking: ethtool-netlink: " Andrew Lunn
2020-06-08 10:02     ` Amit Cohen
2020-06-08 13:47       ` Andrew Lunn
2020-06-07 19:11   ` Florian Fainelli
2020-06-08 15:59     ` Amit Cohen
2020-06-07 14:59 ` [RFC PATCH net-next 06/10] mlxsw: reg: Port Diagnostics Database Register Amit Cohen
2020-06-07 14:59 ` [RFC PATCH net-next 07/10] mlxsw: spectrum_ethtool: Add link extended state Amit Cohen
2020-06-07 18:25   ` Florian Fainelli
2020-06-09  6:58     ` Amit Cohen
2020-06-07 14:59 ` [RFC PATCH net-next 08/10] selftests: forwarding: ethtool: Move different_speeds_get() to ethtool_lib Amit Cohen
2020-06-07 18:18   ` Florian Fainelli
2020-06-07 14:59 ` [RFC PATCH net-next 09/10] selftests: forwarding: forwarding.config.sample: Add port with no cable connected Amit Cohen
2020-06-07 18:18   ` Florian Fainelli
2020-06-07 14:59 ` [RFC PATCH net-next 10/10] selftests: forwarding: Add tests for ethtool extended state Amit Cohen
2020-06-07 18:22   ` Florian Fainelli

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=20200607145945.30559-6-amitc@mellanox.com \
    --to=amitc@mellanox.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=andrew@lunn.ch \
    --cc=ayal@mellanox.com \
    --cc=cforno12@linux.vnet.ibm.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=gustavo@embeddedor.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=liuhangbin@gmail.com \
    --cc=mkubecek@suse.cz \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    --cc=shuah@kernel.org \
    /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.