DPDK 21.11.9
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_common.h>
14#include <rte_byteorder.h>
15#include <rte_log.h>
16#include <rte_string_fns.h>
17#include <rte_power_guest_channel.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* Power Management Environment State */
24enum power_management_env {PM_ENV_NOT_SET, PM_ENV_ACPI_CPUFREQ, PM_ENV_KVM_VM,
25 PM_ENV_PSTATE_CPUFREQ, PM_ENV_CPPC_CPUFREQ};
26
42__rte_experimental
43int rte_power_check_env_supported(enum power_management_env env);
44
58int rte_power_set_env(enum power_management_env env);
59
65
72enum power_management_env rte_power_get_env(void);
73
86int rte_power_init(unsigned int lcore_id);
87
99int rte_power_exit(unsigned int lcore_id);
100
116typedef uint32_t (*rte_power_freqs_t)(unsigned int lcore_id, uint32_t *freqs,
117 uint32_t num);
118
119extern rte_power_freqs_t rte_power_freqs;
120
132typedef uint32_t (*rte_power_get_freq_t)(unsigned int lcore_id);
133
134extern rte_power_get_freq_t rte_power_get_freq;
135
152typedef int (*rte_power_set_freq_t)(unsigned int lcore_id, uint32_t index);
153
154extern rte_power_set_freq_t rte_power_set_freq;
155
168typedef int (*rte_power_freq_change_t)(unsigned int lcore_id);
169
176
183
190
197
203
209
215
221 union {
222 uint64_t capabilities;
224 struct {
225 uint64_t turbo:1;
226 uint64_t priority:1;
227 };
228 };
229};
230
245typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
246 struct rte_power_core_capabilities *caps);
247
248extern rte_power_get_capabilities_t rte_power_get_capabilities;
249
250#ifdef __cplusplus
251}
252#endif
253
254#endif
#define RTE_STD_C11
Definition: rte_common.h:42
int(* rte_power_freq_change_t)(unsigned int lcore_id)
Definition: rte_power.h:168
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:116
rte_power_freq_change_t rte_power_freq_down
uint32_t(* rte_power_get_freq_t)(unsigned int lcore_id)
Definition: rte_power.h:132
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:245
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:152