]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: report maximum number of snapshots with regions
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 30 Sep 2021 21:21:04 +0000 (14:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Oct 2021 13:28:55 +0000 (14:28 +0100)
commit58d94632df9b1ab4038385e93b91c3de796db18d
treeb117aa9eba12a5fb70559e1562288020564e89f5
parent7cf5b1a7deb0b47e362cfbb6002342bc6e91fe2e
devlink: report maximum number of snapshots with regions

Each region has an independently configurable number of maximum
snapshots. This information is not reported to userspace, making it not
very discoverable. Fix this by adding a new
DEVLINK_ATTR_REGION_MAX_SNAPSHOST attribute which is used to report this
maximum.

Ex:

  $devlink region
  pci/0000:af:00.0/nvm-flash: size 10485760 snapshot [] max 1
  pci/0000:af:00.0/device-caps: size 4096 snapshot [] max 10
  pci/0000:af:00.1/nvm-flash: size 10485760 snapshot [] max 1
  pci/0000:af:00.1/device-caps: size 4096 snapshot [] max 10

This information enables users to understand why a new region command
may fail due to having too many existing snapshots.

Reported-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/devlink/devlink-region.rst
Documentation/networking/devlink/ice.rst
include/uapi/linux/devlink.h
net/core/devlink.c