netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 net-next 00/11] Devlink health reporting and recovery system
@ 2019-02-07  9:36 Eran Ben Elisha
  2019-02-07  9:36 ` [PATCH v4 net-next 01/11] devlink: Add devlink formatted message (fmsg) API Eran Ben Elisha
                   ` (13 more replies)
  0 siblings, 14 replies; 28+ messages in thread
From: Eran Ben Elisha @ 2019-02-07  9:36 UTC (permalink / raw)
  To: netdev, David S. Miller
  Cc: Saeed Mahameed, Jiri Pirko, Moshe Shemesh, Aya Levin, Eran Ben Elisha

The health mechanism is targeted for Real Time Alerting, in order to know when
something bad had happened to a PCI device
- Provide alert debug information
- Self healing
- If problem needs vendor support, provide a way to gather all needed debugging
  information.

The main idea is to unify and centralize driver health reports in the
generic devlink instance and allow the user to set different
attributes of the health reporting and recovery procedures.

The devlink health reporter:
Device driver creates a "health reporter" per each error/health type.
Error/Health type can be a known/generic (eg pci error, fw error, rx/tx error)
or unknown (driver specific).
For each registered health reporter a driver can issue error/health reports
asynchronously. All health reports handling is done by devlink.
Device driver can provide specific callbacks for each "health reporter", e.g.
 - Recovery procedures
 - Diagnostics and object dump procedures
 - OOB initial attributes
Different parts of the driver can register different types of health reporters
with different handlers.

Once an error is reported, devlink health will do the following actions:
  * A log is being send to the kernel trace events buffer
  * Health status and statistics are being updated for the reporter instance
  * Object dump is being taken and saved at the reporter instance (as long as
    there is no other dump which is already stored)
  * Auto recovery attempt is being done. Depends on:
    - Auto-recovery configuration
    - Grace period vs. time passed since last recover

The user interface:
User can access/change each reporter attributes and driver specific callbacks
via devlink, e.g per error type (per health reporter)
 - Configure reporter's generic attributes (like: Disable/enable auto recovery)
 - Invoke recovery procedure
 - Run diagnostics
 - Object dump

The devlink health interface (via netlink):
DEVLINK_CMD_HEALTH_REPORTER_GET
  Retrieves status and configuration info per DEV and reporter.
DEVLINK_CMD_HEALTH_REPORTER_SET
  Allows reporter-related configuration setting.
DEVLINK_CMD_HEALTH_REPORTER_RECOVER
  Triggers a reporter's recovery procedure.
DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE
  Retrieves diagnostics data from a reporter on a device.
DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET
  Retrieves the last stored dump. Devlink health
  saves a single dump. If an dump is not already stored by the devlink
  for this reporter, devlink generates a new dump.
  dump output is defined by the reporter.
DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR
  Clears the last saved dump file for the specified reporter.

                                               netlink
                                      +--------------------------+
                                      |                          |
                                      |            +             |
                                      |            |             |
                                      +--------------------------+
                                                   |request for ops
                                                   |(diagnose,
 mlx5_core                             devlink     |recover,
                                                   |dump)
+--------+                            +--------------------------+
|        |                            |    reporter|             |
|        |                            |  +---------v----------+  |
|        |   ops execution            |  |                    |  |
|     <----------------------------------+                    |  |
|        |                            |  |                    |  |
|        |                            |  + ^------------------+  |
|        |                            |    | request for ops     |
|        |                            |    | (recover, dump)     |
|        |                            |    |                     |
|        |                            |  +-+------------------+  |
|        |     health report          |  | health handler     |  |
|        +------------------------------->                    |  |
|        |                            |  +--------------------+  |
|        |     health reporter create |                          |
|        +---------------------------->                          |
+--------+                            +--------------------------+

In this patchset, mlx5e TX reporter is implemented.

Cmdline format:
    devlink health show [DEV reporter REPORTE_NAME]
    devlink health recover DEV reporter REPORTER_NAME
    devlink health diagnose DEV reporter REPORTER_NAME
    devlink health dump show DEV reporter REPORTER_NAME
    devlink health dump clear DEV reporter REPORTER_NAME
    devlink health set DEV reporter REPORTER_NAME NAME VALUE

Cmdline examples:
$devlink health show
pci/0000:00:09.0:
  name tx
    state healthy #err 1 #recover 0 last_dump_ts N/A
    parameters:
      grace_period 500 auto_recover false

$devlink health diagnose pci/0000:00:09.0 reporter tx -j -p
{
    "SQs": [ {
            "sqn": 138,
            "HW state": 1,
            "stopped": false
        },{
            "sqn": 142,
            "HW state": 1,
            "stopped": false
        } ]
}

