From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0049.outbound.protection.outlook.com [104.47.32.49]) by dpdk.org (Postfix) with ESMTP id 94EC62B9A for ; Thu, 5 Oct 2017 11:07:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Hzb9OxvIN/H0sKBuhAMCMc4RAlQdHUvFi8fHksWTA+w=; b=GHdwwDn5riVttSATUbUh/LGfv+BKmLZ0GEi1prYA6yGzls1axai2FSu/jUiqaCpSVuuXZSyChQeFA45gnpgJRKhhYFb7hSVkMkHdsYOOZ7tOFO/fhV1na7KuUjRaqSkHeYeJ84OizT9hTVX/QRbHaM+5Riz6kzIx0hQSNBu21Eo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [IPv6:2401:4900:1984:75ec:516e:bc2f:cd22:9551] (2401:4900:1984:75ec:516e:bc2f:cd22:9551) by BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 5 Oct 2017 09:07:36 +0000 To: "Hunt, David" , dev@dpdk.org References: <1507108515-186477-1-git-send-email-david.hunt@intel.com> <1507130720-48891-1-git-send-email-david.hunt@intel.com> <1507130720-48891-5-git-send-email-david.hunt@intel.com> <75c0cd23-7b05-ca49-5fa5-c8a229f2e0ee@caviumnetworks.com> <6c97bd17-7a24-d1d0-f200-91d68f68c664@intel.com> Cc: konstantin.ananyev@intel.com, jingjing.wu@intel.com, Nemanja Marjanovic , Rory Sexton From: santosh Message-ID: Date: Thu, 5 Oct 2017 14:37:17 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <6c97bd17-7a24-d1d0-f200-91d68f68c664@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [2401:4900:1984:75ec:516e:bc2f:cd22:9551] X-ClientProxiedBy: MA1PR01CA0082.INDPRD01.PROD.OUTLOOK.COM (10.174.56.22) To BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 96202684-ae99-4ae1-5dd8-08d50bd086bb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:mTpNfj1ePr5Rhr8/NlKEFTHh542L7fRFLVwQV2fr/O0jKs58hUnv1WHemjH5yZNSn+90JNHUDkE6et1Op8Fry/YCYBCNwHcz/5t69JACbI1phEMODtpkF6IAB0Dw363qEBAC/Ww1lgsir1Nexo9rAx4FH8cMgL8yDotl2er2o8FjO4bTlIROEiOMcrZxvSUsr1W/iwteAlpB3CB5B3aqyMdZuj7asPNAvA2nL8nRr12phoNqXZo8JaqhTsT9n0EM; 25:9u2/RmsJbMGGfhwD18AWIcADCaYfE1Lr84U2lLbz9CNb0U2Fegpq/piMGGsd/6HOMeJHnrQ/brK3zPBiFBeIzrSXpB6LyjTDe/I7SoXXcWUA4cnEqL35Xs/tiyY9pJmpwoDF+dFmOw5we0hREzBU/GSE2n0nrAq/g6Okl+gf+d+EkERS3PRbPGqDHJvw2pOvnKYiE73XOfYp6SUdIvbnMiU42e81wTNyDC6H26K64L3xZk4XEmasLy+43qx8OHZctN9AcksvDQ/7tsLhdXRVadl+VRigycvlxSrjmP1lwxZrWEAgpBuNHIU/gbcKzSA2jw+/MFNtrEhVcFw6k1GKyg==; 31:wLeUjcFin42umUDhp5PCazUyLOUorEXz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rH80CaLDJhBxBCqPuLoCSryzyn8z1oYNxhdcEWKQVfHbpHH7Sb0uuwE6A1QNZWwc0S5guAXUo2bgn3QtjRAZesLmzrBLmqUQ6Gv8VYrqB4NbY+6kSntDf/M= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(100000703101)(100105400095)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3089; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3089; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6059001)(376002)(346002)(189002)(199003)(377454003)(24454002)(5660300001)(230700001)(316002)(2906002)(23746002)(305945005)(54906003)(58126008)(47776003)(229853002)(101416001)(97736004)(33646002)(7736002)(76176999)(53936002)(50986999)(54356999)(6486002)(68736007)(31686004)(36756003)(4326008)(65826007)(106356001)(93886005)(86152003)(189998001)(105586002)(31696002)(6116002)(81156014)(2950100002)(42882006)(53546010)(8936002)(64126003)(83506001)(65956001)(50466002)(81166006)(8676002)(65806001)(25786009)(6666003)(6246003)(1706002)(72206003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3089; H:[IPv6:2401:4900:1984:75ec:516e:bc2f:cd22:9551]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN6PR07MB3089; 23:jGnH4rybYKjlU4K3kqIBbQLcItVV7OeotSEkC?= =?Windows-1252?Q?ZJdwz8WAs0DFnyX67wQclO8rXrNg5T6CjDVF6idWulojwuVa+khDBApj?= =?Windows-1252?Q?YTQhuV64H5Y/Zwemt9a9yeenU6f2prZOVpvOEI9tQUb9KqTiSUf3DaXL?= =?Windows-1252?Q?/e5Rfxd2ulp3mHQtgruokf/CPflnpEqSzcl3jt+RrrMb14uThAEFoxwG?= =?Windows-1252?Q?ltc3BQUWSvBbzbRaA5kyt9kluIIfAWC5vxz4r1YoG2HBOdTEqWgodVav?= =?Windows-1252?Q?BbeHAptGnHsTNAB4WamntkrrXW8zLjVO2DdRgca2I+QtitYMIVooBu7D?= =?Windows-1252?Q?Hft/oLNs7PMBSL3zcCk7WiIVRDQGXHGgRlBBBzctW8QFiu9lrLSY8WW8?= =?Windows-1252?Q?cEz74O7kzsPdafZfOpl1HNbtMmHAk3cfFVMBkNUN1xQMXc1PNKkhM9yV?= =?Windows-1252?Q?YpMIbs6V7iLSt+Eu4aBua7kqyQijm9O4DmmWbfHrNIJx4yMcXgTwbEmi?= =?Windows-1252?Q?t8NG+vvOm/ZH0Qzw5ZQm8jFH14TEBvbglyZYpQf2S44CuyPDQ5Kq9itz?= =?Windows-1252?Q?HAAAKjGsyE+AeXo37DVnucQtS/sEdQ8uYdPc8TF8wejfj48YW4/iod0X?= =?Windows-1252?Q?tCWpmwk+si2xMZeL22OHfy33aibrS2wYCpxzYiQLfKc7NwD9E3BUZjai?= =?Windows-1252?Q?N8Qeh1vkSqGQbBQm5rSbw0g4dGiThBJFYTh7QzM/stCKb9DpFfmCMxok?= =?Windows-1252?Q?I0UiNB2vzeFE0Py1tgPHcqpFxa/8774ja9VPbabCU/748/Bv5N/PUuas?= =?Windows-1252?Q?KdPj6U0Fm3/jWJFJsfPkVh/zQbPO+2OSX9hzanCu+rNQVe6M4pkwmFxt?= =?Windows-1252?Q?wSYNBOGVzwQS8LOhlzSNuETVqFmHbcS9A760GS/t3yxnbw8tVHqL/cyK?= =?Windows-1252?Q?4z7+N2wm3Wk3ey1H2yENluOvkDOzroFgRJ7B7t6KooI9Gi5hXsAq1RuS?= =?Windows-1252?Q?vfo4uT/dgCM35qTnhyAWbyOCkp7HVx8wWeyP97Eb+sBXb1Xcc0L8dMir?= =?Windows-1252?Q?a3Y5BqgwR8vovfWzWtUzstN58ZIbcCqfWBaLHc3gYZEI49pOAEmPzrn+?= =?Windows-1252?Q?1UvE3Os5XiuJLmP/DTikq4FUSKLH2vMDaZLUFEYYKboWYONM/v2Vn0mt?= =?Windows-1252?Q?zzeBlJi2sEkmxOwU7h4+s3B0+WW8xOb+G3rxC0zrcQnbg89dbbEiaH0G?= =?Windows-1252?Q?cuRK9mDbbBFI8I89b9qx/is/8s2LTkf0X5DV4nSXKbuBb2g4I5HSQY1n?= =?Windows-1252?Q?zluptzqPLnU7ShB5IVnuRyOdx/Go2trTaHCvLDLIeP+Ns8thkbVu3Cxf?= =?Windows-1252?Q?DYt4vSZIi5+No3CPYMqJ0TFipBiENsJiHOZ+QIrTH1YdjjfjgOpRRo?= =?Windows-1252?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 6:QrZ42mJNhdp327z1xfz4Co5A0MvBenMKPQaRmQe+KaClKNZ2BS2Q/wWipI/AIZmuI38pPd5M3fBrhmL+MLPQEBKe//rhxT9LbHRIyFvObbCDWpUAhOKgqjdtyq6aDkcoQIAEZg2evAf3TcF0gAnjK25VaQsekLsyDC44jeb0KWxeXuSjeYFgZoSsatSytwwpH2nRElcCAZNaTIRUzOPlyETspp4E0v1Ld1bGC20NM94AUz8yRaH5CCH+OVhDzDXK+UH2hTqUTDTcS08mcHLr+qAMkF6zoFCjLReuLFpNHQ8Ttjar4b1QOS41Va9M20L4eReTd6/uwpmb0nWcguL62w==; 5:2yGZ4uW4DeOmhCxgo8Tvwv5Yd4HA/DXQ2SbbA8ndJd88JHiVNQmVKrAx3+Pvy3UG9PdH7p+xulT0jl20Cfv5oKkGMICnn7xptYfTwbJdCjnfFRYAm9d4zp1MKfB8FWKfy2p4Sn6dYHs52eosLvLEgQ==; 24:u2fmADIDGhe/HJWgzUgabVfBStUqQ3Oa1TCO+Nbud+cEQ6MY/XvQaqkLK1C2xInnfeE3r+4OEROT3QdVsxCKCNlrfpfBpUGotg/9RJl+DS4=; 7:vvSDefKR6x56MCxoO9npOJgaU2LObb6wCphplA085/IYc1lVNrJXVfTj+WGJT7Y1xARWebhtg77bfFU018ioqCUD3gNQZb1kPbJ9OTPftb3mYGWcoDKJQTsCt1YPjLto0kCuh1xZhep8qnOEPBnNUI1MnAzn3Q5o3x21h5vf/UCwM4/6feHvE/FPvcxRBfIzcnpxEuJBZ9gtgdaAo1pjjHj91VaF0/1VVZYnF0RmeTc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 09:07:36.0259 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3089 Subject: Re: [dpdk-dev] [PATCH v5 4/9] examples/vm_power_mgr: add scale to medium freq fn 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: , X-List-Received-Date: Thu, 05 Oct 2017 09:07:40 -0000 Hi David, On Thursday 05 October 2017 02:17 PM, Hunt, David wrote: > Hi Santosh, > > > On 4/10/2017 5:04 PM, santosh wrote: >> Hi David, >> >> >> On Wednesday 04 October 2017 08:55 PM, David Hunt wrote: >>> Signed-off-by: Nemanja Marjanovic >>> Signed-off-by: Rory Sexton >>> Signed-off-by: David Hunt >>> --- >>> examples/vm_power_manager/power_manager.c | 15 +++++++++++++++ >>> examples/vm_power_manager/power_manager.h | 13 +++++++++++++ >>> 2 files changed, 28 insertions(+) >>> >>> diff --git a/examples/vm_power_manager/power_manager.c b/examples/vm_power_manager/power_manager.c >>> index 80705f9..c021c1d 100644 >>> --- a/examples/vm_power_manager/power_manager.c >>> +++ b/examples/vm_power_manager/power_manager.c >>> @@ -286,3 +286,18 @@ power_manager_disable_turbo_core(unsigned int core_num) >>> POWER_SCALE_CORE(disable_turbo, core_num, ret); >>> return ret; >>> } >>> + >>> +int >>> +power_manager_scale_core_med(unsigned int core_num) >>> +{ >>> + int ret = 0; >>> + >>> + if (core_num >= POWER_MGR_MAX_CPUS) >>> + return -1; >>> + if (!(global_enabled_cpus & (1ULL << core_num))) >>> + return -1; >>> + rte_spinlock_lock(&global_core_freq_info[core_num].power_sl); >>> + ret = rte_power_set_freq(core_num, 5); >> nits: >> what is 5? also should be enum or macro. >> >> Thanks. >> > > This probably shouldn't be hard-coded. The intention is to select a middle frequency. I can add a helper function to get the value > that is halfway between min and max, and use that instead. > I'm ok with your proposition. Thanks. > Thanks, > Dave. > > >