diff options
author | Jan Hoffmann <jan@3e8.eu> | 2023-05-07 01:05:33 +0200 |
---|---|---|
committer | Sander Vanheule <sander@svanheule.net> | 2023-05-07 19:09:02 +0200 |
commit | 6772ae1172ad12cf81b141fd9c5441ad18c0dddf (patch) | |
tree | 5abda832ebc58afab5503c085f9dc22b00965a0e | |
parent | 3356126b8263a5176bd1b633d428865fb0a4ced5 (diff) | |
download | upstream-6772ae1172ad12cf81b141fd9c5441ad18c0dddf.tar.gz upstream-6772ae1172ad12cf81b141fd9c5441ad18c0dddf.tar.bz2 upstream-6772ae1172ad12cf81b141fd9c5441ad18c0dddf.zip |
realtek: don't add CPU port to multicast portmasks
There shouldn't be any reason to forward all multicast to the CPU. The
original commit message also doesn't provide a reason for this seemingly
unrelated change.
The current implementation of the delete method is also broken, as it
entirely removes any entry when the portmask contains only the CPU port,
even if it was explicitly created.
Fixes: 724e4af530cd ("realtek: Store and Restore MC memberships for port enable/disable")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
-rw-r--r-- | target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c | 7 | ||||
-rw-r--r-- | target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c index bdcbb0a074..270ec172e3 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c @@ -994,7 +994,7 @@ static int rtl83xx_mc_group_alloc(struct rtl838x_switch_priv *priv, int port) } set_bit(mc_group, priv->mc_group_bm); - portmask = BIT_ULL(port) | BIT_ULL(priv->cpu_port); + portmask = BIT_ULL(port); priv->r->write_mcast_pmask(mc_group, portmask); return mc_group; @@ -1026,11 +1026,8 @@ static u64 rtl83xx_mc_group_del_port(struct rtl838x_switch_priv *priv, int mc_gr } portmask &= ~BIT_ULL(port); priv->r->write_mcast_pmask(mc_group, portmask); - if (portmask == BIT_ULL(priv->cpu_port)) { - portmask &= ~BIT_ULL(priv->cpu_port); - priv->r->write_mcast_pmask(mc_group, portmask); + if (!portmask) clear_bit(mc_group, priv->mc_group_bm); - } return portmask; } diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c index 811c897234..b4cb39ed5d 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c @@ -981,7 +981,7 @@ static int rtl83xx_mc_group_alloc(struct rtl838x_switch_priv *priv, int port) } set_bit(mc_group, priv->mc_group_bm); - portmask = BIT_ULL(port) | BIT_ULL(priv->cpu_port); + portmask = BIT_ULL(port); priv->r->write_mcast_pmask(mc_group, portmask); return mc_group; @@ -1013,11 +1013,8 @@ static u64 rtl83xx_mc_group_del_port(struct rtl838x_switch_priv *priv, int mc_gr } portmask &= ~BIT_ULL(port); priv->r->write_mcast_pmask(mc_group, portmask); - if (portmask == BIT_ULL(priv->cpu_port)) { - portmask &= ~BIT_ULL(priv->cpu_port); - priv->r->write_mcast_pmask(mc_group, portmask); + if (!portmask) clear_bit(mc_group, priv->mc_group_bm); - } return portmask; } |