DPDK 22.11.6
rte_thread.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 Mellanox Technologies, Ltd
3 * Copyright (C) 2022 Microsoft Corporation
4 */
5
6#include <stdint.h>
7
8#include <rte_os.h>
9#include <rte_compat.h>
10
11#ifndef _RTE_THREAD_H_
12#define _RTE_THREAD_H_
13
22#ifdef __cplusplus
23extern "C" {
24#endif
25
29typedef struct {
30 uintptr_t opaque_id;
32
43typedef uint32_t (*rte_thread_func) (void *arg);
44
53};
54
58typedef struct {
60#ifdef RTE_HAS_CPUSET
61 rte_cpuset_t cpuset;
62#endif
64
68typedef struct eal_tls_key *rte_thread_key;
69
92__rte_experimental
94 const rte_thread_attr_t *thread_attr,
95 rte_thread_func thread_func, void *arg);
96
113__rte_experimental
114int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
115
130__rte_experimental
132
142__rte_experimental
144
161__rte_experimental
163
179__rte_experimental
181
199__rte_experimental
201 enum rte_thread_priority priority);
202
203#ifdef RTE_HAS_CPUSET
204
222__rte_experimental
224 rte_cpuset_t *cpuset);
225
243__rte_experimental
245 rte_cpuset_t *cpuset);
246
264__rte_experimental
266 const rte_cpuset_t *cpuset);
267
285__rte_experimental
287 rte_cpuset_t *cpuset);
288
298int rte_thread_set_affinity(rte_cpuset_t *cpusetp);
299
308void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
309
310#endif /* RTE_HAS_CPUSET */
311
328__rte_experimental
330 enum rte_thread_priority *priority);
331
348__rte_experimental
350 enum rte_thread_priority priority);
351
370__rte_experimental
372 void (*destructor)(void *));
373
386__rte_experimental
388
403__rte_experimental
404int rte_thread_value_set(rte_thread_key key, const void *value);
405
418__rte_experimental
420
421#ifdef __cplusplus
422}
423#endif
424
425#endif /* _RTE_THREAD_H_ */
__rte_experimental int rte_thread_get_affinity_by_id(rte_thread_t thread_id, rte_cpuset_t *cpuset)
__rte_experimental int rte_thread_get_priority(rte_thread_t thread_id, enum rte_thread_priority *priority)
struct eal_tls_key * rte_thread_key
Definition: rte_thread.h:68
__rte_experimental void * rte_thread_value_get(rte_thread_key key)
void rte_thread_get_affinity(rte_cpuset_t *cpusetp)
__rte_experimental int rte_thread_create(rte_thread_t *thread_id, const rte_thread_attr_t *thread_attr, rte_thread_func thread_func, void *arg)
__rte_experimental int rte_thread_detach(rte_thread_t thread_id)
__rte_experimental int rte_thread_value_set(rte_thread_key key, const void *value)
__rte_experimental int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr, rte_cpuset_t *cpuset)
__rte_experimental int rte_thread_key_delete(rte_thread_key key)
__rte_experimental int rte_thread_attr_init(rte_thread_attr_t *attr)
rte_thread_priority
Definition: rte_thread.h:48
@ RTE_THREAD_PRIORITY_REALTIME_CRITICAL
Definition: rte_thread.h:51
@ RTE_THREAD_PRIORITY_NORMAL
Definition: rte_thread.h:49
__rte_experimental int rte_thread_equal(rte_thread_t t1, rte_thread_t t2)
uint32_t(* rte_thread_func)(void *arg)
Definition: rte_thread.h:43
__rte_experimental int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr, rte_cpuset_t *cpuset)
__rte_experimental int rte_thread_key_create(rte_thread_key *key, void(*destructor)(void *))
__rte_experimental int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr, enum rte_thread_priority priority)
__rte_experimental int rte_thread_set_affinity_by_id(rte_thread_t thread_id, const rte_cpuset_t *cpuset)
int rte_thread_set_affinity(rte_cpuset_t *cpusetp)
__rte_experimental int rte_thread_set_priority(rte_thread_t thread_id, enum rte_thread_priority priority)
__rte_experimental int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr)
__rte_experimental rte_thread_t rte_thread_self(void)
enum rte_thread_priority priority
Definition: rte_thread.h:59
rte_cpuset_t cpuset
Definition: rte_thread.h:61
uintptr_t opaque_id
Definition: rte_thread.h:30