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 DFC4AA0524; Mon, 12 Apr 2021 21:24:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C0D41412DE; Mon, 12 Apr 2021 21:24:01 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id E72E91412DD for ; Mon, 12 Apr 2021 21:23:58 +0200 (CEST) IronPort-SDR: NyZS2S3ltmyO1FtusZeVClmUnm2C6NVm2ilFeYh2/zPa9ua0M9cBHAT3o431cqtExh4A3Rjg/I AbcXlREI3UWw== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="258238694" X-IronPort-AV: E=Sophos;i="5.82,216,1613462400"; d="scan'208";a="258238694" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 12:23:57 -0700 IronPort-SDR: VLmsNF1HLJwKZZiHMMEfIfZlnjjZ6IRzNZQfe8/tS/oEWUw4nnuIlzyXnmOijv7SCOfhCwmw4J 8HpnjD6EFxUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,216,1613462400"; d="scan'208";a="450103656" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP; 12 Apr 2021 12:23:57 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 12 Apr 2021 12:23:56 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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, 12 Apr 2021 12:23:56 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Mon, 12 Apr 2021 12:23:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ocDbBJn2PFt8pga1OhQa6dwD9doOgFUZzIxxKWOTq3CpO7UV535buhFGUmlvZe1k1shjRerRcSXKJ1Wx95eWAKtt6kJZrRG3DLBSlRUN1C/GPhwqoo7ZQXoZzIICASPWet0y55p/A9W08WGl9c5oUQHMRUCSMl0eEA7G8HzFr20ffZOE0hzKHqlS8IhKSnG3PtJPaFBfIOj3HDFepe1oHBWj2c1SjkExn9CTjQV+kj3jb/5TliWd8qhykb+293CqI2IlivBa69V/Am1ASUlGcjV/Od2p1C7JYg94jvNOeSHrtdmpG9zGgD7mZ5pbs8xsR2e6gUyLmWEKzVRYy/rK1A== 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=YoEfU2KBuRk/JU+WH1pMjEW5zF9WqFZLzBRFDt588tc=; b=kem7O9WIaP7CT5Vc5JUaKC882xligitTTNvnco3VxwcKCyPWBELDIbP+Pxg4XfTI+0tiEGySdpny8/Z45W/fz2WfnshHrxfnO/WiyA6oPGMz6+POq0Y0AYvSUqZSC57aeKinagXda02eshZyFbPj0HykxDwiA7vhMk6Jnjpk9xEaegYHcfv0109dA5JH8YCiKia192f9D+WmrFqZlrpBhqM5ZTB4RmYn7zNN9bM2bFycq+cxBstIJw7KDMoC18eK6Hkag5N2W49WNDCxIRuRqvoQPE4dHv+Ia8cFhSsuQlSpKgC1eMrSHzw/f/sd3wuiR3vi+9CB9b8oZqUp+Ez+Qg== 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=YoEfU2KBuRk/JU+WH1pMjEW5zF9WqFZLzBRFDt588tc=; b=pgxZsl4xVA8lePC9qo974KFYZ5Q71W21UIFJgQ8S+OPXKViDvu7DZEMnXk3fyyED25wsRxQ8nvP31lBrTo+tH46IylcqjWSiEZxrusHCWRLJVBX6KIb02QQPQf4x727qWhiKIcWh/vPWwd4YKmHK76jiDkEeCsPTBDpoxgRw1IU= Received: from DM6PR11MB2796.namprd11.prod.outlook.com (2603:10b6:5:c8::23) by DM6PR11MB4411.namprd11.prod.outlook.com (2603:10b6:5:201::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Mon, 12 Apr 2021 19:23:54 +0000 Received: from DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9]) by DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9%3]) with mapi id 15.20.4020.022; Mon, 12 Apr 2021 19:23:54 +0000 From: "Dumitrescu, Cristian" To: Li Zhang , "dekelp@nvidia.com" , "orika@nvidia.com" , "viacheslavo@nvidia.com" , "matan@nvidia.com" , "shahafs@nvidia.com" , "lironh@marvell.com" , Thomas Monjalon , "Yigit, Ferruh" , Andrew Rybchenko CC: "dev@dpdk.org" , "rasland@nvidia.com" , "roniba@nvidia.com" Thread-Topic: [PATCH v3 1/4] ethdev: add packet mode in meter profile structure Thread-Index: AQHXLdqjCpzrJ3PtQUO2/+X1E2Vu36qxRrgQ Date: Mon, 12 Apr 2021 19:23:54 +0000 Message-ID: References: <20210408035849.1755493-1-lizh@nvidia.com> <20210410072445.1872769-1-lizh@nvidia.com> <20210410072445.1872769-2-lizh@nvidia.com> In-Reply-To: <20210410072445.1872769-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.79.23.215] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 98acef59-b1ae-4ce6-3d5a-08d8fde8831d x-ms-traffictypediagnostic: DM6PR11MB4411: 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:3826; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7rFU0Cvi7tyrAAS35cILJA6tnvDh4cc7gfaHlFfdgUo2zxPV02o2STTFMyBdzwhhQtQyT9O892aoRUCQTP8El8Vm7H1eFWigDCBJ850VHovgwWrPoijXNFq1HeoaRdifxux+u+vNMddigITaLyLoWO8w6CoXooGUqqSSBEn/8RSSAUpnNcTl0D0/bIlVKdDKq+iWXdcKX+qwDihuIp6UYO747t59vx1SUuDZzsCLw3cTc/JbgwXpz45I685xi8aP2qzdVdHhFMJz8Rbel30FgKkif2hCw2QAtp+IosWBnxnrM9/NER7k+MiuZBOL6k3czCxt77hJr/MEBuLidoqmnWP0Ytl7A3SI976WS/5xJJ3S7GHoR/PNlOX9hd8Y1wft++IEOT0aD504urP7utUbALWaxvBxh4hXUEloACN1irm1w1eLK8oAPrPlDJgoNja18KK0yyn7u4m/TmONH5trOr4CA4UT0XyCNRSfGREps/0bm4OrWBSHNujVlmVrm2hPKyyoSZDXqxKtVUY0cii7GF6wrT2WD2FcnbPnnggK4Bv/rTAzqCOKMWbJGAhq45k0en5p9eTcQrsiyzycIUkmDXgu3j+wbDlttlHcXu94HM3ZuR6FGZ6qzpDbx56RkUCIiSGNg9xOOAGzAq5oSnNsaQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2796.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(366004)(39860400002)(376002)(346002)(396003)(8936002)(86362001)(38100700002)(8676002)(76116006)(4326008)(9686003)(55016002)(2906002)(33656002)(54906003)(52536014)(83380400001)(921005)(66476007)(186003)(66556008)(5660300002)(71200400001)(7416002)(110136005)(64756008)(316002)(7696005)(6506007)(66946007)(53546011)(478600001)(26005)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?T72/F10Kjpwp8OXWZistRMuECA02yoyQSqd/5xdvX/WBSGAPK/JPvD51oXao?= =?us-ascii?Q?nE7gsVYZ5iWR24lodi5o0Noj01HsfLIPDC90hxWfd8ZQDXpmVgp083iZPbp7?= =?us-ascii?Q?vzSft0G3gU5Q5dNLNtBsX1mB0bFBo1ZEc4MMKNpKhKQKuzlsRdFoFY8tCKc/?= =?us-ascii?Q?gpHN5IJRyTFJgONidEnIyE2eDNNiYnm2hf9yNWAcfZwsN4vP1o/o+VbXXIQC?= =?us-ascii?Q?jZKMmzDRGwODbpsHKlvroUHq/UQ+gJTaGeIyLwdYldQaVmnWC0c8H/nvaxIx?= =?us-ascii?Q?rVIdm8w0d5DDTOPU9frPYwrsLJY7STdBmRBbNLRVq4rDd851BG0YSwE8uL3J?= =?us-ascii?Q?S55lubnpdgl3HvNiQyn0HApIQiTMt45u07h9czxEGYgzNI6ESr4dWgf/hapt?= =?us-ascii?Q?yL23jo22Krsr0RXvpfp+1z0lDSGmwE+vlverOs9SlZOwZjW+gLr9qyJUmvc5?= =?us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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: DM6PR11MB2796.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98acef59-b1ae-4ce6-3d5a-08d8fde8831d X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2021 19:23:54.6117 (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: n/cerVPWriue6cCGmxWgOlhwlW459+KW5D220DRPWTFou3M8X1fMf7Civkn3Pe3V+Iofg63C6Iyo4BQuF2jeAZ3F71PbvKGGM1ZLsQJH8fg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4411 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/4] ethdev: add packet mode in meter profile structure 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: Li Zhang > Sent: Saturday, April 10, 2021 8:25 AM > To: dekelp@nvidia.com; orika@nvidia.com; viacheslavo@nvidia.com; > matan@nvidia.com; shahafs@nvidia.com; Dumitrescu, Cristian > ; lironh@marvell.com; Thomas Monjalon > ; Yigit, Ferruh ; Andrew > Rybchenko > Cc: dev@dpdk.org; rasland@nvidia.com; roniba@nvidia.com > Subject: [PATCH v3 1/4] ethdev: add packet mode in meter profile structur= e >=20 > Currently meter algorithms only supports rate is bytes per second(BPS). > Add packet_mode flag in meter profile parameters data structure. > So that it can meter traffic by packet per second. >=20 > When packet_mode is 0, the profile rates and bucket sizes are > specified in bytes per second and bytes > when packet_mode is not 0, the profile rates and bucket sizes are > specified in packets and packets per second. >=20 > The below structure will be extended: > rte_mtr_meter_profile > rte_mtr_capabilities >=20 > Signed-off-by: Li Zhang > Acked-by: Matan Azrad > --- > doc/guides/rel_notes/release_21_05.rst | 12 ++++ > lib/librte_ethdev/rte_mtr.h | 90 ++++++++++++++++++++++---- > 2 files changed, 91 insertions(+), 11 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_21_05.rst > b/doc/guides/rel_notes/release_21_05.rst > index f199ad286d..b4653d63a1 100644 > --- a/doc/guides/rel_notes/release_21_05.rst > +++ b/doc/guides/rel_notes/release_21_05.rst > @@ -152,6 +152,18 @@ New Features > * ethdev: Added RTE_FLOW_ACTION_TYPE_METER_COLOR in enum > rte_flow_action_type. > * ethdev: Added RTE_MTR_ERROR_TYPE_METER_POLICY_ID and > RTE_MTR_ERROR_TYPE_METER_POLICY_ID into rte_mtr_error_type. >=20 > +* **Added support for meter PPS profile.** > + > + Currently meter algorithms only supports bytes per second(BPS). > + Add packet_mode in the meter profile parameters data structures > + to support packet per second (PPS) mode. > + So that it can meter traffic by packet per second. > + Packet_mode must be 0 when it is bytes mode. > + > +* **Updated MLX5 driver.** > + > + * Added support for meter profile packet per second mode > (packet_mode). > + > Removed Items > ------------- >=20 > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h > index 4938ef065f..778fad7638 100644 > --- a/lib/librte_ethdev/rte_mtr.h > +++ b/lib/librte_ethdev/rte_mtr.h > @@ -133,46 +133,71 @@ struct rte_mtr_meter_profile { > union { > /** Items only valid when *alg* is set to srTCM - RFC 2697. */ > struct { > - /** Committed Information Rate (CIR) > (bytes/second). */ > + /** > + * Committed Information Rate (CIR) > + * (bytes per second or packets per second). > + */ > uint64_t cir; >=20 > - /** Committed Burst Size (CBS) (bytes). */ > + /** Committed Burst Size (CBS) (bytes or packets). */ > uint64_t cbs; >=20 > - /** Excess Burst Size (EBS) (bytes). */ > + /** Excess Burst Size (EBS) (bytes or packets). */ > uint64_t ebs; > } srtcm_rfc2697; >=20 > /** Items only valid when *alg* is set to trTCM - RFC 2698. */ > struct { > - /** Committed Information Rate (CIR) > (bytes/second). */ > + /** > + * Committed Information Rate (CIR) > + * (bytes per second or packets per second). > + */ > uint64_t cir; >=20 > - /** Peak Information Rate (PIR) (bytes/second). */ > + /** > + * Peak Information Rate (PIR) > + * (bytes per second or packets per second). > + */ > uint64_t pir; >=20 > - /** Committed Burst Size (CBS) (byes). */ > + /** Committed Burst Size (CBS) (bytes or packets). */ > uint64_t cbs; >=20 > - /** Peak Burst Size (PBS) (bytes). */ > + /** Peak Burst Size (PBS) (bytes or packets). */ > uint64_t pbs; > } trtcm_rfc2698; >=20 > /** Items only valid when *alg* is set to trTCM - RFC 4115. */ > struct { > - /** Committed Information Rate (CIR) > (bytes/second). */ > + /** > + * Committed Information Rate (CIR) > + * (bytes per second or packets per second). > + */ > uint64_t cir; >=20 > - /** Excess Information Rate (EIR) (bytes/second). */ > + /** > + * Excess Information Rate (EIR) > + * (bytes per second or packets per second). > + */ > uint64_t eir; >=20 > - /** Committed Burst Size (CBS) (byes). */ > + /** Committed Burst Size (CBS) (bytes or packets). */ > uint64_t cbs; >=20 > - /** Excess Burst Size (EBS) (bytes). */ > + /** Excess Burst Size (EBS) (bytes or packets). */ > uint64_t ebs; > } trtcm_rfc4115; > }; > + > + /** > + * When zero, the byte mode is enabled for the current profile, so > the > + * *rate* and *size* fields are specified in bytes per second > + * and bytes, respectively. > + * When non-zero, the packet mode is enabled for the current > profile, > + * so the *rate* and *size* fields are specified in packets per second > + * and packets, respectively. > + */ > + int packet_mode; > }; >=20 > /** > @@ -346,6 +371,48 @@ struct rte_mtr_capabilities { > */ > int color_aware_trtcm_rfc4115_supported; >=20 > + /** > + * srTCM rfc2697 byte mode supported. > + * When non-zero, it indicates that byte mode is supported for > + * the srTCM RFC 2697 metering algorithm. > + */ > + int srtcm_rfc2697_byte_mode_supported; > + > + /** > + * srTCM rfc2697 packet mode supported. > + * When non-zero, it indicates that packet mode is supported for > + * the srTCM RFC 2697 metering algorithm. > + */ > + int srtcm_rfc2697_packet_mode_supported; > + > + /** > + * trTCM rfc2698 byte mode supported. > + * When non-zero, it indicates that byte mode is supported for > + * the trTCM RFC 2698 metering algorithm. > + */ > + int trtcm_rfc2698_byte_mode_supported; > + > + /** > + * trTCM rfc2698 packet mode supported. > + * When non-zero, it indicates that packet mode is supported for > + * the trTCM RFC 2698 metering algorithm. > + */ > + int trtcm_rfc2698_packet_mode_supported; > + > + /** > + * trTCM rfc4115 byte mode supported. > + * When non-zero, it indicates that byte mode is supported for > + * the trTCM RFC 4115 metering algorithm. > + */ > + int trtcm_rfc4115_byte_mode_supported; > + > + /** > + * trTCM rfc4115 packet mode supported. > + * When non-zero, it indicates that packet mode is supported for > + * the trTCM RFC 4115 metering algorithm. > + */ > + int trtcm_rfc4115_packet_mode_supported; > + > /** Set of supported statistics counter types. > * @see enum rte_mtr_stats_type > */ > @@ -363,6 +430,7 @@ enum rte_mtr_error_type { > RTE_MTR_ERROR_TYPE_UNSPECIFIED, /**< Cause unspecified. */ > RTE_MTR_ERROR_TYPE_METER_PROFILE_ID, > RTE_MTR_ERROR_TYPE_METER_PROFILE, > + RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE, > RTE_MTR_ERROR_TYPE_MTR_ID, > RTE_MTR_ERROR_TYPE_MTR_PARAMS, > RTE_MTR_ERROR_TYPE_POLICER_ACTION_GREEN, > -- > 2.21.0 Acked-by: Cristian Dumitrescu