New upstream version 17.11.5
[deb_dpdk.git] / lib / librte_eal / common / include / rte_lcore.h
index 50e0d0f..0dd710d 100644 (file)
@@ -40,6 +40,7 @@
  * API for lcore and socket manipulation
  *
  */
+#include <rte_config.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_launch.h>
@@ -135,7 +136,7 @@ rte_lcore_index(int lcore_id)
        if (lcore_id >= RTE_MAX_LCORE)
                return -1;
        if (lcore_id < 0)
-               lcore_id = rte_lcore_id();
+               lcore_id = (int)rte_lcore_id();
        return lcore_config[lcore_id].core_index;
 }
 
@@ -262,6 +263,20 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
  */
 int rte_thread_setname(pthread_t id, const char *name);
 
+/**
+ * Test if the core supplied has a specific role
+ *
+ * @param lcore_id
+ *   The identifier of the lcore, which MUST be between 0 and
+ *   RTE_MAX_LCORE-1.
+ * @param role
+ *   The role to be checked against.
+ * @return
+ *   On success, return 0; otherwise return a negative value.
+ */
+int
+rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role);
+
 #ifdef __cplusplus
 }
 #endif