diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-03 08:24:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-04 20:42:36 -0400 |
commit | 15b04aceeb83086ea3109c331cb7d8c2767fa0c6 (patch) | |
tree | cf87b7b657cdd87f7c6ba1986aa3751560024366 /net/dsa/slave.c | |
parent | df535f4c47a60fd6bf8f1327e9f87628e581e136 (diff) |
dsa: pass switch ID through devlink_port_attrs_set()
Pass the switch ID down the to devlink through devlink_port_attrs_set()
so it can be used by devlink_compat_switch_id_get(). Leave
ndo_get_port_parent_id implementation only for legacy.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index f83525909c57..ce26dddc8270 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -379,6 +379,13 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev, | |||
379 | struct dsa_switch *ds = dp->ds; | 379 | struct dsa_switch *ds = dp->ds; |
380 | struct dsa_switch_tree *dst = ds->dst; | 380 | struct dsa_switch_tree *dst = ds->dst; |
381 | 381 | ||
382 | /* For non-legacy ports, devlink is used and it takes | ||
383 | * care of the name generation. This ndo implementation | ||
384 | * should be removed with legacy support. | ||
385 | */ | ||
386 | if (dp->ds->devlink) | ||
387 | return -EOPNOTSUPP; | ||
388 | |||
382 | ppid->id_len = sizeof(dst->index); | 389 | ppid->id_len = sizeof(dst->index); |
383 | memcpy(&ppid->id, &dst->index, ppid->id_len); | 390 | memcpy(&ppid->id, &dst->index, ppid->id_len); |
384 | 391 | ||