]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: b53: Do not force CPU to be always tagged
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 8 Jun 2021 21:22:04 +0000 (14:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 20:49:20 +0000 (13:49 -0700)
commitd7c9dad0dd9b8013a3bcf06ae3046c42c79f2f7b
tree863145304df660d7da536687ae38ad4b2131ab8e
parentdc320287bab0a38e524c14923544a6ef92626a50
net: dsa: b53: Do not force CPU to be always tagged

Commit efc58488c929 ("net: dsa: b53: Keep CPU port as tagged in all
VLANs") forced the CPU port to be always tagged in any VLAN membership.
This was necessary back then because we did not support Broadcom tags
for all configurations so the only way to differentiate tagged and
untagged traffic while DSA_TAG_PROTO_NONE was used was to force the CPU
port into being always tagged.

With most configurations enabling Broadcom tags, especially after
bf50bc03e542 ("net: dsa: b53: Enable Broadcom tags for 531x5/539x
families") we do not need to apply this unconditional force tagging of
the CPU port in all VLANs.

A helper function is introduced to faciliate the encapsulation of the
specific condition requiring the CPU port to be tagged in all VLANs and
the dsa_switch_ops::untag_bridge_pvid boolean is moved to when
dsa_switch_ops::setup is called when we have already determined the
tagging protocol we will be using.

Reported-by: Matthew Hagan <mnhagan88@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Tested-by: Matthew Hagan <mnhagan88@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c