[PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()

Jonas Gorski posted 1 patch 1 month, 3 weeks ago
drivers/net/dsa/b53/b53_common.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
Posted by Jonas Gorski 1 month, 3 weeks ago
port_fdb_dump() is supposed to only add fdb entries, but we iterate over
the full ARL table, which also inludes multicast entries.

So check if the entry is a multicast entry before passing it on to the
callback().

Additionally, the port of those entries is a bitmask, not a port number,
so any included entries would have even be for the wrong port.

Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/net/dsa/b53/b53_common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index a1a177713d99..2c4131ed7e30 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2169,6 +2169,9 @@ static int b53_fdb_copy(int port, const struct b53_arl_entry *ent,
 	if (!ent->is_valid)
 		return 0;
 
+	if (is_multicast_ether_addr(ent->mac))
+		return 0;
+
 	if (port != ent->port)
 		return 0;
 
-- 
2.43.0
Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
Posted by Andrew Lunn 1 month, 3 weeks ago
On Wed, Dec 17, 2025 at 09:57:56PM +0100, Jonas Gorski wrote:
> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> the full ARL table, which also inludes multicast entries.

includes.

	Andrew
Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
Posted by Paolo Abeni 1 month, 1 week ago
On 12/17/25 11:00 PM, Andrew Lunn wrote:
> On Wed, Dec 17, 2025 at 09:57:56PM +0100, Jonas Gorski wrote:
>> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
>> the full ARL table, which also inludes multicast entries.
> 
> includes.

Please do not resend just for the above. I'll (exceptionally) fix it
while applying the patch.

Cheers,

Paolo
Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
Posted by Jonas Gorski 1 month, 1 week ago
On Sat, Dec 27, 2025 at 5:17 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On 12/17/25 11:00 PM, Andrew Lunn wrote:
> > On Wed, Dec 17, 2025 at 09:57:56PM +0100, Jonas Gorski wrote:
> >> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> >> the full ARL table, which also inludes multicast entries.
> >
> > includes.
>
> Please do not resend just for the above. I'll (exceptionally) fix it
> while applying the patch.

Thank you, I completely forgot about this over the holidays (and getting sick).

Though I also wasn't sure if a typo in the commit message warrants a
new patch version; I sort of assumed this was more a "if a new version
is needed, then fix this as well".

Best regards,
Jonas
Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
Posted by Florian Fainelli 1 month, 3 weeks ago
On 12/17/25 12:57, Jonas Gorski wrote:
> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> the full ARL table, which also inludes multicast entries.
> 
> So check if the entry is a multicast entry before passing it on to the
> callback().
> 
> Additionally, the port of those entries is a bitmask, not a port number,
> so any included entries would have even be for the wrong port.
> 
> Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian