DPDK patches and discussions
 help / color / mirror / Atom feed
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, adrien.mazarguil@6wind.com,
	jingjing.wu@intel.com, john.mcnamara@intel.com,
	hemant.agrawal@nxp.com, jerin.jacob@caviumnetworks.com,
	jasvinder.singh@intel.com
Subject: [dpdk-dev] [PATCH V4 4/5] doc: ethdev traffic metering and policing api
Date: Fri, 13 Oct 2017 13:22:17 +0100	[thread overview]
Message-ID: <1507897338-236951-5-git-send-email-cristian.dumitrescu@intel.com> (raw)
In-Reply-To: <1507897338-236951-1-git-send-email-cristian.dumitrescu@intel.com>

Add new section in the Programmer Guide for the ethdev traffic metering
and policing (MTR) API.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
Changes in v4:
-Improvements from John McNamara on RST formatting

 doc/guides/prog_guide/index.rst                    |   1 +
 .../prog_guide/traffic_metering_and_policing.rst   | 102 +++++++++++++++++++++
 2 files changed, 103 insertions(+)
 create mode 100644 doc/guides/prog_guide/traffic_metering_and_policing.rst

diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index b5ad6b8..fbd2a72 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -44,6 +44,7 @@ Programmer's Guide
     mbuf_lib
     poll_mode_drv
     rte_flow
+    traffic_metering_and_policing
     traffic_management
     cryptodev_lib
     link_bonding_poll_mode_drv_lib
