net: dsa: suppress device links to LAG DSA masters

These don't work (print a harmless error about the operation failing)
and make little sense to have anyway, because when a LAG DSA master goes
away, we will introduce logic to move our CPU port back to the first
physical DSA master. So suppress these device links in preparation for
adding support for LAG DSA masters.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Vladimir Oltean 2022-09-11 04:07:02 +03:00 committed by Paolo Abeni
parent cfeb84a52f
commit 13eccc1bbb

View File

@ -364,12 +364,14 @@ int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp)
mtu = ETH_DATA_LEN + dsa_tag_protocol_overhead(tag_ops); mtu = ETH_DATA_LEN + dsa_tag_protocol_overhead(tag_ops);
/* The DSA master must use SET_NETDEV_DEV for this to work. */ /* The DSA master must use SET_NETDEV_DEV for this to work. */
consumer_link = device_link_add(ds->dev, dev->dev.parent, if (!netif_is_lag_master(dev)) {
DL_FLAG_AUTOREMOVE_CONSUMER); consumer_link = device_link_add(ds->dev, dev->dev.parent,
if (!consumer_link) DL_FLAG_AUTOREMOVE_CONSUMER);
netdev_err(dev, if (!consumer_link)
"Failed to create a device link to DSA switch %s\n", netdev_err(dev,
dev_name(ds->dev)); "Failed to create a device link to DSA switch %s\n",
dev_name(ds->dev));
}
/* The switch driver may not implement ->port_change_mtu(), case in /* The switch driver may not implement ->port_change_mtu(), case in
* which dsa_slave_change_mtu() will not update the master MTU either, * which dsa_slave_change_mtu() will not update the master MTU either,