WSL2-Linux-Kernel/drivers/net/dsa/microchip
Oleksij Rempel b3612ccdf2 net: dsa: microchip: implement multi-bridge support
Current driver version is able to handle only one bridge at time.
Configuring two bridges on two different ports would end up shorting this
bridges by HW. To reproduce it:

	ip l a name br0 type bridge
	ip l a name br1 type bridge
	ip l s dev br0 up
	ip l s dev br1 up
	ip l s lan1 master br0
	ip l s dev lan1 up
	ip l s lan2 master br1
	ip l s dev lan2 up

	Ping on lan1 and get response on lan2, which should not happen.

This happened, because current driver version is storing one global "Port VLAN
Membership" and applying it to all ports which are members of any
bridge.
To solve this issue, we need to handle each port separately.

This patch is dropping the global port member storage and calculating
membership dynamically depending on STP state and bridge participation.

Note: STP support was broken before this patch and should be fixed
separately.

Fixes: c2e866911e ("net: dsa: microchip: break KSZ9477 DSA driver into two files")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20211126123926.2981028-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-26 12:46:38 -08:00
..
Kconfig net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00
Makefile net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00
ksz8.h net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct 2021-04-27 14:13:23 -07:00
ksz8795.c net: dsa: microchip: implement multi-bridge support 2021-11-26 12:46:38 -08:00
ksz8795_reg.h net: dsa: microchip: ksz8795: Fix PVID tag insertion 2021-08-10 09:58:14 +01:00
ksz8795_spi.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz8863_smi.c net: dsa: microchip: ksz8863: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz9477.c net: dsa: microchip: implement multi-bridge support 2021-11-26 12:46:38 -08:00
ksz9477_i2c.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz9477_reg.h net: dsa: microchip: Use the correct style for SPDX License Identifier 2019-10-15 14:59:58 -07:00
ksz9477_spi.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz_common.c net: dsa: microchip: implement multi-bridge support 2021-11-26 12:46:38 -08:00
ksz_common.h net: dsa: microchip: implement multi-bridge support 2021-11-26 12:46:38 -08:00