Subject: Re: [RFC PATCH v3 net-next] Documentation: devlink: Add devlink-sd

From: Jiri Pirko <[email-masked]>
Date: Mon, 19 Feb 2024 10:06:17 +0100

Sat, Feb 17, 2024 at 03:43:32AM CET, [email-masked] wrote:
>On Fri, 16 Feb 2024 09:06:37 +0100 Jiri Pirko wrote:
>> >We disagree how things should be modeled, sort of in principle.
>> >I think it dates all the way back to your work on altnames.
>> >We had the same conversation on DPLL :(
>> >
>> >I prefer to give objects unique IDs and a bunch of optional identifying
>> >attributes, rather than trying to build some well organized hierarchy.
>> >The hierarchy often becomes an unnecessary constraint.  
>> 
>> Sure, no problem on having floating objects with ids and attributes.
>> But in case they relate to HW configuration, you need to somehow glue
>> them to a device eventually. This is what I'm missing how you envision
>> it. The lifetime of object and glue/unglue operations.
>
>My desired lifetime is that the object (shared pool) gets created when
>the first consumer (netdev) appears, and destroyed when the last one
>disappears. Just like you can configure huge rings on a NIC while its

***

>closed and that won't consume any memory, share pool shouldn't exist if
>all its consumers are closed.
>
>The tricky part is to come up with some way of saying that we want
>multiple netdevs to not only use a shared pool, but which ones should
>be sharing which pool, when the pools themselves don't get explicitly
>created. Right?

Yeah, also, there is limitation of who can share with who.

>
>Gluing to the device is easier, IIUC, once the pool is create we can
>give it whatever attributes we want. devlink ID, bus/device, netdev,
>IOMMU domain, anything.

I'm confused. Above (***) you say that the shared pool is created upon
first netdev creation. Now you indicate the user creates it and then
"binds" it to some object (like devlink).

So, do you think there should be 2 types of pools:
1) implicit upon netdev creation
2) explicit defined by the user?