Re: [RFC PATCH net-next 1/2] devlink: Hold a reference on parent device

From
Ido Schimmel <idosch@nvidia.com>
Date
2023-06-22 06:03:24
Reply to
Jakub Kicinski, 2023-06-21
On Wed, Jun 21, 2023 at 12:03:57PM -0700, Jakub Kicinski wrote:
Let's try to fix it at the netdevsim level then?
I think it's a good direction. I couldn't find a way to fix it in
devlink and the problem does seem specific to netdevsim.
AFAIU we only need the bus to remain loaded for nsim_bus_dev_release
to exist?
That's my understanding as well.
What if we split netdevsim into two modules, put the bus stuff in a
new module called netdevsim_bus, and leave the rest (driver) in just
netdevsim. That way we can take a ref on netdevsim_bus until all
devices are gone, and still load / unload netdevsim. With unload
resulting in all devices getting auto-deleted.

I haven't looked in detail so maybe you'll immediately tell me it won't
work, but I'm guessing this is how "real" buses work avoid the problem?
At least with PCI (which I believe is the bus backing most devlink
users), the release callback is builtin - not part of a module - so this
problem can't happen there.

Anyway, I will explore this direction.

Thanks!
Thread (14 messages) 14 messages, 3 authors, last reply 2023-06-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help