From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v4 net-next 8/9] net: dsa: netc: add bridge mode support
Date: Wed, 10 Jun 2026 03:28:00 +0000 [thread overview]
Message-ID: <20260610032801.07C8C1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609032955.2066089-9-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Static FDB entries with VID 0 on a VLAN-aware bridge are incorrectly mapped to the bridge's internal VLAN-unaware PVID, breaking forwarding for unspecified VLANs.
--
commit 2c77a1dbe137ce8f6001205692208e4092133f9f
Author: Wei Fang <wei.fang@nxp.com>
net: dsa: netc: add bridge mode support
This commit wires up the port_bridge_join, port_bridge_leave, and
port_vlan_filtering DSA callbacks to support both VLAN-unaware and
VLAN-aware bridge modes. It introduces a dedicated internal PVID for
VLAN-unaware bridges and manages dynamic FDB entry flushing.
> diff --git a/drivers/net/dsa/netc/netc_main.c b/drivers/net/dsa/netc/netc_main.c
> index fcca22da08d87..299a9e76b9aa9 100644
> --- a/drivers/net/dsa/netc/netc_main.c
> +++ b/drivers/net/dsa/netc/netc_main.c
[ ... ]
> @@ -1510,17 +1554,50 @@ static int netc_port_max_mtu(struct dsa_switch *ds, int port)
[ ... ]
> static int netc_port_fdb_add(struct dsa_switch *ds, int port,
> const unsigned char *addr, u16 vid,
> struct dsa_db db)
> {
> + struct net_device *br_ndev = netc_classify_db(db);
> struct netc_port *np = NETC_PORT(ds, port);
>
> - /* Currently, only support standalone port mode, so only
> - * NETC_STANDALONE_PVID (= 0) is supported here.
> - */
> - if (vid != NETC_STANDALONE_PVID)
> - return -EOPNOTSUPP;
> + if (IS_ERR(br_ndev))
> + return PTR_ERR(br_ndev);
> +
> + if (!vid)
> + vid = netc_vlan_unaware_pvid(br_ndev ? &db.bridge : NULL);
[Severity: High]
Will this unconditionally map VID 0 entries to the bridge's internal
VLAN-unaware PVID, even if the bridge has VLAN filtering enabled?
When an FDB entry is added without a specific VLAN (VID 0) - such as local
port MAC addresses automatically added by the bridge core - it appears this
code translates it to the unaware PVID (e.g., 4095). However, if the bridge
is VLAN-aware, the port's ingress traffic uses the user-configured PVID or
explicitly tagged VLANs, not the unaware PVID.
Since this patch also removes the host flood rule when a port joins a bridge,
traffic destined to the local machine would miss the FDB lookup and be treated
as unknown unicast. Could this result in local traffic being leaked to other
ports via flooding, or dropped entirely if unknown unicast flooding is
disabled?
>
> return netc_port_set_fdb_entry(np, addr, vid);
> }
> @@ -1529,10 +1606,14 @@ static int netc_port_fdb_del(struct dsa_switch *ds, int port,
> const unsigned char *addr, u16 vid,
> struct dsa_db db)
> {
> + struct net_device *br_ndev = netc_classify_db(db);
> struct netc_port *np = NETC_PORT(ds, port);
>
> - if (vid != NETC_STANDALONE_PVID)
> - return -EOPNOTSUPP;
> + if (IS_ERR(br_ndev))
> + return PTR_ERR(br_ndev);
> +
> + if (!vid)
> + vid = netc_vlan_unaware_pvid(br_ndev ? &db.bridge : NULL);
[Severity: High]
Does the same unconditional translation happen here during FDB entry deletion,
potentially preventing VID 0 entries from being removed from the hardware if
the bridge is VLAN-aware?
>
> return netc_port_del_fdb_entry(np, addr, vid);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609032955.2066089-1-wei.fang@oss.nxp.com?part=8
next prev parent reply other threads:[~2026-06-10 3:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 3:29 [PATCH v4 net-next 0/9] net: dsa: netc: add bridge mode support wei.fang
2026-06-09 3:29 ` [PATCH v4 net-next 1/9] net: enetc: add interfaces to manage dynamic FDB entries wei.fang
2026-06-09 3:29 ` [PATCH v4 net-next 2/9] net: enetc: add "Update" and "Delete" operations to VLAN filter table wei.fang
2026-06-09 3:29 ` [PATCH v4 net-next 3/9] net: enetc: add interfaces to manage egress treatment table wei.fang
2026-06-09 3:29 ` [PATCH v4 net-next 4/9] net: enetc: add "Update" operation to the egress count table wei.fang
2026-06-09 3:29 ` [PATCH v4 net-next 5/9] net: dsa: netc: initialize the group bitmap of ETT and ECT wei.fang
2026-06-10 3:27 ` sashiko-bot
2026-06-10 10:13 ` Wei Fang (OSS)
2026-06-09 3:29 ` [PATCH v4 net-next 6/9] net: enetc: add helpers to set/clear table bitmap wei.fang
2026-06-10 3:27 ` sashiko-bot
2026-06-09 3:29 ` [PATCH v4 net-next 7/9] net: dsa: netc: add VLAN filter table and egress treatment management wei.fang
2026-06-10 3:27 ` sashiko-bot
2026-06-10 10:16 ` Wei Fang (OSS)
2026-06-09 3:29 ` [PATCH v4 net-next 8/9] net: dsa: netc: add bridge mode support wei.fang
2026-06-10 3:28 ` sashiko-bot [this message]
2026-06-10 10:30 ` Wei Fang (OSS)
2026-06-09 3:29 ` [PATCH v4 net-next 9/9] net: dsa: netc: implement dynamic FDB entry ageing wei.fang
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=20260610032801.07C8C1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wei.fang@oss.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