提交 d484210b 编写于 作者: J Jiri Pirko 提交者: David S. Miller

dsa: do not support ndo_get_phys_port_name for non-legacy ports

Since each non-legacy slave has its own devlink port instance
correctly set, rely on devlink core to generate correct phys port name.
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 716efee2
......@@ -736,6 +736,13 @@ static int dsa_slave_get_phys_port_name(struct net_device *dev,
{
struct dsa_port *dp = dsa_slave_to_port(dev);
/* 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;
if (snprintf(name, len, "p%d", dp->index) >= len)
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册