mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jonas Gorski <jonas.gorski@gmail.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Kurt Kanzenbach <kurt@linutronix.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 09/11] net: dsa: b53: fix toggling vlan_filtering
Date: Tue, 6 May 2025 09:51:34 +0200	[thread overview]
Message-ID: <89c05b7f-cc3b-4274-a983-0cd867239ae1@redhat.com> (raw)
In-Reply-To: <20250429201710.330937-10-jonas.gorski@gmail.com>

On 4/29/25 10:17 PM, Jonas Gorski wrote:
> @@ -789,26 +805,39 @@ int b53_configure_vlan(struct dsa_switch *ds)
>  	 * entry. Do this only when the tagging protocol is not
>  	 * DSA_TAG_PROTO_NONE
>  	 */
> +	v = &dev->vlans[def_vid];
>  	b53_for_each_port(dev, i) {
> -		v = &dev->vlans[def_vid];
> -		v->members |= BIT(i);
> +		if (!b53_vlan_port_may_join_untagged(ds, i))
> +			continue;
> +
> +		vl.members |= BIT(i);
>  		if (!b53_vlan_port_needs_forced_tagged(ds, i))
> -			v->untag = v->members;
> -		b53_write16(dev, B53_VLAN_PAGE,
> -			    B53_VLAN_PORT_DEF_TAG(i), def_vid);
> +			vl.untag = vl.members;
> +		b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(i),
> +			    def_vid);
>  	}
> +	b53_set_vlan_entry(dev, def_vid, &vl);
>  
> -	/* Upon initial call we have not set-up any VLANs, but upon
> -	 * system resume, we need to restore all VLAN entries.
> -	 */
> -	for (vid = def_vid; vid < dev->num_vlans; vid++) {
> -		v = &dev->vlans[vid];
> +	if (dev->vlan_filtering) {
> +		/* Upon initial call we have not set-up any VLANs, but upon
> +		 * system resume, we need to restore all VLAN entries.
> +		 */
> +		for (vid = def_vid + 1; vid < dev->num_vlans; vid++) {
> +			v = &dev->vlans[vid];
>  
> -		if (!v->members)
> -			continue;
> +			if (!v->members)
> +				continue;
> +
> +			b53_set_vlan_entry(dev, vid, v);
> +			b53_fast_age_vlan(dev, vid);
> +		}
>  
> -		b53_set_vlan_entry(dev, vid, v);
> -		b53_fast_age_vlan(dev, vid);
> +		b53_for_each_port(dev, i) {
> +			if (!dsa_is_cpu_port(ds, i))
> +				b53_write16(dev, B53_VLAN_PAGE,
> +					    B53_VLAN_PORT_DEF_TAG(i),
> +					    dev->ports[i].pvid);

Just if you have to repost for other reasons:
			if (dsa_is_cpu_port(ds, i))
				continue;

			b53_write16(dev, B53_VLAN_PAGE, //...

should probably be more readable.

BTW, @Florian: any deadline for testing feedback on this?

Thanks,

Paolo


  reply	other threads:[~2025-05-06  7:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 20:16 [PATCH net 00/11] net: dsa: b53: accumulated fixes Jonas Gorski
2025-04-29 20:17 ` [PATCH net 01/11] net: dsa: b53: allow leaky reserved multicast Jonas Gorski
2025-04-29 20:17 ` [PATCH net 02/11] net: dsa: b53: keep CPU port always tagged again Jonas Gorski
2025-04-29 20:17 ` [PATCH net 03/11] net: dsa: b53: fix clearing PVID of a port Jonas Gorski
2025-04-29 20:17 ` [PATCH net 04/11] net: dsa: b53: fix flushing old pvid VLAN on pvid change Jonas Gorski
2025-04-30  8:03   ` Florian Fainelli
2025-04-30  9:00     ` Jonas Gorski
2025-04-29 20:17 ` [PATCH net 05/11] net: dsa: b53: fix VLAN ID for untagged vlan on bridge leave Jonas Gorski
2025-04-29 20:17 ` [PATCH net 06/11] net: dsa: b53: always rejoin default untagged VLAN " Jonas Gorski
2025-04-29 20:17 ` [PATCH net 07/11] net: dsa: b53: do not allow to configure VLAN 0 Jonas Gorski
2025-04-29 20:17 ` [PATCH net 08/11] net: dsa: b53: do not program vlans when vlan filtering is off Jonas Gorski
2025-04-29 20:17 ` [PATCH net 09/11] net: dsa: b53: fix toggling vlan_filtering Jonas Gorski
2025-05-06  7:51   ` Paolo Abeni [this message]
2025-05-06  7:55     ` Florian Fainelli
2025-04-29 20:17 ` [PATCH net 10/11] net: dsa: b53: fix learning on VLAN unaware bridges Jonas Gorski
2025-04-29 20:17 ` [PATCH net 11/11] net: dsa: b53: do not set learning and unicast/multicast on up Jonas Gorski
2025-04-30  8:07 ` [PATCH net 00/11] net: dsa: b53: accumulated fixes Florian Fainelli
2025-04-30  8:43   ` Jonas Gorski
2025-05-06 13:42     ` Vladimir Oltean
2025-05-06 14:27       ` Jonas Gorski
2025-05-06 19:03         ` Florian Fainelli
2025-05-06 19:48           ` Jonas Gorski
2025-05-07  7:30             ` Florian Fainelli
2025-05-06 13:08 ` Florian Fainelli
2025-05-08  2:40 ` patchwork-bot+netdevbpf

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=89c05b7f-cc3b-4274-a983-0cd867239ae1@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.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®