diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-04-15 18:46:26 +0300 |
---|---|---|
committer | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-05-04 15:25:00 +0200 |
commit | a2dc153310444a406e1fcf4bbbaff152549fed8f (patch) | |
tree | 1acc2d736ff5868ea2fcdd47fb5bd2a050e1bd74 /net | |
parent | 4bdb2569e1dcbb779ab1889cf1a63f116d5e1950 (diff) |
net: dsa: don't emit targeted cross-chip notifiers for MTU change
A cross-chip notifier with "targeted_match=true" is one that matches
only the local port of the switch that emitted it. In other words,
passing through the cross-chip notifier layer serves no purpose.
Eliminate this concept by calling directly ds->ops->port_change_mtu
instead of emitting a targeted cross-chip notifier. This leaves the
DSA_NOTIFIER_MTU event being emitted only for MTU updates on the CPU
port, which need to be reflected also across all DSA links.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit be6ff9665d642d4cd0800b508ded289eaa5b02a2)
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Conflicts in net/dsa/dsa_priv.h and net/dsa/port.c with commit
8e6598a7b0fa ("net: dsa: Pass VLAN MSTI migration notifications to
driver") which we did not backport.
Diffstat (limited to 'net')
-rw-r--r-- | net/dsa/dsa_priv.h | 4 | ||||
-rw-r--r-- | net/dsa/port.c | 4 | ||||
-rw-r--r-- | net/dsa/slave.c | 10 | ||||
-rw-r--r-- | net/dsa/switch.c | 14 |
4 files changed, 7 insertions, 25 deletions
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index e316015a3e9b..9aca3bef5def 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -98,7 +98,6 @@ struct dsa_notifier_vlan_info { /* DSA_NOTIFIER_MTU */ struct dsa_notifier_mtu_info { const struct dsa_port *dp; - bool targeted_match; int mtu; }; @@ -217,8 +216,7 @@ int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering, struct netlink_ext_ack *extack); bool dsa_port_skip_vlan_configuration(struct dsa_port *dp); int dsa_port_ageing_time(struct dsa_port *dp, clock_t ageing_clock); -int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu, - bool targeted_match); +int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu); int dsa_port_fdb_add(struct dsa_port *dp, const unsigned char *addr, u16 vid); int dsa_port_fdb_del(struct dsa_port *dp, const unsigned char *addr, diff --git a/net/dsa/port.c b/net/dsa/port.c index c257dcd8604f..b6677c626484 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -825,12 +825,10 @@ int dsa_port_bridge_flags(struct dsa_port *dp, return 0; } -int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu, - bool targeted_match) +int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu) { struct dsa_notifier_mtu_info info = { .dp = dp, - .targeted_match = targeted_match, .mtu = new_mtu, }; diff --git a/net/dsa/slave.c b/net/dsa/slave.c index feadaed76a8f..6760533b017d 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1839,15 +1839,14 @@ int dsa_slave_change_mtu(struct net_device *dev, int new_mtu) goto out_master_failed; /* We only need to propagate the MTU of the CPU port to - * upstream switches, so create a non-targeted notifier which - * updates all switches. + * upstream switches, so emit a notifier which updates them. */ - err = dsa_port_mtu_change(cpu_dp, cpu_mtu, false); + err = dsa_port_mtu_change(cpu_dp, cpu_mtu); if (err) goto out_cpu_failed; } - err = dsa_port_mtu_change(dp, new_mtu, true); + err = ds->ops->port_change_mtu(ds, dp->index, new_mtu); if (err) goto out_port_failed; @@ -1860,8 +1859,7 @@ int dsa_slave_change_mtu(struct net_device *dev, int new_mtu) out_port_failed: if (new_master_mtu != old_master_mtu) dsa_port_mtu_change(cpu_dp, old_master_mtu - - dsa_tag_protocol_overhead(cpu_dp->tag_ops), - false); + dsa_tag_protocol_overhead(cpu_dp->tag_ops)); out_cpu_failed: if (new_master_mtu != old_master_mtu) dev_set_mtu(master, old_master_mtu); diff --git a/net/dsa/switch.c b/net/dsa/switch.c index ec10c8ab7318..5bc3e8fa9e1b 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -49,19 +49,7 @@ static int dsa_switch_ageing_time(struct dsa_switch *ds, static bool dsa_port_mtu_match(struct dsa_port *dp, struct dsa_notifier_mtu_info *info) { - if (dp == info->dp) - return true; - - /* Do not propagate to other switches in the tree if the notifier was - * targeted for a single switch. - */ - if (info->targeted_match) - return false; - - if (dsa_port_is_dsa(dp) || dsa_port_is_cpu(dp)) - return true; - - return false; + return dp == info->dp || dsa_port_is_dsa(dp) || dsa_port_is_cpu(dp); } static int dsa_switch_mtu(struct dsa_switch *ds, |