From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A0BFA0588; Tue, 21 Apr 2020 11:31:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6AB3D1D917; Tue, 21 Apr 2020 11:31:04 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2B0BE1BF72 for ; Tue, 21 Apr 2020 11:31:01 +0200 (CEST) IronPort-SDR: Ke65/mxyhA6O//4mncQyy1SCO3wrb7eNHewXNb6Q3I2hLQMTq2oBkExUnpDO/HuCPQ8ccy4qFV yuAYtpIfepVw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 02:31:01 -0700 IronPort-SDR: QTxasuMwehfJUeiraYOXYKwy7ILEHOrGjoP7PJE5HRWEIkkwCgbOmijT+wfyzPRahW9n3p2D9I cN9t0IsZJJXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,409,1580803200"; d="scan'208";a="365292964" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga001.fm.intel.com with ESMTP; 21 Apr 2020 02:31:00 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 21 Apr 2020 02:31:00 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) 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.1713.5; Tue, 21 Apr 2020 02:31:00 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Apr 2020 02:31:00 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 21 Apr 2020 02:30:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z9DXKDAhd+SCh7byOPGH+X9gq1oP+4m0iHNXuZceJRZuGHo88sIl+pe92wzWAnt3morIeV7Q4/ZVQalOY2s219cj8XbS3sZpp2y20RPARCZXewD/70HAo3J6jTMO1TOtUvIidoc3t1JvuiszB9hIMbnbPCP75H5iGDQRtEj5kxumkorfqrbZGnBikl1ZA1OXLNhHWpR+1mNiiuAXmNoYcBURirUNNH9XX1lgq/IGJPJ+6QDqNWKMhRWfEvPTSNWuhKVKJhiHkLtgA9uwW+aqce9ATJcJ+azy4M8tGZQChjGGS373NzJigJ2gxx+L7GDvvGgPrjVd2xKAMOHka53EpQ== 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=LtBBDO7oZlTK5iShxjjtSoZj9zh2pgNDXGbbnD88z74=; b=aYFc/A/ZpJkg0pM47uE56+M/Jt+ehL/eB20qdPFrA40JAcnGzfxS3Ysl1+T91QU0vvTKjL729b0ooQu2lycEB2w9u6AS2enewReEYhuqTxBIH0H7XIaJeWXkDK17jHXk0A/4XG/+ab93AnIkQXMrX/z6lRmMIDjaOgwNxeMMr0aNGxtZHc+wDdg+ZY5n1asdnhuZ43g+P8/+yh3OG6oioJpEXbdq9HEWPbKeo5/UcJMvQyhfaMynLWrIv3Yy2s9k9ye37s4GM8ZNjXAKHx/QrZ08Wytwcr2JtECItPU6S2+IApia6uh6i5TdhDdfITBpJaK3XRCtaKKYOvd+useG9Q== 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=LtBBDO7oZlTK5iShxjjtSoZj9zh2pgNDXGbbnD88z74=; b=AUT01HJhYnclyrbO5CmLr6Qd8Q0d0gSIuJkhgFJQOAuaEpMfOxoj8v3rGJsGrs8FOGqpjXcv+PBlVx3LmDvWt4yHP9XcAerXn1y7yEREpQuDwJtT3JqM6Fo90lDpk3HmlYrWEJHyd5LhWauNW2DMTBgshvs4cRCjVJlKgl2SllY= Received: from BYAPR11MB2935.namprd11.prod.outlook.com (2603:10b6:a03:82::24) by BYAPR11MB3365.namprd11.prod.outlook.com (2603:10b6:a03:7e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Tue, 21 Apr 2020 09:30:55 +0000 Received: from BYAPR11MB2935.namprd11.prod.outlook.com ([fe80::786e:a42b:df03:a829]) by BYAPR11MB2935.namprd11.prod.outlook.com ([fe80::786e:a42b:df03:a829%5]) with mapi id 15.20.2921.030; Tue, 21 Apr 2020 09:30:55 +0000 From: "Dumitrescu, Cristian" To: Nithin Dabilpuram , Thomas Monjalon , "Yigit, Ferruh" , "Andrew Rybchenko" CC: "dev@dpdk.org" , "jerinj@marvell.com" , "kkanas@marvell.com" , Nithin Dabilpuram Thread-Topic: [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode Thread-Index: AQHWD/albJRPkm4dGUCJmUYHj84ik6iDVLWQ Date: Tue, 21 Apr 2020 09:30:55 +0000 Message-ID: References: <20200330160019.29674-1-ndabilpuram@marvell.com> <20200411114430.18506-1-nithind1988@gmail.com> In-Reply-To: <20200411114430.18506-1-nithind1988@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: spf=none (sender IP is ) smtp.mailfrom=cristian.dumitrescu@intel.com; x-originating-ip: [192.198.151.167] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c11acc6b-f200-4e67-179d-08d7e5d6b177 x-ms-traffictypediagnostic: BYAPR11MB3365: 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:9508; x-forefront-prvs: 038002787A x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2935.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(39860400002)(376002)(396003)(136003)(346002)(366004)(76116006)(86362001)(53546011)(6506007)(316002)(8676002)(30864003)(81156014)(26005)(8936002)(110136005)(2906002)(54906003)(33656002)(71200400001)(9686003)(55016002)(66946007)(66556008)(66476007)(66446008)(64756008)(5660300002)(4326008)(7696005)(52536014)(478600001)(186003)(290074003); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Y189RD1XvptYaIg0NjC/vziWilVyRNhhE++PCdeo3jQyioplv4cYs1CxSYTLY4NndCWzB0A5pd4Kf+uF+Fo4UZpdPyJZ1YSJpIxknS25UIYwW93PKLK5zZRYJovXHiQGbZgam8JEWRB0+v7/ScMpIK3/Esld6tfq7Tq0Jq4C6LLflKNJ849RoOsUcbkfcB21GGkm/KtU7wWTczfUGzFKl3QNvEYqwx+T72EafC+ajCZi9ermnrkZPIhIYA3wQFIp+kiEKJ6az5+u0ad6O5bcraa/dNURimfBDq29nBY4QWBNLQ25CjMuo5HnR9J7P74fIVYR5ZV6QtyxHBX4oKInhfgkX9cOgzaHdOVSg0E+BtOjxaOxw/fpCWhT79kbIDVSCsU3e0GHwmoVA2kPfZglYvAKt8sfk7c/mivlrgWIcbraNpi4N/FNTF5WMo0bABLeQJrJwJ21/zJ5ya9hs2Tb849/VuSeE216HBYv5+oOnrBRYuRdRfXLHvrNa5Cr1CQx x-ms-exchange-antispam-messagedata: KmOACv1NEm6e+CGhRhGPHanpruvwts6T1TG8Tz41OFeX5p1GikfjULpsw8RquLo0buS77u9gLGlSBc0n5VZqKl8VGqZB/TReUAZVFX6FlKjWNuuwX0yQyNy8mr7a66YNrG0nQeso4dj3IsTt3HDocg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c11acc6b-f200-4e67-179d-08d7e5d6b177 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2020 09:30:55.6673 (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: mIMtb8D/8nCl2hFsVYdLKRmYu30t1dUA5UIgC+l/yT4svYRrvtmHdUVIha57s9tB5DkgqGyu49KKNnDSEx4GOsKkDVCpMjMvpDQ9akbjU3M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3365 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Nithin, > -----Original Message----- > From: Nithin Dabilpuram > Sent: Saturday, April 11, 2020 12:44 PM > To: Dumitrescu, Cristian ; Thomas Monjalon > ; Yigit, Ferruh ; Andrew > Rybchenko > Cc: dev@dpdk.org; jerinj@marvell.com; kkanas@marvell.com; Nithin > Dabilpuram > Subject: [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt > mode >=20 > From: Nithin Dabilpuram >=20 > Some NIC hardware support shaper to work in packet mode i.e > shaping or ratelimiting traffic is in packets per second (PPS) as > opposed to default bytes per second (BPS). Hence this patch > adds support to configure shared or private shaper in packet mode, > provide rate in PPS and add related tm capabilities in port/level/node > capability structures. >=20 > This patch also updates tm port/level/node capability structures with > exiting features of scheduler wfq packet mode, scheduler wfq byte mode > and private/shared shaper byte mode. >=20 > Signed-off-by: Nithin Dabilpuram > --- >=20 > v1..v2: > - Add seperate capability for shaper and scheduler pktmode and bytemode. > - Add packet_mode field in struct rte_tm_shaper_params to indicate > packet mode shaper profile. >=20 > lib/librte_ethdev/rte_tm.h | 156 > ++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 154 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h > index f9c0cf3..38fff4c 100644 > --- a/lib/librte_ethdev/rte_tm.h > +++ b/lib/librte_ethdev/rte_tm.h > @@ -250,6 +250,23 @@ struct rte_tm_capabilities { > */ > uint64_t shaper_private_rate_max; >=20 > + /** Shaper private packet mode supported. When non-zero, this > parameter > + * indicates that there is atleast one node that can be configured Typo (please fix all occurrences): atleast -> at least > + * with packet mode in it's private shaper. When shaper is configured Typo (please fix all occurrences): it's -> its > + * in packet mode, committed/peak rate provided is interpreted > + * in packets per second. > + */ > + int shaper_private_packet_mode_supported; > + > + /** Shaper private byte mode supported. When non-zero, this > parameter > + * indicates that there is atleast one node that can be configured > + * with byte mode in it's private shaper. When shaper is configured > + * in byte mode, committed/peak rate provided is interpreted in > + * bytes per second. > + */ > + int shaper_private_byte_mode_supported; > + > + > /** Maximum number of shared shapers. The value of zero indicates > that > * shared shapers are not supported. > */ > @@ -284,6 +301,21 @@ struct rte_tm_capabilities { > */ > uint64_t shaper_shared_rate_max; >=20 > + /** Shaper shared packet mode supported. When non-zero, this > parameter > + * indicates a shared shaper can be configured with packet mode. > + * When shared shaper is configured in packet mode, > committed/peak rate > + * provided is interpreted in packets per second. > + */ > + int shaper_shared_packet_mode_supported; > + > + /** Shaper shared byte mode supported. When non-zero, this > parameter > + * indicates that a shared shaper can be configured with byte mode. > + * When shared shaper is configured in byte mode, committed/peak > rate > + * provided is interpreted in bytes per second. > + */ > + int shaper_shared_byte_mode_supported; > + > + > /** Minimum value allowed for packet length adjustment for any > private > * or shared shaper. > */ > @@ -339,6 +371,22 @@ struct rte_tm_capabilities { > */ > uint32_t sched_wfq_weight_max; >=20 > + /** WFQ packet mode supported. When non-zero, this parameter > indicates > + * that there is at least one non-leaf node that supports packet mode > + * for WFQ among its children. WFQ weights will be applied against > + * packet count for scheduling children when a non-leaf node > + * is configured appropriately. > + */ > + int sched_wfq_packet_mode_supported; > + > + /** WFQ byte mode supported. When non-zero, this parameter > indicates > + * that there is at least one non-leaf node that supports byte mode > + * for WFQ among its children. WFQ weights will be applied against > + * bytes for scheduling children when a non-leaf node is configured > + * appropriately. > + */ > + int sched_wfq_byte_mode_supported; > + > /** WRED packet mode support. When non-zero, this parameter > indicates > * that there is at least one leaf node that supports the WRED packet > * mode, which might not be true for all the leaf nodes. In packet > @@ -485,6 +533,24 @@ struct rte_tm_level_capabilities { > */ > uint64_t shaper_private_rate_max; >=20 > + /** Shaper private packet mode supported. When > non-zero, > + * this parameter indicates there is atleast one > + * non-leaf node at this level that can be configured > + * with packet mode in its private shaper. When > private > + * shaper is configured in packet mode, > committed/peak > + * rate provided is interpreted in packets per second. > + */ > + int shaper_private_packet_mode_supported; > + > + /** Shaper private byte mode supported. When > non-zero, > + * this parameter indicates there is atleast one > + * non-leaf node at this level that can be configured > + * with byte mode in its private shaper. When private > + * shaper is configured in byte mode, > committed/peak > + * rate provided is interpreted in bytes per second. > + */ > + int shaper_private_byte_mode_supported; > + > /** Maximum number of shared shapers that any > non-leaf > * node on this level can be part of. The value of zero > * indicates that shared shapers are not supported by > @@ -554,6 +620,25 @@ struct rte_tm_level_capabilities { > */ > uint32_t sched_wfq_weight_max; >=20 > + /** WFQ packet mode supported. When non-zero, > this > + * parameter indicates that there is at least one > + * non-leaf node at this level that supports packet > + * mode for WFQ among its children. WFQ weights > will > + * be applied against packet count for scheduling > + * children when a non-leaf node is configured > + * appropriately. > + */ > + int sched_wfq_packet_mode_supported; > + > + /** WFQ byte mode supported. When non-zero, this > + * parameter indicates that there is at least one > + * non-leaf node at this level that supports byte > + * mode for WFQ among its children. WFQ weights > will > + * be applied against bytes for scheduling children > + * when a non-leaf node is configured appropriately. > + */ > + int sched_wfq_byte_mode_supported; > + > /** Mask of statistics counter types supported by the > * non-leaf nodes on this level. Every supported > * statistics counter type is supported by at least one > @@ -596,6 +681,24 @@ struct rte_tm_level_capabilities { > */ > uint64_t shaper_private_rate_max; >=20 > + /** Shaper private packet mode supported. When > non-zero, > + * this parameter indicates there is atleast one leaf > + * node at this level that can be configured with > + * packet mode in its private shaper. When private > + * shaper is configured in packet mode, > committed/peak > + * rate provided is interpreted in packets per second. > + */ > + int shaper_private_packet_mode_supported; > + > + /** Shaper private byte mode supported. When > non-zero, > + * this parameter indicates there is atleast one leaf > + * node at this level that can be configured with > + * byte mode in its private shaper. When private > shaper > + * is configured in byte mode, committed/peak rate > + * provided is interpreted in bytes per second. > + */ > + int shaper_private_byte_mode_supported; > + > /** Maximum number of shared shapers that any > leaf node > * on this level can be part of. The value of zero > * indicates that shared shapers are not supported by You are missing the shaper_shared_(packet, byte)_mode supported for non-lea= f and leaf nodes in struct rte_tm_level_capabilities. The description of this nodes should be aligned with the description of e.g= . shaper_shared_n_max field: basically, we want to say that, when true, the= flag signifies there is at least on non-leaf/leaf node on this level that = can be part of a shared shaper that works in packet/byte mode. Makes sense? > @@ -686,6 +789,20 @@ struct rte_tm_node_capabilities { > */ > uint64_t shaper_private_rate_max; >=20 > + /** Shaper private packet mode supported. When non-zero, this > parameter > + * indicates private shaper of current node can be configured with > + * packet mode. When configured in packet mode, committed/peak > rate > + * provided is interpreted in packets per second. > + */ > + int shaper_private_packet_mode_supported; > + > + /** Shaper private byte mode supported. When non-zero, this > parameter > + * indicates private shaper of current node can be configured with > + * byte mode. When configured in byte mode, committed/peak rate > + * provided is interpreted in bytes per second. > + */ > + int shaper_private_byte_mode_supported; > + > /** Maximum number of shared shapers the current node can be > part of. > * The value of zero indicates that shared shapers are not supported > by > * the current node. You are missing the shaper_shared_(packet, byte)_mode supported (applicable= for both non-leaf and leaf nodes, so it should occur only once in the comm= on part of the struct) in struct rte_tm_node_capabilities. See the above co= mment on the applicable description style. > @@ -735,6 +852,23 @@ struct rte_tm_node_capabilities { > * WFQ weight, so WFQ is reduced to FQ. > */ > uint32_t sched_wfq_weight_max; > + > + /** WFQ packet mode supported. When non-zero, > this > + * parameter indicates that current node supports > packet > + * mode for WFQ among its children. WFQ weights > will be > + * applied against packet count for scheduling > children > + * when configured appropriately. > + */ > + int sched_wfq_packet_mode_supported; > + > + /** WFQ byte mode supported. When non-zero, this > + * parameter indicates that current node supports > byte > + * mode for WFQ among its children. WFQ weights > will be > + * applied against bytes for scheduling children when > + * configured appropriately. > + */ > + int sched_wfq_byte_mode_supported; > + > } nonleaf; >=20 > /** Items valid only for leaf nodes. */ > @@ -836,10 +970,10 @@ struct rte_tm_wred_params { > * Token bucket > */ > struct rte_tm_token_bucket { > - /** Token bucket rate (bytes per second) */ > + /** Token bucket rate (bytes per second or packets per second) */ > uint64_t rate; >=20 > - /** Token bucket size (bytes), a.k.a. max burst size */ > + /** Token bucket size (bytes or packets), a.k.a. max burst size */ > uint64_t size; > }; >=20 > @@ -860,6 +994,11 @@ struct rte_tm_token_bucket { > * Dual rate shapers use both the committed and the peak token buckets. > The > * rate of the peak bucket has to be bigger than zero, as well as greate= r than > * or equal to the rate of the committed bucket. > + * > + * @see struct > rte_tm_capabilities::shaper_private_packet_mode_supported > + * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported > + * @see struct > rte_tm_capabilities::shaper_shared_packet_mode_supported > + * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported > */ > struct rte_tm_shaper_params { > /** Committed token bucket */ > @@ -874,6 +1013,17 @@ struct rte_tm_shaper_params { > * RTE_TM_ETH_FRAMING_OVERHEAD_FCS). > */ > int32_t pkt_length_adjust; > + > + /** When zero, the private or shared shaper that is associated to this > + * profile works in byte mode and hence *rate* and *size* fields in > + * both token bucket configurations are specified in bytes per second > + * and bytes respectively. > + * When non-zero, that private or shared shaper works in packet > mode and > + * hence *rate* and *size* fields in both token bucket configurations > + * are specified in packets per second and packets respectively. In > + * packet mode, *pkt_length_adjust* is ignored. > + */ Please move the last statement ("In packet mode, *pkt_length_adjust* is ign= ored.") to the description of the pkt_length_adjust field. > + int packet_mode; > }; >=20 > /** > @@ -925,6 +1075,8 @@ struct rte_tm_node_params { > * When non-NULL, it points to a pre-allocated array > of > * *n_sp_priorities* values, with non-zero value for > * byte-mode and zero for packet-mode. > + * @see struct > rte_tm_node_capabilities::sched_wfq_packet_mode_supported > + * @see struct > rte_tm_node_capabilities::sched_wfq_byte_mode_supported > */ > int *wfq_weight_mode; >=20 > -- > 2.8.4 Regards, Cristian