netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/10] Add ethtool extended link state
@ 2020-06-24  8:19 Ido Schimmel
  2020-06-24  8:19 ` [PATCH net-next 01/10] mlxsw: spectrum_dcb: Rename mlxsw_sp_port_headroom_set() Ido Schimmel
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Ido Schimmel @ 2020-06-24  8:19 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, jiri, petrm, amitc, mlxsw, mkubecek, jacob.e.keller,
	andrew, f.fainelli, linux, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

Amit says:

Currently, device drivers can only indicate to user space if the network
link is up or down, without additional information.

This patch set provides an infrastructure that allows these drivers to
expose more information to user space about the link state. The
information can save users' time when trying to understand why a link is
not operationally up, for example.

The above is achieved by extending the existing ethtool LINKSTATE_GET
command with attributes that carry the extended state.

For example, no link due to missing cable:

$ ethtool ethX
...
Link detected: no (No cable)

Beside the general extended state, drivers can pass additional
information about the link state using the sub-state field. For example:

$ ethtool ethX
...
Link detected: no (Autoneg, No partner detected)

In the future the infrastructure can be extended - for example - to
allow PHY drivers to report whether a downshift to a lower speed
occurred. Something like:

$ ethtool ethX
...
Link detected: yes (downshifted)

Patch set overview:

Patches #1-#3 move mlxsw ethtool code to a separate file
Patches #4-#5 add the ethtool infrastructure for extended link state
Patches #6-#7 add support of extended link state in the mlxsw driver
Patches #8-#10 add test cases

Changes since RFC:

* Move documentation patch before ethtool patch
* Add nla_total_size() instead of sizeof() directly
* Return an error code from linkstate_get_ext_state()
* Remove SHORTED_CABLE, add CABLE_TEST_FAILURE instead
* Check if the interface is administratively up before setting ext_state
* Document all sub-states

Amit Cohen (10):
  mlxsw: spectrum_dcb: Rename mlxsw_sp_port_headroom_set()
  mlxsw: Move ethtool_ops to spectrum_ethtool.c
  mlxsw: spectrum_ethtool: Move mlxsw_sp_port_type_speed_ops structs
  Documentation: networking: ethtool-netlink: Add link extended state
  ethtool: Add link extended state
  mlxsw: reg: Port Diagnostics Database Register
  mlxsw: spectrum_ethtool: Add link extended state
  selftests: forwarding: ethtool: Move different_speeds_get() to
    ethtool_lib
  selftests: forwarding: forwarding.config.sample: Add port with no
    cable connected
  selftests: forwarding: Add tests for ethtool extended state

 Documentation/networking/ethtool-netlink.rst  |  110 +-
 drivers/net/ethernet/mellanox/mlxsw/Makefile  |    3 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     |   51 +
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 1540 +--------------
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |   45 +
 .../ethernet/mellanox/mlxsw/spectrum_dcb.c    |    6 +-
 .../mellanox/mlxsw/spectrum_ethtool.c         | 1644 +++++++++++++++++
 include/linux/ethtool.h                       |   22 +
 include/uapi/linux/ethtool.h                  |   70 +
 include/uapi/linux/ethtool_netlink.h          |    2 +
 net/ethtool/linkstate.c                       |   56 +-
 .../selftests/net/forwarding/ethtool.sh       |   17 -
 .../net/forwarding/ethtool_extended_state.sh  |  102 +
 .../selftests/net/forwarding/ethtool_lib.sh   |   17 +
 .../net/forwarding/forwarding.config.sample   |    3 +
 15 files changed, 2124 insertions(+), 1564 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c
 create mode 100755 tools/testing/selftests/net/forwarding/ethtool_extended_state.sh

-- 
2.26.2


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-06-25 22:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24  8:19 [PATCH net-next 00/10] Add ethtool extended link state Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 01/10] mlxsw: spectrum_dcb: Rename mlxsw_sp_port_headroom_set() Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 02/10] mlxsw: Move ethtool_ops to spectrum_ethtool.c Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 03/10] mlxsw: spectrum_ethtool: Move mlxsw_sp_port_type_speed_ops structs Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 04/10] Documentation: networking: ethtool-netlink: Add link extended state Ido Schimmel
2020-06-24 19:07   ` Jacob Keller
2020-06-25 13:34     ` Amit Cohen
2020-06-25 22:57       ` Keller, Jacob E
2020-06-24 20:31   ` Michal Kubecek
2020-06-24  8:19 ` [PATCH net-next 05/10] ethtool: " Ido Schimmel
2020-06-24 21:37   ` Michal Kubecek
2020-06-24  8:19 ` [PATCH net-next 06/10] mlxsw: reg: Port Diagnostics Database Register Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 07/10] mlxsw: spectrum_ethtool: Add link extended state Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 08/10] selftests: forwarding: ethtool: Move different_speeds_get() to ethtool_lib Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 09/10] selftests: forwarding: forwarding.config.sample: Add port with no cable connected Ido Schimmel
2020-06-24  8:19 ` [PATCH net-next 10/10] selftests: forwarding: Add tests for ethtool extended state Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).