From: netdev-bot+sashiko@kernel.org
To: julius@bairaktaris.de
Cc: razor@blackwall.org, idosch@nvidia.com, netdev@vger.kernel.org,
bridge@lists.linux.dev, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
olteanv@gmail.com, vladimir.oltean@nxp.com, jbrandeb@kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: bridge: clear the offloaded flag of an fdb entry that roams
Date: Mon, 23 Nov 2026 19:23:24 +0000 [thread overview]
Message-ID: <179546180446.3135.1475958862197579079@kernel.org> (raw)
In-Reply-To: <20261122192118.1204290-3-julius@bairaktaris.de>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] The new clear_bit() in __fdb_update()
(net/bridge/br_fdb.c:1034) is not ordered against offload reports from…
- [Low] The patch fixes a user-visible defect: after a roam in
__fdb_update(), the entry is shown with NTF_OFFLOADED and matched by…
- [Low] The commit message body, above the `---` line, says: "Found by an
LLM review of __fdb_update() while patch 1 was reworked after the…
--
net: bridge: clear the offloaded flag of an fdb entry that roams
When an entry roams to another port, this patch clears BR_FDB_OFFLOADED
in __fdb_update() right after the switchdev deletion for the old port is
sent. The goal is that the entry is no longer shown as offloaded, or
matched by "bridge fdb flush ... offloaded", when the new port does not
hold it.
[ ... ]
> Found by an LLM review of __fdb_update() while patch 1 was
> reworked after the review of its v1.
[Severity: Low]
This isn't a bug, but "patch 1" and "v1" won't mean anything once this
is in git history.
Could the dependency be named by its subject instead? That would be
"net: bridge: withdraw the switchdev entry of an fdb entry made dynamic",
which provides the roamed variable used in this hunk. Version history
could go below the --- line or in the cover letter.
[ ... ]
> Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
[Severity: Low]
Should this have a Fixes: tag? The roam-time withdrawal that left
BR_FDB_OFFLOADED set seems to come from:
commit 90dc8fd36078 ("net: bridge: notify switchdev of disappearance of
old FDB entry upon migration")
Commit 6eb38bf8eb90 only added the br argument to that
br_switchdev_fdb_notify() call, so it doesn't look like the right target.
The message also doesn't say whether this is meant for net or net-next.
The hunk depends on the roamed variable from "net: bridge: withdraw the
switchdev entry of an fdb entry made dynamic". Could that dependency be
recorded for backports?
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index 4af091c192449..8bb40645bd6b3 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -1031,6 +1031,7 @@ static void __fdb_update(struct net_bridge *br,
> !test_bit(BR_FDB_STICKY, &fdb->flags)))) {
> if (source != old_port) {
> br_switchdev_fdb_notify(br, fdb, RTM_DELNEIGH);
> + clear_bit(BR_FDB_OFFLOADED, &fdb->flags);
[Severity: Medium]
Can a late offload report from the old port set the flag again after
this clear?
DSA programs FDB entries from its workqueue. After the hardware add, it
reports the offload using the orig_dev that was saved when the work was
queued:
net/dsa/user.c:dsa_fdb_offload_notify() {
...
info.offloaded = true;
call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED,
switchdev_work->orig_dev, &info.info, NULL);
}
br_switchdev_event() gets the port p from orig_dev and passes it to
br_fdb_offloaded_set(). That function looks up the entry by {addr, vid}
only and never checks p against the entry's current dst port:
net/bridge/br_fdb.c:br_fdb_offloaded_set() {
...
fdb = br_fdb_find(br, addr, vid);
if (fdb)
assign_bit(BR_FDB_OFFLOADED, &fdb->flags, offloaded);
...
}
With the setup from the commit message, this sequence looks possible:
1. The address is learned on veth. fdb_notify() sends
SWITCHDEV_FDB_ADD_TO_DEVICE. DSA treats it as a host address and
queues the work. The bit is still clear.
2. Before the work runs, a frame with the same source address arrives on
the DSA user port. __fdb_update() sends RTM_DELNEIGH, which is queued
behind the ADD. This clear_bit() does nothing because the bit is not
set yet, and dst becomes the user port. DSA ignores the NEWNEIGH for
its own user port.
3. The worker runs the ADD and calls dsa_fdb_offload_notify() with
orig_dev = veth. br_fdb_offloaded_set() then sets BR_FDB_OFFLOADED on
the entry, which now points at the user port.
4. The worker runs the DEL. DSA doesn't report offloaded=false on delete,
so the flag stays set until the entry ages out or changes.
The entry is then shown as offloaded and matched by "bridge fdb flush
... offloaded" while nothing holds it in hardware. That is the state this
patch is meant to remove. With MAC flapping between two ports, each roam
queues another ADD/DEL pair.
The commit message says:
A roam that races a driver reporting the address as learned on
another port can still leave the flag wrong
This case is different: it is a deferred SWITCHDEV_FDB_OFFLOADED report
from the old port, not a learned report.
Does br_fdb_offloaded_set() also need to ignore reports whose p no longer
matches the entry's dst port?
> br_fdb_dst_write(fdb, dst);
> fdb_modified = true;
> roamed = true;
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122192118.1204290-1-julius%40bairaktaris.de
prev parent reply other threads:[~2026-11-23 19:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 19:21 [PATCH net-next v2 0/2] net: bridge: switchdev state of fdb entries made dynamic or roamed Julius Bairaktaris
2026-11-22 19:21 ` [PATCH net-next v2 1/2] net: bridge: withdraw the switchdev entry of an fdb entry made dynamic Julius Bairaktaris
2026-11-23 19:23 ` netdev-bot+sashiko
2026-11-22 19:21 ` [PATCH net-next v2 2/2] net: bridge: clear the offloaded flag of an fdb entry that roams Julius Bairaktaris
2026-11-23 19:23 ` netdev-bot+sashiko [this message]
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=179546180446.3135.1475958862197579079@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=jbrandeb@kernel.org \
--cc=julius@bairaktaris.de \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=vladimir.oltean@nxp.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