Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Mon, 23 Nov 2026 19:23
Re: [PATCH net-next v2 2/2] net: bridge: clear the offloaded flag of an fdb entry that roams
Author: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 19:23
Date: Mon, 23 Nov 2026 19:23
140 lines
13223 bytes
13223 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads