From 462a088c474832b19ff2730de1e6bea66d399c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 15 Oct 2022 23:01:29 +0200 Subject: Add Turris kernel (includes patches from OpenWrt) --- ...6-09-net-dsa-rtl8366rb-Support-fast-aging.patch | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pkgs/patches-linux-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch (limited to 'pkgs/patches-linux-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch') diff --git a/pkgs/patches-linux-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch b/pkgs/patches-linux-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch new file mode 100644 index 0000000..a74108e --- /dev/null +++ b/pkgs/patches-linux-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch @@ -0,0 +1,57 @@ +From 8eb13420eb9ab4a4e2ebd612bf5dc9dba0039236 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 5 Oct 2021 21:47:03 +0200 +Subject: [PATCH 09/11] net: dsa: rtl8366rb: Support fast aging +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This implements fast aging per-port using the special "security" +register, which will flush any learned L2 LUT entries on a port. + +The vendor API just enabled setting and clearing this bit, so +we set it to age out any entries on the port and then we clear +it again. + +Suggested-by: Vladimir Oltean +Cc: Mauri Sandberg +Cc: DENG Qingfang +Cc: Florian Fainelli +Reviewed-by: Alvin Šipraga +Signed-off-by: Linus Walleij +Reviewed-by: Vladimir Oltean +Signed-off-by: David S. Miller +--- + drivers/net/dsa/rtl8366rb.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/net/dsa/rtl8366rb.c ++++ b/drivers/net/dsa/rtl8366rb.c +@@ -1308,6 +1308,19 @@ rtl8366rb_port_bridge_flags(struct dsa_s + return 0; + } + ++static void ++rtl8366rb_port_fast_age(struct dsa_switch *ds, int port) ++{ ++ struct realtek_smi *smi = ds->priv; ++ ++ /* This will age out any learned L2 entries */ ++ regmap_update_bits(smi->map, RTL8366RB_SECURITY_CTRL, ++ BIT(port), BIT(port)); ++ /* Restore the normal state of things */ ++ regmap_update_bits(smi->map, RTL8366RB_SECURITY_CTRL, ++ BIT(port), 0); ++} ++ + static int rtl8366rb_change_mtu(struct dsa_switch *ds, int port, int new_mtu) + { + struct realtek_smi *smi = ds->priv; +@@ -1720,6 +1733,7 @@ static const struct dsa_switch_ops rtl83 + .port_disable = rtl8366rb_port_disable, + .port_pre_bridge_flags = rtl8366rb_port_pre_bridge_flags, + .port_bridge_flags = rtl8366rb_port_bridge_flags, ++ .port_fast_age = rtl8366rb_port_fast_age, + .port_change_mtu = rtl8366rb_change_mtu, + .port_max_mtu = rtl8366rb_max_mtu, + }; -- cgit v1.2.3