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

  • 0 if entering of power optimized state should proceed
  • -1 if 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

  • 0 on success
  • -EINVAL on invalid parameters
  • -ENOTSUP if 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

  • 0 on success
  • -EINVAL on invalid parameters
  • -ENOTSUP if 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 the pmc array.
  • tsc_timestamp β€” maximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.

Returns

  • 0 on success
  • -EINVAL on invalid parameters
  • -ENOTSUP if 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