New upstream version 17.11-rc3
[deb_dpdk.git] / lib / librte_eal / common / eal_common_thread.c
index 2405e93..55e9696 100644 (file)
@@ -53,6 +53,20 @@ 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;