aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDENG Qingfang <dqfext@gmail.com>2021-01-30 21:43:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-10 09:21:09 +0100
commitffecc05dd3e8d4f7bb9706ca4fffa50b4653f51e (patch)
treea5e880c036bf4d135eb4580058cb23c7196339c0
parent9c7b01fc3e22c49466c1fd0a9024bfda6b76440e (diff)
downloadlinux-yocto-ffecc05dd3e8d4f7bb9706ca4fffa50b4653f51e.tar.gz
linux-yocto-ffecc05dd3e8d4f7bb9706ca4fffa50b4653f51e.tar.bz2
linux-yocto-ffecc05dd3e8d4f7bb9706ca4fffa50b4653f51e.zip
net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add
commit f72f2fb8fb6be095b98af5d740ac50cffd0b0cae upstream. Having multiple destination ports for a unicast address does not make sense. Make port_db_load_purge override existent unicast portvec instead of adding a new port bit. Fixes: 884729399260 ("net: dsa: mv88e6xxx: handle multiple ports in ATU") Signed-off-by: DENG Qingfang <dqfext@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://lore.kernel.org/r/20210130134334.10243-1-dqfext@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 6fa8aa69b418..e04b7fa068af 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1658,7 +1658,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,
if (!entry.portvec)
entry.state = MV88E6XXX_G1_ATU_DATA_STATE_UNUSED;
} else {
- entry.portvec |= BIT(port);
+ if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC)
+ entry.portvec = BIT(port);
+ else
+ entry.portvec |= BIT(port);
+
entry.state = state;
}