netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@mellanox.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Petr Machata <petrm@mellanox.com>, Jiri Pirko <jiri@mellanox.com>,
	Ido Schimmel <idosch@mellanox.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Tariq Toukan <tariqt@mellanox.com>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [RFC PATCH net-next 0/3] RTNL: Add link-down reason reporting
Date: Fri, 15 Mar 2019 17:56:05 +0000	[thread overview]
Message-ID: <cover.1552672441.git.petrm@mellanox.com> (raw)

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


             reply	other threads:[~2019-03-15 17:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15 17:56 Petr Machata [this message]
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

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=cover.1552672441.git.petrm@mellanox.com \
    --to=petrm@mellanox.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=tariqt@mellanox.com \
    /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 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).