Netdev List
 help / color / mirror / Atom feed
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, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 3/4] net: dsa: motorcomm: Read the port PVID instead of bridge's
Date: Wed, 18 Nov 2026 16:02:49 +0000	[thread overview]
Message-ID: <179501776964.3136.5754222174280606355@kernel.org> (raw)
In-Reply-To: <20261116160107.1351198-4-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] 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

  reply	other threads:[~2026-11-18 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:01 [PATCH net v2 0/4] net: dsa: motorcomm: FDB fixup David Yang
2026-11-16 16:01 ` [PATCH net v2 1/4] net: dsa: motorcomm: Do not inherit ports from dynamic FDB entries David Yang
2026-11-16 16:01 ` [PATCH net v2 2/4] net: dsa: motorcomm: Rewrite FDB entry on port migration David Yang
2026-11-18 16:02   ` netdev-bot+sashiko
2026-11-16 16:01 ` [PATCH net v2 3/4] net: dsa: motorcomm: Read the port PVID instead of bridge's David Yang
2026-11-18 16:02   ` netdev-bot+sashiko [this message]
2026-11-16 16:01 ` [PATCH net v2 4/4] net: dsa: motorcomm: Use VID 0 as the unaware PVID David Yang
2026-11-18 16:02   ` 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=179501776964.3136.5754222174280606355@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=linux-kernel@vger.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