Subject: Re: [RFC PATCH net-next 06/19] pds_core: add FW update feature to devlink

From: Jakub Kicinski <[email-masked]>
Date: Mon, 28 Nov 2022 15:33:15 -0800

On Mon, 28 Nov 2022 14:25:46 -0800 Shannon Nelson wrote:
> I don't think Intel selects which FW image to boot, but it looks like 
> mlxsw and nfp use the PARAM_GENERIC_FW_LOAD_POLICY to select between 
> DRIVER, FLASH, or DISK.  Shall I add a couple of generic SLOT_x items to 
> the enum devlink_param_fw_load_policy_value and use this API?  For example:
> 
> 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_SLOT_0,
> 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_SLOT_1,
> 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_SLOT_2,
> 	DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_SLOT_3,

Not the worst idea, although I presume normal FW flashing should switch
between slots to activate the new image by default? Which means the
action of fw flashing would alter the policy set by the user. A little
awkward from an API purist standpoint.

I'd just expose the active "bank" via netlink directly.

> I could then modify the devlink dev info printed to refer to fw_slot_0, 
> fw.slot_1, and fw.slot_2 instead of our vendor specific names.

Jake, didn't you have a similar capability in ice?

Knowing my memory I may have acquiesced to something in another driver
already. That said - I think it's cleaner if we just list the stored
versions per bank, no?