[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9cb77524-cceb-1662-f40f-5ce5dc26ee2a@bang-olufsen.dk>
Date: Tue, 31 Aug 2021 00:24:15 +0000
From: Alvin Šipraga <ALSI@...g-olufsen.dk>
To: Linus Walleij <linus.walleij@...aro.org>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Mauri Sandberg <sandberg@...lfence.com>,
DENG Qingfang <dqfext@...il.com>
Subject: Re: [PATCH net-next 5/5 v2] net: dsa: rtl8366rb: Support fast aging
On 8/30/21 11:48 PM, Linus Walleij wrote:
> This implements fast aging per-port using the special "security"
> register, which will flush any L2 LUTs on a port.
>
> Suggested-by: Vladimir Oltean <olteanv@...il.com>
> Cc: Alvin Šipraga <alsi@...g-olufsen.dk>
> Cc: Mauri Sandberg <sandberg@...lfence.com>
> Cc: DENG Qingfang <dqfext@...il.com>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
Vladimir is probably right about "any" being a bit misleading, but I
think this is doing the right thing. Fixed LUT entries (nonexistent at
the moment) should not be affected by the aging process.
Reviewed-by: Alvin Šipraga <alsi@...g-olufsen.dk>
> ChangeLog v1->v2:
> - New patch suggested by Vladimir.
> ---
> drivers/net/dsa/rtl8366rb.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/dsa/rtl8366rb.c b/drivers/net/dsa/rtl8366rb.c
> index 4cb0e336ce6b..548282119cc4 100644
> --- a/drivers/net/dsa/rtl8366rb.c
> +++ b/drivers/net/dsa/rtl8366rb.c
> @@ -1219,6 +1219,19 @@ rtl8366rb_port_bridge_flags(struct dsa_switch *ds, int port,
> 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 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_port_bridge_join(struct dsa_switch *ds, int port,
> struct net_device *bridge)
> @@ -1673,6 +1686,7 @@ static const struct dsa_switch_ops rtl8366rb_switch_ops = {
> .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,
> };
>
Powered by blists - more mailing lists