]> 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)
commitf56912c3d7c9ed30be07d4697b16166ca422a2c1
treeb89ae22fabfc070ed960ce7469352c43454105fb
parentad531cb70bad03947f61e2ce0bcd9d6b3a8da1f7
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: 651fe1942f44 ("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