Article View: linux.kernel.netdev
Article #21266Re: [PATCH net-next v2 2/2] net: bridge: clear the offloaded flag of an fdb entry that roams
From: 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
Technical Details
Message-ID:
<179546180446.3135.1475958862197579079@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369721-linux-kernel-netdev=dewy.ruReferences:
<20261122192118.1204290-3-julius@bairaktaris.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369721-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179546180446.3135.1475958862197579079@kernel.org> References: <20261122192118.1204290-3-julius@bairaktaris.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3964655"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:HCobRsJczhHbNSPtisKr3yEiFN8= sha256:zTjXQNMDNHp6PnscB7KlzFYm6L+Eo4WtSDymIiJ+9Zg= sha1:ubxKh94yUSUSayFB5+0B3KIhOao= sha256:5fK6C9CeMp8egJKvtmJx4Dhf/FDiWbH5sWJIKnzv5p8= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 3B87C125DC5; Mon, 23 Nov 2026 22:23:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R1zXvkbQCVML; Mon, 23 Nov 2026 22:23:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369721-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 5EDB4125DB9; Mon, 23 Nov 2026 22:23:35 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 9F9102E9D1; Mon, 23 Nov 2026 19:23:33 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795461812; b=Hf9Vd7G7udp9hQGN8d2kjqJ9G7L0iB/g0bPotuvuU1WbpZ112yzjwQIZua5kz1U4q4Qu fjJy8HsC+ezjfS3IDE1tiNgsfzePW0RKc6QW9O4oKPC2k0Hj0vv0+mLF8w9mr1D7KusYF lpWTiKdIP0wSUXHDyV72DvdBoEgE0Z7kMDST5CUnwk/PrtxSqUQn48+Oo3YruduihkERh SIOXx344ipq2oZh1gck/dilYHSIDc6Hun2gpYZyAwhZNcSxbLSB2/tzzXPzWb7OWdrN1C GdOxSWBD+YXrN+S4gvHiLKQ5WFOVLnShvMs3WUXaOBOklODWLzhaPkJcnV817ImF+jA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795461812; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=2FASoa1vEglgVFuA3JUwSekEBLuZRvSl3QGz4VTG3T4=; b=4ncQ+99H1tLa3ctb+6+HnWiL08cxEg7r/RZ9XtHxVGmkGIuppqHQiD70AvcQ2Ro2ImLA ETIbTPlKjn4rm28oMONurWk0WFPnuYa+5EXf5WvtkByAbWm7Iha2IBgUGGz2izf93UKrl GGLjvyPEcYwSwlGlTWggzq75sotM90dO8uE2RpZCbhuAS1aOBcMGJMGldMIEKYfThasTk 86/UiRJg2MZYfbFRi/cwF5la2MXXV3Hd/DhfgLZXTqOWqZJe3aTdkR4hf4m6aCwf8fCLq LOScb8tQhtaHnv3DL4fvQVWm1HWlTJsTWv+i03vK2gyn0P+P4TMtXJSihuInRZYJ75w== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mg1jfK5e; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20B4F606A336; Mon, 23 Nov 2026 19:23:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mg1jfK5e X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795461806; b=WNWorlOmYQnhWrj1p4w23JxHfobkUMq3fUMX70LzMDpZdi+RAhijm88r2JzezspXxsIN mPkkVRub78bLbLZnKU4OYFeCFD15WIQbjUyXq8ZBME9DxrJUlOClFmGA6J4oVo1UUniuk 734jobwZW/v+kcHdALLHe1izHpwydbnkYWo3A2G1u7p56G3K5dKrdjpzZeyPr67darAS5 baANkiTIH/nTHg3zSMsfkGpE61eMu9/lcKX//4osO446JxwIpuiSHoyV8F1+daOG/1Tn1 qiYlZQZvH5VceDE91Cfd1UGFmBY1F9hQtyD5BVGc9cfssfTn1t8WDbzD7OUQsVQkFxA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795461806; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=2FASoa1vEglgVFuA3JUwSekEBLuZRvSl3QGz4VTG3T4=; b=mnRLP7Iett+TGiUtlcIMPnTzvmhKvwENLCmGqb8RUssSgJg9XCV9aduV1mvEJVyM8nm1 43BCGwD9ZestsQ/v3WBd1jiR1vbX4RySW7+I3J5xdPin7YqulQqj/xTqygjPFXiUIP6tD rNeKdw8oAMo8aG75BpLSGfK+eOEZNfcPVEcSS406dFG6PV0GQCOA77IUii4/58kkyrQyb +nZDR/tq4bhdTjtZVFfKuJST4pffoHFwFVzYubv6MMwj9kSVW/Y32HPCi8p4npCImti+B JyIWlEfvWuncPw3wrVJgAcECN9ACYegXswarSSxKUu6Tl+USugoPBxi4492kKTVGZPg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mg1jfK5e; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E9DB606A326; Mon, 23 Nov 2026 19:23:26 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9B261F000CF; Mon, 23 Nov 2026 19:23:24 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795461805; bh=2FASoa1vEglgVFuA3JUwSekEBLuZRvSl3QGz4VTG3T4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=mg1jfK5e37ljeM8EVICIYfInGrpJ+YJ4MrA3xub2rdG68dQCGsBeWT3gABO8KLey6 OZAQpBwa7G7pzvc52uRJH0EI3Do+XtMGYHV1v5Qw7V6tvrgbjPIHRfHaYkRSDnq+8V mcQ8MaVkvfJHmGKz6vDVyKKg15MbT/cuCjMi7uJPyfvjxcf4y0wS04SoYlW9KqvGJJ YPGG007gKWfI2OcePG0VWT8Y6BnYNGsqUu8SMAY2b5dekh2rl0fpst7Bmbs4ODSFjm br/IFekHZQkeb5SO3e6tGyDoAATU9CCwNQygJleSCxgBUIqw9D7Z8WXIc2KOezns5X i/+ORLrWWgShQ== X-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 X-In-Reply-To: <20261122192118.1204290-3-julius@bairaktaris.de> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list