Re: [RFC net-next 1/3] net: dsa: qca8k: offload bridge flags
From: Vladimir Oltean
Date: Sat Aug 07 2021 - 16:45:59 EST
On Sat, Aug 07, 2021 at 08:07:24PM +0800, DENG Qingfang wrote:
> +static int
> +qca8k_port_bridge_flags(struct dsa_switch *ds, int port,
> + struct switchdev_brport_flags flags,
> + struct netlink_ext_ack *extack)
> +{
> + struct qca8k_priv *priv = ds->priv;
> + int ret = 0;
> +
> + if (!ret && flags.mask & BR_LEARNING)
> + ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port),
> + QCA8K_PORT_LOOKUP_LEARN,
> + flags.val & BR_LEARNING ?
> + QCA8K_PORT_LOOKUP_LEARN : 0);
And fast ageing when learning on a port is turned off?
> +
> + if (!ret && flags.mask & BR_FLOOD)
> + ret = qca8k_rmw(priv, QCA8K_REG_GLOBAL_FW_CTRL1,
> + BIT(port + QCA8K_GLOBAL_FW_CTRL1_UC_DP_S),
> + flags.val & BR_FLOOD ?
> + BIT(port + QCA8K_GLOBAL_FW_CTRL1_UC_DP_S) : 0);