[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <89c05b7f-cc3b-4274-a983-0cd867239ae1@redhat.com>
Date: Tue, 6 May 2025 09:51:34 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Jonas Gorski <jonas.gorski@...il.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Andrew Lunn <andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Russell King <linux@...linux.org.uk>,
Kurt Kanzenbach <kurt@...utronix.de>
Cc: Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 09/11] net: dsa: b53: fix toggling vlan_filtering
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
Powered by blists - more mailing lists