DPDK
24.07.0
|
#include <rte_lcore.h>
#include <rte_lock_annotations.h>
#include <rte_pause.h>
#include <rte_stdatomic.h>
Go to the source code of this file.
Data Structures | |
struct | rte_spinlock_t |
struct | rte_spinlock_recursive_t |
Macros | |
#define | RTE_SPINLOCK_INITIALIZER { 0 } |
#define | RTE_SPINLOCK_RECURSIVE_INITIALIZER {RTE_SPINLOCK_INITIALIZER, -1, 0} |
RTE Spinlocks
This file defines an API for read-write locks, which are implemented in an architecture-specific way. This kind of lock simply waits in a loop repeatedly checking until the lock becomes available.
All locks must be initialised before use, and only initialised once.
Definition in file rte_spinlock.h.
#define RTE_SPINLOCK_INITIALIZER { 0 } |
A static spinlock initializer.
Definition at line 38 of file rte_spinlock.h.
#define RTE_SPINLOCK_RECURSIVE_INITIALIZER {RTE_SPINLOCK_INITIALIZER, -1, 0} |
A static recursive spinlock initializer.
Definition at line 203 of file rte_spinlock.h.
|
inlinestatic |
Initialize the spinlock to an unlocked state.
sl | A pointer to the spinlock. |
Definition at line 47 of file rte_spinlock.h.
|
inlinestatic |
Take the spinlock.
sl | A pointer to the spinlock. |
|
inlinestatic |
Release the spinlock.
sl | A pointer to the spinlock. |
|
inlinestatic |
Try to take the lock.
sl | A pointer to the spinlock. |
|
inlinestatic |
Test if the lock is taken.
sl | A pointer to the spinlock. |
Definition at line 129 of file rte_spinlock.h.
|
inlinestatic |
Test if hardware transactional memory (lock elision) is supported
|
inlinestatic |
Try to execute critical section in a hardware memory transaction, if it fails or not available take the spinlock.
NOTE: An attempt to perform a HW I/O operation inside a hardware memory transaction always aborts the transaction since the CPU is not able to roll-back should the transaction fail. Therefore, hardware transactional locks are not advised to be used around rte_eth_rx_burst() and rte_eth_tx_burst() calls.
sl | A pointer to the spinlock. |
|
inlinestatic |
Commit hardware memory transaction or release the spinlock if the spinlock is used as a fall-back
sl | A pointer to the spinlock. |
|
inlinestatic |
Try to execute critical section in a hardware memory transaction, if it fails or not available try to take the lock.
NOTE: An attempt to perform a HW I/O operation inside a hardware memory transaction always aborts the transaction since the CPU is not able to roll-back should the transaction fail. Therefore, hardware transactional locks are not advised to be used around rte_eth_rx_burst() and rte_eth_tx_burst() calls.
sl | A pointer to the spinlock. |
|
inlinestatic |
Initialize the recursive spinlock to an unlocked state.
slr | A pointer to the recursive spinlock. |
Definition at line 211 of file rte_spinlock.h.
|
inlinestatic |
Take the recursive spinlock.
slr | A pointer to the recursive spinlock. |
Definition at line 224 of file rte_spinlock.h.
|
inlinestatic |
Release the recursive spinlock.
slr | A pointer to the recursive spinlock. |
Definition at line 241 of file rte_spinlock.h.
|
inlinestatic |
Try to take the recursive lock.
slr | A pointer to the recursive spinlock. |
Definition at line 260 of file rte_spinlock.h.
|
inlinestatic |
Try to execute critical section in a hardware memory transaction, if it fails or not available take the recursive spinlocks
NOTE: An attempt to perform a HW I/O operation inside a hardware memory transaction always aborts the transaction since the CPU is not able to roll-back should the transaction fail. Therefore, hardware transactional locks are not advised to be used around rte_eth_rx_burst() and rte_eth_tx_burst() calls.
slr | A pointer to the recursive spinlock. |
|
inlinestatic |
Commit hardware memory transaction or release the recursive spinlock if the recursive spinlock is used as a fall-back
slr | A pointer to the recursive spinlock. |
|
inlinestatic |
Try to execute critical section in a hardware memory transaction, if it fails or not available try to take the recursive lock
NOTE: An attempt to perform a HW I/O operation inside a hardware memory transaction always aborts the transaction since the CPU is not able to roll-back should the transaction fail. Therefore, hardware transactional locks are not advised to be used around rte_eth_rx_burst() and rte_eth_tx_burst() calls.
slr | A pointer to the recursive spinlock. |