]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: rebalance LAGs on link up/down events
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 5 Feb 2021 22:02:19 +0000 (00:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Feb 2021 22:51:51 +0000 (14:51 -0800)
commit20111d10360d1863dc078b5ada44c2e4ec1aa647
tree3dd53f46f04d8e8d9dc9dad7a3b12d356c3d5a1b
parent7384ca1a9ff192fea881f16273b8f6a2f97745d7
net: mscc: ocelot: rebalance LAGs on link up/down events

At present there is an issue when ocelot is offloading a bonding
interface, but one of the links of the physical ports goes down. Traffic
keeps being hashed towards that destination, and of course gets dropped
on egress.

Monitor the netdev notifier events emitted by the bonding driver for
changes in the physical state of lower interfaces, to determine which
ports are active and which ones are no longer.

Then extend ocelot_get_bond_mask to return either the configured bonding
interfaces, or the active ones, depending on a boolean argument. The
code that does rebalancing only needs to do so among the active ports,
whereas the bridge forwarding mask and the logical port IDs still need
to look at the permanently bonded ports.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot.h
drivers/net/ethernet/mscc/ocelot_net.c
include/soc/mscc/ocelot.h