linux_dsm_epyc7002/net/dsa
Vladimir Oltean b2243b369c net: dsa: Call driver's setup callback after setting up its switchdev notifier
This allows the driver to perform some manipulations of its own during
setup, using generic switchdev calls. Having the notifiers registered at
setup time is important because otherwise any switchdev transaction
emitted during this time would be ignored (dispatched to an empty call
chain).

One current usage scenario is for the driver to request DSA to set up
802.1Q based switch tagging for its ports.

There is no danger for the driver setup code to start racing now with
switchdev events emitted from the network stack (such as bridge core)
even if the notifier is registered earlier. This is because the network
stack needs a net_device as a vehicle to perform switchdev operations,
and the slave net_devices are registered later than the core driver
setup anyway (ds->ops->setup in dsa_switch_setup vs dsa_port_setup).

Luckily DSA doesn't need a net_device to carry out switchdev callbacks,
and therefore drivers shouldn't assume either that net_devices are
available at the time their switchdev callbacks get invoked.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>-
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-05 21:52:42 -07:00
..
dsa2.c net: dsa: Call driver's setup callback after setting up its switchdev notifier 2019-05-05 21:52:42 -07:00
dsa_priv.h net: dsa: Remove legacy probing support 2019-04-30 23:15:35 -04:00
dsa.c net: dsa: Remove legacy probing support 2019-04-30 23:15:35 -04:00
Kconfig net: dsa: Remove legacy probing support 2019-04-30 23:15:35 -04:00
Makefile net: dsa: Remove legacy probing support 2019-04-30 23:15:35 -04:00
master.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
port.c net: dsa: Add more convenient functions for installing port VLANs 2019-04-30 23:05:29 -04:00
slave.c net/dsa: use intermediate representation for matchall offload 2019-05-05 21:49:24 -07:00
switch.c net: dsa: Unset vlan_filtering when ports leave the bridge 2019-04-30 23:05:28 -04:00
tag_brcm.c dsa: tag_brcm: Avoid unused symbols 2019-04-28 19:41:01 -04: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 dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00
tag_ksz.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04: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_qca.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00
tag_trailer.c dsa: Cleanup unneeded table and make tag structures static 2019-04-28 19:41:01 -04:00