Re: [PATCH net v5 3/8] net: dsa: b53: clear stale state when creating an ARL entry
From: netdev-bot+sashiko
Date: Mon Nov 16 2026 - 14:02:35 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In b53_arl_op() (drivers/net/dsa/b53/b53_common.c), the code
does not do what the commit message says about return values.
--
net: dsa: b53: clear stale state when creating an ARL entry
This patch clears the b53_arl_entry in b53_arl_op() before a new ARL
entry is created, so a multicast add no longer ORs the port into the
forwarding bitmap of an unrelated bin. It also returns early when
deleting an entry that is not present, so stale bin contents are no
longer written back.
> 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.
[Severity: Medium]
Is this paragraph accurate? The code below seems to keep returning 0 for
a delete of an absent entry in both cases.
When the lookup misses, b53_arl_read() returns one of two values:
drivers/net/dsa/b53/b53_common.c:b53_arl_read() {
...
return *idx >= dev->num_arl_bins ? -ENOSPC : -ENOENT;
}
> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 1f5776dfaae2e..dac6013f8fe29 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;
The -ENOSPC case is not changed by this patch. With is_valid == false it
still returns 0, not -ENOENT.
> case -ENOENT:
> + if (!is_valid)
> + return 0;
> +
The new early return in the -ENOENT case also gives 0 for a delete.
Before this patch, the -ENOENT delete path fell through to
b53_arl_write_entry() and returned b53_arl_rw_op(dev, 0), which is
normally 0. So b53_fdb_del() and b53_mdb_del() get 0 for an absent entry
both before and after this change. The real difference is that the stale
bin is no longer written back.
Keeping 0 looks like the right behavior. b53_mdb_del() logs an error on
any non-zero return:
drivers/net/dsa/b53/b53_common.c:b53_mdb_del() {
...
ret = b53_arl_op(priv, 0, port, mdb->addr, mdb->vid, false);
mutex_unlock(&priv->arl_mutex);
if (ret)
dev_err(ds->dev, "failed to delete MDB entry\n");
...
}
Returning -ENOENT there would produce errors during normal teardown.
None of the later patches in the series touch b53_arl_op(), so the code
is the same at the end of the series.
Could this paragraph be dropped, or reworded to describe the change the
code actually makes? Or was a code change from an earlier version of the
patch left out?
> /* 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;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112180202.324504-1-florian.fainelli%40broadcom.com