From: netdev-bot+sashiko@kernel.org
To: mmyangfl@gmail.com
Cc: netdev@vger.kernel.org, andrew@lunn.ch, olteanv@gmail.com,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com
Subject: Re: [PATCH net v3 1/3] net: dsa: motorcomm: Ignore multicast addresses in FDB ops
Date: Mon, 23 Nov 2026 22:11:10 +0000 [thread overview]
Message-ID: <179547187046.3135.5287571257450168353@kernel.org> (raw)
In-Reply-To: <20261119221110.1123578-2-mmyangfl@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message does not say what actually breaks in hardware,
even though the patch carries a Fixes: tag.
- [Low] For multicast MACs, yt921x_dsa_port_fdb_add() now returns 0
without writing anything to the switch.
--
net: dsa: motorcomm: Ignore multicast addresses in FDB ops
This patch makes yt921x_dsa_port_fdb_add() and yt921x_dsa_port_fdb_del()
return early for multicast MAC addresses. Multicast entries are then no
longer touched from the FDB path, because the software bridge never
forwards according to a multicast FDB entry.
> The software bridge never forwards according to an FDB entry with a
> multicast MAC. A multicast entry created by "bridge fdb add" is
> therefore inert in the software data path, but its switchdev
> notification still reaches .port_fdb_add().
>
> Ignore multicast addresses in .port_fdb_add() and .port_fdb_del() so
> multicast entries are not touched from FDB side.
[Severity: Low]
This isn't a bug, but could the commit message say what goes wrong in
hardware without this change? The patch carries a Fixes: tag, and the
description does not mention the user-visible impact.
In this driver the FDB and MDB ops share one hardware table. They use
the same (addr, vid) key and the same helpers:
drivers/net/dsa/motorcomm/chip.c:yt921x_dsa_port_mdb_add() {
...
res = yt921x_fdb_join(priv, addr, vid, BIT(port));
...
}
yt921x_dsa_port_mdb_del() calls yt921x_fdb_leave(), which is also what
the FDB ops called before this patch.
Before this patch, "bridge fdb add <mcast> dev swpN master static" wrote
a static hardware entry. The switch then forwarded that group by the FDB
port mask, while the software bridge forwarded it by MDB or by flooding.
Also, a later "bridge fdb del" of an address that MDB had also
programmed ran yt921x_fdb_leave(). That cleared the port bit from the
MDB-owned entry, or deleted the entry once no ports were left:
drivers/net/dsa/motorcomm/chip.c:yt921x_fdb_leave() {
...
if (!(ctrl2 & YT921X_FDB_IO2_EGR_PORTS_M)) {
ctrl = YT921X_FDB_OP_OP_DEL | YT921X_FDB_OP_START;
...
}
After that, hardware multicast forwarding no longer matches the software
MDB, which still believes the group is offloaded.
Could these two effects be described in the commit message?
> diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
> index c753c746490a1..9a9e8ed76e01f 100644
> --- a/drivers/net/dsa/motorcomm/chip.c
> +++ b/drivers/net/dsa/motorcomm/chip.c
[ ... ]
> @@ -876,6 +879,12 @@ yt921x_dsa_port_fdb_add(struct dsa_switch *ds, int port,
> struct yt921x_priv *priv = dsa_to_yt921x_priv(ds);
> int res;
>
> + /* The software bridge never forwards according to an FDB entry with a
> + * multicast MAC, do not touch it from the FDB path
> + */
> + if (is_multicast_ether_addr(addr))
> + return 0;
[Severity: Low]
Will returning 0 here make the bridge report the multicast entry as
offloaded, even though nothing was written to the switch?
dsa_user_switchdev_event_work() in net/dsa/user.c treats any 0 return
as a successful offload:
dsa_user_switchdev_event_work()
dsa_port_fdb_add()
yt921x_dsa_port_fdb_add() <- returns 0 for multicast
dsa_fdb_offload_notify()
info.offloaded = true;
call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, ...)
The bridge handles this in br_fdb_offloaded_set(), which sets
BR_FDB_OFFLOADED. br_fdb_fill_info() then reports NTF_OFFLOADED.
As a result, "bridge fdb show" would list the multicast entry as
"offload", but the hardware table has no such entry. The driver's fdb
dump path also filters out multicast, so the hardware side shows
nothing. Before this patch the entry was actually programmed.
For comparison, rtl83xx_port_fdb_add() and rtl83xx_port_fdb_del() in
drivers/net/dsa/realtek/rtl83xx.c return -EOPNOTSUPP for the same
check.
If 0 was chosen on purpose, for example to avoid the dev_err() that the
deferred work prints on failure, could the commit message or the code
comment say so?
This also seems to remain after the later patch in this series, "net:
dsa: motorcomm: Rewrite FDB entry on port migration". That patch keeps
the multicast early return of 0 in both fdb_add and fdb_del.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119221110.1123578-1-mmyangfl%40gmail.com
next prev parent reply other threads:[~2026-11-23 22:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 22:10 [PATCH net v3 0/3] net: dsa: motorcomm: FDB fixup David Yang
2026-11-19 22:10 ` [PATCH net v3 1/3] net: dsa: motorcomm: Ignore multicast addresses in FDB ops David Yang
2026-11-23 22:11 ` netdev-bot+sashiko [this message]
2026-11-19 22:10 ` [PATCH net v3 2/3] net: dsa: motorcomm: Do not inherit ports from dynamic FDB entries David Yang
2026-11-23 22:11 ` netdev-bot+sashiko
2026-11-19 22:10 ` [PATCH net v3 3/3] net: dsa: motorcomm: Rewrite FDB entry on port migration David Yang
2026-11-23 22:11 ` netdev-bot+sashiko
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=179547187046.3135.5287571257450168353@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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