Re: [patch net-next] devlink: don't take instance lock for nested handle put

Jiri Pirko
2023-10-10T15:56:42Z

Tue, Oct 10, 2023 at 04:52:31PM CEST, kuba@kernel.org wrote:
>On Tue, 10 Oct 2023 09:31:20 +0200 Jiri Pirko wrote:
>>> In Linux the PF is what controls the SFs, right?
>>> Privileges, configuration/admin, resource control.
>>> How can the parent disappear and children still exist.
>>
>> It's not like the PF instance disappears, the devlink port related to
>> the SF is removed. Whan user does it, driver asks FW to shutdown the SF.
>> That invokes FW flow which eventually leads to event delivered back to
>> driver that removes the SF instance itself.
>
>You understand what I'm saying tho, right?
>
>If we can depend on the parent not disappearing before the child,
>and the hierarchy is a DAG - the locking is much easier, because
>parent can lock the child.

It won't help with the locking though. During GET, the devlink lock
is taken and within it, you need to access the nested devlink attributes.

And during reload->notify, we still need work so the lock are taken in
proper order.

It would only make the rel infrastructure a bit similer. I will look
into that. But it's parallel to this patchset really.

>
>If it's only nVidia that put the control in hands of FW we shouldn't
>complicate the core for y'all.