devlink: Introduce PCI VF port flavour and port attribute
authorParav Pandit <parav@mellanox.com>
Tue, 9 Jul 2019 04:17:38 +0000 (23:17 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jul 2019 19:02:13 +0000 (12:02 -0700)
commite41b6bf3cdd474dc9c587cb55906b0256835bf6d
treea4d3ae70a18d475a29903ab48252d7016621c192
parent98fd2d6563fe4a799934a2a74d632601cd089beb
devlink: Introduce PCI VF port flavour and port attribute

In an eswitch, PCI VF may have port which is normally represented using
a representor netdevice.
To have better visibility of eswitch port, its association with VF,
and its representor netdevice, introduce a PCI VF port flavour.

When devlink port flavour is PCI VF, fill up PCI VF attributes of
the port.

Extend port name creation using PCI PF and VF number scheme on best
effort basis, so that vendor drivers can skip defining their own scheme.

$ devlink port show
pci/0000:05:00.0/0: type eth netdev eth0 flavour pcipf pfnum 0
pci/0000:05:00.0/1: type eth netdev eth1 flavour pcivf pfnum 0 vfnum 0
pci/0000:05:00.0/2: type eth netdev eth2 flavour pcivf pfnum 0 vfnum 1

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/devlink.h
include/uapi/linux/devlink.h
net/core/devlink.c