Commit 60c007b
net: dsa: microchip: ksz8795: Fix PVID tag insertion
commit ef3b02a upstream.
ksz8795 has never actually enabled PVID tag insertion, and it also
programmed the PVID incorrectly. To fix this:
* Allow tag insertion to be controlled per ingress port. On most
chips, set bit 2 in Global Control 19. On KSZ88x3 this control
flag doesn't exist.
* When adding a PVID:
- Set the appropriate register bits to enable tag insertion on
egress at every other port if this was the packet's ingress port.
- Mask *out* the VID from the default tag, before or-ing in the new
PVID.
* When removing a PVID:
- Clear the same control bits to disable tag insertion.
- Don't update the default tag. This wasn't doing anything useful.
Fixes: e66f840 ("net: dsa: ksz: Add Microchip KSZ8795 DSA driver")
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backport to 5.10:
- Drop the KSZ88x3 cases as those chips are not supported here
- Handle VID ranges in ksz8795_port_vlan_del()]
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent f365d53 commit 60c007b
1 file changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
836 | | - | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
| 839 | + | |
| 840 | + | |
839 | 841 | | |
840 | 842 | | |
841 | 843 | | |
| |||
844 | 846 | | |
845 | 847 | | |
846 | 848 | | |
847 | | - | |
| 849 | + | |
848 | 850 | | |
| 851 | + | |
849 | 852 | | |
850 | 853 | | |
851 | 854 | | |
| |||
865 | 868 | | |
866 | 869 | | |
867 | 870 | | |
868 | | - | |
| 871 | + | |
869 | 872 | | |
870 | 873 | | |
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
874 | | - | |
875 | | - | |
| 877 | + | |
| 878 | + | |
876 | 879 | | |
877 | 880 | | |
878 | 881 | | |
| |||
1085 | 1088 | | |
1086 | 1089 | | |
1087 | 1090 | | |
| 1091 | + | |
| 1092 | + | |
1088 | 1093 | | |
1089 | 1094 | | |
1090 | 1095 | | |
| |||
0 commit comments