rte_power_intrinsics.h(3)
β¨ rte_power_intrinsics.h β¨
okay bestie, this one is from the Library Functions Manual, and it's giving advanced power management energy β like, the CPU is gonna take a lil nap but make it architecture-dependent π€π
π NAME π
rte_power_intrinsics.h
πΈ SYNOPSIS πΈ
#include <inttypes.h>
#include <rte_spinlock.h>
π Macros
#define RTE_POWER_MONITOR_OPAQUE_SZ 4
π¦ Typedefs
typedef int(* rte_power_monitor_clb_t) (const uint64_t val, const uint64_t opaque[RTE_POWER_MONITOR_OPAQUE_SZ])
β Functions
int rte_power_monitor (const struct rte_power_monitor_cond *pmc, const uint64_t tsc_timestamp)
int rte_power_monitor_wakeup (const unsigned int lcore_id)
int rte_power_pause (const uint64_t tsc_timestamp)
int rte_power_monitor_multi (const struct rte_power_monitor_cond pmc[], const uint32_t num, const uint64_t tsc_timestamp)
π Detailed Description π
Advanced power management operations, periodt.
So basically, this file defines the APIs for advanced power management, and the whole vibe is architecture-dependent β meaning what actually happens under the hood changes depending on what CPU you're on. No cap. π§
Definition in file rte_power_intrinsics.h.
π Macro Definition Documentation π
#define RTE_POWER_MONITOR_OPAQUE_SZ 4
It's literally the size of the opaque data in the monitor condition. That's it, that's the number. π
Definition at line 25 of file rte_power_intrinsics.h.
π Typedef Documentation π
typedef int(* rte_power_monitor_clb_t) (const uint64_t val, const uint64_t opaque[RTE_POWER_MONITOR_OPAQUE_SZ])
This is the callback definition for monitoring conditions, bestie. Callbacks with this exact signature get used by rte_power_monitor() to check whether the entering of power optimized state should be aborted. Iconic. β¨
Parameters
valβ the value read from memory.opaqueβ callback-specific data.
Returns
0if entering of power optimized state should proceed-1if entering of power optimized state should be aborted
Definition at line 41 of file rte_power_intrinsics.h.
π₯ Function Documentation π₯
int rte_power_monitor (const struct rte_power_monitor_cond * pmc, const uint64_t tsc_timestamp)
Monitors a specific address for changes. This will cause the CPU to enter an architecture-defined optimized power state until either the specified memory address is written to, a certain TSC timestamp is reached, or other reasons cause the CPU to wake up. She's sleeping but she's listening. ππ
Also, an expected value (pmc->val), mask (pmc->mask), and data size (pmc->size) are provided in the pmc power monitoring condition. If the mask is non-zero, the current value pointed to by the pmc->addr pointer will be read and compared against the expected value, and if they match, the entering of optimized power state will be aborted. Why? To prevent the CPU from entering optimized power state and waiting on a write that has already happened by the time this API is called. Preventing the cringe wait, fr fr. π
Warning β οΈ It is responsibility of the user to check if this function is supported at runtime using rte_cpu_get_intrinsics_support() API call. Do not skip the vibe check.
Parameters
pmcβ the monitoring condition structure.tsc_timestampβ maximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.
Returns
0on success-EINVALon invalid parameters-ENOTSUPif unsupported
int rte_power_monitor_wakeup (const unsigned int lcore_id)
Wakes up a specific lcore that is in a power optimized state and is monitoring an address. Wake her up, she has places to be. πΈ
Note π It is safe to call this function if the lcore in question is not sleeping. The function will have no effect β no drama, nothing happens. This function will not wake up a core that is in a power optimized state due to calling rte_power_pause.
Parameters
lcore_idβ lcore ID of a sleeping thread.
int rte_power_pause (const uint64_t tsc_timestamp)
Enters an architecture-defined optimized power state until a certain TSC timestamp is reached. Just a lil nap with a deadline. π¦
Warning β οΈ It is responsibility of the user to check if this function is supported at runtime using rte_cpu_get_intrinsics_support() API call. Again. Always. Forever.
Parameters
tsc_timestampβ maximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.
Returns
0on success-EINVALon invalid parameters-ENOTSUPif unsupported
int rte_power_monitor_multi (const struct rte_power_monitor_cond pmc[], const uint32_t num, const uint64_t tsc_timestamp)
Monitors a set of addresses for changes. The CPU enters an architecture-defined optimized power state until either one of the specified memory addresses is written to, a certain TSC timestamp is reached, or other reasons cause the CPU to wake up. Multi-tasking queen behavior, honestly. π
Also, expected 64-bit values and 64-bit masks are provided. If mask is non-zero, the current value pointed to by the p pointer will be checked against the expected value, and if they do not match, the entering of optimized power state may be aborted.
Warning β οΈ It is responsibility of the user to check if this function is supported at runtime using rte_cpu_get_intrinsics_support() API call. Failing to do so may result in an illegal CPU instruction error. Which is not the slay you want. π
Parameters
pmcβ an array of monitoring condition structures.numβ length of thepmcarray.tsc_timestampβ maximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.
Returns
0on success-EINVALon invalid parameters-ENOTSUPif unsupported
π«Ά Author π«Ά
Generated automatically by Doxygen for DPDK from the source code. Not a human, just a lil robot doing its thing. π€π
k bye bestie, that's the whole page! π This was DPDK Version 25.11.3 of rte_power_intrinsics.h(3) β go forth and let your CPU nap responsibly. π
β¨π
π¦ 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