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 #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)
29 #define RTE_CPU_FILL(set) do \
33 for (i = 0; i < CPU_SETSIZE; i++) \
36 #define RTE_CPU_NOT(dst, src) do \
40 CPU_XOR(dst, &tmp, src); \
42 #elif defined(__FreeBSD__)
43 #include <pthread_np.h>
44 typedef cpuset_t rte_cpuset_t;
45 #define RTE_CPU_AND(dst, src1, src2) do \
48 CPU_COPY(src1, &tmp); \
49 CPU_AND(&tmp, src2); \
50 CPU_COPY(&tmp, dst); \
52 #define RTE_CPU_OR(dst, src1, src2) do \
55 CPU_COPY(src1, &tmp); \
57 CPU_COPY(&tmp, dst); \
59 #define RTE_CPU_FILL(set) CPU_FILL(set)
60 #define RTE_CPU_NOT(dst, src) do \
64 CPU_NAND(&tmp, src); \
65 CPU_COPY(&tmp, dst); \
108 static inline unsigned
120 static inline unsigned
132 static inline unsigned
246 if (lcore_id >= RTE_MAX_LCORE)
264 static inline unsigned int
271 while (i < RTE_MAX_LCORE) {
286 #define RTE_LCORE_FOREACH(i) \
287 for (i = rte_get_next_lcore(-1, 0, 0); \
289 i = rte_get_next_lcore(i, 0, 0))
294 #define RTE_LCORE_FOREACH_SLAVE(i) \
295 for (i = rte_get_next_lcore(-1, 1, 0); \
297 i = rte_get_next_lcore(i, 1, 0))
358 const pthread_attr_t *attr,
359 void *(*start_routine)(
void *),
void *arg);
void rte_thread_get_affinity(rte_cpuset_t *cpusetp)
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)
static int rte_lcore_is_enabled(unsigned int lcore_id)
unsigned int rte_socket_count(void)
unsigned int rte_lcore_to_socket_id(unsigned int lcore_id)
enum rte_lcore_state_t state
unsigned int rte_socket_id(void)
__rte_experimental rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
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
int rte_socket_id_by_idx(unsigned int idx)
__rte_experimental int rte_lcore_to_cpu_id(int lcore_id)
static unsigned rte_get_master_lcore(void)
int rte_lcore_index(int lcore_id)
int rte_ctrl_thread_create(pthread_t *thread, const char *name, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
int( lcore_function_t)(void *)
#define RTE_PER_LCORE(name)
RTE_DECLARE_PER_LCORE(unsigned, _lcore_id)
int rte_thread_set_affinity(rte_cpuset_t *cpusetp)
static unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)