netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shannon Nelson <shannon.nelson@amd.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jiri@nvidia.com
Subject: Re: [PATCH net-next 1/2] devlink: add fw bank select parameter
Date: Thu, 8 Dec 2022 17:15:40 -0800	[thread overview]
Message-ID: <20221208171540.17f26cdb@kernel.org> (raw)
In-Reply-To: <06865416-5094-e34f-d031-fa7d8b96ed9b@amd.com>

On Thu, 8 Dec 2022 10:44:50 -0800 Shannon Nelson wrote:
> >> I think this is a nice guideline, but I'm not sure all physical devices
> >> will work this way.  
> > 
> > Shouldn't it be entirely in SW control? (possibly "FW" category of SW)  
> 
> Sadly, not all HW/FW works the way driver writers would like, nor gives 
> us all the features options we want.  Especially that FW that was built 
> before we driver writers had an opinion about how this should work.
> 
> My comment here mainly is that we need to be able to manage the older FW 
> as well as the newer, and be able to make allowances for FW that doesn't 
> play along as well.

How do we steer new folks towards this design, tho? 

The only idea I have would break backward compat for you - we keep what
I described as default, and for devices which can't do that we require
sort of a manual opt out, for example user must request "don't set to
active" if the driver can't auto-change the active. And explicitly
select the bank if the driver can't provide the stable next-flash
semantics?

IDK what exact pieces of info you're working with and how much of the
semantics you can "fake" in the driver?

> >> How about a new info item
> >>       DEVLINK_ATTR_INFO_ACTIVE_BANK
> >> which would need a new api function something like
> >>       devlink_info_active_bank_put()  
> > 
> > Yes, definitely. But I think the next-to-write is also needed, because
> > we will need to use the next-to-write bank to populate the JSON for
> > stored FW to keep backward compat.
> > 
> > In CLI we can be more loose but the algo in the docs must work and not
> > risk overwriting all the banks if machine gets multiple update cycles
> > before getting drained.  
> 
> If we are going to have multiple "stored" (banks) sections, then we need 
> an api that allows for signifying which stored section are we adding a 
> fw version to, and to be able to add the "active" and "flash-target" and 
> whatever other attributes can get added onto the stored bank.
> 
> One option is to assume a bank context gets set by a call to something 
> like devlink_info_stored_bank_put(), and add a bitmask of attributes 
> (ACTIVE, FLASH_TARGET, CURRENT, ...) that can be added to in the future 
> as needed.
>      int devlink_info_stored_bank_put(struct devlink_info_req *req,
>                                       uint bank_id,
>                                       u32 option_mask)

Yup, that's an option. Dunno if the mask is easier to use than just
separate call per attribute, but I guess you'll be the one to test
this API so you'll find out :)

At the netlink level we'd have a separate nla for active, target,
current banks, so no masks there.. right?

  parent reply	other threads:[~2022-12-09  1:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 17:26 [PATCH net-next 0/2] devlink: add params FW_BANK and ENABLE_MIGRATION Shannon Nelson
2022-12-05 17:26 ` [PATCH net-next 1/2] devlink: add fw bank select parameter Shannon Nelson
2022-12-06  9:07   ` Jiri Pirko
2022-12-06 18:18     ` Shannon Nelson
2022-12-07 13:34       ` Jiri Pirko
2022-12-07  1:41   ` Jakub Kicinski
2022-12-07 19:29     ` Shannon Nelson
2022-12-08  0:36       ` Jakub Kicinski
2022-12-08 18:44         ` Shannon Nelson
2022-12-09  0:47           ` Jacob Keller
2022-12-09  1:24             ` Jakub Kicinski
2022-12-12 18:04               ` Jacob Keller
2022-12-12 18:34                 ` Jakub Kicinski
2022-12-09  1:15           ` Jakub Kicinski [this message]
2022-12-05 17:26 ` [PATCH net-next 2/2] devlink: add enable_migration parameter Shannon Nelson
2022-12-06  9:04   ` Jiri Pirko
2022-12-06 18:28     ` Shannon Nelson
2022-12-07 13:33       ` Jiri Pirko
2022-12-05 18:22 ` [PATCH net-next 0/2] devlink: add params FW_BANK and ENABLE_MIGRATION Leon Romanovsky
2022-12-05 18:55   ` Shannon Nelson
2022-12-06  8:13     ` Leon Romanovsky
2022-12-06  9:00 ` Jiri Pirko
2022-12-06 18:21   ` Shannon Nelson
2022-12-07 13:32     ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221208171540.17f26cdb@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jiri@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=shannon.nelson@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).