diff mbox series

[net-next,5/5] Documentation: devlink rate objects limit_type

Message ID 20220620152647.2498927-6-dchumak@nvidia.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series devlink rate police limiter | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: linux-doc@vger.kernel.org corbet@lwn.net
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 70 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dima Chumak June 20, 2022, 3:26 p.m. UTC
Add devlink rate limit_type attribute information in devlink port
documentation.
Add devlink rate 'limit_type police' attributes in netdevsim devlink
documentation.

Signed-off-by: Dima Chumak <dchumak@nvidia.com>
---
 .../networking/devlink/devlink-port.rst       | 44 +++++++++++++++++--
 .../networking/devlink/netdevsim.rst          |  3 +-
 2 files changed, 43 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/networking/devlink/devlink-port.rst b/Documentation/networking/devlink/devlink-port.rst
index 7627b1da01f2..c2cd97a4ec4f 100644
--- a/Documentation/networking/devlink/devlink-port.rst
+++ b/Documentation/networking/devlink/devlink-port.rst
@@ -184,20 +184,58 @@  This is done through rate objects, which can be one of the two types:
 
 API allows to configure following rate object's parameters:
 
+``limit_type``
+  Type of rate limiting performed by a rate object. Supported types are
+  ``shaping`` and ``police``. Shaping type is a form of back pressure mechanism
+  that can delay traffic until there is a capacity, available at the lower
+  level, to process it. Police type is a simple packet counting and immediate
+  dropping of those packets that exceed the threshold. Some of the parameters
+  may be specific only to one of the limit types.
+
 ``tx_share``
   Minimum TX rate value shared among all other rate objects, or rate objects
-  that parts of the parent group, if it is a part of the same group.
+  that parts of the parent group, if it is a part of the same group. Specific to
+  ``shaping`` limit type.
 
 ``tx_max``
   Maximum TX rate value.
 
+``tx_burst``
+  Size of a bucket that's used to buffer spikes when traffic exceeds ``tx_max``
+  limit. Specific to ``police`` limit type.
+
+``rx_max``
+  Maximum RX rate value.
+
+``rx_burst``
+  Size of a bucket that's used to buffer spikes when traffic exceeds ``rx_max``
+  limit. Specific to ``police`` limit type.
+
+``tx_pkts``
+  Maximum TX rate in packets per second.
+
+``tx_pkts_burst``
+  Size of a bucket that's used to buffer spikes when traffic exceeds ``tx_pkts``
+  limit. Specific to ``police`` limit type.
+
+``rx_pkts``
+  Maximum RX rate in packets per second.
+
+``rx_pkts_burst``
+  Size of a bucket that's used to buffer spikes when traffic exceeds ``rx_pkts``
+  limit. Specific to ``police`` limit type.
+
 ``parent``
   Parent node name. Parent node rate limits are considered as additional limits
   to all node children limits. ``tx_max`` is an upper limit for children.
-  ``tx_share`` is a total bandwidth distributed among children.
+  ``tx_share`` is a total bandwidth distributed among children. It's important
+  that ``limit_type`` of a child object and the parent node should match. In
+  other words, it's only possible to group rate objects of the same
+  ``limit_type``.
 
 Driver implementations are allowed to support both or either rate object types
-and setting methods of their parameters.
+and setting methods of their parameters. The same holds for limit types, a
+driver implementation may support all or only some of them.
 
 Terms and Definitions
 =====================
diff --git a/Documentation/networking/devlink/netdevsim.rst b/Documentation/networking/devlink/netdevsim.rst
index 8a292fb5aaea..32d3171ff281 100644
--- a/Documentation/networking/devlink/netdevsim.rst
+++ b/Documentation/networking/devlink/netdevsim.rst
@@ -64,7 +64,8 @@  The ``netdevsim`` driver supports rate objects management, which includes:
 
 - registerging/unregistering leaf rate objects per VF devlink port;
 - creation/deletion node rate objects;
-- setting tx_share and tx_max rate values for any rate object type;
+- setting limit_type, tx_share, tx_max, tx_burst, rx_max, rx_burst, tx_pkts,
+  tx_pkts_burst, rx_pkts and rx_pkts_burst rate values for any rate object type;
 - setting parent node for any rate object type.
 
 Rate nodes and it's parameters are exposed in ``netdevsim`` debugfs in RO mode.