From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 587FAA09E4; Thu, 28 Jan 2021 19:28:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCA5240682; Thu, 28 Jan 2021 19:28:02 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 054874067A for ; Thu, 28 Jan 2021 19:28:01 +0100 (CET) IronPort-SDR: JN9gatEdv6uOoRHSxSO7omSEu2QnkETxEeMd79bpexFSAK/suDMtdp512hPII38kDUlCK7xXmH Ow8HgBs0f1eQ== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="177725080" X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="177725080" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 10:28:00 -0800 IronPort-SDR: hfH+Foj3ZIc7MFP0ZPaAxPkpci8seILt0JWeTy8bTZoZgGatziX0JJaCJrHLSBhfUAExTJgIqx 37BUlMkxXF+Q== X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="388940327" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.197.127]) ([10.213.197.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 10:27:58 -0800 To: Li Zhang , dekelp@nvidia.com, orika@nvidia.com, viacheslavo@nvidia.com, matan@nvidia.com, "Dumitrescu, Cristian" Cc: dev@dpdk.org, thomas@monjalon.net, rasland@nvidia.com References: <20210125010235.1768333-2-lizh@nvidia.com> <20210125012023.1769769-1-lizh@nvidia.com> <20210125012023.1769769-2-lizh@nvidia.com> From: Ferruh Yigit Message-ID: <8eb6bf7a-f317-68e0-2cdc-e0b7d675a8f1@intel.com> Date: Thu, 28 Jan 2021 18:27:54 +0000 MIME-Version: 1.0 In-Reply-To: <20210125012023.1769769-2-lizh@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 1/25/2021 1:20 AM, Li Zhang wrote: > Currently the flow Meter algorithms in rte_flow > only supports bytes per second(BPS). > Such as Single Rate Three Color Marker (srTCM rfc2697) > This RFC adds the packet per second definition in > Meter algorithms structure, > to support the rte_mtr APIs with type srTCM pps mode. > The below structure will be extended: > rte_mtr_algorithm > rte_mtr_meter_profile > Signed-off-by: Li Zhang cc'ed Cristian for review/comment. > --- > lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h > index 916a09c5c3..3e88904faf 100644 > --- a/lib/librte_ethdev/rte_mtr.h > +++ b/lib/librte_ethdev/rte_mtr.h > @@ -119,6 +119,9 @@ enum rte_mtr_algorithm { > > /** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */ > RTE_MTR_TRTCM_RFC4115, > + > + /** Single Rate Three Color Marker (srTCM) in Packet per second mode */ > + RTE_MTR_SRTCM_PPS, > }; > > /** > @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile { > /** Excess Burst Size (EBS) (bytes). */ > uint64_t ebs; > } trtcm_rfc4115; > + > + /** Items only valid when *alg* is set to srTCM - PPS. */ > + struct { > + /** Committed Information Rate (CIR)(packets/second). */ > + uint64_t cir; > + > + /** Committed Burst Size (CBS) (bytes). */ > + uint64_t cbs; > + > + /** Excess Burst Size (EBS) (bytes). */ > + uint64_t ebs; > + } srtcm_pps; > }; > }; > > @@ -317,6 +332,13 @@ struct rte_mtr_capabilities { > */ > uint32_t meter_trtcm_rfc4115_n_max; > > + /** Maximum number of MTR objects that can have their meter configured > + * to run the srTCM packet per second algorithm. The value of 0 > + * indicates this metering algorithm is not supported. > + * The maximum value is *n_max*. > + */ > + uint32_t meter_srtcm_pps_n_max; > + > /** Maximum traffic rate that can be metered by a single MTR object. For > * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC 2698, > * this is the maximum PIR rate. For trTCM RFC 4115, this is the maximum > @@ -342,6 +364,12 @@ struct rte_mtr_capabilities { > */ > int color_aware_trtcm_rfc4115_supported; > > + /** > + * When non-zero, it indicates that color aware mode is supported for > + * the srTCM packet per second metering algorithm. > + */ > + int color_aware_srtcm_pps_supported; > + > /** When non-zero, it indicates that the policer packet recolor actions > * are supported. > * @see enum rte_mtr_policer_action >