From: netdev-bot+sashiko@kernel.org
To: namiltd@yahoo.com
Cc: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com,
kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com,
maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 6/9] net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D
Date: Sun, 11 Oct 2026 19:51:26 +0000 [thread overview]
Message-ID: <179174828653.434549.15521627518184901889@kernel.org> (raw)
In-Reply-To: <13e3fcb3-895e-4c1a-a8f5-70dd9a0ed345@yahoo.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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] This patch adds a family D branch to
rtl8365mb_vlan_port_get_pvid()…
--
net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D
On family D chips, this commit reads the PVID as a raw 12-bit VID from the
per-port register at 0x0700 + port. Family C keeps using the VLAN MC table
index. It also adds direct-VID variants of the PVID set and clear paths
that skip the MC table on family D.
> diff --git a/drivers/net/dsa/realtek/rtl8365mb_vlan.c b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> index 2c4c5baf93f10..ccfa764b98125 100644
> --- a/drivers/net/dsa/realtek/rtl8365mb_vlan.c
> +++ b/drivers/net/dsa/realtek/rtl8365mb_vlan.c
[ ... ]
> @@ -742,11 +751,25 @@ int rtl8365mb_vlan_port_get_pvid(struct realtek_priv *priv, int port, u16 *pvid)
> u8 vlanmc_idx;
> int ret;
>
> - ret = rtl8365mb_vlan_get_pvid_mc(priv, port, &vlanmc_idx, &vlanmc);
> - if (ret)
> - return ret;
> + if (rtl8365mb_get_family(priv) == RTL8365MB_FAMILY_D) {
> + u32 data;
> +
> + ret = regmap_read(priv->map,
> + RTL8365MB_D_VLAN_PVID_CTRL_REG(port),
> + &data);
> + if (ret)
> + return ret;
> +
> + *pvid = data & RTL8365MB_D_VLAN_PVID_CTRL_MASK;
[Severity: Medium]
Can this report a PVID that the bridge never configured?
The kernel-doc for rtl8365mb_vlan_port_get_pvid() still says:
* Returns the port PVID if defined or 0 if not.
On family C that holds. An unconfigured port has VLANMC index 0, and
rtl8365mb_vlan_get_pvid_mc() memsets the entry, so evid is 0. On family D
this branch returns whatever the register holds.
rtl8365mb_vlan_setup() only calls
rtl8365mb_port_vlan_filtering(ds, dp->index, false, NULL) for each port
and then sets RTL8365MB_VLAN_CTRL_EN_MASK. Nothing there writes 0 to the
family D PVID registers. The only code that writes 0 is
rtl8365mb_vlan_pvid_port_clear_direct(), and it only does so when the
bridge clears a VID that matches the register.
After rtl8365mb_reset_chip(), the register holds its hardware default or
a value loaded from EEPROM. If that value is non-zero, two callers act on
it.
In rtl8365mb_port_vlan_filtering() with vlan_filtering set:
if (pvid_vid)
accepted_frame = RTL8365MB_FRAME_TYPE_ANY_FRAME;
Here, a VLAN-filtering port with no bridge PVID (for example a bridge
with default_pvid 0) would accept untagged frames into the stale VID.
In the undo_set_pvid path of rtl8365mb_port_vlan_add():
if (pvid_vid)
(void)rtl8365mb_vlan_pvid_port_set(ds, port, pvid_vid,
NULL);
On error, this path would program the stale VID as the PVID.
I couldn't confirm the reset value of these registers from the tree, so
this depends on the hardware or EEPROM default. The family D get_pvid
branch and rtl8365mb_vlan_setup() also look unchanged at the end of the
series.
Should rtl8365mb_vlan_setup() clear the family D PVID registers to 0? That
would match the family C convention of VLANMC index 0 as the neutral
PVID.
> + } else {
> + ret = rtl8365mb_vlan_get_pvid_mc(priv, port, &vlanmc_idx,
> + &vlanmc);
> + if (ret)
> + return ret;
> +
> + *pvid = vlanmc.evid;
> + }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/e84d76ee-03df-49b0-8c9a-b289dfae8728%40yahoo.com
next prev parent reply other threads:[~2026-10-11 19:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <e84d76ee-03df-49b0-8c9a-b289dfae8728.ref@yahoo.com>
2026-10-10 19:36 ` [PATCH net-next v3 0/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-10 19:38 ` [PATCH net-next v3 1/9] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko
2026-10-10 19:39 ` [PATCH net-next v3 2/9] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-10-10 19:39 ` [PATCH net-next v3 3/9] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko
2026-10-10 19:40 ` [PATCH net-next v3 4/9] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko
2026-10-10 19:41 ` [PATCH net-next v3 5/9] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko
2026-10-10 19:42 ` [PATCH net-next v3 6/9] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko [this message]
2026-10-10 19:43 ` [PATCH net-next v3 7/9] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko
2026-10-10 19:44 ` [PATCH net-next v3 8/9] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-10-11 19:51 ` netdev-bot+sashiko
2026-10-10 19:44 ` [PATCH net-next v3 9/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-11 19:51 ` 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=179174828653.434549.15521627518184901889@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luizluca@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=namiltd@yahoo.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
all inboxes | Powered by JetHome®