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>
This commit is contained in:

committed by
David S. Miller

parent
df535f4c47
commit
15b04aceeb
@@ -379,6 +379,13 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev,
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
struct dsa_switch_tree *dst = ds->dst;
|
||||
|
||||
/* For non-legacy ports, devlink is used and it takes
|
||||
* care of the name generation. This ndo implementation
|
||||
* should be removed with legacy support.
|
||||
*/
|
||||
if (dp->ds->devlink)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ppid->id_len = sizeof(dst->index);
|
||||
memcpy(&ppid->id, &dst->index, ppid->id_len);
|
||||
|
||||
|
Reference in New Issue
Block a user