devlink: add info subcommand
Add support for reading the device serial number, driver name
and various versions. Example:
$ devlink dev info pci/0000:82:00.0
pci/0000:82:00.0:
driver nfp
serial_number
16240145
versions:
fixed:
board.id AMDA0081-0001
board.rev 15
board.vendor SMA
board.model hydrogen
running:
fw.mgmt 010181.010181.0101d4
fw.cpld 0x1030000
fw.app abm-d372b6
fw.undi 0.0.2
chip.init AMDA-0081-0001
20160318164536
stored:
fw.mgmt 010181.010181.0101d4
fw.app abm-d372b6
fw.undi 0.0.2
chip.init AMDA-0081-0001
20160318164536
$ devlink -jp dev info pci/0000:82:00.0
{
"info": {
"pci/0000:82:00.0": {
"driver": "nfp",
"serial_number": "
16240145",
"versions": {
"fixed": {
"board.id": "AMDA0081-0001",
"board.rev": "15",
"board.vendor": "SMA",
"board.model": "hydrogen"
},
"running": {
"fw.mgmt": "010181.010181.0101d4",
"fw.cpld": "0x1030000",
"fw.app": "abm-d372b6",
"fw.undi": "0.0.2",
"chip.init": "AMDA-0081-0001
20160318164536"
},
"stored": {
"fw.mgmt": "010181.010181.0101d4",
"fw.app": "abm-d372b6",
"fw.undi": "0.0.2",
"chip.init": "AMDA-0081-0001
20160318164536"
}
}
}
}
}
v5:
- remove spurious new line.
v4:
- more commit message improvements.
v3:
- show up-to-date output in the commit message.
v2 (Jiri):
- remove filtering;
- add example in the commit message.
RFCv2:
- make info subcommand of dev.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>