From: Florian Fainelli <florian.fainelli@broadcom.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, jonas.gorski@gmail.com, andrew@lunn.ch,
olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, vivien.didelot@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v5 3/8] net: dsa: b53: clear stale state when creating an ARL entry
Date: Mon, 16 Nov 2026 12:37:30 -0800 [thread overview]
Message-ID: <ba66f497-78fc-4790-93fe-22ff0e44968f@broadcom.com> (raw)
In-Reply-To: <179485573753.3136.13658549628439256102@kernel.org>
On 11/16/26 11:02, netdev-bot+sashiko@kernel.org wrote:
> 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;
>
> [ ... ]
>
The paragraph was left over from an earlier version, the code is correct
and I will send a v6.
pw-bot: cr
--
Florian
next prev parent reply other threads:[~2026-11-16 20:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 18:01 [PATCH net v5 0/8] net: dsa: b53: Preliminary fixes Florian Fainelli
2026-11-12 18:01 ` [PATCH net v5 1/8] net: dsa: b53: initialize the jumbo frame size register offset Florian Fainelli
2026-11-12 18:01 ` [PATCH net v5 2/8] net: dsa: b53: fix the SRAB grant timeout check Florian Fainelli
2026-11-12 18:01 ` [PATCH net v5 3/8] net: dsa: b53: clear stale state when creating an ARL entry Florian Fainelli
2026-11-16 19:02 ` netdev-bot+sashiko
2026-11-16 20:37 ` Florian Fainelli [this message]
2026-11-12 18:01 ` [PATCH net v5 4/8] net: dsa: b53: reject conflicting mirror destinations Florian Fainelli
2026-11-16 19:02 ` netdev-bot+sashiko
2026-11-16 20:38 ` Florian Fainelli
2026-11-12 18:01 ` [PATCH net v5 5/8] net: dsa: b53: use the correct override register 2 Gbps bit Florian Fainelli
2026-11-16 19:02 ` netdev-bot+sashiko
2026-11-16 20:41 ` Florian Fainelli
2026-11-12 18:02 ` [PATCH net v5 6/8] net: dsa: b53: reference count shared mirror source bits Florian Fainelli
2026-11-16 19:02 ` netdev-bot+sashiko
2026-11-16 20:42 ` Florian Fainelli
2026-11-12 18:02 ` [PATCH net v5 7/8] net: dsa: b53: harden mirror register programming Florian Fainelli
2026-11-16 19:02 ` netdev-bot+sashiko
2026-11-16 20:47 ` Florian Fainelli
2026-11-12 18:02 ` [PATCH net v5 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=ba66f497-78fc-4790-93fe-22ff0e44968f@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-bot+sashiko@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®