]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: make learning configurable and keep it off while standalone
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 18 Aug 2022 16:48:09 +0000 (19:48 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Aug 2022 21:36:56 +0000 (14:36 -0700)
commit4e86371521f5e90eef920000f4e26f936536eda7
treeb89ae22fabfc070ed960ce7469352c43454105fb
parent333d5c24a3c0016ef81e9b51341184ae5205f060
net: dsa: microchip: make learning configurable and keep it off while standalone

Address learning should initially be turned off by the driver for port
operation in standalone mode, then the DSA core handles changes to it
via ds->ops->port_bridge_flags().

Leaving address learning enabled while ports are standalone breaks any
kind of communication which involves port B receiving what port A has
sent. Notably it breaks the ksz9477 driver used with a (non offloaded,
ports act as if standalone) bonding interface in active-backup mode,
when the ports are connected together through external switches, for
redundancy purposes.

This fixes a major design flaw in the ksz9477 and ksz8795 drivers, which
unconditionally leave address learning enabled even while ports operate
as standalone.

Fixes: 93279a8384af ("dsa: add DSA switch driver for Microchip KSZ9477")
Link: https://lore.kernel.org/netdev/CAFZh4h-JVWt80CrQWkFji7tZJahMfOToUJQgKS5s0_=9zzpvYQ@mail.gmail.com/
Reported-by: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220818164809.3198039-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h