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 63896A034F; Wed, 31 Mar 2021 18:28:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAD9A140EE9; Wed, 31 Mar 2021 18:28:14 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 12C52140EE2 for ; Wed, 31 Mar 2021 18:28:12 +0200 (CEST) IronPort-SDR: uSNxaXv+JaNTWjRc2UO/5v46ip9Rju160jDPIdQUmn8YFAEfIMN756zq/ZlzX531LI3yuYLcBv nRHdzp6yzBmQ== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="212285386" X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="212285386" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 09:26:48 -0700 IronPort-SDR: dkfjpBzIm9fVlq32N44jRmuAK+rmS3wW44KjDICqOX4iJRVCpAGf3cWGYyw+Lv1xyMiPBqdUM8 0EHa97JLZCxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="412257223" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 31 Mar 2021 09:26:47 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 31 Mar 2021 09:26:47 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 31 Mar 2021 09:26:44 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 31 Mar 2021 09:26:44 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 31 Mar 2021 09:26:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hMyu/u+Ypvo84OMe+aqurBk3EfQkADOGuJ7xCYNIxb0j3y4EzQqA6u1qmOrisssHfhVbsOIf8XwKKFtxJrc2iUffhoUHffo3sO61wVl9O+TVMxf81sBSJKW81JisTH+fIPd51xqXc9snA4tR6PMWKOuoFP2Hv7ocp6CEQSpeEVGgmGL+JMfHyKenHagTJ04uEN3yi11VTKN2CR/XP4LboO8MoRuyIUTyyIOP1se+vrl4xTfxl0pAF/ZaOYf+RSfkNan119dqsz0sY4EW/ygs8/YNfqNIv8L/91x45uScElho+Qs/xBRtyf0qXo5+9D4go/ByCrWS1Ipvc5aMleGOVQ== 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=C0hi8Dvq6hyBGgk9h7V2qgiezdzrFsbgcdvWCjyTT2c=; b=Gr8D/32AQQzvT/w8831UJcgHbw2AamYWTmMAxHCBPJpKseLVrsj1stCSdjZa8cID7fgaE5ZGdyIm8Gjjsf2hEsTyohVaHqpNNJkNjI2Vji8up5Zwkeq6Dz+TWpIqqvvbagIxYsbdKb5L3HEkZTyKXJFjYENv0MkTSul7vAVpTP07LnzKVU/EDcb5q9/o9w3fmgdGwZMPEvtnvUBZkQdu4Y0/451uvxvzHcAdHTc0/0QJfsVNrI/87D4sbtJKbAta3RjrZjL04G/fX1oPstw/0679y8Qlf6xWKdeJJh31Rqq14m2pldqzRB0tsh1GglUuvWLUXUUpDKF/o+FCeqYeFA== 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=C0hi8Dvq6hyBGgk9h7V2qgiezdzrFsbgcdvWCjyTT2c=; b=y0+vhfy9+Gm0c5vIie/UFG3Y/UiInVB3vI2wK+fq3lw2t7KYS5y8Ismzum3KweRBRA7pdfs65WiPQoSPWySwA49zyGfRsKNmcnOh7KimS7ABFYrQfGRVbebw/iCKuV2QuJ2iAQgxvfV6cz4mupmkTVXQt2P2Wwu0QRYAB7cYkLg= Received: from DM6PR11MB2796.namprd11.prod.outlook.com (2603:10b6:5:c8::23) by DM6PR11MB3436.namprd11.prod.outlook.com (2603:10b6:5:65::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.27; Wed, 31 Mar 2021 16:26:42 +0000 Received: from DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::b5d2:6f20:3c0:3627]) by DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::b5d2:6f20:3c0:3627%7]) with mapi id 15.20.3999.028; Wed, 31 Mar 2021 16:26:42 +0000 From: "Dumitrescu, Cristian" To: Li Zhang , "dekelp@nvidia.com" , "orika@nvidia.com" , "viacheslavo@nvidia.com" , "matan@nvidia.com" , "shahafs@nvidia.com" , Thomas Monjalon , "Yigit, Ferruh" , "Andrew Rybchenko" CC: "dev@dpdk.org" , "rasland@nvidia.com" , "roniba@nvidia.com" Thread-Topic: [PATCH 1/2] ethdev: add packet mode in meter profile structure Thread-Index: AQHXJgtzItj7J15qL0SvsWarq8sAsaqeSCjg Date: Wed, 31 Mar 2021 16:26:41 +0000 Message-ID: References: <20210331085405.1445546-1-lizh@nvidia.com> <20210331085405.1445546-2-lizh@nvidia.com> In-Reply-To: <20210331085405.1445546-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: 17af51b3-ee7b-40e3-e2af-08d8f461c4d5 x-ms-traffictypediagnostic: DM6PR11MB3436: 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:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GnmpAeHYk4GI6ok68z6sIQvOK6WvwSR6DzyMtjljOgkgCyO8v3kLeVMjHrKAr5DtGvV2Rwx5iDIOH92XGn5FzjckgpCpoIT1xiY/hSWGkBQRk/TawO+PnupsVCIGhcO93Ii2cmGgJ7lId2ZZ/HBIlJaoIsk5s2rl+Pk5YVy6ifad9JlZkw+o6LEs476slYWCuBDp9TvKx47xsIiuCg6kD45T6iJuiefPJXehEO1Z0RBYHLx+47azHlahchdodCTuNG5L62P015mIXs+/ttHkTaAD3pMFE4s3YjY0Pp6Ygr3UYchnpvUbE7oSpKD/Cdx6fUpahpwSzcsWnNeNOtc5AaiFvpx3fsrjihWUx3bXFsOMcQGs8eq7NYAfi84RA/ak3RVmsPX++y6LcJksDsjV1UB/S3nwvCF+vP7dRpd+zAFe5/sRuQQr5piAtpLis/LgqORNPNV18FIvHoWV5IFObFVByrk6maoqCwFthzFXtybFHF8Uw7+bbv7AocSc9s6jT+GraG2Aq94ORzbOSLpWtwDkRWheW8OdZ+iBpOua347qqf5YoLGsNl3eIlIho7GR+Hgy0X41OLU3bTA+kcgaunEQY+CqbiBjT86Cg9jQ0BSoGd64pRBdywR/Xe1GVHt/7wb2WQlNExX4ffQiJgdxupXvVUOm5Cg1/yZBge04z7eV0rROXXEamtYpgoouT27x 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:(39860400002)(346002)(366004)(136003)(376002)(396003)(478600001)(5660300002)(316002)(8676002)(2906002)(54906003)(52536014)(86362001)(66556008)(8936002)(38100700001)(26005)(83380400001)(4326008)(33656002)(921005)(186003)(66946007)(55016002)(66476007)(7696005)(76116006)(53546011)(6506007)(110136005)(71200400001)(66446008)(9686003)(7416002)(64756008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Kk8vdCNrNIRNl00XHI3u0kXihzC0DOr+H5YYY+D2dni6QK+OyKlDqyGvsDT7?= =?us-ascii?Q?l9nwBvbMxzEjOy4znuPLPAffK1uDxkJJVUriUF/RFK/H2BKzjkoxKwh61sPx?= =?us-ascii?Q?k7UvtXL85e4RcEx7SaA4vtlQTwzRlf5pF0lo1/VxyaqfauTVNKaYlMS3wijx?= =?us-ascii?Q?KfQM/ein6zMOcSKGbBPx6p6n388KMnaZBKOif8+GOEFfEhQCUNFOMXNpYaZo?= =?us-ascii?Q?SwRk4DCK0ZpeKUdfQ9e4BDOib8q+B+gS79emq7fEP2fiPdCM0QNNokPX+rt+?= =?us-ascii?Q?UgQ8cWQoE41k3q/XGYOYe4wEcVg4YMbX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f3gEbd34gNZdkhPxq4d5YscD46u20WEb1o3WkSVetGDWScBMs1FHB?= =?us-ascii?Q?bWA0qRqGNkoItyeEWaXnZyWG+d74SvMBoPapdJEjY7mNykjI79m1tCVhWYSd?= =?us-ascii?Q?VFPCgpjXK0F53s92DDcBcxW1?= 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: DM6PR11MB2796.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17af51b3-ee7b-40e3-e2af-08d8f461c4d5 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2021 16:26:42.3102 (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: OCIFAiNdE224sjMMx9SK1rnkXYv+zpc8sd3064XhqVBXR3w05JjLecWHWRduN1LzFuSbcTFPKjOCMNdfves1/Ufu1qu+X8s843nXanRYXjM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3436 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 1/2] 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" Hi Li, > -----Original Message----- > From: Li Zhang > Sent: Wednesday, March 31, 2021 9:54 AM > To: dekelp@nvidia.com; orika@nvidia.com; viacheslavo@nvidia.com; > matan@nvidia.com; shahafs@nvidia.com; Dumitrescu, Cristian > ; Thomas Monjalon > ; Yigit, Ferruh ; Andrew > Rybchenko > Cc: dev@dpdk.org; rasland@nvidia.com; roniba@nvidia.com > Subject: [PATCH 1/2] ethdev: add packet mode in meter profile structure >=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 > --- > doc/guides/rel_notes/release_21_05.rst | 7 ++ > lib/librte_ethdev/rte_mtr.h | 89 ++++++++++++++++++++++---- > 2 files changed, 85 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 3c76148b11..c9c15794ad 100644 > --- a/doc/guides/rel_notes/release_21_05.rst > +++ b/doc/guides/rel_notes/release_21_05.rst > @@ -119,6 +119,13 @@ New Features > * Added command to display Rx queue used descriptor count. > ``show port (port_id) rxq (queue_id) desc used count`` >=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. >=20 > Removed Items > ------------- > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h > index e1dc59eb06..52611a90f5 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 > /** > @@ -333,6 +358,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 > */ > -- > 2.27.0 These API updates look good to me, but please add the necessary checks to t= he existing drivers implementing the rte_mtr API to makes sure that profile= s with packet_mode set to TRUE are rejected. For the Soft NIC driver, this is a simple check in file drivers/net/softnic= /rte_eth_softnic_meter.c, function meter_profile_check. Thanks! Regards, Cristian