From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B0EF011DE for ; Thu, 5 Oct 2017 10:47:37 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Oct 2017 01:47:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,480,1500966000"; d="scan'208";a="906989427" Received: from dhunt5-mobl1.ger.corp.intel.com (HELO [10.237.220.44]) ([10.237.220.44]) by FMSMGA003.fm.intel.com with ESMTP; 05 Oct 2017 01:47:33 -0700 To: santosh , dev@dpdk.org Cc: konstantin.ananyev@intel.com, jingjing.wu@intel.com, Nemanja Marjanovic , Rory Sexton 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> From: "Hunt, David" Message-ID: <6c97bd17-7a24-d1d0-f200-91d68f68c664@intel.com> Date: Thu, 5 Oct 2017 09:47:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <75c0cd23-7b05-ca49-5fa5-c8a229f2e0ee@caviumnetworks.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 08:47:38 -0000 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. Thanks, Dave.