Skip to content

implement DEVLINK_CMD_REGION_NEW

Jacob Keller netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 15 repliesIn review
  2. v211 patches 21 repliesSuperseded
  3. v19 of 10 patches 15 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11devlink: prepare to support region operationsdrivers/net/ethernet/mellanox/mlx4/crdump.c drivers/net/netdevsim/dev.c include/net/devlink.h +1 more+40 -203 replies
2/11devlink: convert snapshot destructor callback to region opdrivers/net/ethernet/mellanox/mlx4/crdump.c drivers/net/netdevsim/dev.c include/net/devlink.h +1 more+14 -130 replies
3/11devlink: trivial: fix tab in function documentationnet/core/devlink.c+1 -10 replies
4/11devlink: add function to take snapshot while lockednet/core/devlink.c+47 -310 replies
5/11devlink: use -ENOSPC to indicate no more room for snapshotsnet/core/devlink.c+1 -10 replies
6/11devlink: extract snapshot id allocation to helper functionnet/core/devlink.c+14 -12 replies
7/11devlink: report error once U32_MAX snapshot ids have been useddrivers/net/ethernet/mellanox/mlx4/crdump.c drivers/net/netdevsim/dev.c include/net/devlink.h +1 more+33 -130 replies
8/11devlink: track snapshot id usage count using an xarraydrivers/net/ethernet/mellanox/mlx4/crdump.c drivers/net/netdevsim/dev.c include/net/devlink.h +1 more+135 -81 reply
9/11devlink: implement DEVLINK_CMD_REGION_NEWDocumentation/networking/devlink/devlink-region.rst include/net/devlink.h net/core/devlink.c+113 -00 replies
10/11netdevsim: support taking immediate snapshot via devlinkdrivers/net/netdevsim/dev.c tools/testing/selftests/drivers/net/netdevsim/devlink.sh+32 -61 reply
11/11ice: add a devlink region for dumping NVM contentsDocumentation/networking/devlink/ice.rst drivers/net/ethernet/intel/ice/ice.h drivers/net/ethernet/intel/ice/ice_devlink.c +2 more+131 -05 replies

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by.

PatchJakub KicinskiJiri Pirko
1/11R-b R-b
2/11Noticed-by R-b
3/11R-b
4/11R-b R-b
5/11R-b
6/11R-b
7/11R-b
8/11R-b
9/11R-b
10/11R-b
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 00/11] implement DEVLINK_CMD_REGION_NEW

This series adds support for the DEVLINK_CMD_REGION_NEW operation, used to enable userspace requesting a snapshot of a region on demand.

This can be useful to enable adding regions for a driver for which there is no trigger to create snapshots. By making this a core part of devlink, there is no need for the drivers to use a separate channel such as debugfs.

The primary intent for this kind of region is to expose device information that might be useful for diagnostics and information gathering.

The first few patches refactor regions to support a new ops structure for extending the available operations that regions can perform. This includes converting the destructor into an op from a function argument.

Next, patches refactor the snapshot id allocation to use an xarray which tracks the number of current snapshots using a given id. This is done so that id lifetime can be determined, and ids can be released when no longer in use.

Without this change, snapshot ids remain used forever, until the snapshot_id count rolled over UINT_MAX.

Finally, code to enable the previously unused DEVLINK_CMD_REGION_NEW is added. This code enforces that the snapshot id is always provided, unlike previous revisions of this series.

Finally, a patch is added to enable using this new command via the .snapshot callback in both netdevsim and the ice driver.

For the ice driver, a new "nvm-flash" region is added, which will enable read access to the NVM flash contents. The intention for this is to allow diagnostics tools to gather information about the device. By using a snapshot and gathering the NVM contents all at once, the contents can be atomic.

Links to previous discussions:
1st RFC - https://lore.kernel.org/netdev/[email protected]/
2nd RFC - https://lore.kernel.org/netdev/[email protected]/
v1 - https://lore.kernel.org/netdev/[email protected]/
v2 - https://lore.kernel.org/netdev/[email protected]/

Major changes since RFC:
* use an xarray for tracking snapshot ids, rather than an IDR
* remove support for auto-generated snapshot ids in DEVLINK_CMD_REGION_NEW

See each patch for an individual changelog per-patch

Jacob Keller (11):
devlink: prepare to support region operations
devlink: convert snapshot destructor callback to region op
devlink: trivial: fix tab in function documentation
devlink: add function to take snapshot while locked
devlink: use -ENOSPC to indicate no more room for snapshots
devlink: extract snapshot id allocation to helper function
devlink: report error once U32_MAX snapshot ids have been used
devlink: track snapshot id usage count using an xarray
devlink: implement DEVLINK_CMD_REGION_NEW
netdevsim: support taking immediate snapshot via devlink
ice: add a devlink region for dumping NVM contents

 .../networking/devlink/devlink-region.rst     |   8 +
 Documentation/networking/devlink/ice.rst      |  26 ++
 drivers/net/ethernet/intel/ice/ice.h          |   2 +
 drivers/net/ethernet/intel/ice/ice_devlink.c  |  96 +++++
 drivers/net/ethernet/intel/ice/ice_devlink.h  |   3 +
 drivers/net/ethernet/intel/ice/ice_main.c     |   4 +
 drivers/net/ethernet/mellanox/mlx4/crdump.c   |  36 +-
 drivers/net/netdevsim/dev.c                   |  45 ++-
 include/net/devlink.h                         |  33 +-
 net/core/devlink.c                            | 362 +++++++++++++++---
 .../drivers/net/netdevsim/devlink.sh          |  10 +
 11 files changed, 546 insertions(+), 79 deletions(-)
Signature · 1 line
2.24.1