diff options
author | Vivien Didelot <vivien.didelot@gmail.com> | 2019-06-12 18:33:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-15 13:25:36 -0700 |
commit | 422efd032775757c41e9579facd9656a87bf4f00 (patch) | |
tree | 5a01a23afd179b8e9e721b46f2717c542b2d56b7 | |
parent | 877cd9ffbc9ca5990b28ee52e3dd1082a551633f (diff) |
net: dsa: mv88e6xxx: do not flood CPU with unknown multicast
The DSA ports must flood unknown unicast and multicast, but the switch
must not flood the CPU ports with unknown multicast, as this results
in a lot of undesirable traffic that the network stack needs to filter
in software.
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 6691120bd283..9b3d6091d300 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2058,15 +2058,13 @@ static int mv88e6xxx_setup_message_port(struct mv88e6xxx_chip *chip, int port) static int mv88e6xxx_setup_egress_floods(struct mv88e6xxx_chip *chip, int port) { struct dsa_switch *ds = chip->ds; - bool flood; + bool uc = dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port); + bool mc = dsa_is_dsa_port(ds, port); - /* Upstream ports flood frames with unknown unicast or multicast DA */ - flood = dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port); - if (chip->info->ops->port_set_egress_floods) - return chip->info->ops->port_set_egress_floods(chip, port, - flood, flood); + if (!chip->info->ops->port_set_egress_floods) + return 0; - return 0; + return chip->info->ops->port_set_egress_floods(chip, port, uc, mc); } static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port, |