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>
}
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;
}
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;
}
}
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;
}
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;
}