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

Jakub Kicinski
2022-05-26T17:35:46Z

On Thu, 26 May 2022 13:45:49 +0200 Jiri Pirko wrote:
> >Separate instance:
> >
> > for (i = 0; i < sw->num_lcs; i++) {
> > devlink_register(&sw->lc_dl[i]);
> > devlink_line_card_link(&sw->lc[i], &sw->lc_dl[i]);
> > }
> >
> >then report that under the linecard
> >
> > nla_nest_start(msg, DEVLINK_SUBORDINATE_INSTANCE);
> > devlink_nl_put_handle(msg, lc->devlink);
> > nla_nest_end(msg...)
> >
> >then user can update the linecard like any devlink instance, switch,
> >NIC etc. It's better code reuse and I don't see any downside, TBH.
>
> Okay, I was thinking about this a litle bit more, and I would like to
> explore extending the components path. Exposing the components in
> "devlink dev info" and then using them in "devlink dev flash". LC could
> be just one of multiple potential users of components. Will send RFC
> soon.

Feel free to send a mockup of the devlink user space outputs.
The core code for devlink is just meaningless marshaling anyway.