summaryrefslogtreecommitdiffstats
path: root/net/dsa/switch.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-05-11 12:50:18 +0300
committerJakub Kicinski <kuba@kernel.org>2022-05-12 16:38:55 -0700
commitbacf93b0561937695e9c6c1dc1d8ed10ca80eb81 (patch)
treef6631572c4903afed0f1d13955c59ffc291b3c4d /net/dsa/switch.c
parent72c3b0c7359a6f91dd03e08b839adccd9d4268a8 (diff)
downloadlinux-bacf93b0561937695e9c6c1dc1d8ed10ca80eb81.tar.gz
linux-bacf93b0561937695e9c6c1dc1d8ed10ca80eb81.tar.bz2
linux-bacf93b0561937695e9c6c1dc1d8ed10ca80eb81.zip
net: dsa: remove port argument from ->change_tag_protocol()
DSA has not supported (and probably will not support in the future either) independent tagging protocols per CPU port. Different switch drivers have different requirements, some may need to replicate some settings for each CPU port, some may need to apply some settings on a single CPU port, while some may have to configure some global settings and then some per-CPU-port settings. In any case, the current model where DSA calls ->change_tag_protocol for each CPU port turns out to be impractical for drivers where there are global things to be done. For example, felix calls dsa_tag_8021q_register(), which makes no sense per CPU port, so it suppresses the second call. Let drivers deal with replication towards all CPU ports, and remove the CPU port argument from the function prototype. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/switch.c')
-rw-r--r--net/dsa/switch.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index 704975e5c1c2..2b56218fc57c 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -809,14 +809,12 @@ static int dsa_switch_change_tag_proto(struct dsa_switch *ds,
ASSERT_RTNL();
- dsa_switch_for_each_cpu_port(cpu_dp, ds) {
- err = ds->ops->change_tag_protocol(ds, cpu_dp->index,
- tag_ops->proto);
- if (err)
- return err;
+ err = ds->ops->change_tag_protocol(ds, tag_ops->proto);
+ if (err)
+ return err;
+ dsa_switch_for_each_cpu_port(cpu_dp, ds)
dsa_port_set_tag_protocol(cpu_dp, tag_ops);
- }
/* Now that changing the tag protocol can no longer fail, let's update
* the remaining bits which are "duplicated for faster access", and the