Re: [PATCH net-next 00/11] mlxsw: extend line card model by devices and info

Jiri Pirko
2022-04-26T12:37:09Z

Tue, Apr 26, 2022 at 02:11:43PM CEST, andrew@lunn.ch wrote:
>> >> The idea (implemented in the next patchset) is to let these devices
>> >> expose their own "component name", which can then be plugged into the
>> >> existing flash command:
>> >>
>> >> $ devlink lc show pci/0000:01:00.0 lc 8
>> >> pci/0000:01:00.0:
>> >> lc 8 state active type 16x100G
>> >> supported_types:
>> >> 16x100G
>> >> devices:
>> >> device 0 flashable true component lc8_dev0
>> >> device 1 flashable false
>> >> device 2 flashable false
>> >> device 3 flashable false
>> >> $ devlink dev flash pci/0000:01:00.0 file some_file.mfa2 component lc8_dev0
>> >
>> >IDK if it's just me or this assumes deep knowledge of the system.
>> >I don't understand why we need to list devices 1-3 at all. And they
>> >don't even have names. No information is exposed.
>>
>> There are 4 gearboxes on the line card. They share the same flash. So if
>> you flash gearbox 0, the rest will use the same FW.
>
>Is the flash big enough to hold four copies of the firmware? Listing

One copy, all 4 are using it.

>all four devices gives you a path forward to allowing each device to
>have its own firmware.

Yes.

>
>On the flip side, flashable false is not really true. I don't know
>this API at all, but are there any flags? Can you at least indicate it
>is shared? You could then have an output something like:

Yes, that I can do.

>
> device 0 flashable true shared component lc8_dev0
> device 1 flashable true shared component lc8_dev0
> device 2 flashable true shared component lc8_dev0
> device 3 flashable true shared component lc8_dev0
>
>so you get to see the sharing relationship.

Agreed.

>
> Andrew