Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: netdev@vger.kernel.org
Subject: Re: [net-next v3 3/4] devlink: introduce flash update overwrite mask
Date: Tue, 18 Aug 2020 20:54:51 -0700 [thread overview]
Message-ID: <20200818205451.35191c0d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200819002821.2657515-4-jacob.e.keller@intel.com>
On Tue, 18 Aug 2020 17:28:17 -0700 Jacob Keller wrote:
> +The ``devlink-flash`` command allows optionally specifying a mask indicating
> +the how the device should handle subsections of flash components when
remove one 'the'?
> +updating. This mask indicates the set of sections which are allowed to be
> +overwritten.
> diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
> index ebfc4a698809..74a869fbaa67 100644
> --- a/drivers/net/netdevsim/dev.c
> +++ b/drivers/net/netdevsim/dev.c
> @@ -201,6 +201,8 @@ static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev)
> return PTR_ERR(nsim_dev->ports_ddir);
> debugfs_create_bool("fw_update_status", 0600, nsim_dev->ddir,
> &nsim_dev->fw_update_status);
> + debugfs_create_u32("fw_update_overwrite_mask", 0600, nsim_dev->ddir,
> + &nsim_dev->fw_update_overwrite_mask);
Nice to see the test, but netdevsim changes could be separated out :S
> debugfs_create_u32("max_macs", 0600, nsim_dev->ddir,
> &nsim_dev->max_macs);
> debugfs_create_bool("test1", 0600, nsim_dev->ddir,
> -#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.
> 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.
> + __DEVLINK_FLASH_OVERWRITE_MAX_BIT,
> + DEVLINK_FLASH_OVERWRITE_MAX_BIT = __DEVLINK_FLASH_OVERWRITE_MAX_BIT - 1
> +};
next prev parent reply other threads:[~2020-08-19 3:54 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 [this message]
2020-08-19 16:01 ` Keller, Jacob E
2020-08-19 16:30 ` Jakub Kicinski
2020-08-19 17:06 ` Keller, Jacob E
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=20200818205451.35191c0d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=jacob.e.keller@intel.com \
--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).