summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-03-04 00:40:40 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-04 00:40:40 +0100
commit0a303214f8cb8e2043a03f7b727dba620e07e68d (patch)
treee97dc67c70453024cc25356c8e413af85d3b3b3e /net
parentdoc: sfp-phylink: correct code indentation (diff)
parentnet/mlx5e: Use devlink virtual flavour for VF devlink port (diff)
downloadlinux-0a303214f8cb8e2043a03f7b727dba620e07e68d.tar.xz
linux-0a303214f8cb8e2043a03f7b727dba620e07e68d.zip
Merge branch 'devlink-virtual-port'
Parav Pandit says: ==================== devlink: Introduce devlink port flavour virtual Currently PCI PF and VF devlink devices register their ports as physical port in non-representors mode. Introduce a new port flavour as virtual so that virtual devices can register 'virtual' flavour to make it more clear to users. An example of one PCI PF and 2 PCI virtual functions, each having one devlink port. $ devlink port show pci/0000:06:00.0/1: type eth netdev ens2f0 flavour physical port 0 pci/0000:06:00.2/1: type eth netdev ens2f2 flavour virtual port 0 pci/0000:06:00.3/1: type eth netdev ens2f3 flavour virtual port 0 Patch summary: Patch-1 Introduces new devlink port flavour 'virtual'. Patch-2 Uses new flavour to register PCI VF virtual ports. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/devlink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 295d761cbfb1..e8ccea9035c8 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -545,6 +545,7 @@ static int devlink_nl_port_attrs_put(struct sk_buff *msg,
case DEVLINK_PORT_FLAVOUR_PHYSICAL:
case DEVLINK_PORT_FLAVOUR_CPU:
case DEVLINK_PORT_FLAVOUR_DSA:
+ case DEVLINK_PORT_FLAVOUR_VIRTUAL:
if (nla_put_u32(msg, DEVLINK_ATTR_PORT_NUMBER,
attrs->phys.port_number))
return -EMSGSIZE;
@@ -6806,6 +6807,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
switch (attrs->flavour) {
case DEVLINK_PORT_FLAVOUR_PHYSICAL:
+ case DEVLINK_PORT_FLAVOUR_VIRTUAL:
if (!attrs->split)
n = snprintf(name, len, "p%u", attrs->phys.port_number);
else