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

Andrew Lunn
2022-04-26T12:12:03Z

> >> 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
all four devices gives you a path forward to allowing each device to
have its own firmware.

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:

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.

Andrew