OSDN Git Service

net: dsa: lantiq: Add VLAN unaware bridge offloading
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 5 May 2019 22:25:07 +0000 (00:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 17:34:44 +0000 (10:34 -0700)
commit8206e0ce96b33e6513615de9151e794bbc9f3786
treec1650407e0ae3968f830d531e58cc1d880cd902a
parent30d8938384c75e1aad8addf55cb8d152d9d3a135
net: dsa: lantiq: Add VLAN unaware bridge offloading

This allows to offload bridges with DSA to the switch hardware and do
the packet forwarding in hardware.

This implements generic functions to access the switch hardware tables,
which are used to control many features of the switch.

This patch activates the MAC learning by removing the MAC address table
lock, to prevent uncontrolled forwarding of packets between all the LAN
ports, they are added into individual bridge tables entries with
individual flow ids and the switch will do the MAC learning for each
port separately before they are added to a real bridge.

Each bridge consist of an entry in the active VLAN table and the VLAN
mapping table, table entries with the same index are matching. In the
VLAN unaware mode we configure everything with VLAN ID 0, but we use
different flow IDs, the switch should handle all VLANs as normal payload
and ignore them. When the hardware looks for the port of the destination
MAC address it only takes the entries which have the same flow ID of the
ingress packet.

The bridges are configured with 64 possible entries with these
information:
Table Index, 0...63
VLAN ID, 0...4095: VLAN ID 0 is untagged
flow ID, 0..63: Same flow IDs share entries in MAC learning table
port map, one bit for each port number
tagged port map, one bit for each port number

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/lantiq_gswip.c