[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210315200813.5ibjembguad2qnk7@skbuf>
Date: Mon, 15 Mar 2021 22:08:13 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Kurt Kanzenbach <kurt@...-computers.de>
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: dsa: hellcreek: Offload bridge port flags
On Sun, Mar 14, 2021 at 01:52:08PM +0100, Kurt Kanzenbach wrote:
> The switch implements unicast and multicast filtering per port.
> Add support for it. By default filtering is disabled.
>
> Signed-off-by: Kurt Kanzenbach <kurt@...-computers.de>
> ---
> drivers/net/dsa/hirschmann/hellcreek.c | 129 ++++++++++++++++++++-----
> 1 file changed, 104 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
> index c1f873a4fbc4..6cba02307bda 100644
> --- a/drivers/net/dsa/hirschmann/hellcreek.c
> +++ b/drivers/net/dsa/hirschmann/hellcreek.c
> @@ -600,6 +600,83 @@ static void hellcreek_setup_vlan_membership(struct dsa_switch *ds, int port,
> hellcreek_unapply_vlan(hellcreek, upstream, vid);
> }
>
> +static void hellcreek_port_set_ucast_flood(struct hellcreek *hellcreek,
> + int port, bool enable)
> +{
> + struct hellcreek_port *hellcreek_port;
> + u16 val;
> +
> + hellcreek_port = &hellcreek->ports[port];
> +
> + dev_dbg(hellcreek->dev, "%s unicast flooding on port %d\n",
> + enable ? "Enable" : "Disable", port);
> +
> + mutex_lock(&hellcreek->reg_lock);
> +
> + hellcreek_select_port(hellcreek, port);
> + val = hellcreek_port->ptcfg;
> + if (enable)
> + val &= ~HR_PTCFG_UUC_FLT;
> + else
> + val |= HR_PTCFG_UUC_FLT;
What does 'unknown unicast filtering' mean/do, exactly?
The semantics of BR_FLOOD are on egress: all unicast packets with an
unknown destination that are received on ports from this bridging domain
can be flooded towards port X if that port has flooding enabled.
When I hear "filtering", I imagine an ingress setting, am I wrong?
> + hellcreek_write(hellcreek, val, HR_PTCFG);
> + hellcreek_port->ptcfg = val;
> +
> + mutex_unlock(&hellcreek->reg_lock);
> +}
Powered by blists - more mailing lists