]> git.ipfire.org Git - thirdparty/iproute2.git/commit
devlink: add support for linecard show and type set
authorJiri Pirko <jiri@nvidia.com>
Sat, 16 Jul 2022 11:24:51 +0000 (13:24 +0200)
committerDavid Ahern <dsahern@kernel.org>
Thu, 21 Jul 2022 15:19:40 +0000 (09:19 -0600)
commit4cb0bec3744ac4f8d21de0e769f170e4059c6b9e
tree642ff9f38a607c195f980b48849549e4ad516cc8
parent63394af8b1ccd57a38fa22dffee97b2c560c335f
devlink: add support for linecard show and type set

Introduce a new object "lc" to add devlink support for line cards with
two commands:
show - to get the info about the line card state, list of supported
       types as reported by kernel/driver.
set - to set/clear the line card type.

Example:
$ devlink lc
pci/0000:01:00.0:
  lc 1 state unprovisioned
    supported_types:
       16x100G
  lc 2 state unprovisioned
    supported_types:
       16x100G
  lc 3 state unprovisioned
    supported_types:
       16x100G
  lc 4 state unprovisioned
    supported_types:
       16x100G
  lc 5 state unprovisioned
    supported_types:
       16x100G
  lc 6 state unprovisioned
    supported_types:
       16x100G
  lc 7 state unprovisioned
    supported_types:
       16x100G
  lc 8 state unprovisioned
    supported_types:
       16x100G

To provision the slot #8:

$ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G
$ devlink lc show pci/0000:01:00.0 lc 8
pci/0000:01:00.0:
  lc 8 state active type 16x100G
    supported_types:
       16x100G

To uprovision the slot #8:

$ devlink lc set pci/0000:01:00.0 lc 8 notype

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
bash-completion/devlink
devlink/devlink.c
man/man8/devlink-lc.8 [new file with mode: 0644]