]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: Supporting add and delete of devlink port
authorParav Pandit <parav@nvidia.com>
Mon, 1 Feb 2021 21:35:49 +0000 (23:35 +0200)
committerDavid Ahern <dsahern@kernel.org>
Tue, 2 Feb 2021 02:06:36 +0000 (02:06 +0000)
commit331bf89ad08421750ad80688192b9831b02c6361
treee592da5fcb2eb61e22a5626962ba623dc5c208c1
parent836a1365b742a9a46f662bd942807de33e68e880
devlink: Supporting add and delete of devlink port

Enable user to add and delete the devlink port.

Examples for adding and deleting one SF port:

Examples of add, show and delete commands:
$ devlink dev eswitch set pci/0000:06:00.0 mode switchdev

$ devlink port show
pci/0000:06:00.0/65535: type eth netdev ens2f0np0 flavour physical port 0 splittable false

Add devlink port of flavour 'pcipf' for PF number 0 SF number 88:

$ devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88
pci/0000:06:00.0/32768: type eth netdev eth6 flavour pcisf controller 0 pfnum 0 sfnum 88 splittable false
  function:
    hw_addr 00:00:00:00:00:00 state inactive opstate detached

Delete newly added devlink port
$ devlink port del pci/0000:06:00.0/32768

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
devlink/devlink.c
man/man8/devlink-port.8