From: Florian Fainelli <florian.fainelli@broadcom.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
Jonas Gorski <jonas.gorski@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net v4 3/8] net: dsa: b53: clear stale state when creating an ARL entry
Date: Mon, 9 Nov 2026 19:50:13 -0800 [thread overview]
Message-ID: <20261110035018.2169370-4-florian.fainelli@broadcom.com> (raw)
In-Reply-To: <20261110035018.2169370-1-florian.fainelli@broadcom.com>
When an ARL lookup does not find the requested MAC and VID, b53_arl_read()
returns the first free bin index but leaves the entry populated with the
last bin examined. The multicast add path then ORs the requested port into
that unrelated entry's forwarding bitmap, potentially forwarding packets
to ports which are not members of the multicast group.
Clear the entry before creating a new one. Also return without writing
anything when deleting an entry which is not present, instead of making
a new entry from stale bin contents.
Deleting an entry which is not present now returns -ENOENT, including
when the lookup ran out of space (-ENOSPC), where it previously returned
0 in that case.
Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/net/dsa/b53/b53_common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index ca2ba8c157b7..cc42b2a4870a 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2055,9 +2055,13 @@ static int b53_arl_op(struct b53_device *dev, int op, int port,
addr, vid);
return is_valid ? ret : 0;
case -ENOENT:
+ if (!is_valid)
+ return 0;
+
/* We could not find a matching MAC, so reset to a new entry */
dev_dbg(dev->dev, "{%pM,%.4d} not found, using idx: %d\n",
addr, vid, idx);
+ memset(&ent, 0, sizeof(ent));
break;
default:
dev_dbg(dev->dev, "{%pM,%.4d} found, using idx: %d\n",
--
2.53.0
next prev parent reply other threads:[~2026-11-10 3:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 3:50 [PATCH net v4 0/8] net: dsa: b53: Preliminary fixes Florian Fainelli
2026-11-10 3:50 ` [PATCH net v4 1/8] net: dsa: b53: initialize the jumbo frame size register offset Florian Fainelli
2026-11-10 3:50 ` [PATCH net v4 2/8] net: dsa: b53: fix the SRAB grant timeout check Florian Fainelli
2026-11-10 3:50 ` Florian Fainelli [this message]
2026-11-10 3:50 ` [PATCH net v4 4/8] net: dsa: b53: reject conflicting mirror destinations Florian Fainelli
2026-11-10 3:50 ` [PATCH net v4 5/8] net: dsa: b53: use the correct override register 2 Gbps bit Florian Fainelli
2026-11-10 3:50 ` [PATCH net v4 6/8] net: dsa: b53: reference count shared mirror source bits Florian Fainelli
2026-11-10 3:50 ` [PATCH net v4 7/8] net: dsa: b53: harden mirror register programming Florian Fainelli
2026-11-10 3:50 ` [PATCH net v4 8/8] net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365 Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110035018.2169370-4-florian.fainelli@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jonas.gorski@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®