]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/rte_service.c
service: add count per lcore
[dpdk.git] / lib / librte_eal / common / rte_service.c
index 7efb76dc8e2293a6f02fb9bc287a45ff5a78ace7..616bad3a1dc22925f4dc7857f36b945dbc817524 100644 (file)
@@ -396,6 +396,19 @@ rte_service_lcore_list(uint32_t array[], uint32_t n)
        return count;
 }
 
+int32_t
+rte_service_lcore_count_services(uint32_t lcore)
+{
+       if (lcore >= RTE_MAX_LCORE)
+               return -EINVAL;
+
+       struct core_state *cs = &lcore_states[lcore];
+       if (!cs->is_service_core)
+               return -ENOTSUP;
+
+       return __builtin_popcountll(cs->service_mask);
+}
+
 int32_t
 rte_service_start_with_defaults(void)
 {