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 C11D1A04B7; Wed, 16 Sep 2020 16:53:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 801351C2B3; Wed, 16 Sep 2020 16:53:32 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9C16D1C2AC for ; Wed, 16 Sep 2020 16:53:30 +0200 (CEST) IronPort-SDR: 8O8bI9gOCdpddgVICvuEPufd34nFo0hPpFCsphtfvHSfairT5s3N1s7hQTfrMkvg3fXeQ+EWSU QBWlePR1V6Kg== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="177553844" X-IronPort-AV: E=Sophos;i="5.76,433,1592895600"; d="scan'208";a="177553844" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 07:53:29 -0700 IronPort-SDR: arr5qnc5Sucb5niEjEM5MRBxGBSmd+qx0D91xawi1VY8PRwHR49JEqq1keweJdKvPEdXBsUQpH fNNFRT4M3tpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,433,1592895600"; d="scan'208";a="346254262" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga007.jf.intel.com with ESMTP; 16 Sep 2020 07:53:28 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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.1713.5; Wed, 16 Sep 2020 07:53:28 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) 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.1713.5; Wed, 16 Sep 2020 07:53:28 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 16 Sep 2020 07:53:28 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 16 Sep 2020 07:53:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ilQPkCna9fJvWtjn5yLDpAdz2KKShCsO+tJNC8N/FYVWSAJ1Q3DL1UlmcdeghhzaHYg5Dss4/uWH7zHM+rdzs9uwx7uEnSj6tzoI9RAS6k+BpijG4biV+zmypncpBa7sswBzgn6CdHTaH2B6vbv/GvK3fWuf9ymiVO692AUM8mhTyu6FWZXm9guo+HI1yS6t8EZHDQFQGYTwjXmNKv+k2XfquIjTQg8xdV5JWER4TnNgcacD6vW2Q+pcmGaeGZsYCyHpEjKjmTUhOoVZzNOc0wvNtAu/mAcIg79jTyrlG1OG61xAA00e+P1BnP6lhVwJ484yWLDGgW2DoWNUHl0Udg== 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=xHauyqNDeP/0Rh9pAUj4XK6aNQ08gaXIaNH5VWGVDdQ=; b=dudy6Q7zfQq81tlhKTbLGK0QBa9xBAAY4z7TKif4/Nhm6VhKkPqIhFiEMLBc5A97R0Oo399dTXSHw60KJfigdKSLP79fvvrto6uSbnRUhEU3X7sM2vwzh6UD+jL3/4QrpYq3exB5D7VArpF/JgVtbLHPIa0AAhwXCkMYEApv6/kzWpRTOoYTeEAUxcHSxVJKYJHcZ9B8Pcx+azoqmnQTxsvKwS6RvZpPRsVSQmQMXMJa5tvlSXU9YcjJRHZWDx4rWJt4JZbAg9z1t9GvrJ311jdCl/vyRHOeheCKdqxqqLuCp8WVQPCjTRhcoWyEtoWJifT1jAgEJXdarSm3YrgULw== 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=xHauyqNDeP/0Rh9pAUj4XK6aNQ08gaXIaNH5VWGVDdQ=; b=l4J4DcVWzacd1FtsvljFZnIWYx0L9cttwZXKwGAJksopIjYDJFiW/ycCdC5OlqgLNoYrD+T1sBH0pN5Jv2I8R6fjuke2/EJGYn40RujZ/h9u9ke23TDGgCyNFvYBUuy+KeYIUQiwS2j+l1eOU/7nAWmKK+UovAEw4bQt5tEJ87c= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3624.namprd11.prod.outlook.com (2603:10b6:a03:b1::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 14:53:24 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f43b:a137:dab8:8b0b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f43b:a137:dab8:8b0b%6]) with mapi id 15.20.3391.011; Wed, 16 Sep 2020 14:53:24 +0000 From: "Ananyev, Konstantin" To: "Ma, Liang J" CC: "dev@dpdk.org" , "Hunt, David" , "Burakov, Anatoly" Thread-Topic: [dpdk-dev] [PATCH v3 3/6] power: add simple power management API and callback Thread-Index: AQHWitpY4W1ywzYujEqwq5tG0RKxQqlrW/OQ Date: Wed, 16 Sep 2020 14:53:24 +0000 Message-ID: References: <1597141666-20621-1-git-send-email-liang.j.ma@intel.com> <1599214740-3927-1-git-send-email-liang.j.ma@intel.com> <1599214740-3927-3-git-send-email-liang.j.ma@intel.com> <20200914210140.GE13240@sivswdev09.ir.intel.com> In-Reply-To: <20200914210140.GE13240@sivswdev09.ir.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 59e1afb4-805c-4b80-ce33-08d85a504316 x-ms-traffictypediagnostic: BYAPR11MB3624: 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:186; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TrobiOOlV3isLtMTqHXRSpB91bL2Hhx8GnXOWlAlOhdtgqNwE7KOdHYx4cEoW+zTcQYiKFjBVLOmKIvU+KbeT/th4+3AWYeU0Scw5Z6KW1+7qPy8ZzG4o1EDeNLShVV/cwZ+iTGRKDEzZVrNyL4BT+btdzdYcj3xu2Q6/W6UoMqahvSqHwSgJGlqCSNXU2m6sr21xOaVhIuimlAauBm08vybq2z6TImwNy7URVllVP+qWQI4yj5PRQFyxwTjPT00rupnKp/ukQU+g7X2fJY0OBWl2uGLDH9WcKGrZFKs+GXjEBy+PIdFs1TaT0oUnG9aTe2Kbyw2yCjNqYHI0ehsLginXc9bG60L7659Ba3Q3YbVi3EE1qjlFPTzfpN4p5UO x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(71200400001)(8676002)(26005)(186003)(33656002)(52536014)(2906002)(55016002)(5660300002)(9686003)(7696005)(8936002)(86362001)(316002)(6506007)(478600001)(4326008)(6636002)(107886003)(66556008)(76116006)(64756008)(66476007)(4744005)(83380400001)(6862004)(66446008)(54906003)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: wZSJYyy+V/VNYMFPqNMgARv7CuhsFe1F4oWt9VtgzE9XEOCoVG3h6o3nv30LWqUbdHiRzMOu3ivjtw1LRnHceNBCtacYMHD8g0YNhBt3ZjoNF3puxvpVOs41O2F7VlaU91zMb4bSFY1WU4yvQ62ul6PibVrmFWuU899anA1a5/6qRSrVaIbHOyXBGkaR/EgxKAOkQ73VyVdj32Yekl84c1Fsm/kpDnYebxdY2ZpCs/z7Z0wfKDsG6dlaonwnid7ZZgP0s7s53OaX65H15oPsj5bMNKasMhK6cYTWr3Tz2FZ4BmMmnm6IlguIHVSxP4cO8URPEanqdDw1jskk6xaWMlZyhQQdmUvX22xBfjnG/Q/AEY6q8mxndreLFuT/ocs5K6x68uwC5AGY+Ax9fV0Dy/3flTmzCRUjiXTLpVu6jYRsGt0LeEG8ROzmY0oERRASfVg6o2pP0XdQCalA1JR9FgBAFmwsWP5JmgJvvEcRP8l/Kk9ixwsLXwmD5huWynw0qqKwJEe3jUcIA9Uou67c2SLC1mDr3eXf6ryNbWturSj6FFXNSl1T2QvTYhqWItqi92Pr3TN7fxOxqcP2r3Gc3DOeB9K7i/2mpMpxl+cDVEP/gEjxlTVSvivjLo/5UGwVhHzZWWkKxKh4aYjPaI2vFg== 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: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59e1afb4-805c-4b80-ce33-08d85a504316 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2020 14:53:24.0637 (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: Te9IxNY6tO2eFyJvw2sZL06Q7qji3LhDLVnwKKZNZXnaAf/K6PD1Vqa9ov4xv/uhRp+dnDsfCF7DwNLCZqI5jFMABawcw1CiBHuDwXOum64= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3624 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 3/6] power: add simple power management API and callback 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" > > > > > + > > > +switch (dev->cb_mode) { > > > +case RTE_ETH_DEV_POWER_MGMT_CB_WAIT: > > > +case RTE_ETH_DEV_POWER_MGMT_CB_PAUSE: > > > +rte_eth_remove_rx_callback(port_id, 0, > > > + dev->cur_pwr_cb); > > > +break; > > > +case RTE_ETH_DEV_POWER_MGMT_CB_SCALE: > > > +rte_power_freq_max(lcore_id); > > > > Stupid q: what makes you think that lcore frequency was max, > > *before* you setup the callback? > that is because the rte_power_init() has figured out the system max. > the init code invocate rte_power_init() already. So rte_power_init(lcore) always raises lcore frequency to max possible value? > > > > > +rte_eth_remove_rx_callback(port_id, 0, > > > + dev->cur_pwr_cb); > > > +if (rte_power_exit(lcore_id)) > > > +return -EINVAL; > > > +break; > > > +} > > > + > > > +dev->pwr_mgmt_state =3D RTE_ETH_DEV_POWER_MGMT_DISABLED; > > > +dev->cur_pwr_cb =3D NULL; > > > +dev->cb_mode =3D 0; > > > + > > > +return 0; > > > +}