net: dsa: Only notify CPU ports of changes to the tag protocol

Previously DSA ports were also included, on the assumption that the
protocol used by the CPU port had to the matched throughout the entire
tree.

As there is not yet any consumer in need of this, drop the call.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Tobias Waldekranz 2021-04-20 20:53:09 +02:00 committed by David S. Miller
parent 9a99bef5f8
commit 21e0b508c8

View File

@ -323,15 +323,6 @@ static int dsa_switch_vlan_del(struct dsa_switch *ds,
return 0; return 0;
} }
static bool dsa_switch_tag_proto_match(struct dsa_switch *ds, int port,
struct dsa_notifier_tag_proto_info *info)
{
if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
return true;
return false;
}
static int dsa_switch_change_tag_proto(struct dsa_switch *ds, static int dsa_switch_change_tag_proto(struct dsa_switch *ds,
struct dsa_notifier_tag_proto_info *info) struct dsa_notifier_tag_proto_info *info)
{ {
@ -344,16 +335,14 @@ static int dsa_switch_change_tag_proto(struct dsa_switch *ds,
ASSERT_RTNL(); ASSERT_RTNL();
for (port = 0; port < ds->num_ports; port++) { for (port = 0; port < ds->num_ports; port++) {
if (dsa_switch_tag_proto_match(ds, port, info)) { if (!dsa_is_cpu_port(ds, port))
err = ds->ops->change_tag_protocol(ds, port, continue;
tag_ops->proto);
if (err)
return err;
if (dsa_is_cpu_port(ds, port)) err = ds->ops->change_tag_protocol(ds, port, tag_ops->proto);
dsa_port_set_tag_protocol(dsa_to_port(ds, port), if (err)
tag_ops); return err;
}
dsa_port_set_tag_protocol(dsa_to_port(ds, port), tag_ops);
} }
/* Now that changing the tag protocol can no longer fail, let's update /* Now that changing the tag protocol can no longer fail, let's update