DPDK  22.07.0
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
23 extern "C" {
24 #endif
25 
29 typedef struct {
30  uintptr_t opaque_id;
31 } rte_thread_t;
32 
41 };
42 
46 typedef struct eal_tls_key *rte_thread_key;
47 
57 __rte_experimental
59 
60 #ifdef RTE_HAS_CPUSET
61 
79 __rte_experimental
81  const rte_cpuset_t *cpuset);
82 
100 __rte_experimental
102  rte_cpuset_t *cpuset);
103 
113 int rte_thread_set_affinity(rte_cpuset_t *cpusetp);
114 
123 void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
124 
125 #endif /* RTE_HAS_CPUSET */
126 
143 __rte_experimental
145  enum rte_thread_priority *priority);
146 
163 __rte_experimental
165  enum rte_thread_priority priority);
166 
185 __rte_experimental
186 int rte_thread_key_create(rte_thread_key *key,
187  void (*destructor)(void *));
188 
201 __rte_experimental
202 int rte_thread_key_delete(rte_thread_key key);
203 
218 __rte_experimental
219 int rte_thread_value_set(rte_thread_key key, const void *value);
220 
233 __rte_experimental
234 void *rte_thread_value_get(rte_thread_key key);
235 
236 #ifdef __cplusplus
237 }
238 #endif
239 
240 #endif /* _RTE_THREAD_H_ */
__rte_experimental int rte_thread_set_priority(rte_thread_t thread_id, enum rte_thread_priority priority)
__rte_experimental int rte_thread_set_affinity_by_id(rte_thread_t thread_id, const rte_cpuset_t *cpuset)
__rte_experimental int rte_thread_key_delete(rte_thread_key key)
__rte_experimental void * rte_thread_value_get(rte_thread_key key)
struct eal_tls_key * rte_thread_key
Definition: rte_thread.h:46
rte_thread_priority
Definition: rte_thread.h:36
uintptr_t opaque_id
Definition: rte_thread.h:30
__rte_experimental rte_thread_t rte_thread_self(void)
int rte_thread_set_affinity(rte_cpuset_t *cpusetp)
void rte_thread_get_affinity(rte_cpuset_t *cpusetp)
__rte_experimental int rte_thread_key_create(rte_thread_key *key, void(*destructor)(void *))
__rte_experimental int rte_thread_get_priority(rte_thread_t thread_id, enum rte_thread_priority *priority)
__rte_experimental int rte_thread_value_set(rte_thread_key key, const void *value)
__rte_experimental int rte_thread_get_affinity_by_id(rte_thread_t thread_id, rte_cpuset_t *cpuset)