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 41F19A034F; Thu, 1 Apr 2021 03:41:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBEF8140F79; Thu, 1 Apr 2021 03:41:48 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2070.outbound.protection.outlook.com [40.107.93.70]) by mails.dpdk.org (Postfix) with ESMTP id 8F31A40142 for ; Thu, 1 Apr 2021 03:41:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtV7eAiuahUuq1KNcQw4EvsopJhiGYfQoRX/0oagg5JN6fLwM9zo5jH23MCtNm0BNOuGvsYLIz+zyeFbc8MAvnS0Qh8KPSTMNoK4mtVFwPRS/nUlNZhWOievCxSVvm4eG4pPtvk8w3aCjqj6GGYspZpuiPBhTkC4hz9pRzU7mEgm7aUviXV6iHnKjvMi7iDHatAwpts+DaKGMnhTYE3c7hsf5nKpoGAQ5790e2Alj3kEkN36hjZ4IaI16RevPmFPFwCmS9O0QRA7dokWyduSFeCm7dEOI4E4CMHk9FlB7qS1c0DaI0KnAYhcuBZSNmjYF/SwSDFH3aIxDbjH1jRsIQ== 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=ULTGxGCQ6CJhr5A2wreyExKYFgKl3/QuIstaVpxJeSY=; b=WqZ4F73GGPLM1Hf+ydEdWmfzde58OKJYvAxAHr4Rt6uLthMtlqT5jlkcPTwE1Qj+PnquR7d8tiYDZv2Jt29cqwpvYe0J+U1rBWYYaTjEK0+6oJOKeEoc4YP6ZCZHTGmdy3pz+YL2TSByzaaMgs1/PofBf+q9YARc1988kDiZMmGC19CBCahPLnvAh62vaQrapVhqTu4TQLHSrmTAZBJ60G0u092Oabm/zQhKRvOym9G2zo9FjcLJ+VYBK99zbGyk0mr4tgaM1FOtIqcCKMtfPTDbO6UOlqvIhAVVnMZgLrCd/UqrRNfMmdSe4q6c1VNDAa16JFUybibNqvO6L4/Ljg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ULTGxGCQ6CJhr5A2wreyExKYFgKl3/QuIstaVpxJeSY=; b=p6Kr3y60gjfY/o/BOmxSrTbDOlVQ0pkus3mp7fAA352A4PSrRvZmoNiwXH/HajRl7SWupW4dPcEBNFYTdggUVrJAIMw1iL0/PvVAI7U5j4KDvALPjjAPXh1IwCLP48vnBS7cXvpxOhoBNd7mdFdk21yAL3ZbCJTCpUROLFYDnLBx0G491T+ttFYIpchpNNpXyH4OpEOwheKX8Lb21ZFt+yzdsNPDRXQAlUGve3ejgHRLJt62c8CY7fk/h2ne+VmTr7afHjAIFbOGMiS4+7RppjJ01SKJL6L08IGmyL7jkvOtMkkskuW+R67ZxBZ6aMsGVsQMDqp6czIFt6MWIVHsIA== Received: from DM6PR12MB4090.namprd12.prod.outlook.com (2603:10b6:5:217::11) by DM6PR12MB4249.namprd12.prod.outlook.com (2603:10b6:5:223::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.27; Thu, 1 Apr 2021 01:41:46 +0000 Received: from DM6PR12MB4090.namprd12.prod.outlook.com ([fe80::fd19:da7e:347b:87da]) by DM6PR12MB4090.namprd12.prod.outlook.com ([fe80::fd19:da7e:347b:87da%4]) with mapi id 15.20.3977.033; Thu, 1 Apr 2021 01:41:46 +0000 From: Li Zhang To: "Dumitrescu, Cristian" , "dekelp@nvidia.com" , Ori Kam , Slava Ovsiienko , Matan Azrad , Shahaf Shuler , NBU-Contact-Thomas Monjalon , "Yigit, Ferruh" , Andrew Rybchenko CC: "dev@dpdk.org" , Raslan Darawsheh , Roni Bar Yanai Thread-Topic: [PATCH 1/2] ethdev: add packet mode in meter profile structure Thread-Index: AQHXJkrD3L0+ogx8OEmGLzuCxEgxQqqe4shA Date: Thu, 1 Apr 2021 01:41:46 +0000 Message-ID: References: <20210331085405.1445546-1-lizh@nvidia.com> <20210331085405.1445546-2-lizh@nvidia.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [139.227.253.12] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 17f185c9-7cc3-4b99-9752-08d8f4af4f88 x-ms-traffictypediagnostic: DM6PR12MB4249: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,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: 7h2ImdhC1/Y8sEjsyYQQ0HG6/y0qq4tyLY1M+w4ElrClW4Kt4MnGNgTgNtB49sPhmowKfBkr4RzchyMiF7J4DrRhf3PW13hIL/3Xg5rjH8d0jy75GBCVJbEQPd3ksfHqRvZEaK2HUnBO9Q1McH9rk1kEJLkzFZ2wjAU0ALVQQJzIWgINlZmA+szWvQ0oIWH4Y6cHLK6ECOMmJsypARnmDOJbZut3wxChQR5TMzPUZfrNb1KmdVnQzLR0HmeXyWp+4z2tGrkyqTUG7cDDUKYl+RT4bedDkV/4ZbmXEX4lLvVB1ttAiuXxQcMpWtDgUwyD8RbQ2NS8b1RckuXrtY5J48uIWRZtvcbVmWpre6WI+QKTBe5yUu6MnkzrISfjEOX5TK8GK2iqpwAzrlVvlR2tQmB5n2/o4az/bDWs0XXEWoV6mgqhmNj3QYqi+ce5wRwqCiijFtVao+VpNnbwi0pUUecmix3Vnzri/KJcI7hTU4E5tc3scblO0F6oXqXODMkxUWh6sIs8XbsrpphNXtmyG5VICI8PH0kp+USFRhAO1j+D7Zp5IO/J5hnsISaxIHycZONLx7gXeQDS8Y179VhO7J71dd/76/1QDJBWAn9Wi6L5JpLcUsYgXT56l3CWVGUvKg0mP2LJvUOo9ujHeRvAerkb7f7iquCqOBY63VU3LQxec9S7GqxKZ+bZ+scNpQ4J x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4090.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(53546011)(8676002)(6506007)(7696005)(5660300002)(107886003)(4326008)(26005)(2906002)(8936002)(52536014)(921005)(66556008)(186003)(498600001)(76116006)(38100700001)(86362001)(66446008)(64756008)(33656002)(66476007)(9686003)(55016002)(66946007)(110136005)(54906003)(71200400001)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?tJ5zuO82PPSH1xXZFuMWSsSXA5OmpZ4BfUYrGDMrC1BB4J3y8TaO9p7YzGN3?= =?us-ascii?Q?S9AKS2HUQwlTDKYYSK54BbFH+BLM2Yr5iDAHkSFBNTcAvxfIu7Vskzb/2Uh8?= =?us-ascii?Q?G7QXr5aJNEV3zfdOzs+6Bpf1y1xbTp55jioxTAxw32IX6JY7etZMGUWNW/My?= =?us-ascii?Q?sLWt29h73DW+8yjDUmS09rBDMciFDRo0ioxvzTVypPRE6L7pwzYX02J31SDl?= =?us-ascii?Q?uypR8I5p70UhN72YuXQPMnHOxcSOKRca/GjevnXH/rDqWQrOY3hSGZSF1iFf?= =?us-ascii?Q?rMZE5uM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9x9XGOpbA9yM?= =?us-ascii?Q?AS/XDi/uYPFBMFRXTUPhMo13kjIM15HIMTo+bxIijNvRRP9VrQ5zYTU2VYDc?= =?us-ascii?Q?ZhEs1x03F2R/zQilNQcYiAc2RNpnzu6mEODSyWlUChn74ioLDCByY1yH9Ieb?= =?us-ascii?Q?nsPpwoM0m340efaxfjY3lO+N?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4090.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17f185c9-7cc3-4b99-9752-08d8f4af4f88 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2021 01:41:46.2337 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fmW/Q6ksgDoFKAANKf999QRo0YNDCdKyRpmu1/10VR6wWtY+/B2LL+wFkT5T01Y3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4249 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 Dumitrescu, Thank you for your comments. I will add the necessary checks in V2 patches. Regards, Li Zhang > -----Original Message----- > From: Dumitrescu, Cristian > Sent: Thursday, April 1, 2021 12:27 AM > To: Li Zhang ; dekelp@nvidia.com; Ori Kam > ; Slava Ovsiienko ; Matan > Azrad ; Shahaf Shuler ; NBU- > Contact-Thomas Monjalon ; Yigit, Ferruh > ; Andrew Rybchenko > > Cc: dev@dpdk.org; Raslan Darawsheh ; Roni Bar Yanai > > Subject: RE: [PATCH 1/2] ethdev: add packet mode in meter profile structu= re >=20 > External email: Use caution opening links or attachments >=20 >=20 > Hi Li, >=20 > > -----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 > > > > 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. > > > > 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. > > > > The below structure will be extended: > > rte_mtr_meter_profile > > rte_mtr_capabilities > > > > 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(-) > > > > 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`` > > > > +* **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. > > > > 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 269= 7. */ > > struct { > > - /** Committed Information Rate (CIR) > > (bytes/second). */ > > + /** > > + * Committed Information Rate (CIR) > > + * (bytes per second or packets per second). > > + */ > > uint64_t cir; > > > > - /** Committed Burst Size (CBS) (bytes). */ > > + /** Committed Burst Size (CBS) (bytes or > > + packets). */ > > uint64_t cbs; > > > > - /** Excess Burst Size (EBS) (bytes). */ > > + /** Excess Burst Size (EBS) (bytes or packets). > > + */ > > uint64_t ebs; > > } srtcm_rfc2697; > > > > /** Items only valid when *alg* is set to trTCM - RFC 269= 8. */ > > struct { > > - /** Committed Information Rate (CIR) > > (bytes/second). */ > > + /** > > + * Committed Information Rate (CIR) > > + * (bytes per second or packets per second). > > + */ > > uint64_t cir; > > > > - /** Peak Information Rate (PIR) (bytes/second). *= / > > + /** > > + * Peak Information Rate (PIR) > > + * (bytes per second or packets per second). > > + */ > > uint64_t pir; > > > > - /** Committed Burst Size (CBS) (byes). */ > > + /** Committed Burst Size (CBS) (bytes or > > + packets). */ > > uint64_t cbs; > > > > - /** Peak Burst Size (PBS) (bytes). */ > > + /** Peak Burst Size (PBS) (bytes or packets). */ > > uint64_t pbs; > > } trtcm_rfc2698; > > > > /** Items only valid when *alg* is set to trTCM - RFC 411= 5. */ > > struct { > > - /** Committed Information Rate (CIR) > > (bytes/second). */ > > + /** > > + * Committed Information Rate (CIR) > > + * (bytes per second or packets per second). > > + */ > > uint64_t cir; > > > > - /** Excess Information Rate (EIR) (bytes/second).= */ > > + /** > > + * Excess Information Rate (EIR) > > + * (bytes per second or packets per second). > > + */ > > uint64_t eir; > > > > - /** Committed Burst Size (CBS) (byes). */ > > + /** Committed Burst Size (CBS) (bytes or > > + packets). */ > > uint64_t cbs; > > > > - /** 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 s= econd > > + * and packets, respectively. > > + */ > > + int packet_mode; > > }; > > > > /** > > @@ -333,6 +358,48 @@ struct rte_mtr_capabilities { > > */ > > int color_aware_trtcm_rfc4115_supported; > > > > + /** > > + * 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 >=20 > These API updates look good to me, but please add the necessary checks to > the existing drivers implementing the rte_mtr API to makes sure that prof= iles > with packet_mode set to TRUE are rejected. >=20 > 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! >=20 > Regards, > Cristian