Thread (28 messages) 28 messages, 3 authors, 2021-12-15

Re: [PATCH net-next v3 6/6] net: lan966x: Add switchdev support

flat view

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-12-13 14:29:14
Also in: lkml, netdev

On Mon, Dec 13, 2021 at 03:26:56PM +0100, Horatiu Vultur wrote:
quoted
They are independent of each other. You deduce the interface on which
the notifier was emitted using switchdev_notifier_info_to_dev() and act
upon it, if lan966x_netdevice_check() is true. The notifier handling
code itself is stateless, all the state is per port / per switch.
If you register one notifier handler per switch, lan966x_netdevice_check()
would return true for each notifier handler instance, and you would
handle each event twice, would you not?
That is correct, I will get the event twice which is a problem in the
lan966x. The function lan966x_netdevice_check should be per instance, in
this way each instance can filter the events.
The reason why I am putting the notifier_block inside lan966x is to be
able to get to the instance of lan966x even if I get a event that is not
for lan966x port.
That isn't a problem, every netdevice notifier still sees all events.
DSA intercepts a lot of events which aren't directly emitted for its own
interfaces. You don't gain much by having one more, if anything.
quoted
notifier handlers should be registered as singletons, like other drivers
do.
It looks like not all the other driver register them as singletone. For
example: prestera, mlx5, sparx5. (I just have done a git grep for
register_switchdev_notifier, I have not looked in details at the
implementation).
Not all driver writers may have realized that it is an issue that needs
to be thought of.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help