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 different env was already set, you must call rte_power_unset_uncore_env first. no skipping steps πŸ’…

Parameters

  • env β€” env. The environment in which to initialise Uncore Power Management for.

Returns

  • 0 on 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

  • 0 on 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

  • 0 on 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

  • 1 on success with frequency changed. πŸ”₯
  • 0 on 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

  • 1 on success with frequency changed. πŸ”₯
  • 0 on 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

  • 1 on success with frequency changed. πŸ”₯
  • 0 on 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