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

Jiri Pirko
2023-10-10T07:31:25Z

Mon, Oct 09, 2023 at 06:31:29PM CEST, kuba@kernel.org wrote:
>On Mon, 9 Oct 2023 17:37:27 +0200 Jiri Pirko wrote:
>> >I think kernel assuming that this should not happen and requiring
>> >the PF driver to work around potentially stupid FW designs should
>> >be entirely without our rights.
>>
>> But why is it stupid? The SF may be spawned on the same host, but it
>> could be spawned on another one. The FW creates SF internally and shows
>> that to the kernel. Symetrically, the FW is asked to remove SF and it
>> tells to the host that the SF is going away. Flows have to go
>> through FW.
>
>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 can make it work with putting the proprietary FW in the center.
>But Linux as a project has its own objectives.