]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: Add devlink health diagnose command
authorAya Levin <ayal@mellanox.com>
Thu, 28 Feb 2019 12:13:00 +0000 (14:13 +0200)
committerDavid Ahern <dsahern@gmail.com>
Thu, 28 Feb 2019 15:55:57 +0000 (07:55 -0800)
commit7b8baf834d5e95303ed1063a7ef52e81f65a7645
treef97572ef04feeb36e0f98f8cb3df0470557a4433
parent9083a1344d8cbdd4282c22eec6a1f629059221f1
devlink: Add devlink health diagnose command

Add devlink health diagnose command: enabling retrieval of diagnostics data
by the user on a reporter on a device. The command's output is a
free text defined by the reporter.

This patch also introduces an infra structure for flexible format
output. This allow the command to display different data fields
according to the reporter.
Example:
$ devlink health diagnose pci/0000:00:0a.0 reporter tx
SQs:
  sqn: 4403 HW state: 1 stopped: false
  sqn: 4408 HW state: 1 stopped: false
  sqn: 4413 HW state: 1 stopped: false
  sqn: 4418 HW state: 1 stopped: false
  sqn: 4423 HW state: 1 stopped: false

$ devlink health diagnose pci/0000:00:0a.0 reporter tx -jp
{
 "SQs":[
      {
       "sqn":4403,
       "HW state":1,
       "stopped":false
     },
      {
       "sqn":4408,
       "HW state":1,
       "stopped":false
     },
      {
       "sqn":4413,
       "HW state":1,
       "stopped":false
     },
      {
       "sqn":4418,
       "HW state":1,
       "stopped":false
     },
      {
       "sqn":4423,
       "HW state":1,
       "stopped":false
     }
   ]
}

Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
devlink/devlink.c