examples/ip_frag: fix use of ethdev internal device array
[dpdk.git] / lib / librte_eal / common / eal_common_lcore.c
index 3167e9d..38af260 100644 (file)
@@ -5,7 +5,6 @@
 #include <unistd.h>
 #include <limits.h>
 #include <string.h>
-#include <dirent.h>
 
 #include <rte_errno.h>
 #include <rte_log.h>
 #include "eal_private.h"
 #include "eal_thread.h"
 
+int rte_lcore_index(int lcore_id)
+{
+       if (unlikely(lcore_id >= RTE_MAX_LCORE))
+               return -1;
+
+       if (lcore_id < 0)
+               lcore_id = (int)rte_lcore_id();
+
+       return lcore_config[lcore_id].core_index;
+}
+
+int rte_lcore_to_cpu_id(int lcore_id)
+{
+       if (unlikely(lcore_id >= RTE_MAX_LCORE))
+               return -1;
+
+       if (lcore_id < 0)
+               lcore_id = (int)rte_lcore_id();
+
+       return lcore_config[lcore_id].core_id;
+}
+
+rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
+{
+       return lcore_config[lcore_id].cpuset;
+}
+
+unsigned int
+rte_lcore_to_socket_id(unsigned int lcore_id)
+{
+       return lcore_config[lcore_id].socket_id;
+}
+
 static int
 socket_id_cmp(const void *a, const void *b)
 {
@@ -115,14 +147,14 @@ rte_eal_cpu_init(void)
        return 0;
 }
 
-unsigned int __rte_experimental
+unsigned int
 rte_socket_count(void)
 {
        const struct rte_config *config = rte_eal_get_configuration();
        return config->numa_node_count;
 }
 
-int __rte_experimental
+int
 rte_socket_id_by_idx(unsigned int idx)
 {
        const struct rte_config *config = rte_eal_get_configuration();