diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2022-04-11 23:46:17 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2022-04-14 10:12:34 +0200 |
commit | 30d2fcffeb9b5eee0f7a64a1589b5fd839f8be4d (patch) | |
tree | b82caa95393a10d1c2a13a3cd10c337d31686c90 /target/linux/generic/backport-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch | |
parent | a001630a1aafa224f854fa3ea7589ecefb6e01ae (diff) | |
download | upstream-30d2fcffeb9b5eee0f7a64a1589b5fd839f8be4d.tar.gz upstream-30d2fcffeb9b5eee0f7a64a1589b5fd839f8be4d.tar.bz2 upstream-30d2fcffeb9b5eee0f7a64a1589b5fd839f8be4d.zip |
generic: backport 5.16 RTL8366RB improvements
The prerequisite DSA changes for the nice RTL8366RB improvements
are already backported so bring back these changes as well.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'target/linux/generic/backport-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch')
-rw-r--r-- | target/linux/generic/backport-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch b/target/linux/generic/backport-5.15/774-v5.16-09-net-dsa-rtl8366rb-Support-fast-aging.patch new file mode 100644 index 0000000000..a74108e23d --- /dev/null +++ b/target/linux/generic/backport-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 <linus.walleij@linaro.org> +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 <olteanv@gmail.com> +Cc: Mauri Sandberg <sandberg@mailfence.com> +Cc: DENG Qingfang <dqfext@gmail.com> +Cc: Florian Fainelli <f.fainelli@gmail.com> +Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk> +Signed-off-by: Linus Walleij <linus.walleij@linaro.org> +Reviewed-by: Vladimir Oltean <olteanv@gmail.com> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + 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, + }; |