Hi Russell,

On Sun, 17 Feb 2019 16:32:34 +0000, Russell King <[email protected]> 
wrote:
> +static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port,
> +                                    unsigned long flags)
> +{
> +     struct mv88e6xxx_chip *chip = ds->priv;
> +     bool unicast, multicast;
> +     int ret = -EOPNOTSUPP;
> +
> +     unicast = dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port) ||
> +             flags & BR_FLOOD;
> +     multicast = flags & BR_MCAST_FLOOD;
> +
> +     mutex_lock(&chip->reg_lock);
> +     if (chip->info->ops->port_set_egress_floods)
> +             ret = chip->info->ops->port_set_egress_floods(chip, port,
> +                                                           unicast,
> +                                                           multicast);
> +     mutex_unlock(&chip->reg_lock);
> +
> +     return ret;
> +}
> +
> +static unsigned long mv88e6xxx_bridge_flags_support(struct dsa_switch *ds)
> +{
> +     struct mv88e6xxx_chip *chip = ds->priv;
> +     unsigned long support = 0;
> +
> +     if (chip->info->ops->port_set_egress_floods)
> +             support |= BR_FLOOD | BR_MCAST_FLOOD;
> +
> +     return support;
> +}

I think that it isn't necessary to propagate the notion of bridge flags down
to the DSA drivers. It might be just enough to add:

    port_egress_flood(dsa_switch *ds, int port, bool uc, bool mc)

to dsa_switch_ops and set BR_FLOOD | BR_MCAST_FLOOD from the DSA core,
if the targeted driver has ds->ops->port_set_egress_flood. What do you think?


Thanks,

        Vivien

Reply via email to