Re: [PATCH net-next] net: dsa: hellcreek: Offload bridge port flags
From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-03-15 20:08:57
On Sun, Mar 14, 2021 at 01:52:08PM +0100, Kurt Kanzenbach wrote:
quoted hunk ↗ jump to hunk
The switch implements unicast and multicast filtering per port. Add support for it. By default filtering is disabled. Signed-off-by: Kurt Kanzenbach <redacted> --- 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); +}