[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66917c53-3315-42a0-a301-1be2483efd5d@gmail.com>
Date: Tue, 6 May 2025 09:55:21 +0200
From: Florian Fainelli <f.fainelli@...il.com>
To: Paolo Abeni <pabeni@...hat.com>, 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: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 09/11] net: dsa: b53: fix toggling vlan_filtering
On 5/6/2025 9:51 AM, Paolo Abeni wrote:
> 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?
Trying to enjoy some time off until May 17th, depending upon the weather
I might be able to get this tested before the end of this week.
--
Florian
Powered by blists - more mailing lists