DPDK  19.11.10
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
20 extern "C" {
21 #endif
22 
23 /* Power Management Environment State */
24 enum power_management_env {PM_ENV_NOT_SET, PM_ENV_ACPI_CPUFREQ, PM_ENV_KVM_VM,
25  PM_ENV_PSTATE_CPUFREQ};
26 
40 int rte_power_set_env(enum power_management_env env);
41 
46 void rte_power_unset_env(void);
47 
54 enum power_management_env rte_power_get_env(void);
55 
68 int rte_power_init(unsigned int lcore_id);
69 
81 int rte_power_exit(unsigned int lcore_id);
82 
98 typedef uint32_t (*rte_power_freqs_t)(unsigned int lcore_id, uint32_t *freqs,
99  uint32_t num);
100 
101 extern rte_power_freqs_t rte_power_freqs;
102 
114 typedef uint32_t (*rte_power_get_freq_t)(unsigned int lcore_id);
115 
116 extern rte_power_get_freq_t rte_power_get_freq;
117 
134 typedef int (*rte_power_set_freq_t)(unsigned int lcore_id, uint32_t index);
135 
136 extern rte_power_set_freq_t rte_power_set_freq;
137 
150 typedef int (*rte_power_freq_change_t)(unsigned int lcore_id);
151 
166 
182 
197 
212 
226 
239 
252 
258  union {
259  uint64_t capabilities;
261  struct {
262  uint64_t turbo:1;
263  uint64_t priority:1;
264  };
265  };
266 };
267 
282 typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
283  struct rte_power_core_capabilities *caps);
284 
285 extern rte_power_get_capabilities_t rte_power_get_capabilities;
286 
287 #ifdef __cplusplus
288 }
289 #endif
290 
291 #endif
void rte_power_unset_env(void)
rte_power_freq_change_t rte_power_freq_up
rte_power_freq_change_t rte_power_freq_down
uint32_t(* rte_power_get_freq_t)(unsigned int lcore_id)
Definition: rte_power.h:114
uint32_t(* rte_power_freqs_t)(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
Definition: rte_power.h:98
int(* rte_power_set_freq_t)(unsigned int lcore_id, uint32_t index)
Definition: rte_power.h:134
rte_power_freq_change_t rte_power_freq_enable_turbo
enum power_management_env rte_power_get_env(void)
rte_power_freq_change_t rte_power_freq_max
int(* rte_power_freq_change_t)(unsigned int lcore_id)
Definition: rte_power.h:150
#define RTE_STD_C11
Definition: rte_common.h:40
rte_power_freq_change_t rte_power_freq_min
rte_power_freq_change_t rte_power_turbo_status
int rte_power_set_env(enum power_management_env env)
rte_power_freq_change_t rte_power_freq_disable_turbo
int rte_power_init(unsigned int lcore_id)
int(* rte_power_get_capabilities_t)(unsigned int lcore_id, struct rte_power_core_capabilities *caps)
Definition: rte_power.h:282
int rte_power_exit(unsigned int lcore_id)