DPDK  24.11.0-rc3
rte_power_cpufreq.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  * Copyright(c) 2024 Advanced Micro Devices, Inc.
4  */
5 
6 #ifndef RTE_POWER_CPUFREQ_H
7 #define RTE_POWER_CPUFREQ_H
8 
14 #include <rte_common.h>
15 #include <rte_log.h>
16 
17 #include "power_cpufreq.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /* Power Management Environment State */
24 enum power_management_env {
25  PM_ENV_NOT_SET = 0,
26  PM_ENV_ACPI_CPUFREQ,
27  PM_ENV_KVM_VM,
28  PM_ENV_PSTATE_CPUFREQ,
29  PM_ENV_CPPC_CPUFREQ,
30  PM_ENV_AMD_PSTATE_CPUFREQ
31 };
32 
45 int rte_power_check_env_supported(enum power_management_env env);
46 
60 int rte_power_set_env(enum power_management_env env);
61 
66 void rte_power_unset_env(void);
67 
74 enum power_management_env rte_power_get_env(void);
75 
88 int rte_power_init(unsigned int lcore_id);
89 
101 int rte_power_exit(unsigned int lcore_id);
102 
118 uint32_t rte_power_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num);
119 
131 uint32_t rte_power_get_freq(unsigned int lcore_id);
132 
149 uint32_t rte_power_set_freq(unsigned int lcore_id, uint32_t index);
150 
164 int rte_power_freq_up(unsigned int lcore_id);
165 
179 int rte_power_freq_down(unsigned int lcore_id);
180 
194 int rte_power_freq_max(unsigned int lcore_id);
195 
209 int rte_power_freq_min(unsigned int lcore_id);
210 
223 int rte_power_turbo_status(unsigned int lcore_id);
224 
236 int rte_power_freq_enable_turbo(unsigned int lcore_id);
237 
249 int rte_power_freq_disable_turbo(unsigned int lcore_id);
250 
265 int rte_power_get_capabilities(unsigned int lcore_id,
266  struct rte_power_core_capabilities *caps);
267 
268 #ifdef __cplusplus
269 }
270 #endif
271 
272 #endif /* RTE_POWER_CPUFREQ_H */
int rte_power_freq_max(unsigned int lcore_id)
int rte_power_exit(unsigned int lcore_id)
int rte_power_get_capabilities(unsigned int lcore_id, struct rte_power_core_capabilities *caps)
int rte_power_freq_down(unsigned int lcore_id)
int rte_power_freq_up(unsigned int lcore_id)
void rte_power_unset_env(void)
int rte_power_turbo_status(unsigned int lcore_id)
int rte_power_freq_min(unsigned int lcore_id)
uint32_t rte_power_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
enum power_management_env rte_power_get_env(void)
uint32_t rte_power_get_freq(unsigned int lcore_id)
int rte_power_freq_disable_turbo(unsigned int lcore_id)
int rte_power_set_env(enum power_management_env env)
int rte_power_init(unsigned int lcore_id)
int rte_power_freq_enable_turbo(unsigned int lcore_id)
int rte_power_check_env_supported(enum power_management_env env)
uint32_t rte_power_set_freq(unsigned int lcore_id, uint32_t index)