Skip to content

net: devlink: sync flash and dev info commands

Jiri Pirko netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 0 repliesApplied 3/3
  2. v24 patches 13 repliesSuperseded
  3. v14 patches 22 repliesSuperseded

Changes in v3 from the cover letter

- see changelog of individual patches
- dropped patch to expose if version represents a component over netlink v1->v2:
- see changelog of individual patches, no code changes, just split patch
- removed patches that exposed "default flash target"

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3net: devlink: extend info_get() version put to indicate a flash componentinclude/net/devlink.h net/core/devlink.c+46 -40 repliesApplied
2/3netdevsim: add version fw.mgmt info info_get() and mark as a componentdrivers/net/netdevsim/dev.c+11 -10 repliesApplied
3/3net: devlink: limit flash component name to match version returned by info_get()drivers/net/netdevsim/dev.c include/net/devlink.h net/core/devlink.c+90 -210 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [patch net-next v3 0/3] net: devlink: sync flash and dev info commands

From: Jiri Pirko <[email protected]>

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 currently using components so it is still 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.

Example:

$ devlink dev info
netdevsim/netdevsim10:
  driver netdevsim
  versions:
      running:
        fw.mgmt 10.20.30
      stored:
        fw.mgmt 10.20.30
$ 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.

---
v2->v3:
- see changelog of individual patches
- dropped patch to expose if version represents a component over netlink v1->v2:
- see changelog of individual patches, no code changes, just split patch
- removed patches that exposed "default flash target"

Jiri Pirko (3):
net: devlink: extend info_get() version put to indicate a flash
component
netdevsim: add version fw.mgmt info info_get() and mark as a component
net: devlink: limit flash component name to match version returned by

    info_get()
 drivers/net/netdevsim/dev.c |  15 +++-
 include/net/devlink.h       |  19 ++++-
 net/core/devlink.c          | 139 ++++++++++++++++++++++++++++++------
 3 files changed, 147 insertions(+), 26 deletions(-)
Signature · 1 line
2.37.1