All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next 0/4] net: devlink: sync flash and dev info commands
@ 2022-08-18 13:00 Jiri Pirko
  2022-08-18 13:00 ` [patch net-next 1/4] net: devlink: extend info_get() version put to indicate a flash component Jiri Pirko
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: Jiri Pirko @ 2022-08-18 13:00 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, idosch, pabeni, edumazet, saeedm, jacob.e.keller,
	vikas.gupta, gospo

From: Jiri Pirko <jiri@nvidia.com>

Purpose of this patchset is to introduce consistency between two devlink
commands:
  devlink dev info
    Shows versions of running default flash target and components.
  devlink dev flash
    Flashes default flash target or component name (if specified
    on cmdline).

Currently it is up to the driver what versions to expose and what flash
update component names to accept. This is inconsistent. Thankfully, only
netdevsim is currently using components, so it is a good time
to sanitize this.

This patchset makes sure, that devlink.c calls into driver for
component flash update only in case the driver exposes the same version
name.

Also there are two flags exposed to the use over netlink for versions:

1) if driver considers the version represents flashable component,
   DEVLINK_ATTR_INFO_VERSION_IS_COMPONENT is set.
   This provides a list of component names for the user.

2) if driver considers the version represents default flash target (w/o
   component name specified)
   DEVLINK_ATTR_INFO_VERSION_IS_FLASH_UPDATE_DEFAULT is set.
   This tells the user which version is going to be affected by flash
   command when no component name is passed.

Example:
$ devlink dev info
netdevsim/netdevsim10:
  driver netdevsim
  versions:
      running:
        fw.mgmt 10.20.30
        fw 11.22.33
      flash_components:
        fw.mgmt
    flash_update_default fw
$ devlink dev flash netdevsim/netdevsim10 file somefile.bin
[fw.mgmt] Preparing to flash
[fw.mgmt] Flashing 100%
[fw.mgmt] Flash select
[fw.mgmt] Flashing done
$ devlink dev flash netdevsim/netdevsim10 file somefile.bin component fw.mgmt
[fw.mgmt] Preparing to flash
[fw.mgmt] Flashing 100%
[fw.mgmt] Flash select
[fw.mgmt] Flashing done
$ devlink dev flash netdevsim/netdevsim10 file somefile.bin component dummy
Error: selected component is not supported by this device.

Jiri Pirko (4):
  net: devlink: extend info_get() version put to indicate a flash
    component
  net: devlink: expose the info about version representing a component
  netdevsim: expose version of default flash target
  net: devlink: expose default flash update target

 drivers/net/netdevsim/dev.c  |  17 +++-
 include/net/devlink.h        |  18 ++++-
 include/uapi/linux/devlink.h |   3 +
 net/core/devlink.c           | 145 ++++++++++++++++++++++++++++++-----
 4 files changed, 157 insertions(+), 26 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-08-26 11:04 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 13:00 [patch net-next 0/4] net: devlink: sync flash and dev info commands Jiri Pirko
2022-08-18 13:00 ` [patch net-next 1/4] net: devlink: extend info_get() version put to indicate a flash component Jiri Pirko
2022-08-18 21:23   ` Keller, Jacob E
2022-08-19  8:10     ` Jiri Pirko
2022-08-18 13:00 ` [patch net-next 2/4] net: devlink: expose the info about version representing a component Jiri Pirko
2022-08-18 13:00 ` [patch net-next 3/4] netdevsim: expose version of default flash target Jiri Pirko
2022-08-18 13:00 ` [patch net-next 4/4] net: devlink: expose default flash update target Jiri Pirko
2022-08-19  2:53   ` Jakub Kicinski
2022-08-19  8:12     ` Jiri Pirko
2022-08-19 21:54       ` Jakub Kicinski
2022-08-20  5:44         ` Jiri Pirko
2022-08-20 20:11           ` Jakub Kicinski
2022-08-19 20:59     ` Keller, Jacob E
2022-08-19 21:45       ` Jakub Kicinski
2022-08-19 22:07         ` Keller, Jacob E
2022-08-20  5:46           ` Jiri Pirko
2022-08-22 17:09             ` Keller, Jacob E
2022-08-23  6:38               ` Jiri Pirko
2022-08-18 21:16 ` [patch net-next 0/4] net: devlink: sync flash and dev info commands Keller, Jacob E
2022-08-19  2:49 ` Jakub Kicinski
2022-08-19  8:25   ` [patch net-next 0/4] net: devlink: sync flash and dev info command Jiri Pirko
2022-08-23 10:09     ` Kumar, M Chetan
2022-08-23 12:20       ` Jiri Pirko
2022-08-23 16:29         ` Kumar, M Chetan
2022-08-24  8:47           ` Jiri Pirko
2022-08-26  8:54             ` Kumar, M Chetan
2022-08-26 11:01               ` Jiri Pirko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.