🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
5 messages
5 total messages Started by Zhineng Lim Fri, 30 Oct 2026 18:28
Netdev devlink A/B firmware bank selection feature
#9005
Author: Zhineng Lim
Date: Fri, 30 Oct 2026 18:28
29 lines
12250 bytes
Hi Jiri,

I'm from the FBNIC team at Meta, working on firmware and drivers. I
realized that devlink core currently lacks a feature for selecting
which A/B bank to use to activate the firmware, i.e currently we just
have "devlink dev reload pci/<bdf> action fw_activate" to activate a
pending image, or reload a current image if none is pending.

I'm thinking of adding a feature that allows for A/B bank selection,
something like:

devlink dev reload pci/<bdf> action fw_activate bank active
devlink dev reload pci/<bdf> action fw_activate bank inactive

This will be useful if say we just activated a problematic image, and
want to immediately roll back to the previous good one.

Before I submit a series, some questions:
1. Has this feature been proposed before? Were there objections or
discussions I should read?
2. Is extending fw_activate the right interface, or is there an
existing mechanism already for what I'm trying to achieve?
3. How should userspace discover bank-selection support, so explicit
selection cannot silently fall back to ordinary activation on older
kernels?

Regards,
Zinc Lim
Re: Netdev devlink A/B firmware bank selection feature
#9019
Author: Andrew Lunn
Date: Fri, 30 Oct 2026 20:19
24 lines
8892 bytes
On Fri, Oct 30, 2026 at 11:28:52AM -0700, Zhineng Lim wrote:
> Hi Jiri,
> 
> I'm from the FBNIC team at Meta, working on firmware and drivers. I
> realized that devlink core currently lacks a feature for selecting
> which A/B bank to use to activate the firmware, i.e currently we just
> have "devlink dev reload pci/<bdf> action fw_activate" to activate a
> pending image, or reload a current image if none is pending.
> 
> I'm thinking of adding a feature that allows for A/B bank selection,
> something like:

Any hardware out there which supports A, B, and C?

> devlink dev reload pci/<bdf> action fw_activate bank active
> devlink dev reload pci/<bdf> action fw_activate bank inactive

How does 'devlink dev flash' work? Don't you also need a bank
selection?

Seems like 'devlink dev info' needs to indicate banks?

	Andrew
Re: Netdev devlink A/B firmware bank selection feature
#9021
Author: Zhineng Lim
Date: Fri, 30 Oct 2026 21:18
44 lines
13515 bytes
Hi Andrew,

devlink dev info+flash are implemented to handle 2 banks only. For
instance 'devlink dev info' shows a "running" and "stored" field to
represent the current FW that's running and the inactive FW on the
other bank respectively. There are a few architectures out there with
>2 banks but as far I can tell, devlink core only handles 2 bank
cases.

Currently, devlink dev flash does not select the flash bank, it just
passes the image to the driver's flash_update callback and the
driver/firmware then determines where to write it to. I don't intend
on modifying it, instead only expanding on 'devlink dev reload
pci/<bdf> action fw_activate'.

Regards,
Zinc

On Fri, Oct 30, 2026 at 1:19 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Fri, Oct 30, 2026 at 11:28:52AM -0700, Zhineng Lim wrote:
> > Hi Jiri,
> >
> > I'm from the FBNIC team at Meta, working on firmware and drivers. I
> > realized that devlink core currently lacks a feature for selecting
> > which A/B bank to use to activate the firmware, i.e currently we just
> > have "devlink dev reload pci/<bdf> action fw_activate" to activate a
> > pending image, or reload a current image if none is pending.
> >
> > I'm thinking of adding a feature that allows for A/B bank selection,
> > something like:
>
> Any hardware out there which supports A, B, and C?
>
> > devlink dev reload pci/<bdf> action fw_activate bank active
> > devlink dev reload pci/<bdf> action fw_activate bank inactive
>
> How does 'devlink dev flash' work? Don't you also need a bank
> selection?
>
> Seems like 'devlink dev info' needs to indicate banks?
>
>         Andrew
Re: Netdev devlink A/B firmware bank selection feature
#9609
Author: Jiri Pirko
Date: Mon, 02 Nov 2026 12:06
42 lines
11751 bytes
Fri, Oct 30, 2026 at 07:28:52PM +0100, limzhineng2@gmail.com wrote:
>Hi Jiri,
>
>I'm from the FBNIC team at Meta, working on firmware and drivers. I
>realized that devlink core currently lacks a feature for selecting
>which A/B bank to use to activate the firmware, i.e currently we just
>have "devlink dev reload pci/<bdf> action fw_activate" to activate a
>pending image, or reload a current image if none is pending.
>
>I'm thinking of adding a feature that allows for A/B bank selection,
>something like:
>
>devlink dev reload pci/<bdf> action fw_activate bank active
>devlink dev reload pci/<bdf> action fw_activate bank inactive
>
>This will be useful if say we just activated a problematic image, and
>want to immediately roll back to the previous good one.
>
>Before I submit a series, some questions:
>1. Has this feature been proposed before? Were there objections or
>discussions I should read?

I'm not aware of it.


>2. Is extending fw_activate the right interface, or is there an
>existing mechanism already for what I'm trying to achieve?

Looks like the right place.


>3. How should userspace discover bank-selection support, so explicit
>selection cannot silently fall back to ordinary activation on older
>kernels?

max_attr?


>
>Regards,
>Zinc Lim
Re: Netdev devlink A/B firmware bank selection feature
#10373
Author: Andrew Lunn
Date: Tue, 03 Nov 2026 13:16
25 lines
9267 bytes
On Fri, Oct 30, 2026 at 02:18:32PM -0700, Zhineng Lim wrote:
> Hi Andrew,
> 
> devlink dev info+flash are implemented to handle 2 banks only. For
> instance 'devlink dev info' shows a "running" and "stored" field to
> represent the current FW that's running and the inactive FW on the
> other bank respectively. There are a few architectures out there with
> >2 banks but as far I can tell, devlink core only handles 2 bank
> cases.
> 
> Currently, devlink dev flash does not select the flash bank, it just
> passes the image to the driver's flash_update callback and the
> driver/firmware then determines where to write it to. I don't intend
> on modifying it.

Maybe you should? As a firmware developer, i would probably keep one
bank holding a known good image, and the second holding whatever i'm
developing. If my development image crashes and burns, i would swap to
the known good image. If the development image works sufficiently well
it can do a firmware upgrade, i would use it to overwrite itself with
the next iteration. That saves me a power cycle or whatever is needed
to swap to the known good image.

	Andrew
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads