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_power.h"
16 * Check if KVM power management is supported.
21 * - -1 if error, with rte_errno indicating reason for error.
23 int power_kvm_vm_check_supported(void);
26 * Initialize power management for a specific lcore.
33 * - Negative on error.
35 int power_kvm_vm_init(unsigned int lcore_id);
38 * Exit power management on a specific lcore.
45 * - Negative on error.
47 int power_kvm_vm_exit(unsigned int lcore_id);
50 * Get the available frequencies of a specific lcore.
51 * It is not currently supported for VM Power Management.
56 * The buffer array to save the frequencies.
58 * The number of frequencies to get.
63 uint32_t power_kvm_vm_freqs(unsigned int lcore_id, uint32_t *freqs,
67 * Return the current index of available frequencies of a specific lcore.
68 * It is not currently supported for VM Power Management.
76 uint32_t power_kvm_vm_get_freq(unsigned int lcore_id);
79 * Set the new frequency for a specific lcore by indicating the index of
80 * available frequencies.
81 * It is not currently supported for VM Power Management.
86 * The index of available frequencies.
91 int power_kvm_vm_set_freq(unsigned int lcore_id, uint32_t index);
94 * Scale up the frequency of a specific lcore. This request is forwarded to the
96 * It should be protected outside of this function for threadsafe.
103 * - Negative on error.
105 int power_kvm_vm_freq_up(unsigned int lcore_id);
108 * Scale down the frequency of a specific lcore according to the available
110 * It should be protected outside of this function for threadsafe.
117 * - Negative on error.
119 int power_kvm_vm_freq_down(unsigned int lcore_id);
122 * Scale up the frequency of a specific lcore to the highest according to the
123 * available frequencies.
124 * It should be protected outside of this function for threadsafe.
131 * - Negative on error.
133 int power_kvm_vm_freq_max(unsigned int lcore_id);
136 * Scale down the frequency of a specific lcore to the lowest according to the
137 * available frequencies.
138 * It should be protected outside of this function for threadsafe.
145 * - Negative on error.
147 int power_kvm_vm_freq_min(unsigned int lcore_id);
150 * It should be protected outside of this function for threadsafe.
158 int power_kvm_vm_turbo_status(unsigned int lcore_id);
161 * It should be protected outside of this function for threadsafe.
168 * - Negative on error.
170 int power_kvm_vm_enable_turbo(unsigned int lcore_id);
173 * It should be protected outside of this function for threadsafe.
180 * - Negative on error.
182 int power_kvm_vm_disable_turbo(unsigned int lcore_id);
185 * Returns power capabilities for a specific lcore.
190 * pointer to rte_power_core_capabilities object.
194 * - Negative on error.
196 int power_kvm_vm_get_capabilities(unsigned int lcore_id,
197 struct rte_power_core_capabilities *caps);