[PATCH net 04/11] net: dsa: b53: fix flushing old pvid VLAN on pvid change

Jonas Gorski posted 11 patches 9 months, 2 weeks ago
[PATCH net 04/11] net: dsa: b53: fix flushing old pvid VLAN on pvid change
Posted by Jonas Gorski 9 months, 2 weeks ago
Presumably the intention here was to flush the VLAN of the old pvid, not
the added VLAN again, which we already flushed before.

Fixes: a2482d2ce349 ("net: dsa: b53: Plug in VLAN support")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/net/dsa/b53/b53_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 65d74c455c57..c67c0b5fbc1b 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1574,7 +1574,7 @@ int b53_vlan_add(struct dsa_switch *ds, int port,
 	if (!dsa_is_cpu_port(ds, port) && new_pvid != old_pvid) {
 		b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port),
 			    new_pvid);
-		b53_fast_age_vlan(dev, vlan->vid);
+		b53_fast_age_vlan(dev, old_pvid);
 	}
 
 	return 0;
-- 
2.43.0
Re: [PATCH net 04/11] net: dsa: b53: fix flushing old pvid VLAN on pvid change
Posted by Florian Fainelli 9 months, 2 weeks ago

On 4/29/2025 10:17 PM, Jonas Gorski wrote:
> Presumably the intention here was to flush the VLAN of the old pvid, not
> the added VLAN again, which we already flushed before.
> 
> Fixes: a2482d2ce349 ("net: dsa: b53: Plug in VLAN support")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>

Does not this logically belong to patch #3?
-- 
Florian
Re: [PATCH net 04/11] net: dsa: b53: fix flushing old pvid VLAN on pvid change
Posted by Jonas Gorski 9 months, 2 weeks ago
On Wed, Apr 30, 2025 at 10:03 AM Florian Fainelli
<florian.fainelli@broadcom.com> wrote:
>
>
>
> On 4/29/2025 10:17 PM, Jonas Gorski wrote:
> > Presumably the intention here was to flush the VLAN of the old pvid, not
> > the added VLAN again, which we already flushed before.
> >
> > Fixes: a2482d2ce349 ("net: dsa: b53: Plug in VLAN support")
> > Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
>
> Does not this logically belong to patch #3?

Yes and no, IMHO these are two different issues, though closely related.

The flush was always there, and for a long time I wondered why we
flush vlan->vid again. Until I noticed that PVID clears aren't handled
(as a test broke because of that), and then I understood what the
intention of the second flush was.

But I should probably reorder them and first fix flushing of the old
pvid, and then add the handling of unsetting pvid.

Also at one point we might want to limit the flushing of the VID to
just that on that port, but that is a future optimization. I fought
very hard the temptation to include optimizations/refactorings that
don't actually fix things, and will send them at a later time.

Best regards,
Jonas