Re: [PATCH v5 4/9] examples/vm_power_mgr: add scale to medium freq fn
From: santosh <hidden>
Date: 2017-10-04 16:05:06
Hi David, On Wednesday 04 October 2017 08:55 PM, David Hunt wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Nemanja Marjanovic <redacted> Signed-off-by: Rory Sexton <redacted> Signed-off-by: David Hunt <redacted> --- 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.