rte_power_uncore.h(3)
π rte_power_uncore.h π
okay bestie, welcome to the uncore frequency management page from the DPDK Library Functions Manual. this header is literally the group chat for talking to the uncore mesh (the little network between dies, iykyk). sit down, hydrate, we're going in π«Ά
β¨ NAME β¨
rte_power_uncore.h β no cap, that's it, that's the name π
πΈ SYNOPSIS πΈ
#include <rte_compat.h>
#include <rte_common.h>
π Functions π
__rte_experimental int rte_power_set_uncore_env (enum
rte_uncore_power_mgmt_env env)
__rte_experimental void rte_power_unset_uncore_env (void)
__rte_experimental enum rte_uncore_power_mgmt_env
rte_power_get_uncore_env (void)
int rte_power_uncore_init (unsigned int pkg, unsigned int die)
int rte_power_uncore_exit (unsigned int pkg, unsigned int die)
uint32_t rte_power_get_uncore_freq (unsigned int pkg, unsigned int die)
int rte_power_set_uncore_freq (unsigned int pkg, unsigned int die,
uint32_t index)
int rte_power_uncore_freq_max (unsigned int pkg, unsigned int die)
int rte_power_uncore_freq_min (unsigned int pkg, unsigned int die)
__rte_experimental int rte_power_uncore_freqs (unsigned int pkg,
unsigned int die, uint32_t *freqs, uint32_t num)
int rte_power_uncore_get_num_freqs (unsigned int pkg, unsigned int die)
unsigned int rte_power_uncore_get_num_pkgs (void)
unsigned int rte_power_uncore_get_num_dies (unsigned int pkg)
π¦ Detailed Description π¦
Uncore Frequency Management β¨
Definition in file rte_power_uncore.h.
π Function Documentation π
__rte_experimental int rte_power_set_uncore_env (enum rte_uncore_power_mgmt_env env)
okay so this one sets the default uncore power management implementation. it HAS to be called before you call any other rte_power_uncore_*() API, like fr fr, do it first.
it's thread safe π§. a new env can only be set while you're in an uninitialized state β the glow-up only happens once, bestie.
if a differentenvwas already set, you must callrte_power_unset_uncore_envfirst. no skipping steps π
Parameters
- env β env. The environment in which to initialise Uncore Power Management for.
Returns
0on success. π- Negative on error. π
__rte_experimental void rte_power_unset_uncore_env (void )
unsets the global uncore environment configuration. this can ONLY be called after all threads have completed β like, everyone has to be out of the pool before you drain it, periodt. π
__rte_experimental enum rte_uncore_power_mgmt_env rte_power_get_uncore_env (void )
gets the default uncore power management implementation. the reveal β¨
Returns
power_management_envβ The configured environment. π
int rte_power_uncore_init (unsigned int pkg, unsigned int die)
initializes uncore frequency management for a specific die on a package. it goes and grabs all the available frequencies and gets ready to set new die frequencies. main character prep energy π
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
Returns
0on success. π- Negative on error. π
int rte_power_uncore_exit (unsigned int pkg, unsigned int die)
exits uncore frequency management on a specific die on a package. it restores the uncore min and max values to whatever they were before the API was initialized. it's giving "leave things how you found them" π
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
Returns
0on success. π- Negative on error. π
uint32_t rte_power_get_uncore_freq (unsigned int pkg, unsigned int die)
returns the current index of available frequencies of a specific die on a package. it should be protected outside of this function for threadsafe β that's on you, bestie, not on this function π«Ά
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
Returns
- The current index of available frequencies. If error, it will return
'RTE_POWER_INVALID_FREQ_INDEX = (~0)'. π
int rte_power_set_uncore_freq (unsigned int pkg, unsigned int die, uint32_t index)
sets the minimum and maximum uncore frequency for the specified die on a package to the specified index value. it should be protected outside of this function for threadsafe π
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
- index β The index of available frequencies.
Returns
1on success with frequency changed. π₯0on success without frequency changed. π- Negative on error. π
int rte_power_uncore_freq_max (unsigned int pkg, unsigned int die)
sets the minimum and maximum uncore frequency for the specified die on a package to the maximum value according to the available frequencies. go big or go home π
it should be protected outside of this function for threadsafe. π
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
Returns
1on success with frequency changed. π₯0on success without frequency changed. π- Negative on error. π
int rte_power_uncore_freq_min (unsigned int pkg, unsigned int die)
sets the minimum and maximum uncore frequency for the specified die on a package to the minimum value according to the available frequencies. cozy mode activated π
it should be protected outside of this function for threadsafe. π
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
Returns
1on success with frequency changed. π₯0on success without frequency changed. π- Negative on error. π
__rte_experimental int rte_power_uncore_freqs (unsigned int pkg, unsigned int die, uint32_t * freqs, uint32_t num)
returns the list of available frequencies in the index array. bestie said "give me the whole menu" πβ¨
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
- freqs β The buffer array to save the frequencies.
- num β The number of frequencies to get.
Returns
- The number of available index's in frequency array. π’
- Negative on error. π
int rte_power_uncore_get_num_freqs (unsigned int pkg, unsigned int die)
returns the list length of available frequencies in the index array. yes, length, not the list itself, don't get it twisted π
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
- die β Die number. Each package can have several dies connected together via the uncore mesh.
Returns
- The number of available index's in frequency array. π’
- Negative on error. π
unsigned int rte_power_uncore_get_num_pkgs (void )
returns the number of packages (CPUs) on a system by parsing the uncore sysfs directory. detective work πβ¨
This function should NOT be called in the fast path. π«
Returns
- Zero on error. π
- Number of package on system on success. π
unsigned int rte_power_uncore_get_num_dies (unsigned int pkg)
returns the number of dies for packages (CPUs) specified, by parsing the uncore sysfs directory. more detective work π΅οΈβοΈ
This function should NOT be called in the fast path. π«
Parameters
- pkg β Package number. Each physical CPU in a system is referred to as a package.
Returns
- Zero on error. π
- Number of dies for package on success. π
π Author π
Generated automatically by Doxygen for DPDK from the source code. (not me writing my own bio, the robots did it π€β¨)
okay that's the whole page bestie, you ate π
π this was DPDK, Version 25.11.3, living under the header rte_power_uncore.h(3). go forth and manage your uncore frequencies responsibly, mwah π«Άπ
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms