summaryrefslogtreecommitdiffstats
path: root/net/core/devlink.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-06-07 13:01:52 -0700
committerDavid S. Miller <davem@davemloft.net>2021-06-07 13:01:52 -0700
commit126285651b7f95282a0afe3a1b0221419b31d989 (patch)
treee5d547255814a5ed55b6b74be3155464598b39f2 /net/core/devlink.c
parent9977d6f56bacc9784654be4d0f4d27b368f57f5b (diff)
parent3822d0670c9d4342794d73e0d0e615322b40438e (diff)
downloadlinux-126285651b7f95282a0afe3a1b0221419b31d989.tar.bz2
Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net
Bug fixes overlapping feature additions and refactoring, mostly. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/devlink.c')
-rw-r--r--net/core/devlink.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 464f56408247..5260bdfb2403 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -799,7 +799,6 @@ 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;
@@ -9294,6 +9293,13 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
if (n < len && attrs->split)
n += snprintf(name + n, len - n, "s%u",
attrs->phys.split_subport_number);
+ if (!attrs->split)
+ n = snprintf(name, len, "p%u", attrs->phys.port_number);
+ else
+ n = snprintf(name, len, "p%us%u",
+ attrs->phys.port_number,
+ attrs->phys.split_subport_number);
+
break;
case DEVLINK_PORT_FLAVOUR_CPU:
case DEVLINK_PORT_FLAVOUR_DSA: