~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/networking/devlink/devlink-resource.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GPL-2.0
  2 
  3 ================
  4 Devlink Resource
  5 ================
  6 
  7 ``devlink`` provides the ability for drivers to register resources, which
  8 can allow administrators to see the device restrictions for a given
  9 resource, as well as how much of the given resource is currently
 10 in use. Additionally, these resources can optionally have configurable size.
 11 This could enable the administrator to limit the number of resources that
 12 are used.
 13 
 14 For example, the ``netdevsim`` driver enables ``/IPv4/fib`` and
 15 ``/IPv4/fib-rules`` as resources to limit the number of IPv4 FIB entries and
 16 rules for a given device.
 17 
 18 Resource Ids
 19 ============
 20 
 21 Each resource is represented by an id, and contains information about its
 22 current size and related sub resources. To access a sub resource, you
 23 specify the path of the resource. For example ``/IPv4/fib`` is the id for
 24 the ``fib`` sub-resource under the ``IPv4`` resource.
 25 
 26 Generic Resources
 27 =================
 28 
 29 Generic resources are used to describe resources that can be shared by multiple
 30 device drivers and their description must be added to the following table:
 31 
 32 .. list-table:: List of Generic Resources
 33    :widths: 10 90
 34 
 35    * - Name
 36      - Description
 37    * - ``physical_ports``
 38      - A limited capacity of physical ports that the switch ASIC can support
 39 
 40 example usage
 41 -------------
 42 
 43 The resources exposed by the driver can be observed, for example:
 44 
 45 .. code:: shell
 46 
 47     $devlink resource show pci/0000:03:00.0
 48     pci/0000:03:00.0:
 49       name kvd size 245760 unit entry
 50         resources:
 51           name linear size 98304 occ 0 unit entry size_min 0 size_max 147456 size_gran 128
 52           name hash_double size 60416 unit entry size_min 32768 size_max 180224 size_gran 128
 53           name hash_single size 87040 unit entry size_min 65536 size_max 212992 size_gran 128
 54 
 55 Some resource's size can be changed. Examples:
 56 
 57 .. code:: shell
 58 
 59     $devlink resource set pci/0000:03:00.0 path /kvd/hash_single size 73088
 60     $devlink resource set pci/0000:03:00.0 path /kvd/hash_double size 74368
 61 
 62 The changes do not apply immediately, this can be validated by the 'size_new'
 63 attribute, which represents the pending change in size. For example:
 64 
 65 .. code:: shell
 66 
 67     $devlink resource show pci/0000:03:00.0
 68     pci/0000:03:00.0:
 69       name kvd size 245760 unit entry size_valid false
 70       resources:
 71         name linear size 98304 size_new 147456 occ 0 unit entry size_min 0 size_max 147456 size_gran 128
 72         name hash_double size 60416 unit entry size_min 32768 size_max 180224 size_gran 128
 73         name hash_single size 87040 unit entry size_min 65536 size_max 212992 size_gran 128
 74 
 75 Note that changes in resource size may require a device reload to properly
 76 take effect.

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php