netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 00/11] implement DEVLINK_CMD_REGION_NEW
@ 2020-03-26 18:37 Jacob Keller
  2020-03-26 18:37 ` [PATCH net-next v3 01/11] devlink: prepare to support region operations Jacob Keller
                   ` (12 more replies)
  0 siblings, 13 replies; 27+ messages in thread
From: Jacob Keller @ 2020-03-26 18:37 UTC (permalink / raw)
  To: netdev; +Cc: Jakub Kicinski, Jiri Pirko, Jacob Keller

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/20200130225913.1671982-1-jacob.e.keller@intel.com/
2nd RFC - https://lore.kernel.org/netdev/20200214232223.3442651-1-jacob.e.keller@intel.com/
v1 - https://lore.kernel.org/netdev/20200324223445.2077900-1-jacob.e.keller@intel.com/
v2 - https://lore.kernel.org/netdev/20200326035157.2211090-1-jacob.e.keller@intel.com/

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(-)

-- 
2.24.1


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

end of thread, other threads:[~2020-04-28  2:03 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 18:37 [PATCH net-next v3 00/11] implement DEVLINK_CMD_REGION_NEW Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 01/11] devlink: prepare to support region operations Jacob Keller
2020-03-27  8:16   ` tanhuazhong
2020-03-27 19:59     ` Jacob Keller
2020-03-27 20:58     ` Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 02/11] devlink: convert snapshot destructor callback to region op Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 03/11] devlink: trivial: fix tab in function documentation Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 04/11] devlink: add function to take snapshot while locked Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 05/11] devlink: use -ENOSPC to indicate no more room for snapshots Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 06/11] devlink: extract snapshot id allocation to helper function Jacob Keller
2020-03-26 21:15   ` Jiri Pirko
2020-03-26 21:37     ` Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 07/11] devlink: report error once U32_MAX snapshot ids have been used Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 08/11] devlink: track snapshot id usage count using an xarray Jacob Keller
2020-03-26 21:16   ` Jiri Pirko
2020-03-26 18:37 ` [PATCH net-next v3 09/11] devlink: implement DEVLINK_CMD_REGION_NEW Jacob Keller
2020-03-26 18:37 ` [PATCH net-next v3 10/11] netdevsim: support taking immediate snapshot via devlink Jacob Keller
2020-03-26 21:18   ` Jiri Pirko
2020-03-26 18:37 ` [PATCH net-next v3 11/11] ice: add a devlink region for dumping NVM contents Jacob Keller
2020-03-26 21:19   ` Jiri Pirko
2020-03-26 21:38     ` Jacob Keller
2020-03-26 22:35     ` Jacob Keller
2020-03-27  2:37       ` David Miller
2020-03-27 19:56         ` Jacob Keller
2020-03-27  2:39 ` [PATCH net-next v3 00/11] implement DEVLINK_CMD_REGION_NEW David Miller
2020-04-28  0:26 ` Jakub Kicinski
2020-04-28  2:03   ` Keller, Jacob E

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