]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: ksz8795: Fix VLAN filtering
authorBen Hutchings <ben.hutchings@mind.be>
Mon, 9 Aug 2021 23:00:06 +0000 (01:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Aug 2021 08:58:15 +0000 (09:58 +0100)
commit3b7d2001687e179cccb88f68eb986d3b1e04d52b
tree16e1fd7352ecfb3aefd86f08187b523bcc5ce352
parent1eddaec532ff8275ab49c3e49de28824d7bd7e7d
net: dsa: microchip: ksz8795: Fix VLAN filtering

Currently ksz8_port_vlan_filtering() sets or clears the VLAN Enable
hardware flag.  That controls discarding of packets with a VID that
has not been enabled for any port on the switch.

Since it is a global flag, set the dsa_switch::vlan_filtering_is_global
flag so that the DSA core understands this can't be controlled per
port.

When VLAN filtering is enabled, the switch should also discard packets
with a VID that's not enabled on the ingress port.  Set or clear each
external port's VLAN Ingress Filter flag in ksz8_port_vlan_filtering()
to make that happen.

Fixes: f43f531406fa ("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>
drivers/net/dsa/microchip/ksz8795.c