]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'net-devlink-sync-flash-and-dev-info-commands'
authorJakub Kicinski <kuba@kernel.org>
Thu, 25 Aug 2022 20:22:58 +0000 (13:22 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Aug 2022 20:22:58 +0000 (13:22 -0700)
commit6a3670bd164c4db0f48a78acd809f4d24d7eba40
treeb8c0ec9e33bbb6522be4209cbd0d4fcb5526c968
parent649cb164c2c3344b90185078149f82fb6a0b2203
parent36ec6b7a00f9a6820a4605b17de56027178a60e8
Merge branch 'net-devlink-sync-flash-and-dev-info-commands'

Jiri Pirko says:

====================
net: devlink: sync flash and dev info commands

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

Link: https://lore.kernel.org/r/20220824122011.1204330-1-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>