Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Keller, Jacob E" <jacob.e.keller@intel.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [net-next v3 3/4] devlink: introduce flash update overwrite mask
Date: Wed, 19 Aug 2020 17:06:34 +0000	[thread overview]
Message-ID: <02874ECE860811409154E81DA85FBB58C8B9C0F5@fmsmsx101.amr.corp.intel.com> (raw)
In-Reply-To: <20200819093038.2d448fee@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>



> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of Jakub Kicinski
> Sent: Wednesday, August 19, 2020 9:31 AM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: netdev@vger.kernel.org
> Subject: Re: [net-next v3 3/4] devlink: introduce flash update overwrite mask
> 
> On Wed, 19 Aug 2020 16:01:02 +0000 Keller, Jacob E wrote:
> > > > -#define DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT	BIT(0)
> > > > +#define DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT
> 	BIT(0)
> > > > +#define DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK	BIT(1)
> > >
> > > Since core will check supported flags, I'd be tempted to have a flag
> > > for each override type. Saves an 'if' in every driver.
> >
> > Combinations might not be valid (as in ice where identifiers alone
> > isn't supportable) but I suppose I could add something for it.
> 
> I see, looking at the i40e patch it does seem to not matter in practice
> if core checks this or not.
> 

Right, I have it checking to make sure if you don't support the overwrite at all, then the attribute will be rejected but I expect that ultimately drivers will have to check the exact set of combinations they support, and convert them to the driver/firmware-specific values they have.

> > Would it make sense to just add them to the
> > supported_flash_update_params? This results in a bit offset where the
> > "supported" bits don't match the actual used bits in overwrite_mask,
> > so we could also introduce a separate "supported_overwrite_mask" but
> > that might just be overkill since I doubt we'll need to add more than
> > a handlful of overwrite bits...
> >
> > > >  struct devlink_region;
> > > >  struct devlink_info_req;
> > > > diff --git a/include/uapi/linux/devlink.h
> > > > b/include/uapi/linux/devlink.h index cfef4245ea5a..1d8bbe9c1ae1
> > > > 100644 --- a/include/uapi/linux/devlink.h
> > > > +++ b/include/uapi/linux/devlink.h
> > > > @@ -228,6 +228,28 @@ enum {
> > > >  	DEVLINK_ATTR_STATS_MAX = __DEVLINK_ATTR_STATS_MAX - 1
> > > >  };
> > > >
> > > > +/* Specify what sections of a flash component can be overwritten
> > > > when
> > > > + * performing an update. Overwriting of firmware binary sections
> > > > is always
> > > > + * implicitly assumed to be allowed.
> > > > + *
> > > > + * Each section must be documented in
> > > > + * Documentation/networking/devlink/devlink-flash.rst
> > > > + *
> > > > + */
> > > > +enum {
> > > > +	DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT,
> > > > +	DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT,
> > >
> > > IMHO generally a good practice to have 0 be undefined.
> >
> > Even for bits? I saw that for attribute values 0 was undefined, but
> > that didn't seem right for a bit position. sending the bitfield with
> > zero bit set means the same as not sending the bitfield.
> 
> Ah, misread the code, sorry.

  reply	other threads:[~2020-08-19 17:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  0:28 [net-next v3 0/4] devlink " Jacob Keller
2020-08-19  0:28 ` [net-next v3 1/4] devlink: check flash_update parameter support in net core Jacob Keller
2020-08-19  3:45   ` Jakub Kicinski
2020-08-19 15:53     ` Keller, Jacob E
2020-08-19 23:36   ` David Miller
2020-08-20  0:58     ` Jacob Keller
2020-08-19  0:28 ` [net-next v3 2/4] devlink: convert flash_update to use params structure Jacob Keller
2020-08-19  0:28 ` [net-next v3 3/4] devlink: introduce flash update overwrite mask Jacob Keller
2020-08-19  3:54   ` Jakub Kicinski
2020-08-19 16:01     ` Keller, Jacob E
2020-08-19 16:30       ` Jakub Kicinski
2020-08-19 17:06         ` Keller, Jacob E [this message]
2020-08-19  0:28 ` [net-next v3 4/4] ice: add support for " Jacob Keller
2020-08-19  0:28 ` [iproute2-next v3 0/2] devlink " Jacob Keller
2020-08-19  0:28 ` [iproute2-next v3 1/2] Update devlink header for overwrite mask attribute Jacob Keller
2020-08-19  0:28 ` [iproute2-next v3 2/2] devlink: support setting the overwrite mask Jacob Keller

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=02874ECE860811409154E81DA85FBB58C8B9C0F5@fmsmsx101.amr.corp.intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='RE: [net-next v3 3/4] devlink: introduce flash update overwrite mask' \
    /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

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).