]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: rzn1-a5psw: fix STP states handling
authorAlexis Lothoré <alexis.lothore@bootlin.com>
Fri, 12 May 2023 07:27:11 +0000 (09:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:44 +0000 (17:32 +0100)
commit0c19d7bdb551ef06f38b521d14092387e60f6b56
tree805ddc9dc9b211c9fe736c5e1dedf6baa584b677
parent610ecd67a9a404497822d93964ab9e5bf668dbf6
net: dsa: rzn1-a5psw: fix STP states handling

[ Upstream commit ebe9bc50952757b4b25eaf514da7c464196c9606 ]

stp_set_state() should actually allow receiving BPDU while in LEARNING
mode which is not the case. Additionally, the BLOCKEN bit does not
actually forbid sending forwarded frames from that port. To fix this, add
a5psw_port_tx_enable() function which allows to disable TX. However, while
its name suggest that TX is totally disabled, it is not and can still
allow to send BPDUs even if disabled. This can be done by using forced
forwarding with the switch tagging mechanism but keeping "filtering"
disabled (which is already the case in the rzn1-a5sw tag driver). With
these fixes, STP support is now functional.

Fixes: e9fc4f921b1b ("net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver")
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/rzn1_a5psw.c
drivers/net/dsa/rzn1_a5psw.h