$devlink health diagnose pci/0000:00:09.0 reporter tx
SQs: 
  sqn: 138 HW state: 1 stopped: false 
  sqn: 142 HW state: 1 stopped: false 

$devlink health recover pci/0000:00:09 reporter tx

$devlink health set pci/0000:00:09.0 reporter tx grace_period 3500

$devlink health set pci/0000:00:09.0 reporter tx auto_recover false

Changelog:
v4:
- Rebase on latest net-next
- Remove trace_devlink_health signature exposure in case CONFIG_NET_DEVLINK is
  not defined as it shall only be used from devlink.

v3:
- Redesign of devlink <-> driver fmsg API
- Various bug fixes

v2:
- Remove FW* reporters to decrease the amount of patches in the patchset

Aya Levin (1):
  devlink: Add Documentation/networking/devlink-health.txt

Eran Ben Elisha (10):
  devlink: Add devlink formatted message (fmsg) API
  devlink: Add health reporter create/destroy functionality
  devlink: Add health report functionality
  devlink: Add health get command
  devlink: Add health set command
  devlink: Add health recover command
  devlink: Add health diagnose command
  devlink: Add health dump {get,clear} commands
  net/mlx5e: Add tx reporter support
  net/mlx5e: Add tx timeout support for mlx5e tx reporter

 Documentation/networking/devlink-health.txt   |   86 ++
 .../net/ethernet/mellanox/mlx5/core/Makefile  |    2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en.h  |   18 +-
 .../ethernet/mellanox/mlx5/core/en/reporter.h |   15 +
 .../mellanox/mlx5/core/en/reporter_tx.c       |  297 +++++
 .../net/ethernet/mellanox/mlx5/core/en_main.c |  189 +---
 .../net/ethernet/mellanox/mlx5/core/en_tx.c   |    5 +-
 include/net/devlink.h                         |  211 ++++
 include/trace/events/devlink.h                |   65 ++
 include/uapi/linux/devlink.h                  |   24 +
 net/core/devlink.c                            | 1008 +++++++++++++++++
 11 files changed, 1755 insertions(+), 165 deletions(-)
 create mode 100644 Documentation/networking/devlink-health.txt
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/reporter.h
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

-- 
2.17.1


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

end of thread, other threads:[~2019-02-11 10:50 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07  9:36 [PATCH v4 net-next 00/11] Devlink health reporting and recovery system Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 01/11] devlink: Add devlink formatted message (fmsg) API Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 02/11] devlink: Add health reporter create/destroy functionality Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 03/11] devlink: Add health report functionality Eran Ben Elisha
2019-02-07  9:38   ` Jiri Pirko
2019-02-07  9:36 ` [PATCH v4 net-next 04/11] devlink: Add health get command Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 05/11] devlink: Add health set command Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 06/11] devlink: Add health recover command Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 07/11] devlink: Add health diagnose command Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 08/11] devlink: Add health dump {get,clear} commands Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 09/11] net/mlx5e: Add tx reporter support Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 10/11] net/mlx5e: Add tx timeout support for mlx5e tx reporter Eran Ben Elisha
2019-02-07  9:36 ` [PATCH v4 net-next 11/11] devlink: Add Documentation/networking/devlink-health.txt Eran Ben Elisha
2019-02-07 18:37 ` [PATCH v4 net-next 00/11] Devlink health reporting and recovery system David Miller
2019-02-10 18:28 ` [iproute2-next, 0/4] Add support for devlink health Aya Levin
2019-02-10 18:28   ` [PATCH for-next 1/4] devlink: refactor validation of finding required arguments Aya Levin
2019-02-11  2:46     ` David Ahern
2019-02-11 10:29     ` Jiri Pirko
2019-02-10 18:28   ` [PATCH for-next 2/4] devlink: fix print of uint64_t Aya Levin
2019-02-10 20:34     ` Stephen Hemminger
2019-02-11  2:44       ` David Ahern
2019-02-11 10:32     ` Jiri Pirko
2019-02-10 18:28   ` [PATCH for-next 3/4] devlink: fix boolean JSON print Aya Levin
2019-02-10 20:34     ` Stephen Hemminger
2019-02-10 18:28   ` [PATCH for-next 4/4] devlink: add health command support Aya Levin
2019-02-10 20:42     ` Stephen Hemminger
2019-02-11 10:41     ` Jiri Pirko
2019-02-10 18:35 ` [iproute2-next, 0/4] Add support for devlink health Aya Levin

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