summaryrefslogtreecommitdiffstats
path: root/net/netrom/nr_in.c
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2019-05-05 13:19:20 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-05 21:52:42 -0700
commitb2243b369c7862e29cc9163184fef00d0fb0842a (patch)
tree0df9bd3a1b5d32c232c0912a2f7e216a064b249e /net/netrom/nr_in.c
parente7ba0fad9c534bb3c3a4c3ee8ec8f60b6a224161 (diff)
downloadlinux-b2243b369c7862e29cc9163184fef00d0fb0842a.tar.bz2
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>
Diffstat (limited to 'net/netrom/nr_in.c')
0 files changed, 0 insertions, 0 deletions