netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/3] RTNL: Add link-down reason reporting
@ 2019-03-15 17:56 Petr Machata
  2019-03-15 17:56 ` [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to RTNL messages Petr Machata
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Petr Machata @ 2019-03-15 17:56 UTC (permalink / raw)
  To: netdev@vger.kernel.org
  Cc: Petr Machata, Jiri Pirko, Ido Schimmel, davem@davemloft.net,
	Tariq Toukan, jakub.kicinski@netronome.com, andrew@lunn.ch,
	stephen@networkplumber.org

In general, after a port is put administratively up, certain handshake
protocols have to finish successfully, otherwise the port is left in a
NO-CARRIER or DORMANT state. When that happens, it would be useful to
communicate the reasons to the administrator, so that the problem that
prevents the link from being established can be corrected.

This patch set adds two new RTNL attributes, IFLA_LINK_DOWN_REASON_MAJOR
and _MINOR, to carry the information. Major reason codes are drawn from
a well-known enum that is part of the kernel interface. They serve as
broad categories intended to convey a general idea of where the problem
is. Minor codes are arbitrary numbers specific for the driver in
question that add detail to the major reasons.

The hope is that an average user will not need to dive into the minor
reason codes. It is for example largely immaterial what it is that makes
any given cable unsupported, because the administrator will just take
another cable anyway. The minor code may still be provided though, for
the cases where further information is actually necessary.

The party with visibility into details of this process is the driver.
Therefore add two new RTNL hooks, link_down_reason_get_size and
fill_link_down_reason, to provide the necessary information.

Link-down reason is not included if the port is up or administratively
down, because those two state are easy to discover through existing
interfaces. The new interface is intended for debugging of the
transition between these two states.

This is all in patch #1. Patches #2 and #3 add implementation of the new
interfaces for mlxsw.

A preliminary iproute patch that implements display of the new
attributes is available here:

    https://github.com/pmachata/iproute2/tree/link_down_reason

And this is an example output:

    # ip -d link show dev sw1p1
    393: sw1p1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
        link/ether 7c:fe:90:f5:a3:7d brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535
        mlxsw addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 \
        portname p1 switchid 7cfe90f5a340 down_reason NO_CABLE 1024

Petr Machata (3):
  net: rtnetlink: Add link-down reason to RTNL messages
  mlxsw: reg: Add Port Diagnostics Database Register
  mlxsw: spectrum: Add rtnl_link_ops

 drivers/net/ethernet/mellanox/mlxsw/reg.h      |  54 +++++++++++++
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 108 +++++++++++++++++++++++++
 include/net/rtnetlink.h                        |   3 +
 include/uapi/linux/if_link.h                   |  16 ++++
 net/core/rtnetlink.c                           |  22 +++++
 5 files changed, 203 insertions(+)

-- 
2.4.11


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

end of thread, other threads:[~2019-04-23 13:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 17:56 [RFC PATCH net-next 0/3] RTNL: Add link-down reason reporting Petr Machata
2019-03-15 17:56 ` [RFC PATCH net-next 1/3] net: rtnetlink: Add link-down reason to RTNL messages Petr Machata
2019-03-16  2:26   ` Jakub Kicinski
2019-03-17  0:24     ` Michal Kubecek
2019-03-18 12:34     ` Petr Machata
2019-03-18 12:43       ` Michal Kubecek
2019-03-18 13:12       ` Andrew Lunn
2019-03-16  2:26   ` Andrew Lunn
2019-03-18 13:15     ` Petr Machata
2019-03-18 13:33       ` Andrew Lunn
2019-03-18 13:47         ` Petr Machata
2019-03-18 14:02       ` Andrew Lunn
2019-03-18 15:52         ` Stephen Hemminger
2019-03-19 10:18           ` Petr Machata
2019-03-19 11:56             ` Michal Kubecek
2019-03-19 15:42             ` Stephen Hemminger
2019-03-19 15:57               ` Petr Machata
2019-03-17 22:38   ` Roopa Prabhu
2019-03-18  0:03     ` Andrew Lunn
2019-03-28 17:59       ` Petr Machata
2019-03-28 19:51         ` Andrew Lunn
2019-04-23 13:41           ` Jiri Pirko
2019-03-18 12:15     ` Petr Machata
2019-03-15 17:56 ` [RFC PATCH net-next 2/3] mlxsw: reg: Add Port Diagnostics Database Register Petr Machata
2019-03-15 17:56 ` [RFC PATCH net-next 3/3] mlxsw: spectrum: Add rtnl_link_ops Petr Machata
2019-03-16  2:06 ` [RFC PATCH net-next 0/3] RTNL: Add link-down reason reporting Andrew Lunn
2019-03-18 12:11   ` Petr Machata

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).