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 415DDA034F; Thu, 1 Apr 2021 08:19:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDFCA40142; Thu, 1 Apr 2021 08:19:28 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2046.outbound.protection.outlook.com [40.107.92.46]) by mails.dpdk.org (Postfix) with ESMTP id 38E014013F for ; Thu, 1 Apr 2021 08:19:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PFSULeq6/RijYF4TW5qbuAvAfeFq9X7W6xOACfUJF5bwHjJN0q17yQDxX1IUIsHRm8tbPdJ7c9Kf07ttM7zL8zkalF+1AW/MxcI+zYYxr5Z8UwfImoRBC0h58ox9qWeLlrfuI5SqpVzL+lYW9BsGDjiwD2YIwk8LN+4MDZs7Dc3sY4ZvLpEIknmjMQNgEo6yeKXqmqI6iaDlkcbyIZxiwLTHnjhGK+9iAyOK00seqW3b790chycBQ6xz1Y5kbk+wqqDV8GFqARDIPWxLLZebQ4+ict76QiywTYCwGAeO/5jRT0jFqgByrYo9Fhw3C4+SF7/WgxGlxq7UcDti9J/i2w== 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=PPHHdxvscjHCecTsS5KWSI4rd5t0nTW4QR36CeT2nvE=; b=fd0ScEcv2MjwrxgX6Dj5XIjbTdpuugryq88wUxdM9rQi7DUiufZbKFHeRfPTdIM70Ww28MO/k+Jd9xWCulgHuDGBk5l46x+FvzxgypVJScfaGAKkTJLuhB6E34swQhABXo/YiU3yNQG5F7TchtUO3QJBKqQkGRIhGTDrXdXgPQ3rg3QUI/F86VHIvx1R4mlbDI2/7t1QvrD8jGAPJFRLbB9iXKDUFdnZ9yIWckgJ5C9aIZWwZ7hXwaW7tbx8n5dL1GTiVmahALS7xLKhddtjEv7y4ncCgO/9Gk36b5nd7rFLNa3sLBGYWXgg8Rqz7P8kUrNK1hBsZA8B0bkwwmXXKg== 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=PPHHdxvscjHCecTsS5KWSI4rd5t0nTW4QR36CeT2nvE=; b=Ablz2z0wb4mdpiGOAyWio2wNtTE3QrOcIxCB26+TLmIjiKi1OVJrYnBRRz7cssLQZFBn/vQcDAOQQoU6iirn/+l8N1AqH06d1+LuyDES7YP56qEddkKDTeHMOxPjrp+20yXDNqPoAvySVD72ESh8KBD+EiiGq3X2S/9GTfVrSh6X7oadhvbt4tFcIgr7fvCQ+P0FWy5nB/k6qA/5dHil5+5Yfwztg1xPiZeFqPhkVffOzh2/wdxA5tOU6uxiNyzwzjC0S5U3Sfl1yaZYYvPrhIljtHoNPrUtpXYUzd5PC5a4+1kbePzJQPGBf+FqRbYsms0X27OeIeOeSQYtxqXoUQ== Received: from DM6PR12MB4090.namprd12.prod.outlook.com (2603:10b6:5:217::11) by DM5PR1201MB0044.namprd12.prod.outlook.com (2603:10b6:4:54::10) 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 06:19:23 +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.3999.028; Thu, 1 Apr 2021 06:19:23 +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 , Liron Himi 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+ogx8OEmGLzuCxEgxQqqe4shAgABN/ZA= Date: Thu, 1 Apr 2021 06:19:23 +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: e8bc7931-3625-4384-d636-08d8f4d61804 x-ms-traffictypediagnostic: DM5PR1201MB0044: 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: PVLKldDadZhXP4pEM1B/Tq2xGyIfmfL/lICygu29DIRnmbqRKck/PfolUOMqRvJgF5Gv/gxbxO+7Z8oeyAuTsbV8HRcDS0JMl6vRELa69Kp13Y+6mDT9kxrnW7S9m2PRpTpsXB4PDVOrvD3UWMw5RjBOvpNl0gUscVgRRCXN547krjnSmciNYy9OaEq9D6bKYpvXXD/Z0qUTgS0yxQQIqHlipjTRByqSJROgMHwfP+AcRTG7vRJRnwe5JDufJNMDUsmH0yxB9NYIMAgDdOlXJo0lcSleoNKV/SEeANEHSdDXwt3Vvqnsoq1dtfr0WJvp4EgZIyU3fc8DraGO66VGKWvpP3Fm6t5xZQf5A9gEqLH81T1AA+elpqiHBrPHcAGjqFcEUWCRFFSEpNhlxuz52HNMiOYJ0Vh7NjYGh52aNq0czoHHvW2AJxcHXyqWP9II0Yd3KzgYxuBLI7VeJpAGs5MnBde7zf5aICXxUzdbVjz2BsoWuZIz42P+AdvxTV2L25DRreJ/prH+11LrPGmMzyNvyiw6bQJMo6pRSNEH/75L6hbQzioj61J6xnG9oGB+rWQ3wdH223LP0zFbNbordRXtnUskkiMmNJTUWSmaGl7WhF66op6YZ2UzaEmTtF2R1+KlgtgTC2WPILZhW5ZK6Xlqn3nFil4DORc0eC5mRcgJfUpItDjK5uNouSutwU5KiLpM7CB99C6buU4xajIThjTmWkLPms1+tZI0F8zT2WXst9Xxj24uO8I8wqHKdCZH 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)(396003)(136003)(39860400002)(346002)(376002)(366004)(66476007)(8936002)(478600001)(66446008)(26005)(4326008)(52536014)(5660300002)(55016002)(53546011)(64756008)(66556008)(83380400001)(9686003)(7696005)(86362001)(921005)(6506007)(8676002)(33656002)(316002)(71200400001)(76116006)(966005)(38100700001)(107886003)(186003)(2906002)(66946007)(54906003)(2940100002)(110136005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?+ao8ZbC8xDpIpJCXLUW8rw3hGcykWXAV43dLgTabUNVt6ld1/2Q5Z4zUEgio?= =?us-ascii?Q?7dCc80sNkNHdbAuXeRKkW41eTlXyAI4pRCzhfiDRVVKuZ99Hy1g24jB4f7HX?= =?us-ascii?Q?Q1/bx7K2V2ZSb0oGwk9eWHZWxNz08x/0p0jnpcNutgobeUaEick+7bvTlsh2?= =?us-ascii?Q?FVbeL58DYVBmGI9rF2uK1dZbApayP7Xp78TzkS0swQqeGFHJmoe2v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Y0dymxHRo3mKdNagui1/boDDTB8KQzN7jOrXz1QDKG?= =?us-ascii?Q?vylydTN+gM31SJfUTZ4EWZ0MVEEmRb7hXoQ1GVLiDLVnGG1Wi2Y3w3wHCfof?= =?us-ascii?Q?VpeipITRpY/pSyZ+SXEommyl9sKxVumtJ0LNSLqP4TQcr57YpdbDZV+4Ijiz?= =?us-ascii?Q?p77kBx4RjUCHewD4fzQT0/qOvwDIHCMTnZXsmzDaFq9H0FmBF8L5kRsfqWDz?= =?us-ascii?Q?/Oanj0SWlAj8+QQSdURvAkS+?= 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: e8bc7931-3625-4384-d636-08d8f4d61804 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2021 06:19:23.4067 (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: HtG9X/nIasLCDU+5XXqUIEb3CPAoPhpZKgSlpOF+vKLhXp7Fx++pq6zw8qS2zkK/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0044 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 and Liron, I add the check in softnet and mvpp2 drivers in the following patch. Please help review it. https://patchwork.dpdk.org/project/dpdk/list/?series=3D16036 Thanks! Regards, Li Zhang > -----Original Message----- > From: Li Zhang > Sent: Thursday, April 1, 2021 9:42 AM > 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 > > Subject: RE: [PATCH 1/2] ethdev: add packet mode in meter profile structu= re >=20 > Hi Dumitrescu, >=20 > Thank you for your comments. > I will add the necessary checks in V2 patches. >=20 > Regards, > Li Zhang >=20 > > -----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 > > structure > > > > External email: Use caution opening links or attachments > > > > > > 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 > > > > > > 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 2= 697. */ > > > 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 2= 698. */ > > > 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 4= 115. */ > > > 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= second > > > + * 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 fo= r > > > + * 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 fo= r > > > + * 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 fo= r > > > + * 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 the existing drivers implementing the rte_mtr API to makes sure > > that profiles 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_che= ck. > > Thanks! > > > > Regards, > > Cristian