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: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: 2021-12-13 10:25:57
Also in: linux-devicetree, lkml

The 12/09/2021 17:43, Horatiu Vultur wrote:
quoted
quoted
+int lan966x_register_notifier_blocks(struct lan966x *lan966x)
+{
+     int err;
+
+     lan966x->netdevice_nb.notifier_call = lan966x_netdevice_event;
+     err = register_netdevice_notifier(&lan966x->netdevice_nb);
+     if (err)
+             return err;
+
+     lan966x->switchdev_nb.notifier_call = lan966x_switchdev_event;
+     err = register_switchdev_notifier(&lan966x->switchdev_nb);
+     if (err)
+             goto err_switchdev_nb;
+
+     lan966x->switchdev_blocking_nb.notifier_call = lan966x_switchdev_blocking_event;
+     err = register_switchdev_blocking_notifier(&lan966x->switchdev_blocking_nb);
+     if (err)
+             goto err_switchdev_blocking_nb;
+
+     lan966x_owq = alloc_ordered_workqueue("lan966x_order", 0);
+     if (!lan966x_owq) {
+             err = -ENOMEM;
+             goto err_switchdev_blocking_nb;
+     }
These should be singleton objects, otherwise things get problematic if
you have more than one switch device instantiated in the system.
Yes, I will update this.
Actually I think they need to be part of lan966x.
Because we want each lan966x instance to be independent of each other.
This is not seen in this version but is more clear in the next version
(v4).
quoted
-- 
/Horatiu
-- 
/Horatiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help