aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c
diff options
context:
space:
mode:
authorJan Hoffmann <jan@3e8.eu>2023-05-06 19:28:54 +0200
committerSander Vanheule <sander@svanheule.net>2023-05-07 19:07:34 +0200
commit5d34fc92eccc7d8f3fd35fd5841c110ca1aefc13 (patch)
treec8d92333fa6a590daeaaa6d85c8ff6ae34b93499 /target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c
parent4c0a1667f3e752d31b22ca699a9a3fda5eb47dc7 (diff)
downloadupstream-5d34fc92eccc7d8f3fd35fd5841c110ca1aefc13.tar.gz
upstream-5d34fc92eccc7d8f3fd35fd5841c110ca1aefc13.tar.bz2
upstream-5d34fc92eccc7d8f3fd35fd5841c110ca1aefc13.zip
realtek: fix standalone ports in presence of static fdb entries
The registers L2_PORT_STATIC_MV_ACT seem to specify the action to take when the source address of a packet exists as a static fdb entry on another port. By default the configured action is to drop such packets. For standalone ports, this behaviour is undesired, as all traffic should be forwarded to the CPU. So change the action to forward on standalone ports. A situation where this issue can occur is when a non-offloaded bond interface is part of a bridge. In that case, the CPU port will have fdb entries for devices connected to the bond interface, which are managed by the assisted learning feature. For now, this is only implemented for RTL838x/RTL839x, as the available set of registers differs for the other devices. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Diffstat (limited to 'target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c')
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c
index 9ce5098979..74ad031276 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl838x.c
@@ -559,6 +559,15 @@ static void rtl838x_enable_bcast_flood(int port, bool enable)
}
+static void rtl838x_set_static_move_action(int port, bool forward)
+{
+ int shift = MV_ACT_PORT_SHIFT(port);
+ u32 val = forward ? MV_ACT_FORWARD : MV_ACT_DROP;
+
+ sw_w32_mask(MV_ACT_MASK << shift, val << shift,
+ RTL838X_L2_PORT_STATIC_MV_ACT(port));
+}
+
static void rtl838x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
{
int i;
@@ -1750,6 +1759,7 @@ const struct rtl838x_reg rtl838x_reg = {
.enable_flood = rtl838x_enable_flood,
.enable_mcast_flood = rtl838x_enable_mcast_flood,
.enable_bcast_flood = rtl838x_enable_bcast_flood,
+ .set_static_move_action = rtl838x_set_static_move_action,
.stp_get = rtl838x_stp_get,
.stp_set = rtl838x_stp_set,
.mac_port_ctrl = rtl838x_mac_port_ctrl,