From patchwork Mon Nov 20 16:39:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jasvinder Singh X-Patchwork-Id: 31488 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A5F187D30; Mon, 20 Nov 2017 17:26:41 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 688ED3255 for ; Mon, 20 Nov 2017 17:26:37 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2017 08:26:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,428,1505804400"; d="scan'208";a="4965353" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.222.149]) by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2017 08:26:35 -0800 From: Jasvinder Singh To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, jingjing.wu@intel.com, john.mcnamara@intel.com Date: Mon, 20 Nov 2017 16:39:20 +0000 Message-Id: <20171120163920.70660-3-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171120163920.70660-1-jasvinder.singh@intel.com> References: <20171120163920.70660-1-jasvinder.singh@intel.com> Subject: [dpdk-dev] [PATCH 3/3] doc: add description of traffic metering and policing funcs in testpmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Jasvinder Singh Acked-by: John McNamara --- 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 ------------------