diff options
author | Parav Pandit <parav@mellanox.com> | 2019-07-09 07:17:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-09 22:02:13 +0300 |
commit | 98fd2d6563fe4a799934a2a74d632601cd089beb (patch) | |
tree | b046535d64eab29dcf0fba96d9b81eed33b5fb92 /include/net/devlink.h | |
parent | a2c6b87dd08cdfc2d065d4ae369e4e747b521a7f (diff) | |
download | linux-98fd2d6563fe4a799934a2a74d632601cd089beb.tar.xz |
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>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r-- | include/net/devlink.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index 4538c80fe293..97cef896e4d0 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -46,6 +46,10 @@ struct devlink_port_phys_attrs { u32 split_subport_number; }; +struct devlink_port_pci_pf_attrs { + u16 pf; /* Associated PCI PF for this port. */ +}; + struct devlink_port_attrs { u8 set:1, split:1, @@ -54,6 +58,7 @@ struct devlink_port_attrs { struct netdev_phys_item_id switch_id; union { struct devlink_port_phys_attrs phys; + struct devlink_port_pci_pf_attrs pci_pf; }; }; @@ -599,6 +604,9 @@ void devlink_port_attrs_set(struct devlink_port *devlink_port, u32 split_subport_number, const unsigned char *switch_id, unsigned char switch_id_len); +void devlink_port_attrs_pci_pf_set(struct devlink_port *devlink_port, + const unsigned char *switch_id, + unsigned char switch_id_len, u16 pf); int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, u32 size, u16 ingress_pools_count, u16 egress_pools_count, u16 ingress_tc_count, |