]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "net: dsa: setup master before ports"
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 12 Apr 2022 09:44:26 +0000 (12:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Apr 2022 11:38:06 +0000 (12:38 +0100)
commit18fed07678810bc72c69cf2e2613811f9b15b1fc
tree5269fef4f442ebe51b0de6bc5841803fc31e7dcd
parent7309fb2179acd0a6d740c6031a583b1d65c6c3ea
Revert "net: dsa: setup master before ports"

This reverts commit 33966c588e5ea790492710b1fb1e83f6e582d3a0.

dsa_slave_change_mtu() updates the MTU of the DSA master and of the
associated CPU port, but only if it detects a change to the master MTU.

The blamed commit in the Fixes: tag below addressed a regression where
dsa_slave_change_mtu() would return early and not do anything due to
ds->ops->port_change_mtu() not being implemented.

However, that commit also had the effect that the master MTU got set up
to the correct value by dsa_master_setup(), but the associated CPU port's
MTU did not get updated. This causes breakage for drivers that rely on
the ->port_change_mtu() DSA call to account for the tagging overhead on
the CPU port, and don't set up the initial MTU during the setup phase.

Things actually worked before because they were in a fragile equilibrium
where dsa_slave_change_mtu() was called before dsa_master_setup() was.
So dsa_slave_change_mtu() could actually detect a change and update the
CPU port MTU too.

Restore the code to the way things used to work by reverting the reorder
of dsa_tree_setup_master() and dsa_tree_setup_ports(). That change did
not have a concrete motivation going for it anyway, it just looked
better.

Fixes: cb57d9b1d306 ("Revert "net: dsa: stop updating master MTU from master.c"")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c