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

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

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

Extend port name creation using PCI PF number 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

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