mbox series

[ethtool,v2,0/3] Add extended link state

Message ID 20200702131111.23105-1-amitc@mellanox.com
Headers show
Series Add extended link state | expand

Message

Amit Cohen July 2, 2020, 1:11 p.m. UTC
Currently, device drivers can only indicate to user space if the network
link is up or down, without additional information.

This patch set expand link-state to allow 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)

Changes since v1:

* Do not mix uapi header updates with other changes
* Update header files in uapi/ to a net-next snapshot
* Move helper functions from common.c to netlink/settings.c
* Use string tables for enum strings
* Report the numeric value in case of unknown value
* Use banner once, change print concept

Amit Cohen (3):
  uapi: linux: update kernel UAPI header files
  netlink: desc-ethtool.c: Add descriptions of extended state attributes
  netlink: settings: expand linkstate_reply_cb() to support link
    extended state

 netlink/desc-ethtool.c       |   2 +
 netlink/settings.c           | 147 ++++++++++++++++++++++++++++++++++-
 uapi/linux/ethtool.h         |  70 +++++++++++++++++
 uapi/linux/ethtool_netlink.h |   2 +
 4 files changed, 220 insertions(+), 1 deletion(-)

Comments

Michal Kubecek July 5, 2020, 11:45 p.m. UTC | #1
On Thu, Jul 02, 2020 at 04:11:08PM +0300, Amit Cohen wrote:
> Currently, device drivers can only indicate to user space if the network
> link is up or down, without additional information.
> 
> This patch set expand link-state to allow 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)
> 
> Changes since v1:
> 
> * Do not mix uapi header updates with other changes
> * Update header files in uapi/ to a net-next snapshot
> * Move helper functions from common.c to netlink/settings.c
> * Use string tables for enum strings
> * Report the numeric value in case of unknown value
> * Use banner once, change print concept

Applied to branch next (to be merged after 5.8 release), thank you.

Michal

> Amit Cohen (3):
>   uapi: linux: update kernel UAPI header files
>   netlink: desc-ethtool.c: Add descriptions of extended state attributes
>   netlink: settings: expand linkstate_reply_cb() to support link
>     extended state
> 
>  netlink/desc-ethtool.c       |   2 +
>  netlink/settings.c           | 147 ++++++++++++++++++++++++++++++++++-
>  uapi/linux/ethtool.h         |  70 +++++++++++++++++
>  uapi/linux/ethtool_netlink.h |   2 +
>  4 files changed, 220 insertions(+), 1 deletion(-)
> 
> -- 
> 2.20.1
>