DPDK  20.11.10
Functions
rte_power_intrinsics.h File Reference
#include <inttypes.h>
#include <rte_compat.h>
#include <rte_spinlock.h>

Go to the source code of this file.

Functions

static __rte_experimental void rte_power_monitor (const volatile void *p, const uint64_t expected_value, const uint64_t value_mask, const uint64_t tsc_timestamp, const uint8_t data_sz)
 
static __rte_experimental void rte_power_monitor_sync (const volatile void *p, const uint64_t expected_value, const uint64_t value_mask, const uint64_t tsc_timestamp, const uint8_t data_sz, rte_spinlock_t *lck)
 
static __rte_experimental void rte_power_pause (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.

Function Documentation

◆ rte_power_monitor()

static __rte_experimental void rte_power_monitor ( const volatile void *  p,
const uint64_t  expected_value,
const uint64_t  value_mask,
const uint64_t  tsc_timestamp,
const uint8_t  data_sz 
)
inlinestatic
Warning
EXPERIMENTAL: this API may change without prior notice

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 64-bit value and 64-bit mask 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 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
pAddress to monitor for changes.
expected_valueBefore attempting the monitoring, the p address may be read and compared against this value. If value_mask is zero, this step will be skipped.
value_maskThe 64-bit mask to use to extract current value from p.
tsc_timestampMaximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.
data_szData size (in bytes) that will be used to compare expected value with the memory address. Can be 1, 2, 4 or 8. Supplying any other value will lead to undefined result.

◆ rte_power_monitor_sync()

static __rte_experimental void rte_power_monitor_sync ( const volatile void *  p,
const uint64_t  expected_value,
const uint64_t  value_mask,
const uint64_t  tsc_timestamp,
const uint8_t  data_sz,
rte_spinlock_t lck 
)
inlinestatic
Warning
EXPERIMENTAL: this API may change without prior notice

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 64-bit value and 64-bit mask 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 match, the entering of optimized power state may be aborted.

This call will also lock a spinlock on entering sleep, and release it on waking up the CPU.

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
pAddress to monitor for changes.
expected_valueBefore attempting the monitoring, the p address may be read and compared against this value. If value_mask is zero, this step will be skipped.
value_maskThe 64-bit mask to use to extract current value from p.
tsc_timestampMaximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.
data_szData size (in bytes) that will be used to compare expected value with the memory address. Can be 1, 2, 4 or 8. Supplying any other value will lead to undefined result.
lckA spinlock that must be locked before entering the function, will be unlocked while the CPU is sleeping, and will be locked again once the CPU wakes up.

◆ rte_power_pause()

static __rte_experimental void rte_power_pause ( const uint64_t  tsc_timestamp)
inlinestatic
Warning
EXPERIMENTAL: this API may change without prior notice

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. Failing to do so may result in an illegal CPU instruction error.
Parameters
tsc_timestampMaximum TSC timestamp to wait for. Note that the wait behavior is architecture-dependent.