Re: [PATCH net 2/6] net: dsa: ksz: move tag/untag action

From: Vladimir Oltean
Date: Wed Jan 13 2021 - 20:51:36 EST


On Wed, Jan 13, 2021 at 01:45:18PM +0100, Gilles DOFFE wrote:
> Move tag/untag action at the end of the function to avoid
> tagging or untagging traffic if only vlan 0 is handled.
>
> Signed-off-by: Gilles DOFFE <gilles.doffe@xxxxxxxxxxxxxxxxxxxx>
> ---

No matter how much you move the assignment around, there's no escaping
the truth that the Tag Removal bit in the Port Registers affects all
VLANs that egress a port, whereas the BRIDGE_VLAN_INFO_UNTAGGED flag
controls egress VLAN stripping per VLAN. Sorry, if you work with broken
hardware, you might as well treat it accordingly too.

And as to why the moving around would make any difference in the first
place, you need to do a better job explaining that. There is nothing
that prevents PORT_REMOVE_TAG from being written to the port, regardless
of the order of operations. Unless the order matters?