aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/master.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-08-19 20:48:17 +0300
committerPaolo Abeni <pabeni@redhat.com>2022-08-23 11:39:22 +0200
commitf41ec1fd1c20e2a4e60a4ab8490b3e63423c0a8a (patch)
treee2e9449a4e2d00fc97007b57303773b2311b648a /net/dsa/master.c
parentnet: dsa: only bring down user ports assigned to a given DSA master (diff)
downloadlinux-dev-f41ec1fd1c20e2a4e60a4ab8490b3e63423c0a8a.tar.xz
linux-dev-f41ec1fd1c20e2a4e60a4ab8490b3e63423c0a8a.zip
net: dsa: all DSA masters must be down when changing the tagging protocol
The fact that the tagging protocol is set and queried from the /sys/class/net/<dsa-master>/dsa/tagging file is a bit of a quirk from the single CPU port days which isn't aging very well now that DSA can have more than a single CPU port. This is because the tagging protocol is a switch property, yet in the presence of multiple CPU ports it can be queried and set from multiple sysfs files, all of which are handled by the same implementation. The current logic ensures that the net device whose sysfs file we're changing the tagging protocol through must be down. That net device is the DSA master, and this is fine for single DSA master / CPU port setups. But exactly because the tagging protocol is per switch [ tree, in fact ] and not per DSA master, this isn't fine any longer with multiple CPU ports, and we must iterate through the tree and find all DSA masters, and make sure that all of them are down. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/dsa/master.c')
-rw-r--r--net/dsa/master.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/master.c b/net/dsa/master.c
index 9e5dabc751d9..fb810edc8281 100644
--- a/net/dsa/master.c
+++ b/net/dsa/master.c
@@ -307,7 +307,7 @@ static ssize_t tagging_store(struct device *d, struct device_attribute *attr,
*/
goto out;
- err = dsa_tree_change_tag_proto(cpu_dp->ds->dst, dev, new_tag_ops,
+ err = dsa_tree_change_tag_proto(cpu_dp->ds->dst, new_tag_ops,
old_tag_ops);
if (err) {
/* On failure the old tagger is restored, so we don't need the