ethtool: Add link extended state
authorAmit Cohen <amitc@mellanox.com>
Mon, 29 Jun 2020 20:46:16 +0000 (23:46 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jun 2020 00:45:02 +0000 (17:45 -0700)
commitecc31c60240b9808a274befc5db6b8a249a6ade1
tree7b75ef59faf84a3d063cb977fe9f3f6689980bae
parente120c801b8c93bd9bd5d2a61f43f1a45a9ce4f23
ethtool: Add link extended state

Currently, drivers can only tell whether the link is up/down using
LINKSTATE_GET, but no additional information is given.

Add attributes to LINKSTATE_GET command in order to allow drivers
to expose the user more information in addition to link state to ease
the debug process, for example, reason for link down state.

Extended state consists of two attributes - link_ext_state and
link_ext_substate. The idea is to avoid 'vendor specific' states in order
to prevent drivers to use specific link_ext_state that can be in the future
common link_ext_state.

The substates allows drivers to add more information to the common
link_ext_state. For example, vendor can expose 'Autoneg' as link_ext_state
and add 'No partner detected during force mode' as link_ext_substate.

If a driver cannot pinpoint the extended state with the substate
accuracy, it is free to expose only the extended state and omit the
substate attribute.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/ethtool.h
include/uapi/linux/ethtool.h
include/uapi/linux/ethtool_netlink.h
net/ethtool/linkstate.c