DPDK 22.11.4
rte_power.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
3 */
4
5#ifndef _RTE_POWER_H
6#define _RTE_POWER_H
7
13#include <rte_compat.h>
14#include <rte_common.h>
15#include <rte_log.h>
16#include <rte_power_guest_channel.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/* Power Management Environment State */
23enum power_management_env {PM_ENV_NOT_SET, PM_ENV_ACPI_CPUFREQ, PM_ENV_KVM_VM,
24 PM_ENV_PSTATE_CPUFREQ, PM_ENV_CPPC_CPUFREQ};
25
41__rte_experimental
42int rte_power_check_env_supported(enum power_management_env env);
43
57int rte_power_set_env(enum power_management_env env);
58
64
71enum power_management_env rte_power_get_env(void);
72
85int rte_power_init(unsigned int lcore_id);
86
98int rte_power_exit(unsigned int lcore_id);
99
115typedef uint32_t (*rte_power_freqs_t)(unsigned int lcore_id, uint32_t *freqs,
116 uint32_t num);
117
118extern rte_power_freqs_t rte_power_freqs;
119
131typedef uint32_t (*rte_power_get_freq_t)(unsigned int lcore_id);
132
133extern rte_power_get_freq_t rte_power_get_freq;
134
151typedef int (*rte_power_set_freq_t)(unsigned int lcore_id, uint32_t index);
152
153extern rte_power_set_freq_t rte_power_set_freq;
154
167typedef int (*rte_power_freq_change_t)(unsigned int lcore_id);
168
175
182
189
196
202
208
214
220 union {
221 uint64_t capabilities;
223 struct {
224 uint64_t turbo:1;
225 uint64_t priority:1;
226 };
227 };
228};
229
244typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
245 struct rte_power_core_capabilities *caps);
246
247extern rte_power_get_capabilities_t rte_power_get_capabilities;
248
249#ifdef __cplusplus
250}
251#endif
252
253#endif
#define RTE_STD_C11
Definition: rte_common.h:39
int(* rte_power_freq_change_t)(unsigned int lcore_id)
Definition: rte_power.h:167
void rte_power_unset_env(void)
rte_power_freq_change_t rte_power_freq_max
int rte_power_set_env(enum power_management_env env)
uint32_t(* rte_power_freqs_t)(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
Definition: rte_power.h:115
rte_power_freq_change_t rte_power_freq_down
uint32_t(* rte_power_get_freq_t)(unsigned int lcore_id)
Definition: rte_power.h:131
rte_power_freq_change_t rte_power_freq_up
__rte_experimental int rte_power_check_env_supported(enum power_management_env env)
rte_power_freq_change_t rte_power_freq_enable_turbo
rte_power_freq_change_t rte_power_freq_min
int rte_power_init(unsigned int lcore_id)
rte_power_freq_change_t rte_power_turbo_status
enum power_management_env rte_power_get_env(void)
int(* rte_power_get_capabilities_t)(unsigned int lcore_id, struct rte_power_core_capabilities *caps)
Definition: rte_power.h:244
rte_power_freq_change_t rte_power_freq_disable_turbo
int rte_power_exit(unsigned int lcore_id)
int(* rte_power_set_freq_t)(unsigned int lcore_id, uint32_t index)
Definition: rte_power.h:151