Re: [PATCH net-next 00/11] mlxsw: extend line card model by devices and info
From: Jiri Pirko <jiri@resnulli.us>
Date: 2022-06-01 07:35:27
Wed, Jun 01, 2022 at 12:41:59AM CEST, kuba@kernel.org wrote:
On Tue, 31 May 2022 21:34:42 +0200 Jiri Pirko wrote:quoted
And again, for the record, I strongly believe that a separate dl instance for this does not make any sense at all :/ I wonder why you still think it does.For purely software reuse reasons. I think the line cards will require a lot of the same attributes as the full devlink instance, so making them a subobject which can have all the same attributes is poor SW arch.
Sure, I understand the motivation.
Think about it from OOP perspective, you'd definitely factor all that stuff out to an abstract class. We can't do that in netlink but whatever just make it a full dl instance and describe the link between the two. Most NIC vendors (everyone excluding Netronome?) decided that devlink instance is equivalent to a bus device which IIUC it was not supposed to be. It was supposed to be the whole ASIC. If we're okay to stretch
I agree, that is incorrect. That is why I was thinking about sort of "alias" to make it right (2 PF devlink instances would be one connected by alias). Not implemented yet though :/
the definition of a dl instance to be "any independently controllable unit of HW" for NICs then IDK why we can't make a line card a dl instance.
Well, it is not independently controllable. Well, truth is, that in our current implementation, there is one independent "configuration", and that is flash burn of the gearbox. It is done using a "tunnelling" register which encapsulates register communication what is done during flash burning.
Are you afraid of hiding dependencies?
Not really, I'm just not sure I see it is worth the excercise. In czech, we have this saying: "kanon na vrabce". I think that the following picture is better than any translation :) https://i.iinfo.cz/images/72/shutterstock-com-kanon-delo-ptak-vrabec-strilet-1.jpg Will think about it some more.