14 #include <rte_config.h>
23 #define LCORE_ID_ANY UINT32_MAX
25 #if defined(__linux__)
26 typedef cpu_set_t rte_cpuset_t;
27 #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
28 #elif defined(__FreeBSD__)
29 #include <pthread_np.h>
30 typedef cpuset_t rte_cpuset_t;
31 #define RTE_CPU_AND(dst, src1, src2) do \
34 CPU_COPY(src1, &tmp); \
35 CPU_AND(&tmp, src2); \
36 CPU_COPY(&tmp, dst); \
79 static inline unsigned
91 static inline unsigned
103 static inline unsigned
127 if (lcore_id >= RTE_MAX_LCORE)
152 unsigned int __rte_experimental
169 int __rte_experimental
180 static inline unsigned
199 if (lcore_id >= RTE_MAX_LCORE)
217 static inline unsigned
224 while (i < RTE_MAX_LCORE) {
239 #define RTE_LCORE_FOREACH(i) \
240 for (i = rte_get_next_lcore(-1, 0, 0); \
242 i = rte_get_next_lcore(i, 0, 0))
247 #define RTE_LCORE_FOREACH_SLAVE(i) \
248 for (i = rte_get_next_lcore(-1, 1, 0); \
250 i = rte_get_next_lcore(i, 1, 0))
309 __rte_experimental
int
311 const pthread_attr_t *attr,
312 void *(*start_routine)(
void *),
void *arg);
#define RTE_DECLARE_PER_LCORE(type, name)
void rte_thread_get_affinity(rte_cpuset_t *cpusetp)
static unsigned rte_lcore_to_socket_id(unsigned lcore_id)
static int rte_lcore_index(int lcore_id)
int rte_thread_setname(pthread_t id, const char *name)
static unsigned rte_lcore_count(void)
int rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role)
int __rte_experimental rte_socket_id_by_idx(unsigned int idx)
static int rte_lcore_is_enabled(unsigned lcore_id)
__rte_experimental int rte_ctrl_thread_create(pthread_t *thread, const char *name, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
enum rte_lcore_state_t state
static unsigned rte_lcore_id(void)
enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]
struct rte_config * rte_eal_get_configuration(void)
lcore_function_t *volatile f
unsigned int __rte_experimental rte_socket_count(void)
static unsigned rte_get_master_lcore(void)
#define RTE_PER_LCORE(name)
int( lcore_function_t)(void *)
int rte_thread_set_affinity(rte_cpuset_t *cpusetp)
unsigned rte_socket_id(void)
static unsigned rte_get_next_lcore(unsigned i, int skip_master, int wrap)