X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Feal_common_thread.c;h=f1a88f85e5d12d8e49197430c8ea7213081dc988;hb=339341e8e126a34381861b7347a8ad4ffb9cb293;hp=f4d98928f74a308cdc8434aa9dfdaa9adf273f2b;hpb=9e29251b2afa0d3ee45f9851f889522ceba9d950;p=dpdk.git diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c index f4d98928f7..f1a88f85e5 100644 --- a/lib/librte_eal/common/eal_common_thread.c +++ b/lib/librte_eal/common/eal_common_thread.c @@ -46,6 +46,27 @@ #include "eal_thread.h" +RTE_DECLARE_PER_LCORE(unsigned , _socket_id); + +unsigned rte_socket_id(void) +{ + return RTE_PER_LCORE(_socket_id); +} + +int +rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role) +{ + struct rte_config *cfg = rte_eal_get_configuration(); + + if (lcore_id >= RTE_MAX_LCORE) + return -EINVAL; + + if (cfg->lcore_role[lcore_id] == role) + return 0; + + return -EINVAL; +} + int eal_cpuset_socket_id(rte_cpuset_t *cpusetp) { unsigned cpu = 0; @@ -148,3 +169,10 @@ exit: return ret; } + +int rte_ctrl_thread_create(pthread_t *thread, + const pthread_attr_t *attr, + void *(*start_routine)(void *), void *arg) +{ + return pthread_create(thread, attr, start_routine, arg); +}