From: Vladimir Oltean Date: Sun, 11 Sep 2022 01:07:02 +0000 (+0300) Subject: net: dsa: suppress device links to LAG DSA masters X-Git-Tag: v6.1-rc5~319^2~181^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13eccc1bbb2e98df5d616398cd9215d9edab522f;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Paolo Abeni --- diff --git a/net/dsa/master.c b/net/dsa/master.c index 99d773b..2176c14 100644 --- a/net/dsa/master.c +++ b/net/dsa/master.c @@ -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); /* The DSA master must use SET_NETDEV_DEV for this to work. */ - consumer_link = device_link_add(ds->dev, dev->dev.parent, - DL_FLAG_AUTOREMOVE_CONSUMER); - if (!consumer_link) - netdev_err(dev, - "Failed to create a device link to DSA switch %s\n", - dev_name(ds->dev)); + if (!netif_is_lag_master(dev)) { + consumer_link = device_link_add(ds->dev, dev->dev.parent, + DL_FLAG_AUTOREMOVE_CONSUMER); + if (!consumer_link) + netdev_err(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 * which dsa_slave_change_mtu() will not update the master MTU either,