---
name: "rte_power_intrinsics.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_power_intrinsics.h"
---

# rte\_power\_intrinsics.h(3)

## 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.

This file define APIs for advanced power management, which are architecture-dependent.

Definition in file **rte\_power\_intrinsics.h**.

## Macro Definition Documentation

### #define RTE\_POWER\_MONITOR\_OPAQUE\_SZ 4

Size of the opaque data in monitor condition

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\])

Callback definition for monitoring conditions. Callbacks with this signature will be used by **rte\_power\_monitor() to check if the entering of power optimized state should be aborted.**

**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)

**Monitor 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.**

**Additionally, 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. This is intended 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.**

**Warning**

**It is responsibility of the user to check if this function is supported at runtime using rte\_cpu\_get\_intrinsics\_support() API call.**

**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)

**Wake up a specific lcore that is in a power optimized state and is monitoring an address.**

**Note**

**It is safe to call this function if the lcore in question is not sleeping. The function will have no effect.**

**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)

**Enter an architecture-defined optimized power state until a certain TSC timestamp is reached.**

**Warning**

**It is responsibility of the user to check if this function is supported at runtime using rte\_cpu\_get\_intrinsics\_support() API call.**

**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)

**Monitor a set of addresses for changes. This will cause the CPU to enter 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.**

**Additionally,** `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.**

**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.**
