diff options
Diffstat (limited to 'lib/librte_eal/common/include/rte_lcore.h')
-rw-r--r-- | lib/librte_eal/common/include/rte_lcore.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index 6e09d918..dea17f50 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -23,10 +23,18 @@ extern "C" { #define LCORE_ID_ANY UINT32_MAX /**< Any lcore. */ #if defined(__linux__) - typedef cpu_set_t rte_cpuset_t; +typedef cpu_set_t rte_cpuset_t; +#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) #elif defined(__FreeBSD__) #include <pthread_np.h> - typedef cpuset_t rte_cpuset_t; +typedef cpuset_t rte_cpuset_t; +#define RTE_CPU_AND(dst, src1, src2) do \ +{ \ + cpuset_t tmp; \ + CPU_COPY(src1, &tmp); \ + CPU_AND(&tmp, src2); \ + CPU_COPY(&tmp, dst); \ +} while (0) #endif /** @@ -280,8 +288,9 @@ int rte_thread_setname(pthread_t id, const char *name); * Create a control thread. * * Wrapper to pthread_create(), pthread_setname_np() and - * pthread_setaffinity_np(). The dataplane and service lcores are - * excluded from the affinity of the new thread. + * pthread_setaffinity_np(). The affinity of the new thread is based + * on the CPU affinity retrieved at the time rte_eal_init() was called, + * the dataplane and service lcores are then excluded. * * @param thread * Filled with the thread id of the new created thread. |