1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef _POWER_KVM_VM_H
6 #define _POWER_KVM_VM_H
10 * RTE Power Management KVM VM
13 #include <rte_common.h>
14 #include <rte_byteorder.h>
16 #include <rte_string_fns.h>
17 #include "rte_power.h"
24 * Initialize power management for a specific lcore.
31 * - Negative on error.
33 int power_kvm_vm_init(unsigned int lcore_id);
36 * Exit power management on a specific lcore.
43 * - Negative on error.
45 int power_kvm_vm_exit(unsigned int lcore_id);
48 * Get the available frequencies of a specific lcore.
49 * It is not currently supported for VM Power Management.
54 * The buffer array to save the frequencies.
56 * The number of frequencies to get.
61 uint32_t power_kvm_vm_freqs(unsigned int lcore_id, uint32_t *freqs,
65 * Return the current index of available frequencies of a specific lcore.
66 * It is not currently supported for VM Power Management.
74 uint32_t power_kvm_vm_get_freq(unsigned int lcore_id);
77 * Set the new frequency for a specific lcore by indicating the index of
78 * available frequencies.
79 * It is not currently supported for VM Power Management.
84 * The index of available frequencies.
89 int power_kvm_vm_set_freq(unsigned int lcore_id, uint32_t index);
92 * Scale up the frequency of a specific lcore. This request is forwarded to the
94 * It should be protected outside of this function for threadsafe.
101 * - Negative on error.
103 int power_kvm_vm_freq_up(unsigned int lcore_id);
106 * Scale down the frequency of a specific lcore according to the available
108 * It should be protected outside of this function for threadsafe.
115 * - Negative on error.
117 int power_kvm_vm_freq_down(unsigned int lcore_id);
120 * Scale up the frequency of a specific lcore to the highest according to the
121 * available frequencies.
122 * It should be protected outside of this function for threadsafe.
129 * - Negative on error.
131 int power_kvm_vm_freq_max(unsigned int lcore_id);
134 * Scale down the frequency of a specific lcore to the lowest according to the
135 * available frequencies.
136 * It should be protected outside of this function for threadsafe.
143 * - Negative on error.
145 int power_kvm_vm_freq_min(unsigned int lcore_id);
148 * It should be protected outside of this function for threadsafe.
156 int power_kvm_vm_turbo_status(unsigned int lcore_id);
159 * It should be protected outside of this function for threadsafe.
166 * - Negative on error.
168 int power_kvm_vm_enable_turbo(unsigned int lcore_id);
171 * It should be protected outside of this function for threadsafe.
178 * - Negative on error.
180 int power_kvm_vm_disable_turbo(unsigned int lcore_id);
183 * Returns power capabilities for a specific lcore.
188 * pointer to rte_power_core_capabilities object.
192 * - Negative on error.
194 int power_kvm_vm_get_capabilities(unsigned int lcore_id,
195 struct rte_power_core_capabilities *caps);