]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mt7530: fix roaming from DSA user ports
authorDENG Qingfang <dqfext@gmail.com>
Wed, 13 May 2020 15:10:16 +0000 (23:10 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 May 2020 20:49:28 +0000 (13:49 -0700)
commit664662e6de72167c9546ea74e8f4d673734f16c0
treea712cc0a7260d70d79b1a7f3501f3d6d8d1755a8
parent0df02770a9abc32b1824da791242da2387dc813e
net: dsa: mt7530: fix roaming from DSA user ports

When a client moves from a DSA user port to a software port in a bridge,
it cannot reach any other clients that connected to the DSA user ports.
That is because SA learning on the CPU port is disabled, so the switch
ignores the client's frames from the CPU port and still thinks it is at
the user port.

Fix it by enabling SA learning on the CPU port.

To prevent the switch from learning from flooding frames from the CPU
port, set skb->offload_fwd_mark to 1 for unicast and broadcast frames,
and let the switch flood them instead of trapping to the CPU port.
Multicast frames still need to be trapped to the CPU port for snooping,
so set the SA_DIS bit of the MTK tag to 1 when transmitting those frames
to disable SA learning.

Fixes: b2cac9613626 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mt7530.c
drivers/net/dsa/mt7530.h
net/dsa/tag_mtk.c