From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com, jingjing.wu@intel.com,
john.mcnamara@intel.com
Subject: [dpdk-dev] [PATCH 3/3] doc: add description of traffic metering and policing funcs in testpmd
Date: Mon, 20 Nov 2017 16:39:20 +0000 [thread overview]
Message-ID: <20171120163920.70660-3-jasvinder.singh@intel.com> (raw)
In-Reply-To: <20171120163920.70660-1-jasvinder.singh@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 173 ++++++++++++++++++++++++++++
1 file changed, 173 insertions(+)
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 9789139..a8b7913 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2068,6 +2068,179 @@ For example, to set the high bit in the register from the example above::
testpmd> write regbit 0 0xEE00 31 1
port 0 PCI register at offset 0xEE00: 0x8000000A (2147483658)
+Traffic Metering and Policing
+-----------------------------
+
+The following section shows functions for configuring traffic metering and
+policing on the ethernet device through the use of generic ethdev API.
+
+show port traffic management capability
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Show traffic metering and policing capability of the port::
+
+ testpmd> show port meter cap (port_id)
+
+add port meter profile (srTCM rfc2967)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add meter profile (srTCM rfc2697) to the ethernet device::
+
+ testpmd> add port meter profile srtcm_rfc2697 (port_id) (profile_id) \
+ (cir) (cbs) (ebs)
+
+where:
+
+* ``profile_id``: ID for the meter profile.
+* ``cir``: Committed Information Rate (CIR) (bytes/second).
+* ``cbs``: Committed Burst Size (CBS) (bytes).
+* ``ebs``: Excess Burst Size (EBS) (bytes).
+
+add port meter profile (trTCM rfc2968)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add meter profile (srTCM rfc2698) to the ethernet device::
+
+ testpmd> add port meter profile trtcm_rfc2698 (port_id) (profile_id) \
+ (cir) (pir) (cbs) (pbs)
+
+where:
+
+* ``profile_id``: ID for the meter profile.
+* ``cir``: Committed information rate (bytes/second).
+* ``pir``: Peak information rate (bytes/second).
+* ``cbs``: Committed burst size (bytes).
+* ``pbs``: Peak burst size (bytes).
+
+add port meter profile (trTCM rfc4115)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add meter profile (trTCM rfc4115) to the ethernet device::
+
+ testpmd> add port meter profile trtcm_rfc4115 (port_id) (profile_id) \
+ (cir) (eir) (cbs) (ebs)
+
+where:
+
+* ``profile_id``: ID for the meter profile.
+* ``cir``: Committed information rate (bytes/second).
+* ``eir``: Excess information rate (bytes/second).
+* ``cbs``: Committed burst size (bytes).
+* ``ebs``: Excess burst size (bytes).
+
+delete port meter profile
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Delete meter profile from the ethernet device::
+
+ testpmd> del port meter profile (port_id) (profile_id)
+
+create port meter
+~~~~~~~~~~~~~~~~~
+
+Create new meter object for the ethernet device::
+
+ testpmd> create port meter (port_id) (mtr_id) (profile_id) \
+ (meter_enable) (g_action) (y_action) (r_action) (stats_mask) (shared) \
+ (use_pre_meter_color) [(dscp_tbl_entry0) (dscp_tbl_entry1)...\
+ (dscp_tbl_entry63)]
+
+where:
+
+* ``mtr_id``: meter object ID.
+* ``profile_id``: ID for the meter profile.
+* ``meter_enable``: When this parameter has a non-zero value, the meter object
+ gets enabled at the time of creation, otherwise remains disabled.
+* ``g_action``: Policer action for the packet with green color.
+* ``y_action``: Policer action for the packet with yellow color.
+* ``r_action``: Policer action for the packet with red color.
+* ``stats_mask``: Mask of statistics counter types to be enabled for the
+ meter object.
+* ``shared``: When this parameter has a non-zero value, the meter object is
+ shared by multiple flows. Otherwise, meter object is used by single flow.
+* ``use_pre_meter_color``: When this parameter has a non-zero value, the
+ input color for the current meter object is determined by the latest meter
+ object in the same flow. Otherwise, the current meter object uses the
+ *dscp_table* to determine the input color.
+* ``dscp_tbl_entryx``: DSCP table entry x providing meter providing input
+ color, 0 <= x <= 63.
+
+enable port meter
+~~~~~~~~~~~~~~~~~
+
+Enable meter for the ethernet device::
+
+ testpmd> enable port meter (port_id) (mtr_id)
+
+disable port meter
+~~~~~~~~~~~~~~~~~~
+
+Disable meter for the ethernet device::
+
+ testpmd> disable port meter (port_id) (mtr_id)
+
+delete port meter
+~~~~~~~~~~~~~~~~~
+
+Delete meter for the ethernet device::
+
+ testpmd> del port meter (port_id) (mtr_id)
+
+Set port meter profile
+~~~~~~~~~~~~~~~~~~~~~~
+
+Set meter profile for the ethernet device::
+
+ testpmd> set port meter profile (port_id) (mtr_id) (profile_id)
+
+set port meter dscp table
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set meter dscp table for the ethernet device::
+
+ testpmd> set port meter dscp table (port_id) (mtr_id) [(dscp_tbl_entry0) \
+ (dscp_tbl_entry1)...(dscp_tbl_entry63)]
+
+set port meter policer action
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set meter policer action for the ethernet device::
+
+ testpmd> set port meter policer action (port_id) (mtr_id) (action_mask) \
+ (action0) [(action1) (action1)]
+
+where:
+
+* ``action_mask``: Bit mask indicating which policer actions need to be
+ updated. One or more policer actions can be updated in a single function
+ invocation. To update the policer action associated with color C, bit
+ (1 << C) needs to be set in *action_mask* and element at position C
+ in the *actions* array needs to be valid.
+* ``actionx``: Policer action for the color x,
+ RTE_MTR_GREEN <= x < RTE_MTR_COLORS
+
+set port meter stats mask
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set meter stats mask for the ethernet device::
+
+ testpmd> set port meter stats mask (port_id) (mtr_id) (stats_mask)
+
+where:
+
+* ``stats_mask``: Bit mask indicating statistics counter types to be enabled.
+
+show port meter stats
+~~~~~~~~~~~~~~~~~~~~~
+
+Show meter stats of the ethernet device::
+
+ testpmd> show port meter stats (port_id) (mtr_id) (clear)
+
+where:
+
+* ``clear``: Flag that indicates whether the statistics counters should
+ be cleared (i.e. set to zero) immediately after they have been read or not.
Traffic Management
------------------
--
2.9.3
next prev parent reply other threads:[~2017-11-20 16:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 16:39 [dpdk-dev] [PATCH 1/3] app/testpmd: metering and policing CLI clean up Jasvinder Singh
2017-11-20 16:39 ` [dpdk-dev] [PATCH 2/3] app/testpmd: add CLI for metering and policing API Jasvinder Singh
2018-01-07 14:37 ` Wu, Jingjing
2017-11-20 16:39 ` Jasvinder Singh [this message]
2017-12-11 11:18 ` [dpdk-dev] [PATCH 3/3] doc: add description of traffic metering and policing funcs in testpmd Marko Kovacevic
2017-12-11 11:22 ` Mcnamara, John
2017-12-11 11:31 ` Mcnamara, John
2018-01-07 14:25 ` [dpdk-dev] [PATCH 1/3] app/testpmd: metering and policing CLI clean up Wu, Jingjing
2018-01-08 10:25 ` Singh, Jasvinder
2018-01-09 23:56 ` Thomas Monjalon
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=20171120163920.70660-3-jasvinder.singh@intel.com \
--to=jasvinder.singh@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=john.mcnamara@intel.com \
/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).