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 A9615A054F; Mon, 1 Mar 2021 14:20:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F11C22A27C; Mon, 1 Mar 2021 14:20:15 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 546A240041 for ; Mon, 1 Mar 2021 14:20:13 +0100 (CET) IronPort-SDR: Z307CRrm1OLFpogifadG7jtaIh3ar1DOWVedfiUjlK/Lpb3t1VpehQ12FJ883BheXw5s5zWNxT Bm04TKeXnEVA== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="173589379" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="173589379" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 05:20:12 -0800 IronPort-SDR: 4LOkMUmaoJHup9bI3hhHzDS0BsxW53ZF8lmwEI+NgC7XnYY4uo4jKtF2jnlL++UAJAwPF9q2vc PcZF1hM7V3AA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="383053747" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga002.jf.intel.com with ESMTP; 01 Mar 2021 05:20:11 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Mar 2021 05:20:11 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Mon, 1 Mar 2021 05:20:11 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Mon, 1 Mar 2021 05:20:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g7YZsQ772yaV4NrcUAk1w9GYPbwlBQsSJiM9m5+fdDImaWRNIl64yuxxQeu3KDCVlMWvLaKTnjyFXA0INrvkQiLC5Shp+CYpYniSGtdUNwmjqXQx3rtsmCpYYCELvF2NqkSf59E4NMBA79bfHThhHOs9SpfEieM3Nop4Ffb4vi1WvYnMXQhofXjlCFrfM/y+ppNWQFF+phCLUv9sI04853YqnWKrAN/NSaX6hkSGPYXRLy5Wtvh+wVNbTfJf/xn3vxELk+PgiiaO6oddG0fmgao5W2e/aDvlNPYFFlYid4Z0XRjctjuNELo3GsqLko3Swmhb2V77MVk7rzkfVSD1Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8dvYTPUbwASwxYPsM0CH6HJOJORPUsB+CnGJUYIfeF8=; b=gzJHiQZ4bmu2Z0yPjvFmNqHw4tgqBBq+/O+zJVYOC7vqyAdjqG+/2Rt2cpgRNAWiVilh/HEVGaO3gsOc5lfa/XaWPq0owhdL+PhFbKiVm1Iyr36ihEpLqkxtqkSjb7BtKFq7/w+LhxyHFu2wiVylcy/KSH2owGVgyxJUuMgFr8SntJmnZxINwMFvKpCCuFSyOmQxxFNWk4W7skhptthSsBF+s9PApVBtR3tdQJWeqjMEiUV8M936pzQY7eLgElNAiV71oCog/Ti1M23TO7f+AkgLu1fqnkU7z+3wacPBxMdgbS59ox76h7ykYF9rnIlUwiygARDFyi2pV8/LNqoJBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8dvYTPUbwASwxYPsM0CH6HJOJORPUsB+CnGJUYIfeF8=; b=sp+suN5oBcwtb75S8CmWO8mmhuZe+iPYNLfXH0QWn+0gXxXDmlW54h7N4yIJbEUcvWhDzVtU9Zt3gqTQk6P/Ki8zvudaARWsj5Q7ooloesLdwhdLWy0QgwM/G9Cqrv6ypFHXGeCVtaAlz9w8moNoUZldFb0T2d2BBtTM0B6YAIQ= Received: from MWHPR11MB2032.namprd11.prod.outlook.com (2603:10b6:300:2b::13) by MWHPR11MB1373.namprd11.prod.outlook.com (2603:10b6:300:25::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Mon, 1 Mar 2021 13:20:02 +0000 Received: from MWHPR11MB2032.namprd11.prod.outlook.com ([fe80::30c2:967:f635:def2]) by MWHPR11MB2032.namprd11.prod.outlook.com ([fe80::30c2:967:f635:def2%5]) with mapi id 15.20.3890.028; Mon, 1 Mar 2021 13:20:02 +0000 From: "Dumitrescu, Cristian" To: Li Zhang , "dekelp@nvidia.com" , "orika@nvidia.com" , "viacheslavo@nvidia.com" , "matan@nvidia.com" CC: "dev@dpdk.org" , "thomas@monjalon.net" , "rasland@nvidia.com" , "mb@smartsharesystems.com" , "ajit.khaparde@broadcom.com" , "Yigit, Ferruh" , "Singh, Jasvinder" Thread-Topic: [dpdk-dev] [RFC v4 1/4] ethdev: add meter PPS profile Thread-Index: AQHXDoa2zb8ApkK+UkWjVZeNoHieI6pvHMqQ Date: Mon, 1 Mar 2021 13:20:02 +0000 Message-ID: References: <20210125010235.1768333-1-lizh@nvidia.com> <20210301103532.184983-1-lizh@nvidia.com> <20210301103532.184983-2-lizh@nvidia.com> In-Reply-To: <20210301103532.184983-2-lizh@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [109.78.54.76] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b033aff-07a2-49be-ccab-08d8dcb4b8ff x-ms-traffictypediagnostic: MWHPR11MB1373: x-ms-exchange-minimumurldomainage: dpdk.org#2947 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VZxo7GnZMG9b2ZYb8ir1pp4FiN+BhXY2edwxnJhX5th1dkFsg4XS2F/q9pBdB6SfbY4COb26fsMiWYdoDDQmjnKTq3TgzAMWXMhrN87StzWpF4vjXnqxouOunVgPtPyARq+xNOAsJ1czzXa/dDKHlScPmJEzOsACd2uIeTwUcI7wkYmMNgBHXS5Wvuv8xbCBsrtfvhd9zKXHvUQFISE8RSbzhcw2XbiQ2ZHzoPwva2CWPOmXF1K2hVm/R+6Q+riTnFyWT4KBfIIvJNQWXDe7ymmuicBW0kkLEuzzNFT1gM5/OFVBEF28108ycmTyxvghCWJNS/K9tPpB//lGoKR73H+Dt0rJAZSBQZATq5efkhaTRGDthSyZbZ7XKABNFSqPGpA1SAnDtDs+X9ffx38rvN0tWWw4CiCnfp1kU5d1AdXbKtPCPtjOvdLR7OMs//XGL9n4/kohnuNZ3c5QJkHfM13rck5aPae/FJ+BwF8yNKPLfTdong4Gd5V1awgDfKiFXjofEunOgSQCDVA0oVesDigTAvvspZ4pkNetNePg0oPmEuJaIf57A2suTBeI89lGWUbO/kTUqGq5ZqYMlkKATP9IE0W0hPKH+zEF9ag70Uk= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB2032.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(346002)(376002)(366004)(136003)(39860400002)(76116006)(66476007)(66946007)(55016002)(64756008)(66556008)(8936002)(7416002)(186003)(478600001)(71200400001)(966005)(8676002)(66446008)(26005)(4326008)(33656002)(86362001)(110136005)(6506007)(107886003)(5660300002)(83380400001)(316002)(54906003)(52536014)(9686003)(53546011)(2906002)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?S684Vgw4aigw/3fBUrUNYD+SKgRNsba2rotEJJ9jK5NarF1Nt109fctghoTF?= =?us-ascii?Q?kFjX9XHoQrWxVGmRq1AOIe7TXtdosZ/l/7egwnbGSnQJbeVRfXyjembdVuB0?= =?us-ascii?Q?yJ8df5YOUqXZ2A7PZpbmBoir5mDIAtKyUrL+tsxbwL60MJ1s5QsmjL492Zch?= =?us-ascii?Q?eFl2PcLt2SoA/w+sqU0XE+2PxX9twMT23ZgyKu09WejFXj5x1zz1CcrrsxcB?= =?us-ascii?Q?RHVRTV2AlH1GRLd/ahfOo4s5lzAuFSpYS6A9/ZqVnyWc4D0rJH5IHP8bVTDN?= =?us-ascii?Q?ft/BTSju882ARA5bmKjUcr6mK5SRkX8tCF4wWRDiiXNzrBCF7saODxxa3rMf?= =?us-ascii?Q?q+ontUdJ1WAvayoabOhMYw/BxrgT3o/7XNqw9acRa4H37EVuxVqLM3mnHJ5V?= =?us-ascii?Q?A5aTTOg2akudr6XYle5jxtmUz85VBlJQhq3/W5YxIuLiq0a8cjcsc2hqiJNT?= =?us-ascii?Q?Wk6BUMig3qWIuVb1CVglwSPaGZ5QnjQElzHAKG5h1OmfJugdRU5DU1+/QRoM?= =?us-ascii?Q?6/rKBD6cLWJ9cg4bhEnXacVSNAs4BQBX2UQ+tQF0Pc9zg782TwzkX1TbasLw?= =?us-ascii?Q?p23LOZAjRNcGuVlg5zzwMSBPJSCUZjE/DyxBpK0VA/WDF0E45YZfymNRtxxm?= =?us-ascii?Q?dgBh+NWXPSzVmC9Qi5xHznz8/6OkG7enY8zvKX8M/5/8Or/5cTSlxfdLRtN3?= =?us-ascii?Q?q+WXuz167RR0KFJvs1NkgMJPN3tVEV5ptLCGHrAR/WquypoxskEXuO/30EZp?= =?us-ascii?Q?CjOME2Jx71x21dG3iNTMjredh/P+dssNIr7tyBOjABseHqTEW7Nf1vkkPaI9?= =?us-ascii?Q?cS22ffDTocAB/5OcxQc8FuuhdB4Z4p25SZm4VFsUz1zsoCxiFsmvZhajEfxf?= =?us-ascii?Q?Ggvgq74T6V+uX7NvQQGRWA9XFXgsVA6YqmUz0wDYrQMoGlkeJ8hPcivDJV2J?= =?us-ascii?Q?nW+ywYjRVmZMHL2Lwh/o3hpTuz8sNz+rrelt3ZECLYjuOPQ1eSEToCSXHZeL?= =?us-ascii?Q?DIIgdYzNI2MD2MX5gLLZfN0WvJ8g45U+kP2whp3pyenQIWuSZ0WARmjZ5ezv?= =?us-ascii?Q?Rysd5Jz7c34H5uBEjbl5V+C4o7uWiAncjDSL4W8Y5j/PwyZijtWBIfVQt9mo?= =?us-ascii?Q?8wV26Ud/Ms4x0eeKN6k+RfF3fB6SeFPIc8OAj3JDMfJPHespBYCRjyriOYQM?= =?us-ascii?Q?dp9jTQ3H9Q8bFLAmmVrJiOToEDhgNzTgn94QqbvnONbJG2PBfd0jN2KTd+j6?= =?us-ascii?Q?yzafQ2xh44c6BYSm6+apqK6srBsrSGotOD+oBAQ7dS3TCDnf3Mg3BjzHFgA2?= =?us-ascii?Q?NgI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB2032.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b033aff-07a2-49be-ccab-08d8dcb4b8ff X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2021 13:20:02.7261 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gyLdiTARdKyAQQfHhZBOuLZxhcaj+nP4cLYHT1P8kYnlR/H9fs0msBgeRUyJ0UEeSN/4zbTnBWY7pd2X98GXaehx+z31vmdHWABgi1QDjn0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1373 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC v4 1/4] ethdev: add meter PPS profile 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" > -----Original Message----- > From: dev On Behalf Of Li Zhang > Sent: Monday, March 1, 2021 10:35 AM > To: dekelp@nvidia.com; orika@nvidia.com; viacheslavo@nvidia.com; > matan@nvidia.com > Cc: dev@dpdk.org; thomas@monjalon.net; rasland@nvidia.com; > mb@smartsharesystems.com; ajit.khaparde@broadcom.com > Subject: [dpdk-dev] [RFC v4 1/4] ethdev: add meter PPS profile >=20 > Currently meter algorithms only supports rate is bytes per second(BPS). > Add this new meter srTCMp algorithm to support rate is packet per second. > So that it can meter traffic by packet per second. > The below structure will be extended: > rte_mtr_algorithm > rte_mtr_meter_profile > Signed-off-by: Li Zhang > --- > .../traffic_metering_and_policing.rst | 3 +- > doc/guides/rel_notes/release_20_11.rst | 5 +++ > lib/librte_ethdev/rte_mtr.h | 32 +++++++++++++++++++ > 3 files changed, 39 insertions(+), 1 deletion(-) >=20 > diff --git a/doc/guides/prog_guide/traffic_metering_and_policing.rst > b/doc/guides/prog_guide/traffic_metering_and_policing.rst > index 90c781eb1d..4d2405d44a 100644 > --- a/doc/guides/prog_guide/traffic_metering_and_policing.rst > +++ b/doc/guides/prog_guide/traffic_metering_and_policing.rst > @@ -17,7 +17,8 @@ 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) > + and RFC 4115 Two Rate Three Color Marker (trTCM), > + Single Rate Three Color Marker, Packet based (srTCMp). > * Policer actions (per meter output color): recolor, drop > * Statistics (per policer output color) >=20 > diff --git a/doc/guides/rel_notes/release_20_11.rst > b/doc/guides/rel_notes/release_20_11.rst > index 7405a9864f..de04886cc9 100644 > --- a/doc/guides/rel_notes/release_20_11.rst > +++ b/doc/guides/rel_notes/release_20_11.rst > @@ -429,6 +429,11 @@ New Features > can leverage IOAT DMA channels with vhost asynchronous APIs. > See the :doc:`../sample_app_ug/vhost` for more details. >=20 > +* **Added support for meter PPS profile.** > + > + Currently meter algorithms only supports bytes per second(BPS). > + Add this new meter algorithm to support packet per second (PPS) mode. > + So that it can meter traffic by packet per second. >=20 > Removed Items > ------------- > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h > index 916a09c5c3..f27a4b5354 100644 > --- a/lib/librte_ethdev/rte_mtr.h > +++ b/lib/librte_ethdev/rte_mtr.h > @@ -119,6 +119,11 @@ enum rte_mtr_algorithm { >=20 > /** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */ > RTE_MTR_TRTCM_RFC4115, > + > + /** Single Rate Three Color Marker, Packet based (srTCMp). > + * - - similar to IETF RFC 2697 but rate is packet per second. > + */ > + RTE_MTR_SRTCMP, > }; >=20 > /** > @@ -171,6 +176,20 @@ struct rte_mtr_meter_profile { > /** Excess Burst Size (EBS) (bytes). */ > uint64_t ebs; > } trtcm_rfc4115; > + > + /** Items only valid when *alg* is set to srTCMp. */ > + struct { > + /** Committed Information Rate (CIR) > + * (packets/second). > + */ > + uint64_t cir; > + > + /** Committed Burst Size (CBS) (packets). */ > + uint64_t cbs; > + > + /** Excess Burst Size (EBS) (packets). */ > + uint64_t ebs; > + } srtcmp; > }; > }; >=20 > @@ -317,6 +336,13 @@ struct rte_mtr_capabilities { > */ > uint32_t meter_trtcm_rfc4115_n_max; >=20 > + /** Maximum number of MTR objects that can have their meter > configured > + * to run the srTCMp algorithm. The value of 0 > + * indicates this metering algorithm is not supported. > + * The maximum value is *n_max*. > + */ > + uint32_t meter_srtcmp_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 +368,12 @@ struct rte_mtr_capabilities { > */ > int color_aware_trtcm_rfc4115_supported; >=20 > + /** > + * When non-zero, it indicates that color aware mode is supported > for > + * the srTCMp metering algorithm. > + */ > + int color_aware_srtcmp_supported; > + > /** When non-zero, it indicates that the policer packet recolor > actions > * are supported. > * @see enum rte_mtr_policer_action > -- > 2.21.0 Hi Li, As specified in the MAINTEINERS file of DPDK, I am the maintainer of this A= PI, so please make sure you add my email in the To: list of future revision= s of this patch set. Isn't this a duplicate of this other patchset that you authored as well: ht= tp://patchwork.dpdk.org/project/dpdk/patch/20210301094000.183002-2-lizh@nvi= dia.com/ ? Which one do you want to keep? I am pasting below my reply to th= is other patchset. We had this same problem earlier for the rte_tm.h API, where people asked t= o add support for WRED and shaper rates specified in packets to the existin= g byte rate support. I am more than happy to support adding the same here, = but please let's adopt the same solution here rather than invent a differen= t approach. Please refer to struct rte_tm_wred_params and struct rte_tm_shaper_params f= rom rte_tm.h: the packets vs. bytes mode is explicitly specified through th= e use of a flag called packet_mode that is added to the WRED and shaper pro= file. When packet_mode is 0, the profile rates and bucket sizes are specifi= ed in bytes per second and bytes, respectively; when packet_mode is not 0, = the profile rates and bucket sizes are specified in packets and packets per= second, respectively. The same profile parameters are used, no need to inv= ent additional algorithms (such as srTCM - packet mode) or profile data str= uctures. Can we do the same here, please? This is a quick summary of the required API changes to add support for the = packet mode, they are minimal: a) Introduce the packet_mode flag in the profile parameters data structure. b) Change the description (comment) of the rate and bucket size parameters = in the meter profile parameters data structures to reflect that their value= s represents either bytes or packets, depending on the value of the new fla= g packet_mode from the same structure. c) Add the relevant capabilities: just search for "packet" in the rte_tm.h = capabilities data structures and apply the same to the rte_mtr.h capabiliti= es, when applicable. Regards, Cristian