Re: [PATCH net v2 3/4] net: dsa: motorcomm: Read the port PVID instead of bridge's
From: netdev-bot+sashiko
Date: Wed Nov 18 2026 - 11:03:44 EST
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] Besides swapping the bridge master (dsa_port_bridge_dev_get())
for the bridge port (dsa_port_to_bridge_port()), the patch also…
--
net: dsa: motorcomm: Read the port PVID instead of bridge's
This patch changes the yt921x driver so br_vlan_get_pvid() is called on
the bridge port returned by dsa_port_to_bridge_port(). Before, it was
called on the bridge master, which returned the bridge's own PVID. The
change covers yt921x_vlan_filtering(), yt921x_dsa_port_vlan_add() and
yt921x_dsa_port_vlan_del().
> diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
> index 863ebb6c31984..d84d863080ce0 100644
> --- a/drivers/net/dsa/motorcomm/chip.c
> +++ b/drivers/net/dsa/motorcomm/chip.c
[ ... ]
> @@ -1102,16 +1102,16 @@ yt921x_dsa_port_vlan_del(struct dsa_switch *ds, int port,
> mutex_lock(&priv->reg_lock);
> do {
> struct dsa_port *dp = dsa_to_port(ds, port);
> - struct net_device *bdev;
> + struct net_device *brport;
>
> res = yt921x_vlan_del(priv, port, vid);
> if (res)
> break;
>
> - bdev = dsa_port_bridge_dev_get(dp);
> - if (bdev) {
> - br_vlan_get_pvid(bdev, &pvid);
> - if (pvid == vid)
> + brport = dsa_port_to_bridge_port(dp);
> + if (brport) {
> + br_vlan_get_pvid(brport, &pvid);
> + if (!pvid)
[Severity: Low]
Besides the switch to dsa_port_to_bridge_port(), this hunk also changes
the condition in yt921x_dsa_port_vlan_del() from "pvid == vid" to
"!pvid". The commit message only says:
"Query the PVID from dsa_port_to_bridge_port() instead."
Could the changelog mention this condition change too?
The del path now checks whether the port has no PVID at all. Before, it
checked whether the deleted VID was the PVID. The new check works
because the bridge clears vg->pvid before it sends the switchdev delete
notification:
net/bridge/br_vlan.c:nbp_vlan_delete()
__vlan_unpublish(vg, v);
synchronize_net();
...
__vlan_del(vg, v);
__vlan_flush() also clears vg->pvid before it deletes each VLAN.
yt921x_dsa_port_vlan_add() still uses "pvid == vid". That is correct,
because in nbp_vlan_add() the switchdev add notification is sent before
__vlan_flags_commit(), so the driver still sees the old PVID. The two
handlers now use different checks, though, and nothing explains why.
Since the patch carries a Fixes: tag and may be backported, would it be
worth saying in the changelog why the two checks differ, and that the
del path depends on this ordering in the bridge?
The changelog also leaves out the user-visible effects being fixed.
Deleting the bridge's own PVID VID from a port cleared that port's real
hardware PVID. Toggling vlan_filtering programmed the bridge's PVID into
every port. Could these be described too?
> res = yt921x_pvid_clear(priv, port);
> }
> } while (0);
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116160107.1351198-1-mmyangfl%40gmail.com