linux/net/dsa
Vladimir Oltean ec5ae61076 net: dsa: sja1105: save/restore VLANs using a delta commit method
Managing the VLAN table that is present in hardware will become very
difficult once we add a third operating state
(best_effort_vlan_filtering). That is because correct cleanup (not too
little, not too much) becomes virtually impossible, when VLANs can be
added from the bridge layer, from dsa_8021q for basic tagging, for
cross-chip bridging, as well as retagging rules for sub-VLANs and
cross-chip sub-VLANs. So we need to rethink VLAN interaction with the
switch in a more scalable way.

In preparation for that, use the priv->expect_dsa_8021q boolean to
classify any VLAN request received through .port_vlan_add or
.port_vlan_del towards either one of 2 internal lists: bridge VLANs and
dsa_8021q VLANs.

Then, implement a central sja1105_build_vlan_table method that creates a
VLAN configuration from scratch based on the 2 lists of VLANs kept by
the driver, and based on the VLAN awareness state. Currently, if we are
VLAN-unaware, install the dsa_8021q VLANs, otherwise the bridge VLANs.

Then, implement a delta commit procedure that identifies which VLANs
from this new configuration are actually different from the config
previously committed to hardware. We apply the delta through the dynamic
configuration interface (we don't reset the switch). The result is that
the hardware should see the exact sequence of operations as before this
patch.

This also helps remove the "br" argument passed to
dsa_8021q_crosschip_bridge_join, which it was only using to figure out
whether it should commit the configuration back to us or not, based on
the VLAN awareness state of the bridge. We can simplify that, by always
allowing those VLANs inside of our dsa_8021q_vlans list, and committing
those to hardware when necessary.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-12 13:08:08 -07:00
..
dsa2.c net: dsa: introduce a dsa_switch_find function 2020-05-10 19:52:33 -07:00
dsa_priv.h net: dsa: provide an option for drivers to always receive bridge VLANs 2020-05-12 13:08:07 -07:00
dsa.c net: dsa: introduce a dsa_port_from_netdev public helper 2020-05-07 17:31:57 -07:00
Kconfig net: dsa: add GRO support via gro_cells 2020-04-23 12:32:13 -07:00
Makefile net: dsa: add support for Atheros AR9331 TAG format 2019-12-20 17:05:47 -08:00
master.c net: dsa: Do not leave DSA master with NULL netdev_ops 2020-05-06 17:31:54 -07:00
port.c net: dsa: provide an option for drivers to always receive bridge VLANs 2020-05-12 13:08:07 -07:00
slave.c net: dsa: provide an option for drivers to always receive bridge VLANs 2020-05-12 13:08:07 -07:00
switch.c net: dsa: permit cross-chip bridging between all trees in the system 2020-05-10 19:52:33 -07:00
tag_8021q.c net: dsa: sja1105: save/restore VLANs using a delta commit method 2020-05-12 13:08:08 -07:00
tag_ar9331.c net: dsa: tag_ar9331: Make sure there is headroom for tag 2020-02-14 07:34:51 -08:00
tag_brcm.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
tag_dsa.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00
tag_edsa.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00
tag_gswip.c net: dsa: tag_gswip: fix typo in tagger name 2020-01-16 13:58:26 +01:00
tag_ksz.c net: dsa: ksz: use common define for tag len 2019-12-20 21:06:49 -08:00
tag_lan9303.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00
tag_mtk.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00
tag_ocelot.c net: dsa: ocelot: Constify dsa_device_ops 2020-05-11 16:50:45 -07:00
tag_qca.c net: dsa: tag_qca: Make sure there is headroom for tag 2020-02-14 07:34:51 -08:00
tag_sja1105.c net: dsa: tag_sja1105: Constify dsa_device_ops 2020-05-11 16:50:45 -07:00
tag_trailer.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00