@@ -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
=====================
@@ -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.
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(-)