Subject: Re: [PATCH net-next 1/2] devlink: add fw bank select parameter

From: Jakub Kicinski <[email-masked]>
Date: Mon, 12 Dec 2022 10:34:50 -0800

On Mon, 12 Dec 2022 10:04:37 -0800 Jacob Keller wrote:
> >    DEVLINK_ATTR_INFO_VERSION_STORED	[nest]
> >      DEVLINK_ATTR_INFO_VERSION_NAME	[str]
> >      DEVLINK_ATTR_INFO_VERSION_VALUE     [str]
> >      DEVLINK_ATTR_INFO_VERSION_BANK	[u32] // << optional
> >   
> 
> 
> Yea this is what I was thinking. With this change we have:
> 
> old kernel, old devlink - behaves as today
> old kernel, new devlink - prints "unknown bank"

Ah, unintentionally I put bank in all nests.
For existing single-image devices I think we can continue to skip 
the bank attr. So old kernel new devlink should behave the same as
old/old.

> new kernel, old devlink - old devlink should ignore the attribute
> new kernel, new devlink - prints bank info along with version
> 
> So I don't see any issue with adding these attributes getting confused 
> when working with old or new userspace.
> 
> >> I think we could also add a new attribute to both reload and flash which
> >> specify which bank to use. For flash, this would be which bank to
> >> program, and for update this would be which bank to load the firmware
> >> from when doing a "fw_activate".  
> > 
> > SG!
> >   
> >> Is that reasonable? Do you still need a permanent "use this bank by
> >> default" parameter as well?  
> > 
> > I hope we cover all cases, so no param needed?  
> 
> The only reason one might want a parameter is if we want to change some 
> default. For example I think I saw some devices load firmware during 
> resets or initialization.

Any reset/activation should happen from the active bank, right?
We should have a way to set the active bank but I reckon that's
more of a normal command than a param thing?

> But I think that is something we can cross if the extra attributes for 
> reload and flash are not sufficient. We can always add a parameter 
> later. We can't easily take them away once added.