| rte_thread.h(3) | Library Functions Manual | rte_thread.h(3) |
rte_thread.h
#include <stdint.h>
#include <rte_os.h>
#include <rte_compat.h>
struct rte_thread_t
struct rte_thread_attr_t
#define RTE_THREAD_NAME_SIZE 16
#define RTE_THREAD_INTERNAL_PREFIX 'dpdk-'
#define RTE_THREAD_INTERNAL_NAME_SIZE 11
typedef uint32_t(* rte_thread_func) (void *arg)
typedef struct eal_tls_key * rte_thread_key
enum rte_thread_priority {
RTE_THREAD_PRIORITY_NORMAL = 0,
RTE_THREAD_PRIORITY_REALTIME_CRITICAL = 1 }
int rte_thread_create (rte_thread_t *thread_id,
const rte_thread_attr_t *thread_attr, rte_thread_func
thread_func, void *arg)
int rte_thread_create_control (rte_thread_t *thread, const char
*name, rte_thread_func thread_func, void *arg)
__rte_internal int rte_thread_create_internal_control
(rte_thread_t *id, const char *name, rte_thread_func func,
void *arg)
int rte_thread_join (rte_thread_t thread_id, uint32_t
*value_ptr)
int rte_thread_detach (rte_thread_t thread_id)
rte_thread_t rte_thread_self (void)
void rte_thread_set_name (rte_thread_t thread_id, const char
*thread_name)
__rte_internal void rte_thread_set_prefixed_name (rte_thread_t
id, const char *name)
int rte_thread_equal (rte_thread_t t1, rte_thread_t t2)
int rte_thread_attr_init (rte_thread_attr_t *attr)
int rte_thread_attr_set_priority (rte_thread_attr_t
*thread_attr, enum rte_thread_priority priority)
int rte_thread_attr_set_affinity (rte_thread_attr_t
*thread_attr, rte_cpuset_t *cpuset)
int rte_thread_attr_get_affinity (rte_thread_attr_t
*thread_attr, rte_cpuset_t *cpuset)
int rte_thread_set_affinity_by_id (rte_thread_t thread_id, const
rte_cpuset_t *cpuset)
int rte_thread_get_affinity_by_id (rte_thread_t thread_id,
rte_cpuset_t *cpuset)
int rte_thread_set_affinity (rte_cpuset_t *cpusetp)
void rte_thread_get_affinity (rte_cpuset_t *cpusetp)
int rte_thread_get_priority (rte_thread_t thread_id, enum
rte_thread_priority *priority)
int rte_thread_set_priority (rte_thread_t thread_id, enum
rte_thread_priority priority)
int rte_thread_key_create (rte_thread_key *key,
void(*destructor)(void *))
int rte_thread_key_delete (rte_thread_key key)
int rte_thread_value_set (rte_thread_key key, const void *value)
void * rte_thread_value_get (rte_thread_key key)
Threading functions
Simple threads functionality supplied by EAL.
Definition in file rte_thread.h.
Maximum thread name length (including '\0').
Definition at line 27 of file rte_thread.h.
Thread name prefix automatically added to all internal threads.
Definition at line 32 of file rte_thread.h.
Maximum internal thread name length (including '\0').
Definition at line 34 of file rte_thread.h.
Thread function
Function pointer to thread start routine.
Parameters
Returns
Definition at line 53 of file rte_thread.h.
TLS key type, an opaque pointer.
Definition at line 78 of file rte_thread.h.
Thread priority values.
Enumerator
Definition at line 58 of file rte_thread.h.
Create a new thread that will invoke the 'thread_func' routine.
Parameters
Returns
Create a control thread.
Creates a control thread with the given name and attributes. The affinity of the new thread is based on the CPU affinity retrieved at the time rte_eal_init() was called, the EAL threads are then excluded. If setting the name of the thread fails, the error is ignored and a debug message is logged.
Parameters
Returns
Create an internal control thread.
Creates a control thread with the given name prefixed. If setting the name of the thread fails, the error is ignored and logged.
The affinity of the new thread is based on the CPU affinity retrieved at the time rte_eal_init() was called, the EAL threads are then excluded.
Parameters
Returns
Waits for the thread identified by 'thread_id' to terminate
Parameters
Returns
Indicate that the return value of the thread is not needed and all thread resources should be release when the thread terminates.
Parameters
Returns
Get the id of the calling thread.
Returns
Set the name of the thread.
This API is a noop if the underlying platform does not support setting the thread name or the platform-specific API used to set the thread name fails.
Parameters
Set the name of an internal thread with the common prefix.
This API is a noop if the underlying platform does not support setting the thread name, or if it fails.
Parameters
Check if 2 thread ids are equal.
Parameters
Returns
Initialize the attributes of a thread. These attributes can be passed to the rte_thread_create() function that will create a new thread and set its attributes according to attr.
Parameters
Returns
Set the thread priority value in the thread attributes pointed to by 'thread_attr'.
Parameters
Returns
Set the CPU affinity value in the thread attributes pointed to by 'thread_attr'.
Parameters
Returns
Get the value of CPU affinity that is set in the thread attributes pointed to by 'thread_attr'.
Parameters
Returns
Set the affinity of thread 'thread_id' to the cpu set specified by 'cpuset'.
Parameters
Returns
Get the affinity of thread 'thread_id' and store it in 'cpuset'.
Parameters
Returns
Set core affinity of the current thread. Support both EAL and non-EAL thread and update TLS.
Parameters
Returns
Get core affinity of the current thread.
Parameters
Get the priority of a thread.
Parameters
Returns
Set the priority of a thread.
Parameters
Returns
Create a TLS data key visible to all threads in the process. the created key is later used to get/set a value. and optional destructor can be set to be called when a thread exits.
Parameters
Returns
Delete a TLS data key visible to all threads in the process.
Parameters
Returns
Set value bound to the TLS key on behalf of the calling thread.
Parameters
Returns
Get value bound to the TLS key on behalf of the calling thread.
Parameters
Returns
Generated automatically by Doxygen for DPDK from the source code.
| Version 24.11.3 | DPDK |