diff --git a/doc/guides/prog_guide/traffic_metering_and_policing.rst b/doc/guides/prog_guide/traffic_metering_and_policing.rst
new file mode 100644
index 0000000..89f0e68
--- /dev/null
+++ b/doc/guides/prog_guide/traffic_metering_and_policing.rst
@@ -0,0 +1,102 @@
+..  BSD LICENSE
+    Copyright(c) 2017 Intel Corporation. All rights reserved.
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+    * Neither the name of Intel Corporation nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Traffic Metering and Policing API
+=================================
+
+
+Overview
+--------
+
+This is the generic API for the Quality of Service (QoS) Traffic Metering and
+Policing (MTR) of Ethernet devices. This API is agnostic of the underlying HW,
+SW or mixed HW-SW implementation.
+
+The main features are:
+
+* Part of DPDK rte_ethdev API
+* Capability query API
+* Metering algorithms: RFC 2697 Single Rate Three Color Marker (srTCM), RFC 2698
+  and RFC 4115 Two Rate Three Color Marker (trTCM)
+* Policer actions (per meter output color): recolor, drop
+* Statistics (per policer output color)
+
+Configuration steps
+-------------------
+
+The metering and policing stage typically sits on top of flow classification,
+which is why the MTR objects are enabled through a special "meter" action.
+
+The MTR objects are created and updated in their own name space (``rte_mtr``)
+within the ``librte_ether`` library. Whether an MTR object is private to a
+flow or potentially shared by several flows has to be specified at its
+creation time.
+
+Once successfully created, an MTR object is hooked into the RX processing path
+of the Ethernet device by linking it to one or several flows through the
+dedicated "meter" flow action. One or several "meter" actions can be registered
+for the same flow. An MTR object can only be destroyed if there are no flows
+using it.
+
+Run-time processing
+-------------------
+
+Traffic metering determines the color for the current packet (green, yellow,
+red) based on the previous history for this flow as maintained by the MTR
+object. The policer can do nothing, override the color the packet or drop the
+packet. Statistics counters are maintained for MTR object, as configured.
+
+The processing done for each input packet hitting an MTR object is:
+
+* Traffic metering: The packet is assigned a color (the meter output color)
+  based on the previous traffic history reflected in the current state of the
+  MTR object, according to the specific traffic metering algorithm. The
+  traffic metering algorithm can typically work in color aware mode, in which
+  case the input packet already has an initial color (the input color), or in
+  color blind mode, which is equivalent to considering all input packets
+  initially colored as green.
+
+* Policing: There is a separate policer action configured for each meter
+  output color, which can:
+
+  * Drop the packet.
+
+  * Keep the same packet color: the policer output color matches the meter
+    output color (essentially a no-op action).
+
+  * Recolor the packet: the policer output color is set to a different color
+    than the meter output color. The policer output color is the output color
+    of the packet, which is set in the packet meta-data (i.e. struct
+    ``rte_mbuf::sched::color``).
+
+* Statistics: The set of counters maintained for each MTR object is
+  configurable and subject to the implementation support. This set includes
+  the number of packets and bytes dropped or passed for each output color.
-- 
2.7.4

  parent reply	other threads:[~2017-10-13 12:22 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 16:44 [dpdk-dev] [RFC 0/3] rte_mtr: generic ethdev API for metering and policing Cristian Dumitrescu
2017-05-30 16:44 ` [dpdk-dev] [RFC 1/3] ethdev: add traffic metering and policing ops get API Cristian Dumitrescu
2017-05-30 16:44 ` [dpdk-dev] [RFC 2/3] ethdev: add new rte_mtr API for traffic metering and policing Cristian Dumitrescu
2017-08-26  0:06   ` [dpdk-dev] [PATCH 0/3] rte_mtr: generic ethdev API for " Cristian Dumitrescu
2017-08-26  0:06     ` [dpdk-dev] [PATCH 1/3] ethdev: add new eth_dev_ops function for mtr ops get Cristian Dumitrescu
2017-09-13  5:50       ` Jerin Jacob
2017-09-19 15:52         ` Dumitrescu, Cristian
2017-10-05 13:09       ` [dpdk-dev] [PATCH V2 0/5] rte_mtr: generic ethdev api for metering and policing Cristian Dumitrescu
2017-10-05 13:09         ` [dpdk-dev] [PATCH V2 1/5] ethdev: add new flow action " Cristian Dumitrescu
2017-10-06 13:57           ` Adrien Mazarguil
2017-10-06 14:50             ` Dumitrescu, Cristian
2017-10-06 14:45           ` [dpdk-dev] [PATCH V3 0/5] rte_mtr: generic ethdev api " Cristian Dumitrescu
2017-10-06 14:45             ` [dpdk-dev] [PATCH V3 1/5] ethdev: add new flow action " Cristian Dumitrescu
2017-10-06 14:55               ` Adrien Mazarguil
2017-10-13 12:22               ` [dpdk-dev] [PATCH V4 0/5] rte_mtr: generic ethdev api " Cristian Dumitrescu
2017-10-13 12:22                 ` [dpdk-dev] [PATCH V4 1/5] ethdev: add new flow action " Cristian Dumitrescu
2017-10-18  2:55                   ` Jerin Jacob
2017-10-13 12:22                 ` [dpdk-dev] [PATCH V4 2/5] ethdev: add new eth_dev_ops function for mtr ops get Cristian Dumitrescu
2017-10-17 12:40                   ` Hemant Agrawal
2017-10-13 12:22                 ` [dpdk-dev] [PATCH V4 3/5] ethdev: add new api for traffic metering and policing Cristian Dumitrescu
2017-10-17 12:39                   ` Hemant Agrawal
2017-10-18  2:58                   ` Jerin Jacob
2017-10-13 12:22                 ` Cristian Dumitrescu [this message]
2017-10-13 15:43                   ` [dpdk-dev] [PATCH V4 4/5] doc: ethdev traffic metering and policing api Mcnamara, John
2017-10-13 12:22                 ` [dpdk-dev] [PATCH V4 5/5] app/testpmd: cli for traffic metering and policing Cristian Dumitrescu
2017-10-16  9:49                   ` Wu, Jingjing
2017-10-16 10:10                     ` Wu, Jingjing
2017-10-20 12:15                 ` [dpdk-dev] [PATCH V4 0/5] rte_mtr: generic ethdev api for " Dumitrescu, Cristian
2017-10-06 14:45             ` [dpdk-dev] [PATCH V3 2/5] ethdev: add new eth_dev_ops function for mtr ops get Cristian Dumitrescu
2017-10-12 10:58               ` Hemant Agrawal
2017-10-06 14:45             ` [dpdk-dev] [PATCH V3 3/5] ethdev: add new api for traffic metering and policing Cristian Dumitrescu
2017-10-12 10:48               ` Hemant Agrawal
2017-10-12 10:54                 ` Hemant Agrawal
2017-10-13 12:29                 ` Dumitrescu, Cristian
2017-10-06 14:45             ` [dpdk-dev] [PATCH V3 4/5] doc: ethdev traffic metering and policing api Cristian Dumitrescu
2017-10-12 14:59               ` Mcnamara, John
2017-10-13 12:26                 ` Dumitrescu, Cristian
2017-10-12 15:01               ` Mcnamara, John
2017-10-06 14:45             ` [dpdk-dev] [PATCH V3 5/5] app/testpmd: cli for traffic metering and policing Cristian Dumitrescu
2017-10-13  6:32               ` Wu, Jingjing
2017-10-13 12:30                 ` Dumitrescu, Cristian
2017-10-05 13:09         ` [dpdk-dev] [PATCH V2 2/5] ethdev: add new eth_dev_ops function for mtr ops get Cristian Dumitrescu
2017-10-05 13:09         ` [dpdk-dev] [PATCH V2 3/5] ethdev: add new api for traffic metering and policing Cristian Dumitrescu
2017-10-05 13:09         ` [dpdk-dev] [PATCH V2 4/5] doc: ethdev traffic metering and policing api Cristian Dumitrescu
2017-10-05 13:09         ` [dpdk-dev] [PATCH V2 5/5] app/testpmd: cli for traffic metering and policing Cristian Dumitrescu
2017-10-06 13:58           ` Adrien Mazarguil
2017-08-26  0:06     ` [dpdk-dev] [PATCH 2/3] ethdev: add new rte_mtr API " Cristian Dumitrescu
2017-09-01  8:09       ` Hemant Agrawal
2017-09-04 14:32         ` Dumitrescu, Cristian
2017-09-06  9:15           ` Hemant Agrawal
2017-09-19 16:14             ` Dumitrescu, Cristian
2017-09-21 13:20       ` Thomas Monjalon
2017-10-06 10:03         ` Dumitrescu, Cristian
2017-08-26  0:06     ` [dpdk-dev] [PATCH 3/3] rte_flow: add new action " Cristian Dumitrescu
2017-09-06 16:23       ` Adrien Mazarguil
2017-09-19 16:36         ` Dumitrescu, Cristian
2017-09-19 17:00           ` Adrien Mazarguil
2017-10-06 10:02             ` Dumitrescu, Cristian
2017-09-21 13:28     ` [dpdk-dev] [PATCH 0/3] rte_mtr: generic ethdev API for " Thomas Monjalon
2017-05-30 16:44 ` [dpdk-dev] [RFC 3/3] rte_flow: add new action for traffic " Cristian Dumitrescu
2017-06-01 15:13   ` Adrien Mazarguil
2017-06-06 18:37     ` Dumitrescu, Cristian
2017-07-10 15:21       ` Adrien Mazarguil
2017-07-12 18:06         ` Dumitrescu, Cristian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507897338-236951-5-git-send-email-cristian.dumitrescu@intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jasvinder.singh@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=jingjing.wu@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).