Skip to content

Commit 13eccc1

Browse files
vladimirolteanPaolo Abeni
authored andcommitted
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 <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent cfeb84a commit 13eccc1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

net/dsa/master.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,14 @@ int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp)
364364
mtu = ETH_DATA_LEN + dsa_tag_protocol_overhead(tag_ops);
365365

366366
/* The DSA master must use SET_NETDEV_DEV for this to work. */
367-
consumer_link = device_link_add(ds->dev, dev->dev.parent,
368-
DL_FLAG_AUTOREMOVE_CONSUMER);
369-
if (!consumer_link)
370-
netdev_err(dev,
371-
"Failed to create a device link to DSA switch %s\n",
372-
dev_name(ds->dev));
367+
if (!netif_is_lag_master(dev)) {
368+
consumer_link = device_link_add(ds->dev, dev->dev.parent,
369+
DL_FLAG_AUTOREMOVE_CONSUMER);
370+
if (!consumer_link)
371+
netdev_err(dev,
372+
"Failed to create a device link to DSA switch %s\n",
373+
dev_name(ds->dev));
374+
}
373375

374376
/* The switch driver may not implement ->port_change_mtu(), case in
375377
* which dsa_slave_change_mtu() will not update the master MTU either,

0 commit comments

Comments
 (0)